yes i mean like this. But still I couldn't find the exact code.
My java script code is
(function() {
window.onload = function() {
var map = document.getElementById('map');
var pakistan = new google.maps.LatLng(30.7311, 70.7412);
var options = {
center: pakistan,
zoom: 5,
mapTypeId: google.maps.MapTypeId.TERRAIN};
var map = new google.maps.Map(document.getElementById("map"), options);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
var mango = new google.maps.Marker({
position: new google.maps.LatLng(31.5758, 74.3269),
map: map,
icon: '
http://gmaps-samples.googlecode.com/svn/trunk/markers/blue/blank.png',
title: 'Mango'
});
var infowindow = new google.maps.InfoWindow({
content:'Mango'
});
google.maps.event.addListener(mango, 'click', function() {
infowindow.open(map, mango);
});
var places = [];
places.push(new google.maps.LatLng(30.7311, 70.7412));
places.push(new google.maps.LatLng(29.9833, 73.2667));
places.push(new google.maps.LatLng(24.8508, 67.0181));
for (var i = 0; i < places.length; i++) {
var marker = new google.maps.Marker({
position: places[i],
map: map,
icon: '
http://gmaps-samples.googlecode.com/svn/trunk/markers/green/marker1.png',
title: 'Orange ' + i
});
(function(i, marker) {
google.maps.event.addListener(marker, 'click', function() {
var infowindow = new google.maps.InfoWindow({
content: 'Orange ' + i
});
infowindow.open(map, marker);});
})(i, marker);
var ctaLayer = new google.maps.KmlLayer('
https://dl.dropbox.com/u/83672293/wildlife-national-parks-pakistan.kml');
ctaLayer.setMap(map);
}
}
})();
I want to add three layers with check-boxes in the side bar i.e. for mango, places and for kml layer.
Will you please help me in writing the code for this.
Thanks,