@arunawalpola/leaflet.polylinemeasure 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -837,13 +837,13 @@
837
837
  var last = function() {
838
838
  return this.slice(-1)[0];
839
839
  };
840
- // this._rubberlinePath = L.polyline ([], {
841
- // // Style of temporary, dashed line while moving the mouse
842
- // color: this.options.tempLine.color,
843
- // weight: this.options.tempLine.weight,
844
- // interactive: false,
845
- // dashArray: '8,8'
846
- // }).addTo(this._layerPaint).bringToBack();
840
+ this._rubberlinePath = L.polyline ([], {
841
+ // Style of temporary, dashed line while moving the mouse
842
+ color: this.options.tempLine.color,
843
+ weight: this.options.tempLine.weight,
844
+ interactive: false,
845
+ dashArray: '8,8'
846
+ }).addTo(this._layerPaint).bringToBack();
847
847
 
848
848
  var polylineState = this; // use "polylineState" instead of "this" to allow measuring on 2 different maps the same time
849
849
 
@@ -866,7 +866,8 @@
866
866
  // update style on previous marker
867
867
  var lastCircleMarker = this.circleMarkers.last();
868
868
  if (lastCircleMarker) {
869
- lastCircleMarker.bindTooltip (polylineState.options.tooltipTextDelete, {direction:'top', opacity:0.7, className:'polyline-measure-popupTooltip'});
869
+ // Commented to remove tooltip for first marker
870
+ // lastCircleMarker.bindTooltip (polylineState.options.tooltipTextDelete, {direction:'top', opacity:0.7, className:'polyline-measure-popupTooltip'});
870
871
  lastCircleMarker.off ('click', polylineState._finishPolylinePath, polylineState);
871
872
  if (this.circleMarkers.length === 1) {
872
873
  lastCircleMarker.setStyle (polylineState.options.startCircle);
@@ -954,20 +955,19 @@
954
955
  }
955
956
  };
956
957
 
957
- // Commented out to prevent first marker tooltip from appearing
958
- // var firstTooltip = L.marker (clickCoords, {
959
- // icon: icon,
960
- // interactive: false
961
- // })
962
- // firstTooltip.addTo(this._layerPaint);
963
- // var text = '';
964
- // if (this.options.showBearings === true) {
965
- // text = this.options.bearingTextIn+':---°<br>'+this.options.bearingTextOut+':---°';
966
- // }
967
- // text = text + '<div class="polyline-measure-tooltip-difference">+' + '0</div>';
968
- // text = text + '<div class="polyline-measure-tooltip-total">' + '0</div>';
969
- // firstTooltip._icon.innerHTML = text;
970
- // this._currentLine.tooltips.push (firstTooltip);
958
+ var firstTooltip = L.marker (clickCoords, {
959
+ icon: icon,
960
+ interactive: false
961
+ })
962
+ firstTooltip.addTo(this._layerPaint);
963
+ var text = '';
964
+ if (this.options.showBearings === true) {
965
+ text = this.options.bearingTextIn+':---°<br>'+this.options.bearingTextOut+':---°';
966
+ }
967
+ text = text + '<div class="polyline-measure-tooltip-difference">+' + '0</div>';
968
+ text = text + '<div class="polyline-measure-tooltip-total">' + '0</div>';
969
+ firstTooltip._icon.innerHTML = text;
970
+ this._currentLine.tooltips.push (firstTooltip);
971
971
  this._currentLine.circleCoords.last = last;
972
972
  this._currentLine.tooltips.last = last;
973
973
  this._currentLine.circleMarkers.last = last;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arunawalpola/leaflet.polylinemeasure",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Leaflet Plugin to measure distances of simple lines as well as of complex polylines",
5
5
  "main": "Leaflet.PolylineMeasure.js",
6
6
  "scripts": {