CatalystCode / project-fortis

Repository for all parts of the Fortis architecture
https://aka.ms/fortis-story
MIT License
29 stars 17 forks source link

Map re-position: Heatmap Zoom Fixes #19

Closed rachelnicole closed 6 years ago

rachelnicole commented 6 years ago

Not ready for review yet, just opening up the PR to track things for myself.

rachelnicole commented 6 years ago

@c-w so what happened was changing the state wasn't updating the map, moveMapToNewLocation was only applicable for changing placeId so there's a new function moveMapToBoundingBox which we're calling when the button is clicked, and passing through the original bbox value with this.refs.map.leafletElement.fitBounds(bounds); the leafletElement was the key to this as i realized it was the thing that's actually handling the map movement, watching for state changes wasn't hooked up.

This was a lot to figure out, originally I thought that updating the state for bbox and zoom would have automatically changed the way the map moves, but that wasn't the case.