I think this has already been discussed a few times. However, the
groups search often seems to be broken, so once again:


Try to call setMarker() within the timeout you want. This should work
in all standard compliant browsers. To avoid troubles with other
browsers, that do not check that your xml file has been changed,
because they are chaching the file and prefer to display the old file
again, you can try the following:


var r = Math.round(Math.random()*1000000);

GDownloadUrl("xml/gpsvalues.xml?foo=" + r, ...


If this doesn't solve the problem, please read the posting guide lines
and post a link to your non working map.




On Sep 16, 9:29 am, Ekgapol <[email protected]> wrote:
> Code :
>
>  function initializeGoogleMaps() {
>       if (GBrowserIsCompatible()) {
>         var map = new GMap2(document.getElementById("map"));
>                 map.setCenter(new GLatLng(lat,lng), 17);
>
>                 // Map Control
>
>         map.addControl(new GLargeMapControl());
>         map.addControl(new GMapTypeControl());
>
> //////////////////////////
>                 var baseIcon = new GIcon(G_DEFAULT_ICON);
>                 baseIcon.image = "http://www.veryicon.com/icon/png/Transport/
> Transport/Ambulance.png";
>         baseIcon.shadow = "";
>         baseIcon.iconSize = new GSize(34, 34);
>         baseIcon.shadowSize = new GSize(0, 0);
>         baseIcon.iconAnchor = new GPoint(9, 34);
>         baseIcon.infoWindowAnchor = new GPoint(9, 2);
>
>         function createMarker(point, text) {
>
>           var letteredIcon = new GIcon(baseIcon);
>
>           markerOptions = { icon:letteredIcon };
>           var marker = new GMarker(point, markerOptions);
>
>           return marker;
>         }
>
>           setMarker();
>
>       }
>           
> //////////////////////////////////////////////////////////////////////////////////////
>       function setMarker(){
>                 GDownloadUrl("xml/gpsvalues.xml", function(data) {
>           var xml = GXml.parse(data);
>           var markers = xml.documentElement.getElementsByTagName
> ("marker");
>
>           for (var i = 0; i < markers.length; i++) {
>             var latlng = new GLatLng(parseFloat(markers[i].getAttribute
> ("lat")),
>                                     parseFloat(markers[i].getAttribute
> ("lng")));
>                         var name = markers[i].getAttribute("name");
>                         map.addOverlay(createMarker(latlng,name));
>           }
>         });
>
>           }
>
>     }
>
> i want to display my marker from XML file and refresh every 1 minute.
--~--~---------~--~----~------------~-------~--~----~
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