I am trying to get load my KML from my local disk with given below code :
<script type="text/javascript">
function initialize() {
var mapOptions = {
center: new google.maps.LatLng(43.321675,-75.172631),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"),mapOptions);
var ctaLayer = new google.maps.KmlLayer('C:/Users/Ashutosh_k/Downloads/newyork.kml');
ctaLayer.setMap(map);
}
</script>
Problem : When my google map is displaying its not showing up the elements of KML .
Best Answer
I don't think that it is possible to add local .kml files. The file needs to be stored at a location where the remote API is able to access it.
You have several choices as suggested here: