Forum Xamarin.iOS

iOS Map Zoom information

FlorianMICHALONFlorianMICHALON FRMember ✭✭✭

Hello every one,

i'm doing custom renderer for Map, and i'm trying to get information about zoom in iOS but i don't find solution on iOS, for exemple on Android i have this :

`
map.CameraChange += Map_CameraChange;
[...]

private void Map_CameraChange(object sender, GoogleMap.CameraChangeEventArgs e)
{

        if(e.Position.Zoom < 7)
        {
            if (lastzoomlvl > 7)
            {
                nativelement.HandleZoomToHigh(this, new EventArgs());
            }
            else if(lastzoomlvl == 0)
            {
                nativelement.HandleZoomToHigh(this, new EventArgs());
            }
            lastzoomlvl = e.Position.Zoom;
        }
        else
        {
            if(lastzoomlvl < 7)
            {
                nativelement.HandleZoomGood(this, new EventArgs());
            }
            else if (lastzoomlvl == 0)
            {
                nativelement.HandleZoomGood(this, new EventArgs());
            }
            lastzoomlvl = e.Position.Zoom;
        }
    }

`

Any one have an idea for equivalent in iOS or a solution about zoom?

Posts

  • ColeXColeX Member, Xamarin Team Xamurai
    edited July 2018

    Here are two ways you can take .

    1. implement delegate IMapViewDelegate and method DidChangeCameraPosition.
    2. implement Event CameraPositionChanged.

    Then you can get object CameraPosition ,and get its zoom.

Sign In or Register to comment.