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

Add slippy tiles #71

Merged
merged 6 commits into from
Aug 28, 2019
Merged

Add slippy tiles #71

merged 6 commits into from
Aug 28, 2019

Conversation

nachtm
Copy link
Contributor

@nachtm nachtm commented Aug 23, 2019

We now use mapbox-gl to display our data instead of static images. Users can zoom in/out and pan around to an extent:
image
image

Since we were concerned about potentially hitting our quota of map loads, I did some work to recycle the map instances as much as possible. Basically, the <App/> component stores a div and a <Map/> associated with that div. The CityProfileCard needs access to that div, which I could have done by passing it down as a prop but decided to try using a Context instead. I think it's pretty clean but I'm happy to rework. Actually getting the CityProfileCard to show an element passed in to it took a little hacking/magic as seen in this comment.

Thanks to @ahmouda12 for doing a lot of the initial legwork here!

Remaining TODOs on the map area:

  • button to switch between styles
  • update the legend
  • add an "open in iD editor" button
  • anything else?

Copy link
Collaborator

@MonicaBrandeis MonicaBrandeis left a comment

Choose a reason for hiding this comment

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

LGTM!

@MonicaBrandeis
Copy link
Collaborator

@nachtm let me know if rest to-do will be on your other PR so we can merge or we should wait!

@nachtm
Copy link
Contributor Author

nachtm commented Aug 26, 2019

I took the svg that @ahmouda12 created through d3 and added it directly to the map as the legend. Looks like this:
image
If anyone has a better eye for design and wants to make/suggest improvements I'm all ears.

@nachtm
Copy link
Contributor Author

nachtm commented Aug 27, 2019

More updates: we now have an open in iD editor button (the pencil logo on the right) and a switch-map-styles button (the layers button on the left).

Looks like this:
image

More specifically, here are the three different layers:
image

@MonicaBrandeis can you confirm that these are correct?

@MonicaBrandeis
Copy link
Collaborator

Not exactly

  1. No car -> Car Ownership
  2. Population
    Delete the work from home

@nachtm
Copy link
Contributor Author

nachtm commented Aug 27, 2019

Updated the layer names again:
image

Copy link
Contributor

@sayas01 sayas01 left a comment

Choose a reason for hiding this comment

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

Looks great!

@sayas01 sayas01 merged commit 79ae909 into spatialdev:master Aug 28, 2019
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.

3 participants