Since both iOS and Android support min and max zoom for the map, can you please add it to the PCL?
which platform do you want?
Yes we can, I found set min/max zoom-level in Android and iOS Google Maps API.
I suggest adding listed APIs in Xamarin.Forms.GoogleMaps.
Map.SetMinMaxZoomLevel(float minZoomLevel, float maxZoomLevel) methodMap.MinZoomLevel property (getter only)Map.MaxZoomLevel property (getter only)Why Map.MinZoom doesn't have the setter?
Because separated setter and getter to each methods in GoogleMaps Android API(setMaxZoomPreference and getMinZoomLevel).
But this implementations are very easy.
Is there somebody who can try?
@amay077 Have you implemented this Zoom Level setter properties.
Any one has implemented this I need to add this in my project
I have fixed this using customising maps CameraChanged method
googleMap.CameraChanged += async (object sender, CameraChangedEventArgs e) => await GoogleMap_CameraChanged(sender,e) ;
async Task GoogleMap_CameraChanged(object sender, CameraChangedEventArgs e)
{
if(e.Position.Zoom>maxZoom){
CameraPosition cameraPosition = new CameraPosition(e.Position.Target, maxZoom);
CameraUpdate cameraUpdate = CameraUpdateFactory.NewCameraPosition(cameraPosition);
googleMap.InitialCameraUpdate = cameraUpdate;
await googleMap.AnimateCamera(cameraUpdate);
}
if (e.Position.Zoom <minZoom )
{
CameraPosition cameraPosition = new CameraPosition(e.Position.Target, minZoom);
CameraUpdate cameraUpdate = CameraUpdateFactory.NewCameraPosition(cameraPosition);
googleMap.InitialCameraUpdate = cameraUpdate;
await googleMap.AnimateCamera(cameraUpdate);
}
}
This feature would be really handy to have in this library
Most helpful comment
I suggest adding listed APIs in Xamarin.Forms.GoogleMaps.
Map.SetMinMaxZoomLevel(float minZoomLevel, float maxZoomLevel)methodMap.MinZoomLevelproperty (getter only)Map.MaxZoomLevelproperty (getter only)Why
Map.MinZoomdoesn't have the setter?Because separated setter and getter to each methods in GoogleMaps Android API(
setMaxZoomPreferenceandgetMinZoomLevel).But this implementations are very easy.
Is there somebody who can try?