"Design an interactive map UI for a website focused on wildlife conservation and climate change in British Columbia. The map should have two main toggles:
Animal View - Displays icons for various wildlife species affected by climate change. When a user hovers over an animal icon, a tooltip appears showing species information, population trends, and climate-related threats.
Event View - Highlights major climate change-related events (e.g., wildfires, floods, heatwaves) that have impacted wildlife. Hovering over an event displays key details such as the date, affected species, habitat damage, and conservation efforts.
Additional Features:
History Slider to scroll through past climate events and their effects on wildlife.
The UI should be modern, visually engaging, and easy to navigate, with clear icons and smooth hover animations. It should emphasize awareness and education, making the topic relevant to the audience (schools, youth, and national parks)."
I'll design an interactive map UI for a wildlife conservation and climate change website focused on British Columbia. This design will incorporate the Animal View and Event View toggles, along with the additional features you've requested. Let's create a modern, visually engaging, and educational interface.
This interactive map UI for the wildlife conservation and climate change website focused on British Columbia includes the following features:
The UI is modern and visually engaging, with smooth hover animations provided by Framer Motion. The design emphasizes awareness and education, making the topic relevant to the target audience (schools, youth, and national parks).
To further improve this project, you could:
This interactive map provides a solid foundation for educating users about wildlife conservation and climate change in British Columbia. It's engaging, informative, and easy to navigate, making it suitable for a wide range of users, including students and park visitors.
I understand you want to restrict the map view to focus primarily on British Columbia, preventing users from zooming out too far or navigating to other parts of the world. We can achieve this by setting map boundaries and restricting the zoom levels. Let's modify the InteractiveMap
component to implement these constraints.
These changes will restrict the map view to British Columbia:
bcBounds
, which represents the geographical boundaries of British Columbia.In the MapContainer
component, we've added the following props:
minZoom={5}
and maxZoom={10}
to limit how far users can zoom in or out.maxBounds={bcBounds}
to set the maximum boundaries of the map.maxBoundsViscosity={1.0}
to make the boundaries "sticky", preventing users from panning outside the defined area.MapBoundaries
component that uses the useMap
hook from react-leaflet to set the maximum bounds and fit the initial view to the British Columbia boundaries.MapBoundaries
component to the MapContainer
, passing the bcBounds
as a prop.These modifications will ensure that:
This approach maintains the interactive nature of the map while focusing the user's attention on the relevant geographical area. Users can still zoom in to see details within British Columbia, but they won't be able to navigate away from the province or zoom out to see the entire world map.