I am trying to add Measurement Controls to my Leaflet Maps. For addressing the issue, I tried it on simplest map.
I created a simple map with Leaflet and added the Measurement Plugin. Now the problem is that when a user starts measuring and click on map, the map automatically moves away like running away from the point.
What could be the issue? Can you anybody please help?
<div id="map"></div>
<script src="resources/leaflet.js"></script>
<script src="resources/leaflet-measure.js"></script>
<script>
var map = L.map('map').setView([33.693638, 73.06479], 12);
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
var measureControl = L.control.measure();
measureControl.addTo(map);
</script>
Issue Resolved!
It is a compatibility issue between the plugin and leaflet. Actually the plugin is compatible with the version 1.3.1 of Leaflet JS.