When you double tap on MKMapView : zoom in.
But how to zoom out??
There's always using two fingers to zoom in and out. On the emulator you need to hold down an option key to get 'two fingers' appear on the emulated screen (I think it's the Alt key but I use a PC keyboard on my mac so may differ on a real mac keyboard)
As for doing it procedurally you need to set the region on the mapkit.
via the setRegion method of your MKMapKit object.
Make sure you're within bounds though as it will cause a crash if not. (i.e. long -180
Related
In MapBoxGL JS the pitch of a map can be changed by holding down the CTRL key, holding down the mouse and then moving it. Is there an equivalent way to accomplish this on a touch screen with no keyboard (e.g. smartphones). The context of this question - I want to use mapInstance.getPitch to record the last pitch selected by the user.
Yes, using two fingers on one's smartphone.
I am using Leaflet in a mobile app and want to get rid of the two zooming buttons in the top corner, but I need the exact same effect (zooming without the possibility of panning around with it) but using a pinching gesture. Alas, the default pinching gesture does not keep the view centred!
I don't know why, but keeping the zoom centred when using the mousewheel or doubleclick are available options for the map object:
If passed 'center', double-click zoom will zoom to the center of the view regardless of where the mouse was.
If passed 'center', it will zoom to the center of the view regardless of where the mouse was.
But not for touchZoom, I tried. maybe the nice people at Leaflet thought the effect doesn't "feel" nice, but I really wish I could try it nonetheless and judge it by myself.
Anyone knows how to get a similar effect? I don't really want to end up calling setView() at every "zoom" event call, if that even was an option...
Found out that I could use the maxBounds option. If you set both corners on a single point (the one you'd use for setView, for example), the map won't be able to pan away from it.
Now i understand we can have 5 touch points by default in iPhone and have varied touch points enabled onto the different SDKs. However i have accomplished registering the touch points and getting distances, actual number of touch points. I would want to know if there's a way to accomplish and get the Diameter of a particular touch point for e.g. calculating the thumb touch in comparison with the index finger, Any ideas?
I think Apple makes it fairly clear that they don't intend to give third-party developers access to low-level multi-touch information. From Apple's documentation on Event Handling in iOS:
A finger on the screen affords a much different level of precision
than a mouse pointer. When a user touches the screen, the area of
contact is actually elliptical and tends to be offset below the point
where the user thinks he or she touched. This “contact patch” also
varies in size and shape based on which finger is touching the screen,
the size of the finger, the pressure of the finger on the screen, the
orientation of the finger, and other factors. The underlying
Multi-Touch system analyzes all of this information for you and
computes a single touch point.
I can’t speak to Android, but the public APIs in the iOS SDK don’t give you any information about a touch other than its position. These guys found a private API (i.e. one that’ll get you rejected from the App Store if you use it) for getting the diameter of a touch on the screen, but they haven’t provided any further information or released the library.
It's likely possible on Android (4.3 I have, but most likely others too), as you can both activate an overlay display of touch properties in the Developer options as Pointer location (in Input category), which shows you coordinates, their Delta (=difference) and two properties you might be interested in: Prs, that is pressure and Size. It seems you can find the thresholds that would recognize a thumb and the index finger in most cases. That's just what I would imply from the values I have seen in that display.
A proof that this is possible within the allowed API is Yet Another MultiTouch Test Android App listed on on Google Play which for me shows the pressure of each touch in it's own interface (so it must be available in the standard API).
I'm developing an application that uses an MKOverlayPathView to highlight certain positions on an MKMapView. Basically the idea is that the overlay path view gets passed a list of CLLocationCoordinate2D structs, then connects them linearly using CGPathAddLineToPoint() in its custom drawRect: implementation.
However, in both the Simulator and on a device (iPhone 3GS running 4.2.1), I notice some strange behavior: the path behaves perfectly well up to a certain zoom level, then will begin to "fuzz" (for lack of a better term) in certain segments. These problem areas are always sharply delineated, and the rest of the path will be just fine:
I've tried calling setNeedsLayout and invalidatePath on the path view (from the MKMapView's regionDidChangeAnimated notification method), but both of those will just cause the fuzzed area to disappear, rather than be redrawn properly. Is there a fix for this?
i know in iphone simulator to input using multi-touch, hold down the OPT key while using the mouse. will see two virtual fingertips.and move the mouse to pinch in and out.
my problem is in simulator,these two fingertips will only be overlap at the center all the time, if i jus want move one finger and another finger fix at a point,rather move two fingertips together how to achieve this in iphone simulator?in other word i want this two virtual finger can be overlap anywhere on the screen but not just center
If you press Shift-Option they will also move together with a static distance.