teovillanueva / react-native-web-maps

Cross platform maps for react & react-native 🗺
https://teovillanueva.github.io/react-native-web-maps/
MIT License
57 stars 14 forks source link

Prevent component from requesting user location by default. #25

Closed sreuter closed 1 year ago

sreuter commented 1 year ago

When including MapView, the user is immediately being asked to share their location. I tried providing a initialRegion, which works but still triggers a location request.

sreuter commented 1 year ago

Alright, I found the line causing this.

@teovillanueva As this seems to have been the default behavior for a while, I'll create a PR that allows setting this to false on init.

sreuter commented 1 year ago

I just noticed that you're piggy-backing on the MapView options of react-native-map as this is meant to be a drop-in replacement. Hence it might make sense to change the default behavior to what it does on iOS, Android and issue a new major version instead.

sreuter commented 1 year ago

I opted for a sensible default based on the existing showUserLocation from MapView.

PR is here: https://github.com/teovillanueva/react-native-web-maps/pull/28

In case somebody wants to use this before it's merged: @sreuter/react-native-web-maps@0.9.2

teovillanueva commented 1 year ago

closed by #28