Nevermind, I see now that GDownloadUrl doesn't work for external URLs
but only local pages.

On Jan 4, 4:47 pm, jjbuchan <[email protected]> wrote:
> Hi, I've been trying to display points from a json file as markers on
> a map but no matter what I seem to change nothing within the
> GDownloadUrl part is executed.  If I was to add anything just after
> GDownloadUrl it wont work either.
>
> Any help on what I'm doing wrong would be much appreciated as it's
> starting to bug me.
>
> I've included the relevant code below:
>
> ...
>
> function parseJson (map, doc) {
>   var jsonData = eval("(" + doc + ")");
>   for (var i = 0; i < jsonData.positions.length; i++) {
>     var marker = createMarker(jsonData.positions[i]);
>     map.addOverlay(marker);
>   }
>
> }
>
> function load() {
>       if (GBrowserIsCompatible()) {
>         var jsonUrl = "http://www.instamapper.com/api?
> action=getPositions&key=****************&num=10&format=json";
>         var map = new GMap2(document.getElementById("map"));
>         map.addControl(new GLargeMapControl());
>         map.addControl(new GMapTypeControl());
>         map.setCenter(new GLatLng(57.19748, 2.09044), 4);
>         GDownloadUrl(jsonUrl, function(data, responseCode) {
>           parseJson(map, data);
>         });
>       }
>     }
>
>     </script>
>   </head>
>   <body onload="load()" onunload="GUnload()">
>     <div id="map" style="position:absolute;top:0px;left:0px;width:
> 100%; height: 100%"></div>
>   </body>
> </html>
>
> Thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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