Hey @usman.qureshi,
we recently released the Bounds endpoint dedicated to compute bounds for your assets.
It accepts same search query parameter as Store Search API and returns a LatLngBoundsLiteral that you can pass to the fitBounds() method.
Here is a simple implementation to retrieve bounds based on stores country code and fit the map on them.
async function getBounds() {
const query = "country:GB";
const url = `https://api.woosmap.com/stores/search/bounds?key=PUBLIC_API_KEY&query=${query}`;
const response = await fetch(url);
return response.json();
}
getBounds().then((boundsResponse) => {
this.map.fitBounds(boundsResponse.bounds);
});