@arunawalpola/leaflet.polylinemeasure 1.0.0 → 1.0.2

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.
@@ -759,17 +759,19 @@
759
759
  var textCurrent = '';
760
760
  if (differenceRound.value > 0 ) {
761
761
  if (this.options.showBearings === true) {
762
- textCurrent = this.options.bearingTextIn + ': ' + angleIn + '°<br>'+this.options.bearingTextOut+':---°';
762
+ //textCurrent = this.options.bearingTextIn + ': ' + angleIn + '°<br>'+this.options.bearingTextOut+':---°';
763
+ textCurrent = this.options.bearingTextIn + '' + angleIn + '°';
763
764
  }
764
765
  textCurrent += '<div class="polyline-measure-tooltip-difference">+' + differenceRound.value + '&nbsp;' + differenceRound.unit + '</div>';
765
766
  }
766
- textCurrent += '<div class="polyline-measure-tooltip-total">' + totalRound.value + '&nbsp;' + totalRound.unit + '</div>';
767
+ //textCurrent += '<div class="polyline-measure-tooltip-total">' + totalRound.value + '&nbsp;' + totalRound.unit + '</div>';
767
768
  currentTooltip._icon.innerHTML = textCurrent;
768
769
  if ((this.options.showBearings === true) && (prevTooltip)) {
769
- var textPrev = prevTooltip._icon.innerHTML;
770
- var regExp = new RegExp(this.options.bearingTextOut + '.*\°');
771
- var textReplace = textPrev.replace(regExp, this.options.bearingTextOut + ': ' + angleOut + "°");
772
- prevTooltip._icon.innerHTML = textReplace;
770
+ // var textPrev = prevTooltip._icon.innerHTML;
771
+ // var regExp = new RegExp(this.options.bearingTextOut + '.*\°');
772
+ // var textReplace = textPrev.replace(regExp, this.options.bearingTextOut + ': ' + angleOut + "°");
773
+ // prevTooltip._icon.innerHTML = textReplace;
774
+ prevTooltip._icon.innerHTML = '';
773
775
  }
774
776
  },
775
777
 
@@ -800,10 +802,10 @@
800
802
  html : "<div style = 'color:" + this.options.arrow.color + "; font-size: 16px; line-height: 16px; vertical-align:top; transform: rotate("+ cssAngle +"deg)'>&#x27a4;</div>" // best results if iconSize = font-size = line-height and iconAnchor font-size/2 .both values needed to position symbol in center of L.divIcon for all font-sizes.
801
803
  });
802
804
  var newArrowMarker = L.marker (center, {icon: iconArrow, zIndexOffset:-50}).addTo(this._layerPaint); // zIndexOffset to draw arrows below tooltips
803
- if (!this._currentLine){ // just bind tooltip if not drawing line anymore, cause following the instruction of tooltip is just possible when not drawing a line
804
- newArrowMarker.bindTooltip (this.options.tooltipTextAdd, {direction:'top', opacity:0.7, className:'polyline-measure-popupTooltip'});
805
- }
806
- newArrowMarker.on ('click', this._clickedArrow, this);
805
+ // if (!this._currentLine){ // just bind tooltip if not drawing line anymore, cause following the instruction of tooltip is just possible when not drawing a line
806
+ // newArrowMarker.bindTooltip (this.options.tooltipTextAdd, {direction:'top', opacity:0.7, className:'polyline-measure-popupTooltip'});
807
+ // }
808
+ // newArrowMarker.on ('click', this._clickedArrow, this);
807
809
  return newArrowMarker;
808
810
  },
809
811
 
@@ -835,13 +837,13 @@
835
837
  var last = function() {
836
838
  return this.slice(-1)[0];
837
839
  };
838
- this._rubberlinePath = L.polyline ([], {
839
- // Style of temporary, dashed line while moving the mouse
840
- color: this.options.tempLine.color,
841
- weight: this.options.tempLine.weight,
842
- interactive: false,
843
- dashArray: '8,8'
844
- }).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();
845
847
 
846
848
  var polylineState = this; // use "polylineState" instead of "this" to allow measuring on 2 different maps the same time
847
849
 
@@ -952,19 +954,20 @@
952
954
  }
953
955
  };
954
956
 
955
- var firstTooltip = L.marker (clickCoords, {
956
- icon: icon,
957
- interactive: false
958
- })
959
- firstTooltip.addTo(this._layerPaint);
960
- var text = '';
961
- if (this.options.showBearings === true) {
962
- text = this.options.bearingTextIn+':---°<br>'+this.options.bearingTextOut+':---°';
963
- }
964
- text = text + '<div class="polyline-measure-tooltip-difference">+' + '0</div>';
965
- text = text + '<div class="polyline-measure-tooltip-total">' + '0</div>';
966
- firstTooltip._icon.innerHTML = text;
967
- this._currentLine.tooltips.push (firstTooltip);
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);
968
971
  this._currentLine.circleCoords.last = last;
969
972
  this._currentLine.tooltips.last = last;
970
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.0",
3
+ "version": "1.0.2",
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": {