I am using Google Maps SDK in my project. I want to check and detect when tap on google map that is used single finger or double finger ?
My requirement is, disable single finger use and enable double finger use. I want all Gestures work on double finger not on single finger.
First, disable all gesture on your GMSMapView instance. Documentation says:
You can disable the default gestures on the map by setting properties of the GMSUISettings class, which is available as a property of the GMSMapView
Source: https://developers.google.com/maps/documentation/ios-sdk/controls
Then you may be able to add some UITapGestureRecognizer:
Source: https://developer.apple.com/documentation/uikit/uitapgesturerecognizer
Don't forget to set numberOfTouchesRequired to 2 !
Source: https://developer.apple.com/documentation/uikit/uitapgesturerecognizer/1623580-numberoftouchesrequired
Related
I have successfully managed to implement draggable annotations by using this link https://docs.mapbox.com/ios/maps/examples/draggable-views/. However, these annotations become draggable only after long pressing on them. I am looking for a solution wherein the annotations become draggable as soon as they are added to the map. Thanks a lot for helping :)
Ended up coming up with my own implementation to suit my needs. Heres how I went about it:-
Add the UIPanGestureRecognizer on the annotation view of the annotation that needs to be dragged.
In the gesture recognizer, convert the in-screen gesture location to real-world coordinates using the mapView.convert(point, mapView) method. Use these coordinates to update the location of the dragged coordinate
Use the started and the ended state property of the gesture recognizer to determine the start and end of the drag gesture.
I'm trying to make a card game app (with swift 4) like a Solitaire Card Game.
So I have to use Drag and Drop to each Card UIView.
But I think there are two ways to use for dragging.
Which one is better between UIPanGesture and UIDragInteraction/UIDropInteraction?
Furthermore, I'm not sure about what panning means.
2. what is difference between dragging and panning?
(From Apple site: UIDragInteraction & UIPanGestureRecognizer),
UIDragInteraction
An interaction to enable dragging of items from a view, employing a delegate to provide drag items and to respond to calls from the drag session.
UIPanGestureRecognizer
A concrete subclass of UIGestureRecognizer that looks for panning (dragging) gestures.
Here, Pan & Drag gesture is almost same.
Some of differences which I got from searching are as follow..
UIDragInteraction works from iOS 11.0+ & UIPanGestureRecognizer works from iOS 3.2+, so if you want to run your application in older version devices then you should use UIPanGestureRecognizer
UIPanGestureRecognizer works on the whole screen & gives you the CGPoints as response of touch where UIDragInteraction works on the particular object you want to drag & drop & gives you direct the view object.
UIPanGestureRecognizer can work with multiple touches & handle those where UIDragInteraction doesn't allow you to handle multiple touch.
Hope this helps.
Thanks
I am trying to create a gesture recognizer that responds to three touches, but the gesture is ignored if the user has the accessibility zoom feature enabled, which triggers off a three finger double tap.
My view uses massive UI elements, so zooming is not appropriate. Is there an api to disable the accessibility zoom so I can respond to a three finger tap?
You could try posting a UIAccessibilityPauseAssistiveTechnologyNotification though I believe this only refers to external ATs, and not to VoiceOver and Zoom features. Though I have not played around with it much.
EDIT: I just checked, the constant for disabling the zoom feature is not available in UIAccessibilityConstants.h. So this will not work, meaning there is no viable solution for this.
I using GoogleMaps.framework in my iOS app. I need detect double tap on marker to do some action.
I try to find some public method to do it, but I am not lucky. Have any way to do it?
By referring to the delegate functions provided by the google map you can detect the if a marker has been clicked on :)
Assuming the marker is a view, can you not add a UITapGestureRecognizer to it and then set the number of taps required to trigger the recognizer to two?
I'm working on an app (iOS 7) which is using Google Maps (v1.8.1). I'm trying to implement a feature, where You would have a polygon in the map, and when you double tap it - it zooms to the polygon. I've read around that I could disable zooming gestures in the map, via googleMapView.settings.zoomGestures = NO;, but I don't want to lose zoomGestures at all (You can zoom in using double tap (when not double tapping on the polygon) or pinch to zoom). I've tried adding a GestureRecognizer, but the method for the recognizer gets called after the zoom happens (GMSMapViewDelegate method willMove gets called first). How would I go about this?