Commit 1ceee493 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Evita saltos de leaflet-measure, adapta para >=1.8

Este workaround es compatible con las versiones anteriores de Leaflet y
además prepara al widget para trabajar con versión 1.8.
parent febe5b6c
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -162,6 +162,22 @@ define([

		_onMeasureToolsLoaded: function(dfd) {

			// TODO workaround >= v1.8 https://github.com/ljagis/leaflet-measure/issues/171#issuecomment-1137483548
			L.Control.Measure.include({
				// set icon on the capture marker
				_setCaptureMarkerIcon: function () {
					// disable autopan
					this._captureMarker.options.autoPanOnFocus = false;

					// default function
					this._captureMarker.setIcon(
						L.divIcon({
							iconSize: this._map.getSize().multiplyBy(2)
						})
					);
				},
			});

			var measure = new L.Control.Measure({
				position: 'topright',
				primaryLengthUnit: 'meters',