Index: mnohub/src/main/webapp/static/bower/Leaflet.label/dist/leaflet.label-src.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>windows-1252 =================================================================== --- mnohub/src/main/webapp/static/bower/Leaflet.label/dist/leaflet.label-src.js (revision ) +++ mnohub/src/main/webapp/static/bower/Leaflet.label/dist/leaflet.label-src.js (revision ) @@ -6,27 +6,15 @@ http://leafletjs.com https://github.com/jacobtoye */ -(function (factory, window) { +(function (window, document, undefined) { +/* + * Leaflet.label assumes that you have already included the Leaflet library. + */ - // define an AMD module that relies on 'leaflet' - if (typeof define === 'function' && define.amd) { - define(['leaflet'], factory); +L.labelVersion = '0.2.1'; - // define a Common JS module that relies on 'leaflet' - } else if (typeof exports === 'object') { - module.exports = factory(require('leaflet')); - } +L.Label = L.Class.extend({ - // attach your plugin to the global 'L' variable - if (typeof window !== 'undefined' && window.L) { - window.LeafletLabel = factory(L); - } -}(function (L) { -L.labelVersion = '0.2.4'; - - -var LeafletLabel = L.Class.extend({ - includes: L.Mixin.Events, options: { @@ -50,8 +38,7 @@ onAdd: function (map) { this._map = map; - this._pane = this.options.pane ? map._panes[this.options.pane] : - this._source instanceof L.Marker ? map._panes.markerPane : map._panes.popupPane; + this._pane = this._source instanceof L.Marker ? map._panes.markerPane : map._panes.popupPane; if (!this._container) { this._initLayout(); @@ -75,7 +62,6 @@ if (L.Browser.touch && !this.options.noHide) { L.DomEvent.on(this._container, 'click', this.close, this); - map.on('click', this.close, this); } }, @@ -117,7 +103,6 @@ if (map) { if (L.Browser.touch && !this.options.noHide) { L.DomEvent.off(this._container, 'click', this.close); - map.off('click', this.close, this); } map.removeLayer(this); @@ -277,8 +262,6 @@ }); -/*global LeafletLabel */ - // This object is a mixin for L.Marker and L.CircleMarker. We declare it here as both need to include the contents. L.BaseMarkerMethods = { showLabel: function () { @@ -317,7 +300,7 @@ var labelAnchor = this.options.icon ? this.options.icon.options.labelAnchor : this.options.labelAnchor, anchor = L.point(labelAnchor) || L.point(0, 0); - anchor = anchor.add(LeafletLabel.prototype.options.offset); + anchor = anchor.add(L.Label.prototype.options.offset); if (options && options.offset) { anchor = anchor.add(options.offset); @@ -340,7 +323,7 @@ this._hasLabelHandlers = true; } - this.label = new LeafletLabel(options, this) + this.label = new L.Label(options, this) .setContent(content); return this; @@ -409,7 +392,6 @@ } }; - // Add in an option to icon that is used to set where the label anchor is L.Icon.Default.mergeOptions({ labelAnchor: new L.Point(9, -20) @@ -474,12 +456,10 @@ L.CircleMarker.include(L.BaseMarkerMethods); -/*global LeafletLabel */ - L.Path.include({ bindLabel: function (content, options) { if (!this.label || this.label.options !== options) { - this.label = new LeafletLabel(options, this); + this.label = new L.Label(options, this); } this.label.setContent(content); @@ -532,7 +512,6 @@ } }); - L.Map.include({ showLabel: function (label) { return this.addLayer(label); @@ -560,5 +539,4 @@ } }); - return LeafletLabel; -}, window)); +}(this, document)); \ No newline at end of file