My bad, I just noticed im in the wrong part of the group.
My issue is not version related tho, ive tried both v2 and v3. The
only difference on V2 is that the map gets very slow, and there is 1
marker created but the marker is placed on top of the map and is not
attached to any coordinates.

On 16 sep, 15:07, Stef <[email protected]> wrote:
> Hi
> I am trying to create markers from a database. I do this by outputting
> the DB results to json and loading the json in the google maps code.
> The JSON is valid and is being loaded.
>
> My full Google maps code is:
>
>     function initialize() {
>     $.getJSON("/GoogleMaps/Map", loadMap);
>
> }
>
> function loadMap(mapData) {
>     var myLatlng = new google.maps.LatLng(52.368, 4.806);
>     var myOptions = {
>         zoom: 8,
>         center: myLatlng,
>         mapTypeId: google.maps.MapTypeId.ROADMAP
>     }
>
>     var map = new google.maps.Map(document.getElementById("map"),
> myOptions);
>
>     $.each(mapData.locations, function (i, location) {
>         setupLocationMarker(map, location);
>     });
>
> }
>
> function setupLocationMarker(map, location) {
>
>     console.debug(location.LatLng);
>
>     var marker = new google.maps.Marker({
>         position: location.Latlng,
>         map: map,
>     });
>
> }
>
> The JSON:
>
>     {
>     "locations": [
>         {
>             "Id": 1,
>             "Name": null,
>             "LatLng": "52.368, 4.806",
>         },
>         {
>             "Id": 2,
>             "Name": null,
>             "LatLng": "52.333, 4.839",
>         },
>
> Ive tried debugging with Firebug but I get no errors. The coordinates
> seem to load just fine, but no markers are created. Does anyone know
> how to solve this?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to