lib/leaflet.draw/src/draw/handler/Draw.Marker.js in leaflet-js-0.6.beta4 vs lib/leaflet.draw/src/draw/handler/Draw.Marker.js in leaflet-js-0.7.0
- old
+ new
@@ -3,10 +3,11 @@
TYPE: 'marker'
},
options: {
icon: new L.Icon.Default(),
+ repeatMode: false,
zIndexOffset: 2000 // This should be > than the highest z-index any markers
},
initialize: function (map, options) {
// Save the type so super can fire, need to do this as cannot do this.TYPE :(
@@ -17,11 +18,11 @@
addHooks: function () {
L.Draw.Feature.prototype.addHooks.call(this);
if (this._map) {
- this._tooltip.updateContent({ text: 'Click map to place marker.' });
+ this._tooltip.updateContent({ text: L.drawLocal.draw.handlers.marker.tooltip.start });
// Same mouseMarker as in Draw.Polyline
if (!this._mouseMarker) {
this._mouseMarker = L.marker(this._map.getCenter(), {
icon: L.divIcon({
@@ -78,20 +79,24 @@
this._map
.on('click', this._onClick, this)
.addLayer(this._marker);
}
else {
+ latlng = this._mouseMarker.getLatLng();
this._marker.setLatLng(latlng);
}
},
_onClick: function () {
this._fireCreatedEvent();
this.disable();
+ if (this.options.repeatMode) {
+ this.enable();
+ }
},
_fireCreatedEvent: function () {
var marker = new L.Marker(this._marker.getLatLng(), { icon: this.options.icon });
L.Draw.Feature.prototype._fireCreatedEvent.call(this, marker);
}
-});
\ No newline at end of file
+});