-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Refactor map component #69
Conversation
✔️ Deploy Preview for mattapan-mapping ready! 🔨 Explore the source changes: a7f1356 🔍 Inspect the deploy log: https://app.netlify.com/sites/mattapan-mapping/deploys/618c1ec7c6e11a000944ea89 😎 Browse the preview: https://deploy-preview-69--mattapan-mapping.netlify.app/ |
Also, I deleted package.json in this changeset incase things conflate with yarn packages (I think I had it from when originally I set up CRA) |
satellite: 'mapbox://styles/mapbox/satellite-v9', | ||
satelliteStreet: 'mapbox://styles/mapbox/satellite-streets-v11', | ||
navigationDay: 'mapbox://styles/mapbox/navigation-day-v1', | ||
navigationNight: 'mapbox://styles/mapbox/navigation-night-v1', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Threw in map styles into the Theme and worked pretty well with intellisense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤩
@@ -7,6 +7,8 @@ interface Theme { | |||
fonts: Fonts; | |||
|
|||
colors: Colors; | |||
|
|||
map: MapStyles; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yay or nay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yay
ace7b09
to
d06bff9
Compare
Thanks for choosing our opinion(s) on the Mapbox library setup, @laudickson! Not sure why the deploy preview situation is so overloaded but this is the one that built I think, though the mapbox token might not be right still https://deploy-preview-69--mattapan-mapping.netlify.app/#/ Final build was most successful I guess: https://mattapan-mapping.netlify.app/explore |
I'll go over and share more in-depth with group tomorrow, but I'm somewhat settling on this pattern for now -
Ex. pattern loosely looks like
Concerns/issues:
|
src/pages/ExplorePage.tsx
Outdated
id: 'greaterMattapanZoning', | ||
type: 'line', | ||
paint: { | ||
'line-color': 'yellow', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a color as defined from color palette
@thadk good look there, it has been working locally for me pretty much all this time but turns out it was related to this visgl/react-map-gl#1266 and this version of mapbox isn't transpiring correctly. Lots of suggested solutions in that thread, but this one seemed to work as far as from looking at the deploy preview (craco ftw once again!) |
and move assets and boundaries into public folder and use from there |
First few thoughts trying out a refactored more 'general' component for map
Changed from vanilla js mapbox library to react-map-gl pacakge. I've found it is WAY more react-typescript friendly and felt very little friction with the type-system
This is pretty rough and tbh the more I played with ReactMapGL I questioned if even it's necessary to have a generic in-app Map component and just use ReactMapGL component directly when you need to - their API and documentation is pretty comprehensive and they give lots of examples that offers a lot of great patterns
https://visgl.github.io/react-map-gl/examples/geojson
https://visgl.github.io/react-map-gl/docs
Also used some things from Brad's PR https://github.com/codeforboston/mattapan-mapping/blob/b909bec69422fbd94183af1a95c88824305d8511/src/components/Map/Map.tsx v useful
This PR is in draft for now, I'll spend a couple more shower thoughts and see if I can polish this further. The 'Explore' page is playground for now to see how an instance of Map component could play out (still using not-curated-data)