-
Notifications
You must be signed in to change notification settings - Fork 4
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
Stop scroll capture on crash map and upgrade react-map-gl to v7 #1398
Conversation
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 looks like a lot of change because it used to be a class component. The big changes are that shared config between all the maps was extracted into map.js
. The old code also manages viewport
state which isn't needed in the newer react-map-gl
API.
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.
Same here - class component made into a function component.
transform: `translate(0px, ${ | ||
isDragging && animated ? `-${size}px` : `${-size / 2}px` | ||
})`, |
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.
I had to update this style because the map was rendering the pin marker way off center with the old transform/translate values.
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 was the location polygon editor component. Not needed. 🗑️
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.
The toolbar only used by LocationEditMap
. 🗑️
@@ -49,8 +49,7 @@ | |||
"react-csv-reader": "^3.0.6", | |||
"react-datepicker": "^2.9.6", | |||
"react-dom": "^16.8.6", | |||
"react-map-gl": "^5.1.1", | |||
"react-map-gl-draw": "^0.15.0", |
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 package was only used by the unneeded LocationEditMap
component removed in this PR. It isn't compatible with the new react-map-gl
version anyways.
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.
✌️
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 looks great Mike. I've read through the code and tested it with your really helpful and clear PR comment / testing steps. It's all 🚢 🚀 . I'm looking forward to reading the next PR!
I especially enjoyed reading about the browser coverage, and that's a really cool site you linked to show how they compared. Lots of TIL in there for me too.
padding: "10px", | ||
}; | ||
|
||
export default class CrashMap extends Component { |
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.
Thanks for taking the time to turn this into a functional component! 🙏 🙏
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.
+1 🙌
touchPitch: false, | ||
dragRotate: false, | ||
boxZoom: false, | ||
maxBounds: [[-99, 29], [-96, 32]], |
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.
love the touch of making a bounding box so you cant go exploring the whole planet anymore!
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.
💯
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.
Thanks for working on this Mike, everything looks great! +1 thanks for turning those classes into functional components and rly like the touch of the bounding box 🚢
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 is looking so good! i'm moving on to the related PRs 🍿 🙌 🚢
@@ -49,8 +49,7 @@ | |||
"react-csv-reader": "^3.0.6", | |||
"react-datepicker": "^2.9.6", | |||
"react-dom": "^16.8.6", | |||
"react-map-gl": "^5.1.1", | |||
"react-map-gl-draw": "^0.15.0", |
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.
✌️
touchPitch: false, | ||
dragRotate: false, | ||
boxZoom: false, | ||
maxBounds: [[-99, 29], [-96, 32]], |
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.
💯
atd-vze/src/views/Crashes/Crash.js
Outdated
// refetchCrashData={refetch} | ||
// setIsEditingCoords={setIsEditingCoords} | ||
// /> | ||
null} |
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.
noting that this is restored in a related branch of this work
padding: "10px", | ||
}; | ||
|
||
export default class CrashMap extends Component { |
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.
+1 🙌
Update LocationMap
Update CrashEditCoordsMap
Associated issues
cityofaustin/atd-data-tech#15867
cityofaustin/atd-data-tech#15190
Please review these PRs in this order: #1398, #1399, #1400
This PR:
react-map-gl
to v7 andmapbox-gl
as wellreact-map-gl-draw
and theLocationEditMap
component that used it. This feature/component was intended to allow VZ users to edit location polygon which was never needed.browserslist
config inpackage.json
to address a JavaScript transpile error related to Mapbox GLTesting
URL to test:
https://deploy-preview-1398--atd-vze-staging.netlify.app/
Steps to test:
Ship list