Open asneuvon opened 8 years ago
i just did the same for GISCloud, for me i just added these to the bottom of lvector.js
lvector.GISCloud.prototype.onAdd = function() { this.setMap(window.map); }; lvector.GISCloud.prototype.onRemove = function() { this._hide(); this.setMap(null); };
and changed this piece:
_hide: function() { this._idleListener && this.options.map.off("moveend", this._idleListener); this._zoomChangeListener && this.options.map.off("zoomend", this._zoomChangeListener); this._autoUpdateInterval && clearInterval(this._autoUpdateInterval); this._clearFeatures(); this._lastQueriedBounds = null; if (this._gotAll) this._gotAll = !1 },
to this:
_hide: function() { this._idleListener && this.options.map.off("moveend", this._idleListener, this); this._zoomChangeListener && this.options.map.off("zoomend", this._zoomChangeListener, this); this._autoUpdateInterval && clearInterval(this._autoUpdateInterval); this._clearFeatures(); this._lastQueriedBounds = null; if (this._gotAll) this._gotAll = !1 },
should work for all the other sources.
First of all, thanks for a great package, solved a real problem for me!
But: The ArcGIS Server layer (lvector.AGS) didn't seem to support adding it into a layer control i.e. letting the user check it visible and invisible in a list of contents. I experimented a bit and ti would seem to me that this functionality can easily be included by adding following methods the Layer.js:
Worked for me at least. However, I couldn't figure out how to set the layer invisible by code (this would be the default state when adding the layer)...