Skip to content

Commit

Permalink
Merge pull request #195 from Zverik/master
Browse files Browse the repository at this point in the history
showLength for polylines and showRadius for circles
  • Loading branch information
jacobtoye committed Oct 2, 2013
2 parents 5476483 + 07a2c5a commit 68333aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/draw/handler/Draw.Circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ L.Draw.Circle = L.Draw.SimpleShape.extend({
fillOpacity: 0.2,
clickable: true
},
showRadius: true,
metric: true // Whether to use the metric meaurement system or imperial
},

Expand Down Expand Up @@ -54,8 +55,8 @@ L.Draw.Circle = L.Draw.SimpleShape.extend({

this._tooltip.updateContent({
text: this._endLabelText,
subtext: 'Radius: ' + L.GeometryUtil.readableDistance(radius, this.options.metric)
subtext: this.options.showRadius ? 'Radius: ' + L.GeometryUtil.readableDistance(radius, this.options.metric) : ''
});
}
}
});
});
3 changes: 2 additions & 1 deletion src/draw/handler/Draw.Polyline.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ L.Draw.Polyline = L.Draw.Feature.extend({
clickable: true
},
metric: true, // Whether to use the metric meaurement system or imperial
showLength: true, // Whether to display distance in the tooltip
zIndexOffset: 2000 // This should be > than the highest z-index any map layers
},

Expand Down Expand Up @@ -293,7 +294,7 @@ L.Draw.Polyline = L.Draw.Feature.extend({
text: L.drawLocal.draw.handlers.polyline.tooltip.start
};
} else {
distanceStr = this._getMeasurementString();
distanceStr = this.options.showLength ? this._getMeasurementString() : '';

if (this._markers.length === 1) {
labelText = {
Expand Down

0 comments on commit 68333aa

Please sign in to comment.