mbari-org / dash5

Web based UI and client applications for MBARI.
mbari.vercel.app
0 stars 2 forks source link

Refactor siteConfig and Google Elevator Service Hooks #295

Closed jimjeffers closed 1 year ago

jimjeffers commented 1 year ago

This update removes calls to fetch any /info calls via useSiteConfig in favor of using the config stored within the useTethysApiContext since the useSiteConfig call is an outlier that provides the baseUrl for the service via the /info call. It's a bit meta in it's behavior so relying on the ApiProvider's context is the best way to retrieve the results from /info. I believe this was my fault and I used the API call interchangeably with the context.

Further more - I refactored the depth call that relies on loading the google maps API with a functioning key to it's own hook. You can override the key provided in the /info call by setting the NEXT_PUBLIC_GOOGLE_MAPS_API_KEY to a key that has access to google maps and the google maps elevation APIs. The key provided by the /info call does not allow localhost and restricts the domain to the okeanids domain so you will need to set your own API key override if you want to test the depth requests on your local machine.

This should display the depth as shown in #294 on both the overview and deplpoyment maps moving forward.