performant-software / react-components

A library of shared React components
https://performant-software.github.io/react-components/
MIT License
1 stars 1 forks source link

Enhancement: Map component that accepts a list of Core Data place URLs #261

Open ajolipa opened 7 months ago

ajolipa commented 7 months ago

We will need the ability to render a map that displays place markers for a list of places, which will be passed as part of the props object. The map should automatically fit the bounds to nicely fit all of the listed places on the same map.

Looking at the results list map display in the core-data-map-client repo, it appears that displaying multiple hits in the same map is accomplished in that case using the map.addSource and map.addLayer methods called inside a useEffect hook when the hits data from the search interface is updated. In the specific case of the Ground Beneath our Feet path viewer, unlike in the case of displaying search results, the list of places to display will not be dynamically updated client-side on the page; it will just be a static list of places coming from the TinaCMS content. But we will also want the ability to display a map of search results elsewhere on the site, so I guess ideally the same component would be able to handle both cases.