/* var map = null;
var poly2 = null;
var poly = [];
var visbility = false;
var polyline1, polyline2;
var event_div = document.getElementById("event-log"); //log element
var visible = document.getElementById("visible"); //show hide polyline button
window.onload = function() {
var center = new L.LatLng(28.549948, 77.268241);
map = new MapmyIndia.Map('map', {
center: center,
editable: true,
zoomControl: true,
hybrid: true
});
**map initialization with tiles of MapmyIndia with MapmyIndia.Map**
**
1. Create a MapmyIndia Map by simply calling new MapmyIndia.Map() and passing it a html div id, all other parameters are optional...
2. All leaflet mapping functions can be called simply by using "L" object.
3. In future, MapmyIndia may extend the customised/forked Leaflet object to enhance mapping functionality for developers,
which will be clearly documented in the MapmyIndia API documentation section.
**
array of wgs points
var pts1 = [
new L.LatLng(center.lat - 150 / 10000, center.lng - 150 / 10000),
new L.LatLng(center.lat + 0 / 10000, center.lng - 50 / 10000),
new L.LatLng(center.lat + 50 / 10000, center.lng - 100 / 10000),
new L.LatLng(center.lat + 70 / 10000, center.lng + 50 / 10000),
new L.LatLng(center.lat - 70 / 10000, center.lng + 100 / 10000)
];
array of wgs points
var pts2 = [
new L.LatLng(center.lat - 150 / 10000, center.lng - 450 / 10000),
new L.LatLng(center.lat + 0 / 10000, center.lng - 350 / 10000),
new L.LatLng(center.lat + 50 / 10000, center.lng - 500 / 10000),
new L.LatLng(center.lat + 70 / 10000, center.lng - 250 / 10000),
new L.LatLng(center.lat - 70 / 10000, center.lng - 200 / 10000),
new L.LatLng(center.lat - 70 / 10000, center.lng + 100 / 10000)
];
parameters of polyline
var poly1param = {
weight: 4,
opacity: 0.5
};
var poly1 = new L.Polyline(pts1, poly1param); polyline with given points and default color is created
...
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.