From 828d8ba26f24a733f5cf50f6e47c489ad9a17a03 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Fri, 14 Feb 2014 18:13:12 -0800 Subject: refs #60: first cut of POI rendering * add basic marker style to stylesheet * pass through marker style to PBF conversion * marker/point tile parsing, bucket, buffer, shaders, etc. * new sprite hosting for 1x/2x variants * sprite load accepts screen scale argument --- ios/MBXViewController.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ios/MBXViewController.mm') diff --git a/ios/MBXViewController.mm b/ios/MBXViewController.mm index c5d6effa1a..a687350af0 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); -- cgit v1.2.1 From 9710fbef994f96c3eeab66aab4d73c97c7270138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Wed, 19 Feb 2014 15:39:44 +0100 Subject: enable texture interpolation during rotating and scaling --- ios/MBXViewController.mm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ios/MBXViewController.mm') diff --git a/ios/MBXViewController.mm b/ios/MBXViewController.mm index a687350af0..040c05803e 100644 --- a/ios/MBXViewController.mm +++ b/ios/MBXViewController.mm @@ -236,6 +236,7 @@ class MBXMapView if (pinch.state == UIGestureRecognizerStateBegan) { + mapView->map.startScaling(); self.scale = mapView->map.getScale(); } else if (pinch.state == UIGestureRecognizerStateChanged) @@ -258,6 +259,7 @@ class MBXMapView } else if (pinch.state == UIGestureRecognizerStateEnded) { + mapView->map.stopScaling(); if (fabsf(pinch.velocity) < 20) return; @@ -270,6 +272,9 @@ 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]; } @@ -280,12 +285,17 @@ 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]; } -- cgit v1.2.1 From cbf96ba1c6212e57bfa5abd696f9313fe28304fc Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Wed, 19 Feb 2014 12:27:23 -0800 Subject: minor formatting --- ios/MBXViewController.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ios/MBXViewController.mm') diff --git a/ios/MBXViewController.mm b/ios/MBXViewController.mm index 040c05803e..b8cfbdb927 100644 --- a/ios/MBXViewController.mm +++ b/ios/MBXViewController.mm @@ -237,6 +237,7 @@ class MBXMapView if (pinch.state == UIGestureRecognizerStateBegan) { mapView->map.startScaling(); + self.scale = mapView->map.getScale(); } else if (pinch.state == UIGestureRecognizerStateChanged) @@ -260,6 +261,7 @@ class MBXMapView else if (pinch.state == UIGestureRecognizerStateEnded) { mapView->map.stopScaling(); + if (fabsf(pinch.velocity) < 20) return; @@ -272,7 +274,8 @@ class MBXMapView mapView->map.scaleBy(new_scale / scale, [pinch locationInView:pinch.view].x, [pinch locationInView:pinch.view].y, duration); } - else if (pinch.state == UIGestureRecognizerStateCancelled) { + else if (pinch.state == UIGestureRecognizerStateCancelled) + { mapView->map.stopScaling(); } @@ -286,6 +289,7 @@ class MBXMapView if (rotate.state == UIGestureRecognizerStateBegan) { mapView->map.startRotating(); + self.angle = mapView->map.getAngle(); } else if (rotate.state == UIGestureRecognizerStateChanged) -- cgit v1.2.1