How to add KML as a layer in google maps (javascript v3) without zooming / scaling the map?
I add KML, which has several events around the world, because of this google maps javascript v3 changes the map scale to a very large enlarged view.
Here is a sample code:
function loadOverlay(inc)
{
var overlay = new google.maps.KmlLayer(inc);
overlay.setMap(map);
overlayArray.push(overlay);
}
function initialize_gmap()
{
var Rochester = new google.maps.LatLng(43.1561, -77.607);
var myOptions = {
zoom: 11,
center: Rochester,
mapTypeId: google.maps.MapTypeId.TERRAIN
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}
initialize_gmap();
loadOverlay("linktokml.kml");
After loading kml, it switches to a very large scale to show all locations in kml. How can I either prevent this, or return to the original degree / scale?
Thanks in advance.
source
share