Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User features - saved locations #260

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

User features - saved locations #260

wants to merge 3 commits into from

Conversation

amyfromandi
Copy link
Contributor

@amyfromandi amyfromandi commented Dec 18, 2024

Updates:

  • Added saved locations list to leftside panel
  • Created clickable location names
  • When location names are selected, mapmarker repositions to the lat/lng on the map. Mapview also pans and zooms to that location on the map (at a default of 7 right now).

TODO:

  • Save zoom/orientation config within the database
  • Render the zoom and orientation that is stored in the database
  • Allow postgrest to return geojson
  • render geojson as spots or clusters onto the map

@amyfromandi amyfromandi changed the title User features User features - saved locations Dec 18, 2024
@davenquinn
Copy link
Member

This is linked to UW-Macrostrat/macrostrat#105

Copy link
Member

@davenquinn davenquinn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks broadly good, but there are some improvements that could be made.

@@ -129,6 +131,13 @@ function useMapLocationManager(): [MapPosition, PositionBuilder] {
(position: mapboxgl.LngLat | null, map: mapboxgl.Map | undefined) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should try using the map location management hooks/components from the @macrostrat/mapbox-react module.

@@ -79,6 +80,7 @@ export function Page() {
mapboxToken: mapboxAccessToken,
mapPosition: inspectPosition,
bounds: [-125, 24, -66, 49],
onMapLoaded: (map) => setMapInstance(map),
Copy link
Member

@davenquinn davenquinn Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be necessary: if you make the panels that require a map reference into separate components, you can get a reference to the map using the useMapRef hook from @macrostrat/mapbox-react. This will only work if it's a separate component within the one that contains the MapAreaContainer.

@@ -41,7 +41,7 @@
max-width: 180px

select
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try using BlueprintJS form components to blend in with the style of the rest of the application

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants