This is not exactly an API question, as you need traditional
javascript to do it.

However, lets just say this is your object

var jsonMarkerList = [
        {"Latitude":"-33.867564351","Longitude":"151.250016"},
        {"Latitude":"-33.877564150","Longitude":"151.282313"},
        {"Latitude":"-33.887564451","Longitude":"151.310016"}
]

You would then need a for loop to break this down and

for (var i=0; i < jsonMarkerList.length; i++) {

     var lat = jsonMarkerList[i].Latitude; //extract Lat
     var lng = jsonMarkerList[i].Longitude; //extract Lng
     var markerLatLng = new google.maps.LatLng(lat, lng);
     createMarker(markerLatLng); //function to create markers
}

Then the function called createMarker would need to do the work to
drop the pins (from the markerLatLng we created) such as:

function createMarker(myLatLng) {
     var marker = new google.maps.Marker({
        position: myLatlng,
        map: map
     });
}

This is just an example, which assumes that your JSON file has been
converted to an Array. Go to http://json.org to learn more about
decoding/encoding JSON strings into objects and visa versa

Hope this helps you somewhat.

Pete



On Jan 21, 6:43 am, geoffcox <geoffa...@gmail.com> wrote:
> Hello
>
> Could someone explain how I associated the address (from JSON file)
> with the marker icon in version 3?
>
> Is version 3 about to replace version 2?
>
> Thanks
>
> Geoff
-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to google-maps-js-api...@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.


Reply via email to