mousebird-consulting-inc / WhirlyGlobe

WhirlyGlobe Development
Other
830 stars 255 forks source link

Cannot lock out two finger pan+zoom gesture #611

Closed ACoyte closed 8 years ago

ACoyte commented 8 years ago

I am trying to centre my WG (2.4) to the current GPS/location services position.

To make this more intuitive to the user, I wish to prevent them from any panning gesture as my code is trying to keep the GPS marker om the centre of the map, and move/rotate the map according to position and heading.

The following code shows what I am trying to achieve however after executing this code, the user can still pan the map around using two fingers. I want the user to ONLY be able to rotate and zoom but not change the map's position.

if (self.centreGpsPosition) {
    self.whirlyGlobeViewController.panGesture = NO;
    self.whirlyGlobeViewController.doubleTapDragGesture = NO;
    self.whirlyGlobeViewController.twoFingerTapGesture = NO;
    [self.whirlyGlobeViewController setPosition:self.gpsLocation];
}
mousebird commented 8 years ago

Should now be working. Be sure to turn off the rotateGesture as well.