My first and bad solution : I'm surprised because firebug do not detects any errors & the default location with UI is good.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas- microsoft-com:vml"> <head> <title>Google Maps API : GGeoXml KML Overlay without map.setCenter</ title> <script src="http://maps.google.com/maps? file=api&v=2.x&key=ABQIAAAATndsWAV5Q2y7pRRi-22W_hT- aJDDOfE19RD2M2wFI3ho9DvBhRQxTLk39his2U7124of16qknR5beQ" type="text/ javascript"></script> <script type="text/javascript"> var geoXml; var map; var url = "http://maps.google.fr/maps/ms? ie=UTF8&hl=fr&oe=UTF8&msa=0&msid=115115239782170342035.00045c5d8b68ccf0d0247&output=kml"; function goXML() { geoXml = new GGeoXml(url, initialize); } function initialize() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map_canvas")); geoXml.gotoDefaultViewport(map); map.setUIToDefault(); map.addOverlay(geoXml); }else{ alert("Sorry !"); } } </script> <style type="text/css"> <!-- html, body { margin: 0; padding: 0; height: 100%; } #map_canvas { width: 100%; height: 100%; } --> </style> </head> <body onload="goXML()" onunload="GUnload()"> <div id="map_canvas"></div> </body> </html> And the second solution (Perfect ... i hope) - Link : http://www.lesentierhistoriquedetouraine.fr/GGeoXml-without-map.setCenter-2.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas- microsoft-com:vml"> <head> <title>Google Maps API : GGeoXml KML Overlay without map.setCenter 2</title> <script src="http://maps.google.com/maps? file=api&v=2.x&key=ABQIAAAATndsWAV5Q2y7pRRi-22W_hT- aJDDOfE19RD2M2wFI3ho9DvBhRQxTLk39his2U7124of16qknR5beQ" type="text/ javascript"></script> <script type="text/javascript"> var geoXml; var map; var centermap; var url = "http://maps.google.fr/maps/ms? ie=UTF8&hl=fr&oe=UTF8&msa=0&msid=115115239782170342035.00045c5d8b68ccf0d0247&output=kml"; function initialize() { if (GBrowserIsCompatible()) { geoXml = new GGeoXml(url); map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(0,0),0); map.setUIToDefault(); map.addOverlay(geoXml); geoXml.gotoDefaultViewport(map); GEvent.addListener(geoXml, "load", function(){ document.getElementById("wait").style.display = "none"; document.getElementById("map_canvas").style.visibility = "visible"; map.savePosition(); }); }else{ alert("Sorry !"); } } </script> <style type="text/css"> <!-- *{ margin: 0; padding: 0; } html, body { height: 100%; } #map_container{ position: absolute; left: 50%; top: 50%; width: 800px; height: 400px; margin-top: -200px; margin-left: -400px; background-color:#e5e3df; } #map_canvas { position: absolute; width: 800px; height: 400px; visibility: hidden; } #wait{ margin: 180px 350px; width: 100px; border: 1px solid black; background-color:#f00; color:white; } --> </style> </head> <body onload="initialize()" onunload="GUnload()"> <div id="map_container"> <div id="wait"> Loading ...</div> <div id="map_canvas"></div> </div> </body> </html> On 10 mai, 13:30, Rossko <[email protected]> wrote: > > i try to use GGeoXml without map.setCenter : > > This thread may > helphttp://groups.google.com/group/google-maps-api/browse_thread/thread/8... > > -- > 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 > athttp://groups.google.com/group/google-maps-api?hl=en. -- 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.
