ios - Position GMSMarker on bottom when clicked -
when gmsmarker
clicked , infowindow
opened camera moves point gmsmarker
@ center of gmsmapview
. how change camera move position marker @ bottom when moved?
when implement gms didtapmarker
delegate
method without infowindow
fine:
func mapview(mapview: gmsmapview, didtapmarker marker: gmsmarker) -> bool { var point = mapview.projection.pointforcoordinate(marker.position) point.y = point.y - 200 let camera = gmscameraupdate.settarget(mapview.projection.coordinateforpoint(point)) mapview.animatewithcameraupdate(camera) return true }
it positions marker on bottom. if return false
shows infowindow , marker centered again.
mapview.selectedmarker = marker
missing in didtapmarker
delegate
method. method should this:
func mapview(mapview: gmsmapview, didtapmarker marker: gmsmarker) -> bool { var point = mapview.projection.pointforcoordinate(marker.position) point.y = point.y - 150 let camera = gmscameraupdate.settarget(mapview.projection.coordinateforpoint(point)) mapview.animatewithcameraupdate(camera) mapview.selectedmarker = marker return true }
Comments
Post a Comment