diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 0120036ea..e51b2f755 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1423,11 +1423,13 @@ L.TileLayer = L.GridLayer.extend({ }, _clearSearchResults: function() { + if (this._searchTerm) { + this._selections.clearLayers(); + } this._lastSearchResult = null; this._searchResults = null; this._searchTerm = null; this._searchResultsLayer.clearLayers(); - this._selections.clearLayers(); }, _drawSearchResults: function() {