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

initial fixes for reactmapgl7 #362

Closed
wants to merge 2 commits into from
Closed

initial fixes for reactmapgl7 #362

wants to merge 2 commits into from

Conversation

qqap
Copy link
Contributor

@qqap qqap commented May 21, 2023

The purpose of updating to react-map-gl v7 is two fold:

  • Get access to onError for GeolocateControl, 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.
  • Potentially use MapLibre instead of Mapbox (MapLibre is an open source alternative to Mapbox. It has been released to ensure a free-to-use option is available following the announcement that Mapbox is to move to a proprietary license model.)

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.

latitude: viewport.latitude,
zoom: viewport.zoom,
}}
onLoad={e => this.geolocateControlRef.current && this.geolocateControlRef.current.trigger()}
Copy link
Collaborator

@incognitojam incognitojam May 28, 2023

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

Copy link
Contributor Author

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}
Copy link
Collaborator

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

Copy link
Contributor Author

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.

@qqap qqap closed this by deleting the head repository Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants