google-maps-ios-utils
google-maps-ios-utils copied to clipboard
Detect touch on marker or cluster
Hi Guy
How can i detect touch on marker or cluster ?
Touch on number or image
I do the following to zoom when on a cluster vs on a marker:
func mapView(mapView: GMSMapView, didTapMarker marker: GMSMarker) -> Bool {
let zoom = defaults.floatForKey(AppDelegate.zoomNamespace)
let zoomIncrement:Float = 0.5
let zoomIn = GMSCameraUpdate.zoomTo(zoom+zoomIncrement)
let clusters = clusterManager.clusterAlgorithm.getClusters(zoom)
for (_, cluster) in clusters.enumerate() {
if cluster.isKindOfClass(GStaticCluster) {
let clusterMarker = (cluster as! GStaticCluster).marker
if clusterMarker.position.latitude == marker.position.
latitude
&& clusterMarker.position.longitude == marker.position.
longitude {
// Click on cluster to zoom in
self.mapView.animateWithCameraUpdate(zoomIn)
}
}
}
On Tue, Jul 26, 2016 at 9:57 PM, TamNguyen [email protected] wrote:
Hi Guy How can i detect touch on marker or cluster ? Touch on number or image [image: simulator screen shot jul 27 2016 2 56 35 pm] https://cloud.githubusercontent.com/assets/9377583/17168028/578f6b44-540a-11e6-9c76-f0170285bbca.png
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/DDRBoxman/google-maps-ios-utils/issues/32, or mute the thread https://github.com/notifications/unsubscribe-auth/ACqz9JStGi9K5wu-gP1jiO4UlGyED4Zxks5qZw9TgaJpZM4JV7im .
Hi thank you for your comment But i want detect touch on number zoom map to show item marker inside this.
ok i got it. Thank you so much
Hey guy. When i touch on number cluster i want to zoom map to level show all item marker inside this. How to implement ? Thanks,