I've been visiting your website and among the other things I have seen
this tuto: http://econym.org.uk/gmap/basic12.htm where you explain how
we can load data with a JSON file using GDownloadUrl.
You explain that this method have a potential pitfalls like this:
Be aware that Javascript i/o is asynchronous, so that the browser can
get on with doing other things like fetching images if the i/o request
takes a while to complete.
If you're used to programming languages that wait for i/o to complete,
you might tend to put code that uses the data read from the file after
the "GDownloadUrl()" statement. That would be wrong because code
placed there would get executed immediately rather than waiting for
the data to arrive. Any code that acts on the retrieved data should be
placed inside the process_it() function.
May be that's my problem but I don't understand how can I solve it.
I put more details:
I got a function used to load the map in a javascript file and a html
page where I call its javascript file.
js:
if (GBrowserIsCompatible()) {
map = new GMap2 ......
load controls....
and in that moment I call
GDownloadUrl("points.json", function(data) {
var jsonData = eval("("+ data+")");
here I got a function that send the data of the json file to plot
the markers on a map as you can see below....
createMarkerRecursivo(jsonData);
function createMarkerRecursivo(jsonData){
var n = new Array();
if (col.length == undefined) {
n[0] = col.attributes;
}else n = col;
for (var i = 0; i < col.length; i++){
}
blablbalbalbalaa........I'm using MapIconMaker and
MarkerManager to achieve clustering...
}
}
}else {.......}
I get load the markers in localhost but as you read yesterday in a
real server I can't load these markers....
Could you help me?
Thanks in advance,
On 16 jun, 03:35, Mike Williams <[email protected]> wrote:
> Try pointing your browser directly at the points.json file on your real
> server.
>
> You might possibly have uploaded it incorrectly, or you might be running
> on a wonky webserver that returns an error when asked to serve a file
> with an extension that it doesn't recognise.
>
> --
> Mike Williamshttp://econym.org.uk/gmap
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---