Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8039997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:45:04+00:00 2026-06-05T03:45:04+00:00

I have a multidimensional JSON , whose data I want to use to plot

  • 0

I have a multidimensional JSON, whose data I want to use to plot markers on my Google Map.

I use this plugin for Jquery to work with my Google Map.

With my current code I don’t see any markers appear on my map. What could be causing this?

Upon init event – the script should iterate over the JSON data, plot it on the map, and create/attach info-boxes with appropriate HTML markup for each value of each property to every marker.

My JSON looks like this:

[{product:{productName:"ProductA", productPrice:"19.99", productQuantity:"12", Lat:"53.573858", Lng:"45.985456"}},{product:{... repeat ...}}, {...}]

My jQuery’s $.each() looks like this:

$('#map').gmap(mapOptions).bind('init', function () {
    $.post('myscript.php', function (json) {
        var theMarkers = json;
        $.each(theMarkers.product, function (i, object) {
            $.each(object, function (property, value) {
                $('#map').gmap('addMarker', {
                    'position': new google.maps.LatLng(object.Lat.value, object.Lng.value),
                    'bounds': true,
                    'icon': 'myicon.png'
                }).click(function () {
                    $('#map').gmap('openInfoWindow', {
                        'content': '<h1>' + object.productName.value + '</h1>' + '<h2 style="color: grey">' + object.productPrice.value + '</h2><p style="color: green">' + object.productQuantity.value + '</p>'
                    }, this);
                });
            });
        });
    });
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T03:45:05+00:00Added an answer on June 5, 2026 at 3:45 am

    Solution:

    $('#map').gmap(mapOptions).bind('init', function(){
                        $.post('myscript.php', function(json){
                            var theMarkers = json;
                            $.each(theMarkers, function(i, element) {
                                $.each(element, function(object, dataMembers){
                                        $('#map').gmap('addMarker', { 'position': new google.maps.LatLng(parseFloat(dataMembers.Lat), parseFloat(dataMembers.Lng)), 'bounds':true, 'icon':'myicon.png' } ).click(function(){                                
                                            $('#map').gmap('openInfoWindow', { 'content': '<h1>'+dataMembers.productName+'</h1>'+'<h2 style="color: grey">'+dataMembers.productPrice+'</h2><p style="color: green">'+dataMembers.productQuantity+'</p>' }, this);
                                        }); 
                                });
                            });
                        }); 
    
                    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multidimensional array converted to JSON data in this format. [[null,null,null,null,null,null],[null,null,null,1,1,null],[null,null,null,null,1,1],[null,null,null,null,null,null],[null,null,null,null,null,null]] I
I have gathered data with jQuery, putten it into a multidimensional array, used JSON.stringify
I have the following data which I want to save in my DB (this
I have a multidimensional array, here: $noticeDate = json_encode( $noticesDates ); and I want
hi i have multidimensional array in php i want to remove an index from
I have an multidimensional array that looks like this: Array ( [0] => Array
I have a large multidimensional array and I basically want to drop the first
I have a multidimensional array that looks something like this: ourThing = array( 'id'
I am creating a multidimensional array for sections / rows based on json data
I have been thinking about this. I am aware you can use json_encode(); to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.