summaryrefslogtreecommitdiff
path: root/plugins/leaflet/scripts/leaflet-providers/preview/L.Map.Sync.js
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/leaflet/scripts/leaflet-providers/preview/L.Map.Sync.js')
-rw-r--r--plugins/leaflet/scripts/leaflet-providers/preview/L.Map.Sync.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/leaflet/scripts/leaflet-providers/preview/L.Map.Sync.js b/plugins/leaflet/scripts/leaflet-providers/preview/L.Map.Sync.js
new file mode 100644
index 0000000..2fa0953
--- /dev/null
+++ b/plugins/leaflet/scripts/leaflet-providers/preview/L.Map.Sync.js
@@ -0,0 +1,3 @@
+(function(){L.Map=L.Map.extend({sync:function(a,b){this._initSync();var b=b||{},c=!1;this._syncMaps.forEach(function(b){a===b&&(c=!0)});c||this._syncMaps.push(a);b.noInitialSync||a.setView(this.getCenter(),this.getZoom(),{animate:!1,reset:!0});return this},unsync:function(a){var b=this;this._syncMaps&&this._syncMaps.forEach(function(c,d){a===c&&b._syncMaps.splice(d,1)});return this},_initSync:function(){if(!this._syncMaps){var a=this;this._syncMaps=[];L.extend(a,{setView:function(b,c,d,e){e||a._syncMaps.forEach(function(a){a.setView(b,
+c,d,!0)});return L.Map.prototype.setView.call(this,b,c,d)},panBy:function(b,c,d){d||a._syncMaps.forEach(function(a){a.panBy(b,c,!0)});return L.Map.prototype.panBy.call(this,b,c)},_onResize:function(b,c){c||a._syncMaps.forEach(function(a){a._onResize(b,!0)});return L.Map.prototype._onResize.call(this,b)}});a.on("zoomend",function(){a._syncMaps.forEach(function(b){b.setView(a.getCenter(),a.getZoom(),{animate:!1,reset:!1})})},this);a.dragging._draggable._updatePosition=function(){L.Draggable.prototype._updatePosition.call(this);
+var b=this;a._syncMaps.forEach(function(a){L.DomUtil.setPosition(a.dragging._draggable._element,b._newPos);a.fire("moveend")})}}}})})(); \ No newline at end of file