stefanocudini / leaflet-search

Search stuff in a Leaflet map
https://opengeo.tech/maps/leaflet-search/
MIT License
773 stars 335 forks source link

fix: this._layer -> this.options.layer #281

Closed mashkovd closed 3 years ago

mashkovd commented 3 years ago

When initialize - this._layer = this.options.layer || new L.LayerGroup(). Then bool(this._layer) always is True(options.url is never use) If options.layer is null. It's bug

andrew-lis commented 3 years ago

Thanks! it took me an hour to figure out why the newest version ain't workin'! I've checked the code and figured out that there's no way it gonna work!

My temporary hack:

        this.map.addControl(searchControl);
        searchControl._layer = null; // reset layer after initialization
hrzhao commented 3 years ago

It was same gay only modify this line and raise this bug. look #285

stefanocudini commented 3 years ago

solver from version 3.0.0 published in npm