Open adilsaeed31 opened 5 years ago
This function would be very useful to me, too.
Hi @adilsaeed31 and @dlcole,
I would try storing a reference to the mapView.
If you are using angular, inside of the onMapReady()
function you can set the mapView to a property in your component.
onMapReady = (event) => {
const mapView: MapView = event.object;
this.mapView = mapView;
}
Now that you have a reference to the map, you can update it anywhere you'd like inside of that component, like this.mapView.latitude = 38.1203202
Hope this helps!
Using angular:
<MapView [latitude]="your_latitude_property" [longitude]="your_longitude_property"
Whenever you update your properties inside your component. It will jump on it, during change detection.
Also as @tylerablake said. one must store a reference to the map. so you can manipulate it later on.
ps: don't forget that you have to update your properties inside the "zone". otherwise change detection won't happen.
Cheers.
Hi,
I want to center a map view after adding the marker but there is no easy way to center a map view. Please advise how I can do this.
Thank you.
Regards, Muhammad Adil