How to setCenter mapview with location in google maps sdk for iOS? With mapkit we can do setCenter:Location. How do this with google maps sdk for iOS.
相关问题
- Animating GMSMarker in a circular path
- GMSMapStyle unresolved identifier
- Implement new Google Maps SDK to my iOS app
- Increase in app size after use of Google Maps SDK
- How to prevent camera from moving when tapping mar
相关文章
- How to draw a proper polylines on google maps [clo
- How to use delegates in Google map API for IOS 6 [
- Fetching nearby places using google maps
- Is there a Google Maps equivalent to mkmapsnapshot
- How to integrate new Google map app with ios app
- iOS GoogleMaps SDK - animateToCameraPosition anima
- GMSMarker opacity animation not repeating
- didChangeCameraPosition get bounding box/ rectangl
as stated in my comments above, the 'animate...' solutions do not provide true center (provides top center instead), and 'moveCamera:' does indeed provide true center (but doesn't animate).
my only work around was to add call to 'animateToZoom:' after call to 'moveCamera:'. this provides true center and adds some 'illusive' animation to center.
update: more elegant animation solution with zoom out, then zoom back in and true center (on marker tap).
note: if you want to set your own coords just replace marker.position with your own CLLocationCoordinate2D
I use this helper method:
Create a new camera with the GMSCameraPosition constructor
+ (GMSCameraPosition *)cameraWithTarget:(CLLocationCoordinate2D)target zoom:(CGFloat)zoom
then use the method
You can also just use
but the previous allows you to change the zoom, bearing, and viewing angle within the camera constructor if you want more control over the final appearance of the camera.