diff --git a/src/draw/handler/Draw.Circle.js b/src/draw/handler/Draw.Circle.js index 8c85c37cc..bc347448c 100644 --- a/src/draw/handler/Draw.Circle.js +++ b/src/draw/handler/Draw.Circle.js @@ -21,11 +21,11 @@ L.Draw.Circle = L.Draw.SimpleShape.extend({ // Save the type so super can fire, need to do this as cannot do this.TYPE :( this.type = L.Draw.Circle.TYPE; + this._initialLabelText = L.drawLocal.draw.handlers.circle.tooltip.start; + L.Draw.SimpleShape.prototype.initialize.call(this, map, options); }, - _initialLabelText: L.drawLocal.draw.handlers.circle.tooltip.start, - _drawShape: function (latlng) { if (!this._shape) { this._shape = new L.Circle(this._startLatLng, this._startLatLng.distanceTo(latlng), this.options.shapeOptions); @@ -53,7 +53,7 @@ L.Draw.Circle = L.Draw.SimpleShape.extend({ radius = this._shape.getRadius().toFixed(1); this._tooltip.updateContent({ - text: 'Release mouse to finish drawing.', + text: this._endLabelText, subtext: 'Radius: ' + L.GeometryUtil.readableDistance(radius, this.options.metric) }); } diff --git a/src/draw/handler/Draw.Rectangle.js b/src/draw/handler/Draw.Rectangle.js index 89d331032..3e11edfbb 100644 --- a/src/draw/handler/Draw.Rectangle.js +++ b/src/draw/handler/Draw.Rectangle.js @@ -20,9 +20,10 @@ L.Draw.Rectangle = L.Draw.SimpleShape.extend({ // Save the type so super can fire, need to do this as cannot do this.TYPE :( this.type = L.Draw.Rectangle.TYPE; + this._initialLabelText = L.drawLocal.draw.handlers.rectangle.tooltip.start; + L.Draw.SimpleShape.prototype.initialize.call(this, map, options); }, - _initialLabelText: L.drawLocal.draw.handlers.rectangle.tooltip.start, _drawShape: function (latlng) { if (!this._shape) { diff --git a/src/draw/handler/Draw.SimpleShape.js b/src/draw/handler/Draw.SimpleShape.js index 53e4136e4..988ecd535 100644 --- a/src/draw/handler/Draw.SimpleShape.js +++ b/src/draw/handler/Draw.SimpleShape.js @@ -6,6 +6,8 @@ L.Draw.SimpleShape = L.Draw.Feature.extend({ }, initialize: function (map, options) { + this._endLabelText = L.drawLocal.draw.handlers.simpleshape.tooltip.end; + L.Draw.Feature.prototype.initialize.call(this, map, options); }, @@ -60,7 +62,7 @@ L.Draw.SimpleShape = L.Draw.Feature.extend({ this._tooltip.updatePosition(latlng); if (this._isDrawing) { - this._tooltip.updateContent({ text: L.drawLocal.draw.handlers.simpleshape.tooltip.end }); + this._tooltip.updateContent({ text: this._endLabelText }); this._drawShape(latlng); } },