From 62ea1f21858c69f6921c775ba7a3de201f0514d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 26 Jan 2017 18:52:44 +0100 Subject: [core] remove trailing whitespace, add trailing newlines, add space after // --- platform/macos/app/MapDocument.m | 80 ++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'platform/macos/app/MapDocument.m') diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m index 40fd9e4600..225bb4d3af 100644 --- a/platform/macos/app/MapDocument.m +++ b/platform/macos/app/MapDocument.m @@ -40,7 +40,7 @@ NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id *)layer.text rawValue]; layer.text = [MGLStyleValue valueWithRawValue:stringByLocalizingString(textField)]; @@ -391,7 +391,7 @@ NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id region = [[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:self.mapView.styleURL bounds:self.mapView.visibleCoordinateBounds fromZoomLevel:self.mapView.zoomLevel toZoomLevel:self.mapView.maximumZoomLevel]; NSData *context = [[NSValueTransformer valueTransformerForName:@"OfflinePackNameValueTransformer"] reverseTransformedValue:nameTextField.stringValue]; [[MGLOfflineStorage sharedOfflineStorage] addPackForRegion:region withContext:context completionHandler:^(MGLOfflinePack * _Nullable pack, NSError * _Nullable error) { @@ -687,27 +687,27 @@ NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id valueWithStops:@{ @0.0: [MGLStyleValue valueWithRawValue:[NSColor redColor]], @10.0: [MGLStyleValue valueWithRawValue:[NSColor yellowColor]], @20.0: [MGLStyleValue valueWithRawValue:[NSColor blackColor]], }]; fillStyleLayer.fillColor = colorFunction; - + NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"]; NSURL *geoJSONURL = [NSURL fileURLWithPath:filePath]; MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"ams" URL:geoJSONURL options:nil]; [self.mapView.style addSource:source]; - + MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"test" source:source]; fillLayer.fillColor = [MGLStyleValue valueWithRawValue:[NSColor greenColor]]; fillLayer.predicate = [NSPredicate predicateWithFormat:@"%K == %@", @"type", @"park"]; [self.mapView.style addLayer:fillLayer]; - + NSImage *image = [NSImage imageNamed:NSImageNameIChatTheaterTemplate]; [self.mapView.style setImage:image forName:NSImageNameIChatTheaterTemplate]; - + MGLSource *streetsSource = [self.mapView.style sourceWithIdentifier:@"composite"]; MGLSymbolStyleLayer *theaterLayer = [[MGLSymbolStyleLayer alloc] initWithIdentifier:@"theaters" source:streetsSource]; theaterLayer.sourceLayerIdentifier = @"poi_label"; @@ -740,7 +740,7 @@ NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id Date: Thu, 26 Jan 2017 23:51:29 -0800 Subject: [macos] Flatten point collections, not multipoints --- platform/macos/app/MapDocument.m | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'platform/macos/app/MapDocument.m') diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m index 64833a8560..a72eb42dec 100644 --- a/platform/macos/app/MapDocument.m +++ b/platform/macos/app/MapDocument.m @@ -22,10 +22,13 @@ NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id shape in shapes) { NSArray *subshapes; - // Flatten multipoints but not polylines or polygons. - if ([shape isMemberOfClass:[MGLMultiPoint class]]) { - NSUInteger pointCount = [(MGLMultiPoint *)shape pointCount]; - CLLocationCoordinate2D *coordinates = [(MGLMultiPoint *)shape coordinates]; + if ([shape isKindOfClass:[MGLMultiPolyline class]]) { + subshapes = [(MGLMultiPolyline *)shape polylines]; + } else if ([shape isKindOfClass:[MGLMultiPolygon class]]) { + subshapes = [(MGLMultiPolygon *)shape polygons]; + } else if ([shape isKindOfClass:[MGLPointCollection class]]) { + NSUInteger pointCount = [(MGLPointCollection *)shape pointCount]; + CLLocationCoordinate2D *coordinates = [(MGLPointCollection *)shape coordinates]; NSMutableArray *pointAnnotations = [NSMutableArray arrayWithCapacity:pointCount]; for (NSUInteger i = 0; i < pointCount; i++) { MGLPointAnnotation *pointAnnotation = [[MGLPointAnnotation alloc] init]; @@ -33,10 +36,6 @@ NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id Date: Wed, 4 Jan 2017 07:35:25 -0800 Subject: [ios, macos] Add support for data-driven property functions --- platform/macos/app/MapDocument.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'platform/macos/app/MapDocument.m') diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m index 225bb4d3af..62ddd2ce60 100644 --- a/platform/macos/app/MapDocument.m +++ b/platform/macos/app/MapDocument.m @@ -373,8 +373,9 @@ NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id *)layer.text rawValue]; layer.text = [MGLStyleValue valueWithRawValue:stringByLocalizingString(textField)]; - } else if ([layer.text isKindOfClass:[MGLStyleFunction class]]) { - MGLStyleFunction *function = (MGLStyleFunction *)layer.text; + } + else if ([layer.text isKindOfClass:[MGLCameraStyleFunction class]]) { + MGLCameraStyleFunction *function = (MGLCameraStyleFunction *)layer.text; NSMutableDictionary *stops = function.stops.mutableCopy; [stops enumerateKeysAndObjectsUsingBlock:^(NSNumber *zoomLevel, MGLStyleConstantValue *stop, BOOL *done) { NSString *textField = stop.rawValue; -- cgit v1.2.1 From 360e5bf631229e2aec71780a515a42e32d4c28e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Tue, 7 Feb 2017 18:26:49 -0800 Subject: [ios, macos] Fixed runtime styling deprecation warnings --- platform/macos/app/MapDocument.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'platform/macos/app/MapDocument.m') diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m index 62ddd2ce60..6f63542527 100644 --- a/platform/macos/app/MapDocument.m +++ b/platform/macos/app/MapDocument.m @@ -689,11 +689,11 @@ NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id valueWithStops:@{ + MGLStyleValue *colorFunction = [MGLStyleValue valueWithInterpolationMode:MGLInterpolationModeExponential cameraStops:@{ @0.0: [MGLStyleValue valueWithRawValue:[NSColor redColor]], @10.0: [MGLStyleValue valueWithRawValue:[NSColor yellowColor]], @20.0: [MGLStyleValue valueWithRawValue:[NSColor blackColor]], - }]; + } options:nil]; fillStyleLayer.fillColor = colorFunction; NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"]; @@ -715,11 +715,11 @@ NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id )annotation { if ([annotation isKindOfClass:[DroppedPinAnnotation class]]) { - DroppedPinAnnotation *droppedPin = annotation; + DroppedPinAnnotation *droppedPin = (DroppedPinAnnotation *)annotation; [droppedPin resume]; } } - (void)mapView:(MGLMapView *)mapView didDeselectAnnotation:(id )annotation { if ([annotation isKindOfClass:[DroppedPinAnnotation class]]) { - DroppedPinAnnotation *droppedPin = annotation; + DroppedPinAnnotation *droppedPin = (DroppedPinAnnotation *)annotation; [droppedPin pause]; } } -- cgit v1.2.1 From d12ac71ba76c441e8dca97d0186abe4646a7d716 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Sat, 11 Feb 2017 16:57:09 -0500 Subject: [macos] Round non-freeform zoom gestures/commands to nearest integer Affects: - Double-tap gestures - Two-finger tap gestures - +/- button pushes - Shortcut keys - Menu items and shortcut keys (in macapp) --- platform/macos/app/MapDocument.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'platform/macos/app/MapDocument.m') diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m index 6f63542527..2de189c856 100644 --- a/platform/macos/app/MapDocument.m +++ b/platform/macos/app/MapDocument.m @@ -217,11 +217,11 @@ NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id