Skip to content

Commit

Permalink
Support showing polyline distance if enabled
Browse files Browse the repository at this point in the history
As discussed in Leaflet/Leaflet#5266 , modern web browsers like Chrome/Chromium/Opera support touch events. Thus, L.Browser.touch returns true even on non-touch screens. In any case, the _getTooltipText should display the distance if showLength is set to true. Without this change, showLength is broken in many browsers for Polyline.
  • Loading branch information
basisbit committed Oct 19, 2017
1 parent 4f26385 commit e185e8c
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/draw/handler/Draw.Polyline.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,6 @@ L.Draw.Polyline = L.Draw.Feature.extend({
_getTooltipText: function () {
var showLength = this.options.showLength,
labelText, distanceStr;
if (L.Browser.touch) {
showLength = false; // if there's a better place to put this, feel free to move it
}
if (this._markers.length === 0) {
labelText = {
text: L.drawLocal.draw.handlers.polyline.tooltip.start
Expand Down

0 comments on commit e185e8c

Please sign in to comment.