Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Updates to map component #24

Merged
merged 19 commits into from
Jul 31, 2018
Merged

Updates to map component #24

merged 19 commits into from
Jul 31, 2018

Conversation

paylakatel
Copy link
Contributor

This PR:

  • brings back feature counts so we can display them on the map
  • changes how we render the map from leaflet to mapboxGL to improve performance
  • adds a heatmap layer on zoom out
  • makes sure the pop-ups display information about all the crashes if a user selects multiple points
  • sort of deals with timezones by adding 5 hours to our dates - a method that may need to be made more robust in the future

Adds a readme file
* removes lastupdated prop from div

* use count method instead of length of id list for feature counts

* use mapbox gl instead of leaflet for performance
* removes lastupdated prop from div

* use count method instead of length of id list for feature counts

* use mapbox gl instead of leaflet for performance

* clean up leaflet artifacts

* make feature service urls cleaner
* removes lastupdated prop from div

* use count method instead of length of id list for feature counts

* use mapbox gl instead of leaflet for performance

* clean up leaflet artifacts

* make feature service urls cleaner

* deals with time zones for feauture counts
@paylakatel paylakatel requested a review from fionawhim July 31, 2018 14:51
const mapboxgl = process.browser ? require('mapbox-gl') : null;
// Despite using mapboxgl to render the map, we still use esri-leaflet to
// query to the layer
const { featureLayer } = process.browser ? require('esri-leaflet') : {};
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a TODO to remove that dependency and just AJAX the info in.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added here: #25. Could be a good debt bash item for next week

'cob-basemap': {
type: 'raster',
tiles: [
'https://awsgeo.boston.gov/arcgis/rest/services/Basemaps/BostonCityBasemap_WM/MapServer/tile/{z}/{y}/{x}',
Copy link
Contributor

Choose a reason for hiding this comment

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

cool!

this.map.on('click', e => {
// Crash and fatalitiy points are often stacked on top of eachother
// in the data. We want the pop-ups to show information about all
// the crashes that occured in the clicked location.
Copy link
Contributor

Choose a reason for hiding this comment

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

fancy!

return a[1] > b[1] ? -1 : 1;
});

new mapboxgl.Popup({ closeOnClickboolean: true })
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this just be closeOnClick: true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lol yes - thank you

Copy link
Contributor

@fionawhim fionawhim left a comment

Choose a reason for hiding this comment

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

LGTM!

@paylakatel paylakatel merged commit e60bc37 into master Jul 31, 2018
paylakatel added a commit that referenced this pull request Jul 31, 2018
* fix icon url (#14)

* adds back feature counts (#16)

* Add a readme (#17)

Adds a readme file

* Update map (#20)

* removes lastupdated prop from div

* use count method instead of length of id list for feature counts

* use mapbox gl instead of leaflet for performance

* Update map (#21)

* removes lastupdated prop from div

* use count method instead of length of id list for feature counts

* use mapbox gl instead of leaflet for performance

* clean up leaflet artifacts

* make feature service urls cleaner

* Update map (#22)

* removes lastupdated prop from div

* use count method instead of length of id list for feature counts

* use mapbox gl instead of leaflet for performance

* clean up leaflet artifacts

* make feature service urls cleaner

* deals with time zones for feauture counts

* Update map (#23)

* removes lastupdated prop from div

* use count method instead of length of id list for feature counts

* use mapbox gl instead of leaflet for performance

* clean up leaflet artifacts

* make feature service urls cleaner

* deals with time zones for feauture counts

* adjust heatmap props, popups show num crashes and info about each

* Updates to map component (#24)

* fix icon url (#14) (#15)

* adds back feature counts (#16)

* Add a readme (#17)

Adds a readme file

* removes lastupdated prop from div

* use count method instead of length of id list for feature counts

* use mapbox gl instead of leaflet for performance

* Update map (#20)

* removes lastupdated prop from div

* use count method instead of length of id list for feature counts

* use mapbox gl instead of leaflet for performance

* clean up leaflet artifacts

* make feature service urls cleaner

* Update map (#21)

* removes lastupdated prop from div

* use count method instead of length of id list for feature counts

* use mapbox gl instead of leaflet for performance

* clean up leaflet artifacts

* make feature service urls cleaner

* deals with time zones for feauture counts

* Update map (#22)

* removes lastupdated prop from div

* use count method instead of length of id list for feature counts

* use mapbox gl instead of leaflet for performance

* clean up leaflet artifacts

* make feature service urls cleaner

* deals with time zones for feauture counts

* adjust heatmap props, popups show num crashes and info about each

* clean up code

* fixed a couple typos in comments

* fix closeOnClick typo

* deleting extra lines/fixing what i broke (#28)
@paylakatel paylakatel deleted the update-map branch September 7, 2018 17:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants