木木木

Swift / Ruby on Railsなどの学習メモ。


Google Maps iOS SDKで全てのマーカーが入るようにズームアウト

こんなかんじ

- (void)zoomMapToShowAllMarkers
{
    CLLocationCoordinate2D myLocation = ((GMSMarker *)_mapView.markers.firstObject).position;
    GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] initWithCoordinate:myLocation coordinate:myLocation];

    for (GMSMarker *marker in _mapView.markers)
        bounds = [bounds includingCoordinate:marker.position];

    [_mapView animateWithCameraUpdate:[GMSCameraUpdate fitBounds:bounds withPadding:70.0f]];
}
日本で一番簡単にビットコインが買える取引所 coincheck bitcoin