Zoom MKMapView to fit polyline points

后端 未结 8 1242
小蘑菇
小蘑菇 2020-12-05 04:39

I have an array, allCollections, that holds programmatically-created arrays of CLLocations the user has recorded through my iOS app. Each sub-array in allCollections holds a

8条回答
  •  我在风中等你
    2020-12-05 05:13

    @Fundtimer pointed it right way, Only thing is that Padding needs to be adjusted as per visual needs, that way it will support all the other overlays and following is the generic solution for all overlays.

    -(void)zoomIntoExistingMapObjectForAnnot:(CustomMapAnnotation *)annot
    {
       id overlay = annot.shape;//I have overlay property in custom annotation class.
       [_mapView setVisibleMapRect:[overlay boundingMapRect] edgePadding:UIEdgeInsetsMake(150.0, 150.0, 150.0, 150.0) animated:YES];
    }
    

提交回复
热议问题