googlemaps / react-native-navigation-sdk

Apache License 2.0
25 stars 5 forks source link

Height/width of the map cannot be changed. #192

Closed nexttrack07 closed 2 months ago

nexttrack07 commented 3 months ago

Is there a way to recenter the map programmatically? Or refresh the map? For example, if the provided height changes the map doesn't update. We have several use cases where we need to dynamically change the height of the map.

illuminati1911 commented 3 months ago

Hi @nexttrack07

Is there a way to recenter the map programmatically? Or refresh the map? For example, if the provided height changes the map doesn't update. We have several use cases where we need to dynamically change the height of the map.

There is no recenter function. Not even in the native SDKs. Not sure if it will help you, but you can move the camera to your location by using moveCamera function of the MapViewController

By "height of the map" are you talking about the zoom level?

nexttrack07 commented 3 months ago

Hey Thanks for the response. In the NavigationView component, we specify the width and height. I want to be able to update the height and it should reflect in UI. For example, the height is initially stored in state to 500, then I want to change it to 300 and it should update.

illuminati1911 commented 3 months ago

@nexttrack07 Thanks for reporting this. In regards to the height/width it seems to be a bug in the SDK. I'll change the title to match this.

jokerttu commented 2 months ago

Hi @nexttrack07 Please check PR #239, this PR improves how layout is handled on native Android and iOS code, allowing developers to have better control on NavigationView size.