var map1;
var Marker2;
var mkr=[];
var center = "28.5507160000001,77.2689280000001";
var center = center.split(",");
var lat = center[0];var lng=center[1];
// multiple marker
document.getElementById('checkbox').addEventListener('change', (event) => {
if (event.target.checked) {
// mutiple marker call
multi_marker();
}
else{
MapmyIndia.remove({map:map1,layer:Marker2});
map1.setZoom(4);
map1.setCenter({lat: lat, lng: lng});
}
});
// multiple marker
document.getElementById('checkbox1').addEventListener('change', (event) => {
if (event.target.checked) {
mkr[0]= new MapmyIndia.Marker({map:map1,position:{lat: 28.519467, lng: 77.223150},fitbounds:false,icon:'https://maps.mapmyindia.com/images/to.png',width:"35px",height:"35px",html:'<div style="white-space:nowrap;font-size:10px;padding-left:15px;color:#fff">BM</div>',popupOptions:{"openPopup":true},popupHtml:'<div id="data">balmukand</div>',draggable:false});
mkr[1]= new MapmyIndia.addMarker({map:map1,position:{lat: 28.569467, lng: 77.273150},fitbounds:false,icon:'https://maps.mapmyindia.com/images/to.png',width:"35px",height:"35px",html:'<div style="white-space:nowrap;font-size:10px;padding-left:15px;color:#fff">BM</div>',popupOptions:{"openPopup":true},popupHtml:'<div id="data">balmukand</div>',draggable:false});
}
else{
MapmyIndia.remove({map:map1,layer:mkr});
}
});
// Map Function
function initMap1() {
var center = {lat: lat, lng: lng};
map1 = new MapmyIndia.Map(document.getElementById('right-menu'),
{
center: center,
zoomControl: true,
location: true,
});
}
// multiple marker function
function multi_marker(){
var clusters = document.getElementById('clusters').value;
var geojson = document.getElementById('geojson').value;
var fitbounds1= document.getElementById('fitbounds1').value;
var icon_url = document.getElementById('icon_url').value;
var clustersoptions =...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.