var map = null;
window.onload = function() {
var centre = new L.LatLng(28.549948, 77.268241);
map=new MapmyIndia.Map('map',{center:centre,zoomControl: true,hybrid:true });
/*1.create a MapmyIndia Map by simply calling new MapmyIndia.Map() and passsing it at the minimum div object, all others are optional...
2.all leaflet mapping functions can be called simply on the L object
3.MapmyIndia may extend and in future modify the customised/forked Leaflet object to enhance mapping functionality for developers, which will be clearly documented in the MapmyIndia API documentation section.*/
var event_div = document.getElementById("event-log");
/***map-events****/
map.on("dblclick", function(e) {
var pt = e.latlng;/*event returns lat lng of clicked point*/
event_div.innerHTML= "dbclick:</br> lat:" + pt.lat + "</br>lng:" + pt.lng + "</br>" + event_div.innerHTML;
});
map.on("click", function(e) {
var pt = e.latlng;/*event returns lat lng of clicked point*/
event_div.innerHTML= "click:</br> lat:" + pt.lat + "</br>lng:" + pt.lng + "</br>" + event_div.innerHTML;
});
map.on("resize", function(e) {
event_div.innerHTML="map resized</br>" + event_div.innerHTML;
});
map.on("mouseup", function(e) {
var pt = e.latlng;/*event returns lat lng of current point*/
event_div.innerHTML = "mouseup:</br> lat:" + pt.lat + "</br>lng:" + pt.lng + "</br>" + event_div.innerHTML;
});
map.on("mousedown", function(e) {
var pt = e.latlng;/*event returns lat lng of current point*/
event_div.innerHTML =...
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.