iOS, How to use GMSCoordinateBounds to show all the markers of the map?

后端 未结 10 1908
无人共我
无人共我 2020-12-23 09:28

I want to show all the markers that are on my map, after doing some searches I found that it should be done with GMSCoordinateBounds (Google Maps SDK) I\'ve

10条回答
  •  悲&欢浪女
    2020-12-23 10:14

    We can find the same code every where , but make sure that it is in viewDidAppear() method

    //bounding to a region of markers
    GMSCoordinateBounds *bounds =
    [[GMSCoordinateBounds alloc] initWithCoordinate:sourceMarker.position coordinate:destMarker.position];
    [_mapView moveCamera:[GMSCameraUpdate fitBounds:bounds withPadding:50.0]];
    

提交回复
热议问题