-
Notifications
You must be signed in to change notification settings - Fork 75
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
initial fixes for reactmapgl7 #362
Conversation
src/components/Navigation/index.js
Outdated
latitude: viewport.latitude, | ||
zoom: viewport.zoom, | ||
}} | ||
onLoad={e => this.geolocateControlRef.current && this.geolocateControlRef.current.trigger()} |
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.
Could we avoid requesting the user's location until they click on the map? That would preserve the current behavior
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.
Yes, we can change it to onClick.
latitude: viewport.latitude, | ||
zoom: viewport.zoom, | ||
}} | ||
onLoad={e => this.geolocateControlRef.current && this.geolocateControlRef.current.trigger()} | ||
onViewportChange={this.viewportChange} | ||
onContextMenu={null} | ||
mapStyle={MAP_STYLE} | ||
width="100%" | ||
height="100%" | ||
onNativeClick={this.focus} |
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 map height should increase when the user interacts with it, but this callback doesn't seem to be called 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.
Yes, it seems like the height property is now part of mapStyle, but I'm not sure how it translates visually for the navigation map.
The purpose of updating to
react-map-gl v7
is two fold:onError
forGeolocateControl
, which can help in Notify when camera/location access is blocked #338 and even browser events which are once denied to notify user of further actions.Current code compiles and bugs with the drag events on both navigation and drive maps are resolved. I wasn't able to dive into onViewportChange since I wasn't able to see the features affected in the demo version. Dead code parameters can be removed once the API migration is complete.