You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Background Maps is enabled, we want the list of map styles to be to be from useMapServerQuery('styles') hook. When Background Maps is NOT enabled, we want the list of available styles to come from the logic found in MapStyleProvider. Technically the api in MapStyleProvider only provides a single item, but we will maintain it as an array to be consistent with useMapServerQuery('styles'). We are also moving towards tanstack query for all API calls. Create a custom hook (called useLegacyMapServerQuery), using tanstack, to make the API calls. Then create another hook, that returns the results from useMapServerQuery or the results from useLegacyMapServerQuery, based on whether the feature flag is on.
To Do:
Create new hook 'useLegacyMapServerQuery'. Using Tanstack, call the api calls in Map Style Provider
Create new hook useMapStyles() that returns the results from useMapServerQuery('/styles') or useLegacyMapServerQuery depending on feature flag. The useMapServerQuery('/styles') returns a list of MapServerStyleInfo, but we only want to save the url into the list that is being returned. useMapStyles() should return string[]
The text was updated successfully, but these errors were encountered:
When
Background Maps
is enabled, we want the list of map styles to be to be fromuseMapServerQuery('styles')
hook. WhenBackground Maps
is NOT enabled, we want the list of available styles to come from the logic found in MapStyleProvider. Technically the api inMapStyleProvider
only provides a single item, but we will maintain it as an array to be consistent withuseMapServerQuery('styles')
. We are also moving towards tanstack query for all API calls. Create a custom hook (called useLegacyMapServerQuery), using tanstack, to make the API calls. Then create another hook, that returns the results fromuseMapServerQuery
or the results fromuseLegacyMapServerQuery
, based on whether the feature flag is on.To Do:
useMapServerQuery('/styles')
oruseLegacyMapServerQuery
depending on feature flag. TheuseMapServerQuery('/styles')
returns a list of MapServerStyleInfo, but we only want to save theurl
into the list that is being returned.useMapStyles()
should returnstring[]
The text was updated successfully, but these errors were encountered: