Sha256: 6e42938a3b34e8474bc86469719a907e97e9eda4fa41442e3e1d8a950c233d19
Contents?: true
Size: 960 Bytes
Versions: 3
Compression:
Stored size: 960 Bytes
Contents
/* * L.FeatureGroup extends L.LayerGroup by introducing mouse events and bindPopup method shared between a group of layers. */ L.FeatureGroup = L.LayerGroup.extend({ includes: L.Mixin.Events, addLayer: function (layer) { this._initEvents(layer); L.LayerGroup.prototype.addLayer.call(this, layer); if (this._popupContent && layer.bindPopup) { layer.bindPopup(this._popupContent); } }, bindPopup: function (content) { this._popupContent = content; return this.invoke('bindPopup', content); }, setStyle: function (style) { return this.invoke('setStyle', style); }, _events: ['click', 'dblclick', 'mouseover', 'mouseout'], _initEvents: function (layer) { for (var i = 0, len = this._events.length; i < len; i++) { layer.on(this._events[i], this._propagateEvent, this); } }, _propagateEvent: function (e) { e.layer = e.target; e.target = this; this.fire(e.type, e); } });
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
leaflet-ruby-0.3.beta4 | lib/leaflet/src/layer/FeatureGroup.js |
leaflet-ruby-0.3.beta3 | lib/leaflet/src/layer/FeatureGroup.js |
leaflet-ruby-0.3.beta1 | lib/leaflet/src/layer/FeatureGroup.js |