I am creating KML file for google maps, and the file is generating properly in the same directory. But When I use it in my page, it doesn't show proper map.
Here is my code in javascript
function init()
{
if (GBrowserIsCompatible()) {
geoXml = new GGeoXml("http://localhost:1546/Website1/myKML.kml");
//geoXml = new GGeoXml("http://www.spencerwilliams.net/kml/kmltest3.xml");
map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(0,0),0);
map.addControl(new GLargeMapControl());
map.addControl(new GLargeMapControl());
map.addOverlay(geoXml);
map.setCenter(geoXml.getDefaultCenter());
geoXml.gotoDefaultViewport(map);
}
}
This function is being called on Body's onload event.
When I used following statement in it, the map was showing proper locations.
//geoXml = new GGeoXml("http://www.spencerwilliams.net/kml/kmltest3.xml");
Can anybody guide me further please, Peter sir and Mr. Robbe Morris?
Thanks in Advance..