This topic is archived. woosmap.TiledView, mapView.set('stores') and setSearchParameters belong to the Store Locator JS API, which has been retired. In Map JS you control what gets drawn yourself, so an empty result set simply means drawing nothing, and the workaround below is no longer needed. See Display stores overlay.
Hello @Tucsky,
Yes, it’s the default behaviour when using woosmap.TiledView.
To return the TiledView to its original display state, without any query or location marker, you should set the properties 'stores' and 'location' to null.
mapView.set('location', null);
mapView.set('stores', null);
This implies to display all the Stores on your Map.
To manage the display of your Stores, you can work with the mapView.setSearchParameters() method.
this.mapView.setSearchParameters(new woosmap.search.SearchParameters({query: searchQuery}))
But, it will properly work only if you’re not applying a location bias (lat,lng) to your Search Parameter.
If you’re using a location to search nearby stores, one solution could be to set a query which returns no stores, for example:
mapView.setSearchParameters(
new woosmap.search.SearchParameters({ query: 'tag:"No_Results_Tag"' })
);
I know it is not the best we can give you. Preferably, we should support the location bias also in the tiledview setSearchParameters. I will feedback this to our product team.
Please let me know if this can be an acceptable workaround for you.
Thanks.