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

WIP: Show object detail on click #6

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

CloudNiner
Copy link
Owner

@CloudNiner CloudNiner commented Oct 22, 2020

Also adds pointer and highlights on feature hover.

TODO:

  • Verify correctness of click handling that discovers the matching old or new feature in the diff for modified features
  • Remove react-mapbox-gl dependency from package.json

Notes

Ran npm audit fix.

Removes react-mapbox-gl. I rewrote the map component to help debug an issue and it ended up being a relatively straightforward implementation that made including the extra lib not seem worth it.

Refactor to remove react-mapbox-gl dep, since our
use case is simple (just lots of layer declarations)
and the dependency adds complexity and larger bundles.

String geojson feature IDs don't get copied into the
vector tiles, thus can't be used for "feature state":
    mapbox/mapbox-gl-js#2716

Work around just uses osm object id via "promoteId".
It's possible but unlikely that two objects of different
types could share the same int id in a single diff. I
think the behavior in this case is just that both
elements with the same id would receive the same hover state.
The duplicate is likely offscreen.
Add prettierrc to set max width to 100
TODO: Verify find logic for old/new versions
of object in map click handler
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.

1 participant