summaryrefslogtreecommitdiff
path: root/ios/MBXViewController.mm
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-02-21 12:07:46 +0100
committerKonstantin Käfer <mail@kkaefer.com>2014-02-21 12:07:46 +0100
commit1fb44511929d7ddb0f972334bb95ff779cf77481 (patch)
tree7d9f897d04eba2411303d358ccc7008d75cd5a12 /ios/MBXViewController.mm
parentbd2d865fc474f752b48b88b4b8fd2c8eb307f301 (diff)
parentd5c611d7076e901b524b0d941b29b1a8180429e3 (diff)
downloadqtlocation-mapboxgl-1fb44511929d7ddb0f972334bb95ff779cf77481.tar.gz
Merge pull request #68 from mapbox/poi-render
refs #60: first cut of POI rendering
Diffstat (limited to 'ios/MBXViewController.mm')
-rw-r--r--ios/MBXViewController.mm16
1 files changed, 15 insertions, 1 deletions
diff --git a/ios/MBXViewController.mm b/ios/MBXViewController.mm
index 8d734459cd..9900451082 100644
--- a/ios/MBXViewController.mm
+++ b/ios/MBXViewController.mm
@@ -49,7 +49,7 @@ class MBXMapView
{
settings.load();
- map.setup();
+ map.setup([[UIScreen mainScreen] scale]);
CGRect frame = [[UIScreen mainScreen] bounds];
map.resize(frame.size.width, frame.size.height, frame.size.width, frame.size.height);
@@ -238,6 +238,8 @@ class MBXMapView
if (pinch.state == UIGestureRecognizerStateBegan)
{
+ mapView->map.startScaling();
+
self.scale = mapView->map.getScale();
}
else if (pinch.state == UIGestureRecognizerStateChanged)
@@ -260,6 +262,8 @@ class MBXMapView
}
else if (pinch.state == UIGestureRecognizerStateEnded)
{
+ mapView->map.stopScaling();
+
if (fabsf(pinch.velocity) < 20)
return;
@@ -272,6 +276,10 @@ class MBXMapView
mapView->map.scaleBy(new_scale / scale, [pinch locationInView:pinch.view].x, [pinch locationInView:pinch.view].y, duration);
}
+ else if (pinch.state == UIGestureRecognizerStateCancelled)
+ {
+ mapView->map.stopScaling();
+ }
[self updateRender];
}
@@ -282,12 +290,18 @@ class MBXMapView
if (rotate.state == UIGestureRecognizerStateBegan)
{
+ mapView->map.startRotating();
+
self.angle = mapView->map.getAngle();
}
else if (rotate.state == UIGestureRecognizerStateChanged)
{
mapView->map.setAngle(self.angle + rotate.rotation, [rotate locationInView:rotate.view].x, [rotate locationInView:rotate.view].y);
}
+ else if (rotate.state == UIGestureRecognizerStateEnded || rotate.state == UIGestureRecognizerStateCancelled)
+ {
+ mapView->map.stopRotating();
+ }
[self updateRender];
}