From 1f3345cc7b2a5dbd8bc707ff9da857b3e3dfc84c Mon Sep 17 00:00:00 2001 From: Sam Fader Date: Tue, 23 Oct 2018 15:38:44 -0700 Subject: [PATCH 01/10] first draft --- Examples.xcodeproj/project.pbxproj | 32 ++++++--- Examples/Examples.h | 1 + Examples/Examples.m | 1 + .../marker.imageset/Contents.json | 8 +++ .../squircle.imageset/Contents.json | 8 +++ .../star.imageset/Contents.json | 8 +++ .../Headers/SymbolLayerZOrderExample.h | 18 +++++ .../ObjectiveC/SymbolLayerZOrderExample.m | 71 +++++++++++++++++++ Examples/Swift/SymbolLayerZOrderExample.swift | 65 +++++++++++++++++ 9 files changed, 203 insertions(+), 9 deletions(-) create mode 100644 Examples/ObjectiveC/Headers/SymbolLayerZOrderExample.h create mode 100644 Examples/ObjectiveC/SymbolLayerZOrderExample.m create mode 100644 Examples/Swift/SymbolLayerZOrderExample.swift diff --git a/Examples.xcodeproj/project.pbxproj b/Examples.xcodeproj/project.pbxproj index d4cdd3b3..2b6b9ad7 100644 --- a/Examples.xcodeproj/project.pbxproj +++ b/Examples.xcodeproj/project.pbxproj @@ -40,6 +40,8 @@ 07F53B851E00D02100B58DB3 /* AnnotationViewsAndImagesExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 07F53B841E00D02100B58DB3 /* AnnotationViewsAndImagesExample.m */; }; 1F1F84751E538ABB00332CC3 /* BlockingGesturesDelegateExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F1F84741E538ABB00332CC3 /* BlockingGesturesDelegateExample.m */; }; 1F1F84771E53A3B700332CC3 /* BlockingGesturesDelegateExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F1F84761E53A3B700332CC3 /* BlockingGesturesDelegateExample.swift */; }; + 2F00FCD121750D5A0028FC69 /* SymbolLayerZOrderExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F00FCD021750D5A0028FC69 /* SymbolLayerZOrderExample.m */; }; + 2F00FCD3217511760028FC69 /* SymbolLayerZOrderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F00FCD2217511760028FC69 /* SymbolLayerZOrderExample.swift */; }; 3E085B801EC526C500163C99 /* BuildingsExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E085B7F1EC526C500163C99 /* BuildingsExample.swift */; }; 3E085B831EC526E500163C99 /* BuildingsExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E085B821EC526E500163C99 /* BuildingsExample.m */; }; 3E1806101EAA800A004DB131 /* UserLocationAnnotationExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E18060F1EAA800A004DB131 /* UserLocationAnnotationExample.m */; }; @@ -232,6 +234,9 @@ 1F1F84761E53A3B700332CC3 /* BlockingGesturesDelegateExample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlockingGesturesDelegateExample.swift; sourceTree = ""; }; 29A0D7C8DCD539DCA5DA1BAC /* Pods-Examples.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Examples.release.xcconfig"; path = "Pods/Target Support Files/Pods-Examples/Pods-Examples.release.xcconfig"; sourceTree = ""; }; 2ECF27F4ACA1A3CA05DE1954 /* Pods-DocsCode.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DocsCode.release.xcconfig"; path = "Pods/Target Support Files/Pods-DocsCode/Pods-DocsCode.release.xcconfig"; sourceTree = ""; }; + 2F00FCCF21750D5A0028FC69 /* SymbolLayerZOrderExample.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SymbolLayerZOrderExample.h; sourceTree = ""; }; + 2F00FCD021750D5A0028FC69 /* SymbolLayerZOrderExample.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SymbolLayerZOrderExample.m; sourceTree = ""; }; + 2F00FCD2217511760028FC69 /* SymbolLayerZOrderExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SymbolLayerZOrderExample.swift; sourceTree = ""; }; 3E085B7F1EC526C500163C99 /* BuildingsExample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BuildingsExample.swift; sourceTree = ""; }; 3E085B811EC526E500163C99 /* BuildingsExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BuildingsExample.h; sourceTree = ""; }; 3E085B821EC526E500163C99 /* BuildingsExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BuildingsExample.m; sourceTree = ""; }; @@ -476,6 +481,7 @@ 3EBCD70D1DC28240001E342F /* ImageAnnotationExample.swift */, 3E1806111EAA804B004DB131 /* UserLocationAnnotationExample.swift */, 64BBDB021DF24E0900BB705D /* WebAPIDataExample.swift */, + 2F00FCD2217511760028FC69 /* SymbolLayerZOrderExample.swift */, ); name = "Markers and callouts"; sourceTree = ""; @@ -577,6 +583,7 @@ 96D431FB1C84B4F7007D09D1 /* ImageAnnotationExample.m */, 3E18060F1EAA800A004DB131 /* UserLocationAnnotationExample.m */, 64BBDAFC1DF24DEB00BB705D /* WebAPIDataExample.m */, + 2F00FCD021750D5A0028FC69 /* SymbolLayerZOrderExample.m */, ); name = "Markers and callouts"; sourceTree = ""; @@ -864,6 +871,7 @@ 968247011C5BDCBB00494AB8 /* StudioClassicStyleExample.h */, 9691AAA11C5AAD8F006A58C6 /* StudioStyleExample.h */, 05536CB3200F9B4900657097 /* SwitchStylesExample.h */, + 2F00FCCF21750D5A0028FC69 /* SymbolLayerZOrderExample.h */, 64CF970E1DF224D400C3C27B /* ThirdPartyVectorStyleExample.h */, 3E18060E1EAA800A004DB131 /* UserLocationAnnotationExample.h */, 969E7FDB1D25C31700663F84 /* UserTrackingModesExample.h */, @@ -1061,7 +1069,7 @@ }; 9619628B1C581700002D3DAB = { CreatedOnToolsVersion = 7.3; - DevelopmentTeam = GJZR2MEM28; + DevelopmentTeam = GM7DBR7Y3J; LastSwiftMigration = 0900; ProvisioningStyle = Automatic; }; @@ -1239,7 +1247,7 @@ files = ( ); inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-DocsCode/Pods-DocsCode-frameworks.sh", + "${SRCROOT}/Pods/Target Support Files/Pods-DocsCode/Pods-DocsCode-frameworks.sh", "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework", "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework.dSYM", "${BUILT_PRODUCTS_DIR}/MapboxCoreNavigation/MapboxCoreNavigation.framework", @@ -1266,7 +1274,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DocsCode/Pods-DocsCode-frameworks.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-DocsCode/Pods-DocsCode-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; B8CEDEEE83C3362F5C012330 /* [CP] Embed Pods Frameworks */ = { @@ -1275,7 +1283,7 @@ files = ( ); inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Examples/Pods-Examples-frameworks.sh", + "${SRCROOT}/Pods/Target Support Files/Pods-Examples/Pods-Examples-frameworks.sh", "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework", "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework.dSYM", ); @@ -1286,7 +1294,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Examples/Pods-Examples-frameworks.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Examples/Pods-Examples-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; D8896F91CDF96A2DF29EF047 /* [CP] Check Pods Manifest.lock */ = { @@ -1390,6 +1398,7 @@ 3EBCD7221DC28240001E342F /* LineAnnotationGeoJSONExample.swift in Sources */, 3E085B831EC526E500163C99 /* BuildingsExample.m in Sources */, 3E9EF27C209CFD460053D1D7 /* HeatmapExample.swift in Sources */, + 2F00FCD3217511760028FC69 /* SymbolLayerZOrderExample.swift in Sources */, 64BBDAF61DF232FD00BB705D /* SelectFeatureExample.swift in Sources */, CA3B162E2098CA7E005C087B /* TestingSupport.m in Sources */, 64BBDAF81DF2330B00BB705D /* SelectFeatureExample.m in Sources */, @@ -1436,6 +1445,7 @@ 05FA53A61FE2FA34001F3D7D /* OfflinePackExample.m in Sources */, 3E22EF521F8821F800605203 /* ImageSourceExample.m in Sources */, 05FA53A71FE2FA34001F3D7D /* StaticSnapshotExample.m in Sources */, + 2F00FCD121750D5A0028FC69 /* SymbolLayerZOrderExample.m in Sources */, 3EBCD71C1DC28240001E342F /* CustomCalloutViewExample.swift in Sources */, 05FA53AD1FE2FBB3001F3D7D /* DefaultCalloutExample.m in Sources */, CA39B2C1209B881300D37037 /* AnnotationViewExample+UITesting.m in Sources */, @@ -1724,16 +1734,18 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 0; - DEVELOPMENT_TEAM = GJZR2MEM28; + DEVELOPMENT_TEAM = GM7DBR7Y3J; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", ); INFOPLIST_FILE = Examples/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.examples; + PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.examples6; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Examples/Examples-Bridging-Header.h"; SWIFT_VERSION = 4.0; }; @@ -1747,16 +1759,18 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 0; - DEVELOPMENT_TEAM = GJZR2MEM28; + DEVELOPMENT_TEAM = GM7DBR7Y3J; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", ); INFOPLIST_FILE = Examples/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.examples; + PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.examples6; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Examples/Examples-Bridging-Header.h"; SWIFT_VERSION = 4.0; }; diff --git a/Examples/Examples.h b/Examples/Examples.h index 30d1c433..19c045ae 100644 --- a/Examples/Examples.h +++ b/Examples/Examples.h @@ -57,6 +57,7 @@ extern NSString *const MBXExampleStaticSnapshot; extern NSString *const MBXExampleStudioClassicStyle; extern NSString *const MBXExampleStudioStyle; extern NSString *const MBXExampleSwitchStyles; +extern NSString *const MBXExampleSymbolLayerZOrder; extern NSString *const MBXExampleThirdPartyVectorStyle; extern NSString *const MBXExampleUserLocationAnnotation; extern NSString *const MBXExampleUserTrackingModes; diff --git a/Examples/Examples.m b/Examples/Examples.m index 90873494..d2978f41 100644 --- a/Examples/Examples.m +++ b/Examples/Examples.m @@ -53,6 +53,7 @@ + (NSArray *)groups { @{@"className": MBXExamplePolygonAnnotation, @"title": @"Add a polygon annotation"}, @{@"className": MBXExampleLineStyleLayer, @"title": @"Add a line style layer from GeoJSON"}, @{@"className": MBXExampleAnimatedLine, @"title": @"Animate a line"}, + @{@"className": MBXExampleSymbolLayerZOrder, @"title": @"Specify z order of features in symbol layer"} ] }, @{ diff --git a/Examples/Files/clustering.xcassets/marker.imageset/Contents.json b/Examples/Files/clustering.xcassets/marker.imageset/Contents.json index 37439e12..5fc72b0a 100644 --- a/Examples/Files/clustering.xcassets/marker.imageset/Contents.json +++ b/Examples/Files/clustering.xcassets/marker.imageset/Contents.json @@ -4,6 +4,14 @@ "idiom" : "universal", "filename" : "marker.pdf", "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], "info" : { diff --git a/Examples/Files/clustering.xcassets/squircle.imageset/Contents.json b/Examples/Files/clustering.xcassets/squircle.imageset/Contents.json index 2fb896be..7eddcb22 100644 --- a/Examples/Files/clustering.xcassets/squircle.imageset/Contents.json +++ b/Examples/Files/clustering.xcassets/squircle.imageset/Contents.json @@ -4,6 +4,14 @@ "idiom" : "universal", "filename" : "squircle.pdf", "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], "info" : { diff --git a/Examples/Files/clustering.xcassets/star.imageset/Contents.json b/Examples/Files/clustering.xcassets/star.imageset/Contents.json index 19c4c1cf..7b2919e9 100644 --- a/Examples/Files/clustering.xcassets/star.imageset/Contents.json +++ b/Examples/Files/clustering.xcassets/star.imageset/Contents.json @@ -4,6 +4,14 @@ "idiom" : "universal", "filename" : "star.pdf", "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], "info" : { diff --git a/Examples/ObjectiveC/Headers/SymbolLayerZOrderExample.h b/Examples/ObjectiveC/Headers/SymbolLayerZOrderExample.h new file mode 100644 index 00000000..fe3576f7 --- /dev/null +++ b/Examples/ObjectiveC/Headers/SymbolLayerZOrderExample.h @@ -0,0 +1,18 @@ +// +// SymbolLayerZOrderExample.h +// Examples +// +// Created by Sam Fader on 10/15/18. +// Copyright © 2018 Mapbox. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface SymbolLayerZOrderExample : UIViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/Examples/ObjectiveC/SymbolLayerZOrderExample.m b/Examples/ObjectiveC/SymbolLayerZOrderExample.m new file mode 100644 index 00000000..8fdd3e79 --- /dev/null +++ b/Examples/ObjectiveC/SymbolLayerZOrderExample.m @@ -0,0 +1,71 @@ +// +// SymbolLayerZOrderExample.m +// Examples +// +// Created by Sam Fader on 10/15/18. +// Copyright © 2018 Mapbox. All rights reserved. +// + +#import "SymbolLayerZOrderExample.h" +@import Mapbox; + +NSString *const MBXExampleSymbolLayerZOrder = @"SymbolLayerZOrderExample"; + +@interface SymbolLayerZOrderExample () + +@property (nonatomic) MGLMapView *mapView; + +@end + +@implementation SymbolLayerZOrderExample + +- (void)viewDidLoad { + [super viewDidLoad]; + + // Create a new map view using the Mapbox Light style. + self.mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds + styleURL:[MGLStyle lightStyleURL]]; + + self.mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + self.mapView.tintColor = [UIColor darkGrayColor]; + + // Set the map’s center coordinate and zoom level. + self.mapView.centerCoordinate = CLLocationCoordinate2DMake(38.897,-77.039); + self.mapView.zoomLevel = 10.5; + + self.mapView.delegate = self; + [self.view addSubview: self.mapView]; +} + +// Wait until the style is loaded before modifying the map style. +- (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style { + + // "mapbox://examples.2uf7qges" is a map ID referencing a tileset. For more + // more information, see mapbox.com/help/define-map-id/ + MGLSource *source = [[MGLVectorTileSource alloc] initWithIdentifier:@"trees" configurationURL:[NSURL URLWithString:@"mapbox://examples.2uf7qges"]]; + + [self.mapView.style addSource:source]; + + MGLCircleStyleLayer *layer = [[MGLCircleStyleLayer alloc] initWithIdentifier: @"tree-style" source:source]; + + // The source name from the source's TileJSON metadata: mapbox.com/api-documentation/#retrieve-tilejson-metadata + layer.sourceLayerIdentifier = @"yoshino-trees-a0puw5"; + + // Stops based on age of tree in years. + NSDictionary *stops = @{ + @0: [UIColor colorWithRed:1.00 green:0.72 blue:0.85 alpha:1.0], + @2: [UIColor colorWithRed:0.69 green:0.48 blue:0.73 alpha:1.0], + @4: [UIColor colorWithRed:0.61 green:0.31 blue:0.47 alpha:1.0], + @7: [UIColor colorWithRed:0.43 green:0.20 blue:0.38 alpha:1.0], + @16: [UIColor colorWithRed:0.33 green:0.17 blue:0.25 alpha:1.0] + }; + + // Style the circle layer color based on the above stops dictionary. + layer.circleColor = [NSExpression expressionWithFormat:@"mgl_step:from:stops:(AGE, %@, %@)", [UIColor colorWithRed:1.0 green:0.72 blue:0.85 alpha:1.0], stops]; + + layer.circleRadius = [NSExpression expressionForConstantValue:@3]; + + [self.mapView.style addLayer:layer]; +} + +@end diff --git a/Examples/Swift/SymbolLayerZOrderExample.swift b/Examples/Swift/SymbolLayerZOrderExample.swift new file mode 100644 index 00000000..0be348ab --- /dev/null +++ b/Examples/Swift/SymbolLayerZOrderExample.swift @@ -0,0 +1,65 @@ +// +// SymbolLayerZOrderExample.swift +// Examples +// +// Created by Sam Fader on 10/15/18. +// Copyright © 2018 Mapbox. All rights reserved. +// + +import Foundation +import Mapbox + +@objc(SymbolLayerZOrderExample_Swift) + +class SymbolLayerZOrderExample_Swift: UIViewController, MGLMapViewDelegate { + +var mapView: MGLMapView! + +override func viewDidLoad() { + super.viewDidLoad() + // Create a new map view using the Mapbox Light style. + mapView = MGLMapView(frame: view.bounds) + mapView.styleURL = MGLStyle.lightStyleURL + mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight] + mapView.tintColor = .darkGray + // Set the map’s center coordinate and zoom level. + mapView.setCenter(CLLocationCoordinate2D(latitude: -41.292650, longitude: 174.778768), animated: false) + mapView.zoomLevel = 11.5 + mapView.delegate = self + view.addSubview(mapView) +} + +// Wait until the style is loaded before modifying the map style. +func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) { + // Add icons to the map's style. + style.setImage(UIImage(named: "oval")!, forName: "oval") + style.setImage(UIImage(named: "squircle")!, forName: "squircle") + style.setImage(UIImage(named: "star")!, forName: "star") + + let feature1 = MGLPointFeature() + feature1.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768) + feature1.attributes = ["id": "squircle"] + let feature2 = MGLPointFeature() + feature2.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768) + feature2.attributes = ["id": "oval"] + let feature3 = MGLPointFeature() + feature3.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768) + feature3.attributes = ["id": "star"] + + let shapeCollection = MGLShapeCollectionFeature(shapes: [feature1, feature2, feature3]) + let source = MGLShapeSource(identifier: "symbol-layer-z-order-example", shape: shapeCollection, options: nil) + style.addSource(source) + let layer = MGLSymbolStyleLayer(identifier: "points-style", source: source) + layer.sourceLayerIdentifier = "symbol-layer-z-order-example" + + // Create a stops dictionary with keys that are possible values for 'id', paired with icon images that will represent those features. + let icons = ["squircle": "squircle", "oval": "oval", "star": "star"] + // Use the stops dictionary to assign an icon based on the "POITYPE" for each feature. + layer.iconImageName = NSExpression(format: "FUNCTION(%@, 'valueForKeyPath:', id)", icons) + + layer.iconAllowsOverlap = NSExpression(forConstantValue: true) + layer.iconIgnoresPlacement = NSExpression(forConstantValue: true) + layer.symbolZOrder = NSExpression(forConstantValue: "source") + style.addLayer(layer) + } +} From 6d89cb1d3dad2684661d32344c437a5c26def3f0 Mon Sep 17 00:00:00 2001 From: Sam Fader Date: Thu, 25 Oct 2018 15:01:15 -0700 Subject: [PATCH 02/10] add toggle to switch between z order type --- Examples/Swift/SymbolLayerZOrderExample.swift | 39 ++++++++++++++++++- Podfile.lock | 2 +- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/Examples/Swift/SymbolLayerZOrderExample.swift b/Examples/Swift/SymbolLayerZOrderExample.swift index 0be348ab..5547e766 100644 --- a/Examples/Swift/SymbolLayerZOrderExample.swift +++ b/Examples/Swift/SymbolLayerZOrderExample.swift @@ -14,6 +14,7 @@ import Mapbox class SymbolLayerZOrderExample_Swift: UIViewController, MGLMapViewDelegate { var mapView: MGLMapView! +var symbolLayer: MGLSymbolStyleLayer? override func viewDidLoad() { super.viewDidLoad() @@ -58,8 +59,44 @@ func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) { layer.iconImageName = NSExpression(format: "FUNCTION(%@, 'valueForKeyPath:', id)", icons) layer.iconAllowsOverlap = NSExpression(forConstantValue: true) - layer.iconIgnoresPlacement = NSExpression(forConstantValue: true) layer.symbolZOrder = NSExpression(forConstantValue: "source") style.addLayer(layer) + + self.symbolLayer = layer + + // Create a UISegmentedControl to toggle between map styles + let styleToggle = UISegmentedControl(items: ["viewport-y", "source"]) + styleToggle.translatesAutoresizingMaskIntoConstraints = false + styleToggle.tintColor = UIColor(red: 0.976, green: 0.843, blue: 0.831, alpha: 1) + styleToggle.backgroundColor = UIColor(red: 0.973, green: 0.329, blue: 0.294, alpha: 1) + styleToggle.layer.cornerRadius = 4 + styleToggle.clipsToBounds = true + styleToggle.selectedSegmentIndex = 1 + view.insertSubview(styleToggle, aboveSubview: mapView) + styleToggle.addTarget(self, action: #selector(toggleLayer(sender:)), for: .valueChanged) + + // Configure autolayout constraints for the UISegmentedControl to align + // at the bottom of the map view and above the Mapbox logo and attribution + NSLayoutConstraint.activate([NSLayoutConstraint(item: styleToggle, attribute: NSLayoutAttribute.centerX, relatedBy: NSLayoutRelation.equal, toItem: mapView, attribute: NSLayoutAttribute.centerX, multiplier: 1.0, constant: 0.0)]) + NSLayoutConstraint.activate([NSLayoutConstraint(item: styleToggle, attribute: .bottom, relatedBy: .equal, toItem: mapView.logoView, attribute: .top, multiplier: 1, constant: -20)]) + } + // Change the map style based on the selected index of the UISegmentedControl + @objc func toggleLayer(sender: UISegmentedControl) { + switch sender.selectedSegmentIndex { + case 0: + useSource() + case 1: + useViewportY() + default: + useSource() + } + } + + func useSource() { + self.symbolLayer?.symbolZOrder = NSExpression(forConstantValue: "source") + } + + func useViewportY() { + self.symbolLayer?.symbolZOrder = NSExpression(forConstantValue: "viewport-y") } } diff --git a/Podfile.lock b/Podfile.lock index ac182d18..26ca7205 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -50,4 +50,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: d7f13c38c14f3595d1289272a6b68d0d6486d1f8 -COCOAPODS: 1.6.0.beta.1 +COCOAPODS: 1.5.3 From 33c2d876184b83033e0e12d60f463c5b4018561c Mon Sep 17 00:00:00 2001 From: Sam Fader Date: Fri, 16 Nov 2018 11:18:16 -0800 Subject: [PATCH 03/10] update draft of ObjC example --- .../ObjectiveC/SymbolLayerZOrderExample.m | 149 +++++++++++++++--- 1 file changed, 124 insertions(+), 25 deletions(-) diff --git a/Examples/ObjectiveC/SymbolLayerZOrderExample.m b/Examples/ObjectiveC/SymbolLayerZOrderExample.m index 8fdd3e79..9213e007 100644 --- a/Examples/ObjectiveC/SymbolLayerZOrderExample.m +++ b/Examples/ObjectiveC/SymbolLayerZOrderExample.m @@ -30,8 +30,8 @@ - (void)viewDidLoad { self.mapView.tintColor = [UIColor darkGrayColor]; // Set the map’s center coordinate and zoom level. - self.mapView.centerCoordinate = CLLocationCoordinate2DMake(38.897,-77.039); - self.mapView.zoomLevel = 10.5; + self.mapView.centerCoordinate = CLLocationCoordinate2DMake(-41.292650,174.778768); + self.mapView.zoomLevel = 11.5; self.mapView.delegate = self; [self.view addSubview: self.mapView]; @@ -40,32 +40,131 @@ - (void)viewDidLoad { // Wait until the style is loaded before modifying the map style. - (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style { - // "mapbox://examples.2uf7qges" is a map ID referencing a tileset. For more - // more information, see mapbox.com/help/define-map-id/ - MGLSource *source = [[MGLVectorTileSource alloc] initWithIdentifier:@"trees" configurationURL:[NSURL URLWithString:@"mapbox://examples.2uf7qges"]]; - - [self.mapView.style addSource:source]; - - MGLCircleStyleLayer *layer = [[MGLCircleStyleLayer alloc] initWithIdentifier: @"tree-style" source:source]; - - // The source name from the source's TileJSON metadata: mapbox.com/api-documentation/#retrieve-tilejson-metadata - layer.sourceLayerIdentifier = @"yoshino-trees-a0puw5"; - - // Stops based on age of tree in years. - NSDictionary *stops = @{ - @0: [UIColor colorWithRed:1.00 green:0.72 blue:0.85 alpha:1.0], - @2: [UIColor colorWithRed:0.69 green:0.48 blue:0.73 alpha:1.0], - @4: [UIColor colorWithRed:0.61 green:0.31 blue:0.47 alpha:1.0], - @7: [UIColor colorWithRed:0.43 green:0.20 blue:0.38 alpha:1.0], - @16: [UIColor colorWithRed:0.33 green:0.17 blue:0.25 alpha:1.0] - }; + // Add icons to the map's style. + [style setImage:([UIImage imageNamed:@"oval"]) forName:@"oval"]; + [style setImage:([UIImage imageNamed:@"squircle"]) forName:@"squircle"]; + [style setImage:([UIImage imageNamed:@"star"]) forName:@"star"]; +// style.setImage(UIImage(named: "oval")!, forName: "oval") +// style.setImage(UIImage(named: "squircle")!, forName: "squircle") +// style.setImage(UIImage(named: "star")!, forName: "star") +// + MGLPointFeature *feature1 = [MGLPointFeature alloc]; + feature1.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768); + feature1.attributes = @{@"id": @"squircle"}; +// let feature1 = MGLPointFeature() +// feature1.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768) +// feature1.attributes = ["id": "squircle"] + MGLPointFeature *feature2 = [MGLPointFeature alloc]; + feature2.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768); + feature2.attributes = @{@"id": @"oval"}; +// let feature2 = MGLPointFeature() +// feature2.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768) +// feature2.attributes = ["id": "oval"] + MGLPointFeature *feature3 = [MGLPointFeature alloc]; + feature3.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768); + feature3.attributes = @{@"id": @"star"}; +// let feature3 = MGLPointFeature() +// feature3.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768) +// feature3.attributes = ["id": "star"] +// + MGLShapeCollectionFeature *shapeCollection = [MGLShapeCollectionFeature shapeCollectionWithShapes:@[feature1, feature2, feature3]]; + // let shapeCollection = MGLShapeCollectionFeature(shapes: [feature1, feature2, feature3]) + MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"symbol-layer-z-order-example" shape:shapeCollection options:nil]; +// let source = MGLShapeSource(identifier: "symbol-layer-z-order-example", shape: shapeCollection, options: nil) + [style addSource:source]; +// style.addSource(source) + MGLSymbolStyleLayer *layer = [[MGLSymbolStyleLayer alloc] initWithIdentifier:@"points-style" source:source]; +// let layer = MGLSymbolStyleLayer(identifier: "points-style", source: source) + layer.sourceLayerIdentifier = @"symbol-layer-z-order-example"; +// layer.sourceLayerIdentifier = "symbol-layer-z-order-example" +// +// // Create a stops dictionary with keys that are possible values for 'id', paired with icon images that will represent those features. + NSDictionary *icons = @{@"squircle": @"squircle", @"oval": @"oval", @"star": @"star"}; +// let icons = ["squircle": "squircle", "oval": "oval", "star": "star"] +// // Use the stops dictionary to assign an icon based on the "POITYPE" for each feature. + layer.iconImageName = [NSExpression expressionWithFormat:@"FUNCTION(%@, 'valueForKeyPath:', id)", icons]; + // layer.iconImageName = NSExpression(format: "FUNCTION(%@, 'valueForKeyPath:', id)", icons) + + layer.iconAllowsOverlap = [NSExpression expressionForConstantValue:@(YES)]; +// layer.iconAllowsOverlap = NSExpression(forConstantValue: true) + layer.symbolZOrder = [NSExpression expressionForConstantValue:@"source"]; +// layer.symbolZOrder = NSExpression(forConstantValue: "source") + [style addLayer:layer]; +// style.addLayer(layer) +// +// self.symbolLayer = layer + + UISegmentedControl *styleToggle =[[UISegmentedControl alloc] initWithItems:@[@"viewport-y", @"source"]]; + styleToggle.translatesAutoresizingMaskIntoConstraints = NO; + styleToggle.tintColor = [UIColor colorWithRed:0.976 green:0.843 blue:0.831 alpha:1]; + styleToggle.backgroundColor = [UIColor colorWithRed:0.973 green:0.329 blue:0.294 alpha:1]; + styleToggle.layer.cornerRadius = 4; + styleToggle.clipsToBounds = YES; + styleToggle.selectedSegmentIndex = 1; + [self.view insertSubview:styleToggle aboveSubview:self.mapView]; + [styleToggle addTarget:self action:@selector(changeStyle:) forControlEvents:UIControlEventValueChanged]; +// // Create a UISegmentedControl to toggle between map styles +// let styleToggle = UISegmentedControl(items: ["viewport-y", "source"]) +// styleToggle.translatesAutoresizingMaskIntoConstraints = false +// styleToggle.tintColor = UIColor(red: 0.976, green: 0.843, blue: 0.831, alpha: 1) +// styleToggle.backgroundColor = UIColor(red: 0.973, green: 0.329, blue: 0.294, alpha: 1) +// styleToggle.layer.cornerRadius = 4 +// styleToggle.clipsToBounds = true +// styleToggle.selectedSegmentIndex = 1 +// view.insertSubview(styleToggle, aboveSubview: mapView) +// styleToggle.addTarget(self, action: #selector(toggleLayer(sender:)), for: .valueChanged) +// - // Style the circle layer color based on the above stops dictionary. - layer.circleColor = [NSExpression expressionWithFormat:@"mgl_step:from:stops:(AGE, %@, %@)", [UIColor colorWithRed:1.0 green:0.72 blue:0.85 alpha:1.0], stops]; + // Configure autolayout constraints for the UISegmentedControl to align + // at the bottom of the map view and above the Mapbox logo and attribution + NSMutableArray *constraints = [NSMutableArray array]; - layer.circleRadius = [NSExpression expressionForConstantValue:@3]; + [constraints addObject:[NSLayoutConstraint constraintWithItem:styleToggle attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.mapView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:1.0]]; + [constraints addObject:[NSLayoutConstraint constraintWithItem:styleToggle attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.mapView.logoView attribute:NSLayoutAttributeTop multiplier:1 constant:-20]]; - [self.mapView.style addLayer:layer]; + [self.view addConstraints:constraints]; +// // Configure autolayout constraints for the UISegmentedControl to align +// // at the bottom of the map view and above the Mapbox logo and attribution +// NSLayoutConstraint.activate([NSLayoutConstraint(item: styleToggle, attribute: NSLayoutAttribute.centerX, relatedBy: NSLayoutRelation.equal, toItem: mapView, attribute: NSLayoutAttribute.centerX, multiplier: 1.0, constant: 0.0)]) +// NSLayoutConstraint.activate([NSLayoutConstraint(item: styleToggle, attribute: .bottom, relatedBy: .equal, toItem: mapView.logoView, attribute: .top, multiplier: 1, constant: -20)]) +} + +// Change the map style based on the selected index of the UISegmentedControl +- (void)changeStyle:(UISegmentedControl *)sender { + switch(sender.selectedSegmentIndex){ + case 0: + self.mapView.styleURL = [MGLStyle satelliteStyleURL]; + break; + case 1: + self.mapView.styleURL = [MGLStyle streetsStyleURL]; + break; + case 2: + self.mapView.styleURL = [MGLStyle lightStyleURL]; + break; + } +} +// Change the map style based on the selected index of the UISegmentedControl +//@objc func toggleLayer(sender: UISegmentedControl) { +// switch sender.selectedSegmentIndex { +// case 0: +// useSource() +// case 1: +// useViewportY() +// default: +// useSource() +// } +//} +// +- (void)useSource:(UISegmentedControl *)sender { +} +//func useSource() { +// self.symbolLayer?.symbolZOrder = NSExpression(forConstantValue: "source") +//} +// +- (void)useViewportY:(UISegmentedControl *)sender { } +//func useViewportY() { +// self.symbolLayer?.symbolZOrder = NSExpression(forConstantValue: "viewport-y") +//} @end From 51765c31ccba58e4233b2b51efd45038af25b90d Mon Sep 17 00:00:00 2001 From: Sam Fader Date: Mon, 19 Nov 2018 14:10:14 -0500 Subject: [PATCH 04/10] finished examples --- .../ObjectiveC/SymbolLayerZOrderExample.m | 100 ++++-------------- Examples/Swift/SymbolLayerZOrderExample.swift | 20 ++-- 2 files changed, 24 insertions(+), 96 deletions(-) diff --git a/Examples/ObjectiveC/SymbolLayerZOrderExample.m b/Examples/ObjectiveC/SymbolLayerZOrderExample.m index 9213e007..73787e1c 100644 --- a/Examples/ObjectiveC/SymbolLayerZOrderExample.m +++ b/Examples/ObjectiveC/SymbolLayerZOrderExample.m @@ -14,6 +14,7 @@ @interface SymbolLayerZOrderExample () @property (nonatomic) MGLMapView *mapView; +@property (nonatomic) MGLSymbolStyleLayer *layer; @end @@ -44,76 +45,42 @@ - (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style { [style setImage:([UIImage imageNamed:@"oval"]) forName:@"oval"]; [style setImage:([UIImage imageNamed:@"squircle"]) forName:@"squircle"]; [style setImage:([UIImage imageNamed:@"star"]) forName:@"star"]; -// style.setImage(UIImage(named: "oval")!, forName: "oval") -// style.setImage(UIImage(named: "squircle")!, forName: "squircle") -// style.setImage(UIImage(named: "star")!, forName: "star") -// + MGLPointFeature *feature1 = [MGLPointFeature alloc]; feature1.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768); feature1.attributes = @{@"id": @"squircle"}; -// let feature1 = MGLPointFeature() -// feature1.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768) -// feature1.attributes = ["id": "squircle"] + MGLPointFeature *feature2 = [MGLPointFeature alloc]; feature2.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768); feature2.attributes = @{@"id": @"oval"}; -// let feature2 = MGLPointFeature() -// feature2.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768) -// feature2.attributes = ["id": "oval"] + MGLPointFeature *feature3 = [MGLPointFeature alloc]; feature3.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768); feature3.attributes = @{@"id": @"star"}; -// let feature3 = MGLPointFeature() -// feature3.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768) -// feature3.attributes = ["id": "star"] -// + MGLShapeCollectionFeature *shapeCollection = [MGLShapeCollectionFeature shapeCollectionWithShapes:@[feature1, feature2, feature3]]; - // let shapeCollection = MGLShapeCollectionFeature(shapes: [feature1, feature2, feature3]) MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"symbol-layer-z-order-example" shape:shapeCollection options:nil]; -// let source = MGLShapeSource(identifier: "symbol-layer-z-order-example", shape: shapeCollection, options: nil) + [style addSource:source]; -// style.addSource(source) - MGLSymbolStyleLayer *layer = [[MGLSymbolStyleLayer alloc] initWithIdentifier:@"points-style" source:source]; -// let layer = MGLSymbolStyleLayer(identifier: "points-style", source: source) - layer.sourceLayerIdentifier = @"symbol-layer-z-order-example"; -// layer.sourceLayerIdentifier = "symbol-layer-z-order-example" -// -// // Create a stops dictionary with keys that are possible values for 'id', paired with icon images that will represent those features. + self.layer = [[MGLSymbolStyleLayer alloc] initWithIdentifier:@"points-style" source:source]; + self.layer.sourceLayerIdentifier = @"symbol-layer-z-order-example"; + // Create a stops dictionary with keys that are possible values for 'id', paired with icon images that will represent those features. NSDictionary *icons = @{@"squircle": @"squircle", @"oval": @"oval", @"star": @"star"}; -// let icons = ["squircle": "squircle", "oval": "oval", "star": "star"] -// // Use the stops dictionary to assign an icon based on the "POITYPE" for each feature. - layer.iconImageName = [NSExpression expressionWithFormat:@"FUNCTION(%@, 'valueForKeyPath:', id)", icons]; - // layer.iconImageName = NSExpression(format: "FUNCTION(%@, 'valueForKeyPath:', id)", icons) - - layer.iconAllowsOverlap = [NSExpression expressionForConstantValue:@(YES)]; -// layer.iconAllowsOverlap = NSExpression(forConstantValue: true) - layer.symbolZOrder = [NSExpression expressionForConstantValue:@"source"]; -// layer.symbolZOrder = NSExpression(forConstantValue: "source") - [style addLayer:layer]; -// style.addLayer(layer) -// -// self.symbolLayer = layer + // Use the stops dictionary to assign an icon based on the "POITYPE" for each feature. + self.layer.iconImageName = [NSExpression expressionWithFormat:@"FUNCTION(%@, 'valueForKeyPath:', id)", icons]; + self.layer.iconAllowsOverlap = [NSExpression expressionForConstantValue:@(YES)]; + self.layer.symbolZOrder = [NSExpression expressionForConstantValue:@"source"]; + [style addLayer:self.layer]; UISegmentedControl *styleToggle =[[UISegmentedControl alloc] initWithItems:@[@"viewport-y", @"source"]]; styleToggle.translatesAutoresizingMaskIntoConstraints = NO; - styleToggle.tintColor = [UIColor colorWithRed:0.976 green:0.843 blue:0.831 alpha:1]; - styleToggle.backgroundColor = [UIColor colorWithRed:0.973 green:0.329 blue:0.294 alpha:1]; + styleToggle.backgroundColor = [UIColor colorWithRed:0.83 green:0.84 blue:0.95 alpha:1.0]; + styleToggle.tintColor = [UIColor colorWithRed:0.26 green:0.39 blue:0.98 alpha:1.0]; styleToggle.layer.cornerRadius = 4; styleToggle.clipsToBounds = YES; styleToggle.selectedSegmentIndex = 1; [self.view insertSubview:styleToggle aboveSubview:self.mapView]; [styleToggle addTarget:self action:@selector(changeStyle:) forControlEvents:UIControlEventValueChanged]; -// // Create a UISegmentedControl to toggle between map styles -// let styleToggle = UISegmentedControl(items: ["viewport-y", "source"]) -// styleToggle.translatesAutoresizingMaskIntoConstraints = false -// styleToggle.tintColor = UIColor(red: 0.976, green: 0.843, blue: 0.831, alpha: 1) -// styleToggle.backgroundColor = UIColor(red: 0.973, green: 0.329, blue: 0.294, alpha: 1) -// styleToggle.layer.cornerRadius = 4 -// styleToggle.clipsToBounds = true -// styleToggle.selectedSegmentIndex = 1 -// view.insertSubview(styleToggle, aboveSubview: mapView) -// styleToggle.addTarget(self, action: #selector(toggleLayer(sender:)), for: .valueChanged) -// // Configure autolayout constraints for the UISegmentedControl to align // at the bottom of the map view and above the Mapbox logo and attribution @@ -123,48 +90,17 @@ - (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style { [constraints addObject:[NSLayoutConstraint constraintWithItem:styleToggle attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.mapView.logoView attribute:NSLayoutAttributeTop multiplier:1 constant:-20]]; [self.view addConstraints:constraints]; -// // Configure autolayout constraints for the UISegmentedControl to align -// // at the bottom of the map view and above the Mapbox logo and attribution -// NSLayoutConstraint.activate([NSLayoutConstraint(item: styleToggle, attribute: NSLayoutAttribute.centerX, relatedBy: NSLayoutRelation.equal, toItem: mapView, attribute: NSLayoutAttribute.centerX, multiplier: 1.0, constant: 0.0)]) -// NSLayoutConstraint.activate([NSLayoutConstraint(item: styleToggle, attribute: .bottom, relatedBy: .equal, toItem: mapView.logoView, attribute: .top, multiplier: 1, constant: -20)]) } // Change the map style based on the selected index of the UISegmentedControl - (void)changeStyle:(UISegmentedControl *)sender { switch(sender.selectedSegmentIndex){ case 0: - self.mapView.styleURL = [MGLStyle satelliteStyleURL]; + self.layer.symbolZOrder = [NSExpression expressionForConstantValue:@"viewport-y"]; break; case 1: - self.mapView.styleURL = [MGLStyle streetsStyleURL]; - break; - case 2: - self.mapView.styleURL = [MGLStyle lightStyleURL]; + self.layer.symbolZOrder = [NSExpression expressionForConstantValue:@"source"];; break; } } -// Change the map style based on the selected index of the UISegmentedControl -//@objc func toggleLayer(sender: UISegmentedControl) { -// switch sender.selectedSegmentIndex { -// case 0: -// useSource() -// case 1: -// useViewportY() -// default: -// useSource() -// } -//} -// -- (void)useSource:(UISegmentedControl *)sender { -} -//func useSource() { -// self.symbolLayer?.symbolZOrder = NSExpression(forConstantValue: "source") -//} -// -- (void)useViewportY:(UISegmentedControl *)sender { -} -//func useViewportY() { -// self.symbolLayer?.symbolZOrder = NSExpression(forConstantValue: "viewport-y") -//} - @end diff --git a/Examples/Swift/SymbolLayerZOrderExample.swift b/Examples/Swift/SymbolLayerZOrderExample.swift index 5547e766..5000bc99 100644 --- a/Examples/Swift/SymbolLayerZOrderExample.swift +++ b/Examples/Swift/SymbolLayerZOrderExample.swift @@ -35,7 +35,7 @@ func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) { // Add icons to the map's style. style.setImage(UIImage(named: "oval")!, forName: "oval") style.setImage(UIImage(named: "squircle")!, forName: "squircle") - style.setImage(UIImage(named: "star")!, forName: "star") + style.setImage(UIImage(named: "star")!, forName: "star" let feature1 = MGLPointFeature() feature1.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768) @@ -67,8 +67,8 @@ func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) { // Create a UISegmentedControl to toggle between map styles let styleToggle = UISegmentedControl(items: ["viewport-y", "source"]) styleToggle.translatesAutoresizingMaskIntoConstraints = false - styleToggle.tintColor = UIColor(red: 0.976, green: 0.843, blue: 0.831, alpha: 1) - styleToggle.backgroundColor = UIColor(red: 0.973, green: 0.329, blue: 0.294, alpha: 1) + styleToggle.backgroundColor = UIColor(red: 0.83, green: 0.84, blue: 0.95, alpha: 1.0) + styleToggle.tintColor = UIColor(red: 0.26, green: 0.39, blue: 0.98, alpha: 1.0) styleToggle.layer.cornerRadius = 4 styleToggle.clipsToBounds = true styleToggle.selectedSegmentIndex = 1 @@ -84,19 +84,11 @@ func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) { @objc func toggleLayer(sender: UISegmentedControl) { switch sender.selectedSegmentIndex { case 0: - useSource() + self.symbolLayer?.symbolZOrder = NSExpression(forConstantValue: "viewport-y") case 1: - useViewportY() + self.symbolLayer?.symbolZOrder = NSExpression(forConstantValue: "source") default: - useSource() + self.symbolLayer?.symbolZOrder = NSExpression(forConstantValue: "source") } } - - func useSource() { - self.symbolLayer?.symbolZOrder = NSExpression(forConstantValue: "source") - } - - func useViewportY() { - self.symbolLayer?.symbolZOrder = NSExpression(forConstantValue: "viewport-y") - } } From eff2d812e190ee0c8493f5b60db47866d2b9e070 Mon Sep 17 00:00:00 2001 From: Nadia Barbosa Date: Mon, 19 Nov 2018 16:27:45 -0800 Subject: [PATCH 05/10] Fix PBX file / add missing brace / silence SwiftLint Fix product bundle identifier Fix SwiftLint line spacing warnings --- Examples.xcodeproj/project.pbxproj | 18 +++++++++--------- Examples/Swift/SymbolLayerZOrderExample.swift | 16 ++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Examples.xcodeproj/project.pbxproj b/Examples.xcodeproj/project.pbxproj index 2b6b9ad7..019fa07b 100644 --- a/Examples.xcodeproj/project.pbxproj +++ b/Examples.xcodeproj/project.pbxproj @@ -1069,7 +1069,7 @@ }; 9619628B1C581700002D3DAB = { CreatedOnToolsVersion = 7.3; - DevelopmentTeam = GM7DBR7Y3J; + DevelopmentTeam = GJZR2MEM28; LastSwiftMigration = 0900; ProvisioningStyle = Automatic; }; @@ -1247,7 +1247,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-DocsCode/Pods-DocsCode-frameworks.sh", + "${PODS_ROOT}/Target Support Files/Pods-DocsCode/Pods-DocsCode-frameworks.sh", "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework", "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework.dSYM", "${BUILT_PRODUCTS_DIR}/MapboxCoreNavigation/MapboxCoreNavigation.framework", @@ -1274,7 +1274,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-DocsCode/Pods-DocsCode-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DocsCode/Pods-DocsCode-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; B8CEDEEE83C3362F5C012330 /* [CP] Embed Pods Frameworks */ = { @@ -1283,7 +1283,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Examples/Pods-Examples-frameworks.sh", + "${PODS_ROOT}/Target Support Files/Pods-Examples/Pods-Examples-frameworks.sh", "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework", "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework.dSYM", ); @@ -1294,7 +1294,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Examples/Pods-Examples-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Examples/Pods-Examples-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; D8896F91CDF96A2DF29EF047 /* [CP] Check Pods Manifest.lock */ = { @@ -1736,14 +1736,14 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 0; - DEVELOPMENT_TEAM = GM7DBR7Y3J; + DEVELOPMENT_TEAM = GJZR2MEM28; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", ); INFOPLIST_FILE = Examples/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.examples6; + PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.examples; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Examples/Examples-Bridging-Header.h"; @@ -1761,14 +1761,14 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 0; - DEVELOPMENT_TEAM = GM7DBR7Y3J; + DEVELOPMENT_TEAM = GJZR2MEM28; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", ); INFOPLIST_FILE = Examples/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.examples6; + PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.examples; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Examples/Examples-Bridging-Header.h"; diff --git a/Examples/Swift/SymbolLayerZOrderExample.swift b/Examples/Swift/SymbolLayerZOrderExample.swift index 5000bc99..cafd7efc 100644 --- a/Examples/Swift/SymbolLayerZOrderExample.swift +++ b/Examples/Swift/SymbolLayerZOrderExample.swift @@ -35,8 +35,8 @@ func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) { // Add icons to the map's style. style.setImage(UIImage(named: "oval")!, forName: "oval") style.setImage(UIImage(named: "squircle")!, forName: "squircle") - style.setImage(UIImage(named: "star")!, forName: "star" - + style.setImage(UIImage(named: "star")!, forName: "star") + let feature1 = MGLPointFeature() feature1.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768) feature1.attributes = ["id": "squircle"] @@ -46,24 +46,24 @@ func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) { let feature3 = MGLPointFeature() feature3.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768) feature3.attributes = ["id": "star"] - + let shapeCollection = MGLShapeCollectionFeature(shapes: [feature1, feature2, feature3]) let source = MGLShapeSource(identifier: "symbol-layer-z-order-example", shape: shapeCollection, options: nil) style.addSource(source) let layer = MGLSymbolStyleLayer(identifier: "points-style", source: source) layer.sourceLayerIdentifier = "symbol-layer-z-order-example" - + // Create a stops dictionary with keys that are possible values for 'id', paired with icon images that will represent those features. let icons = ["squircle": "squircle", "oval": "oval", "star": "star"] // Use the stops dictionary to assign an icon based on the "POITYPE" for each feature. layer.iconImageName = NSExpression(format: "FUNCTION(%@, 'valueForKeyPath:', id)", icons) - + layer.iconAllowsOverlap = NSExpression(forConstantValue: true) layer.symbolZOrder = NSExpression(forConstantValue: "source") style.addLayer(layer) - + self.symbolLayer = layer - + // Create a UISegmentedControl to toggle between map styles let styleToggle = UISegmentedControl(items: ["viewport-y", "source"]) styleToggle.translatesAutoresizingMaskIntoConstraints = false @@ -74,7 +74,7 @@ func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) { styleToggle.selectedSegmentIndex = 1 view.insertSubview(styleToggle, aboveSubview: mapView) styleToggle.addTarget(self, action: #selector(toggleLayer(sender:)), for: .valueChanged) - + // Configure autolayout constraints for the UISegmentedControl to align // at the bottom of the map view and above the Mapbox logo and attribution NSLayoutConstraint.activate([NSLayoutConstraint(item: styleToggle, attribute: NSLayoutAttribute.centerX, relatedBy: NSLayoutRelation.equal, toItem: mapView, attribute: NSLayoutAttribute.centerX, multiplier: 1.0, constant: 0.0)]) From d42f683adf208823411be380e1748ca4cf1aea3f Mon Sep 17 00:00:00 2001 From: Sam Fader Date: Mon, 26 Nov 2018 15:15:25 -0800 Subject: [PATCH 06/10] remove comments --- Examples/Examples.m | 2 +- Examples/ObjectiveC/Headers/SymbolLayerZOrderExample.h | 8 -------- Examples/ObjectiveC/SymbolLayerZOrderExample.m | 8 -------- Examples/Swift/SymbolLayerZOrderExample.swift | 8 -------- 4 files changed, 1 insertion(+), 25 deletions(-) diff --git a/Examples/Examples.m b/Examples/Examples.m index d2978f41..cf882cc2 100644 --- a/Examples/Examples.m +++ b/Examples/Examples.m @@ -53,7 +53,7 @@ + (NSArray *)groups { @{@"className": MBXExamplePolygonAnnotation, @"title": @"Add a polygon annotation"}, @{@"className": MBXExampleLineStyleLayer, @"title": @"Add a line style layer from GeoJSON"}, @{@"className": MBXExampleAnimatedLine, @"title": @"Animate a line"}, - @{@"className": MBXExampleSymbolLayerZOrder, @"title": @"Specify z order of features in symbol layer"} + @{@"className": MBXExampleSymbolLayerZOrder, @"title": @"Specify z order of features in a symbol layer"} ] }, @{ diff --git a/Examples/ObjectiveC/Headers/SymbolLayerZOrderExample.h b/Examples/ObjectiveC/Headers/SymbolLayerZOrderExample.h index fe3576f7..275bf7a7 100644 --- a/Examples/ObjectiveC/Headers/SymbolLayerZOrderExample.h +++ b/Examples/ObjectiveC/Headers/SymbolLayerZOrderExample.h @@ -1,11 +1,3 @@ -// -// SymbolLayerZOrderExample.h -// Examples -// -// Created by Sam Fader on 10/15/18. -// Copyright © 2018 Mapbox. All rights reserved. -// - #import #import diff --git a/Examples/ObjectiveC/SymbolLayerZOrderExample.m b/Examples/ObjectiveC/SymbolLayerZOrderExample.m index 73787e1c..456d649b 100644 --- a/Examples/ObjectiveC/SymbolLayerZOrderExample.m +++ b/Examples/ObjectiveC/SymbolLayerZOrderExample.m @@ -1,11 +1,3 @@ -// -// SymbolLayerZOrderExample.m -// Examples -// -// Created by Sam Fader on 10/15/18. -// Copyright © 2018 Mapbox. All rights reserved. -// - #import "SymbolLayerZOrderExample.h" @import Mapbox; diff --git a/Examples/Swift/SymbolLayerZOrderExample.swift b/Examples/Swift/SymbolLayerZOrderExample.swift index 5000bc99..e02a7695 100644 --- a/Examples/Swift/SymbolLayerZOrderExample.swift +++ b/Examples/Swift/SymbolLayerZOrderExample.swift @@ -1,11 +1,3 @@ -// -// SymbolLayerZOrderExample.swift -// Examples -// -// Created by Sam Fader on 10/15/18. -// Copyright © 2018 Mapbox. All rights reserved. -// - import Foundation import Mapbox From af118bf32f7900d48728997d955d6a639499edfd Mon Sep 17 00:00:00 2001 From: Sam Fader Date: Mon, 26 Nov 2018 15:33:11 -0800 Subject: [PATCH 07/10] more fixes --- Examples/ObjectiveC/SymbolLayerZOrderExample.m | 17 +++++++++++++---- Examples/Swift/SymbolLayerZOrderExample.swift | 12 ++++++++++-- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Examples/ObjectiveC/SymbolLayerZOrderExample.m b/Examples/ObjectiveC/SymbolLayerZOrderExample.m index 456d649b..bb1fc4aa 100644 --- a/Examples/ObjectiveC/SymbolLayerZOrderExample.m +++ b/Examples/ObjectiveC/SymbolLayerZOrderExample.m @@ -34,6 +34,8 @@ - (void)viewDidLoad { - (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style { // Add icons to the map's style. + // Note that adding icons to the map's style does not mean they have + // been added to the map yet. [style setImage:([UIImage imageNamed:@"oval"]) forName:@"oval"]; [style setImage:([UIImage imageNamed:@"squircle"]) forName:@"squircle"]; [style setImage:([UIImage imageNamed:@"star"]) forName:@"star"]; @@ -57,13 +59,20 @@ - (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style { self.layer = [[MGLSymbolStyleLayer alloc] initWithIdentifier:@"points-style" source:source]; self.layer.sourceLayerIdentifier = @"symbol-layer-z-order-example"; // Create a stops dictionary with keys that are possible values for 'id', paired with icon images that will represent those features. - NSDictionary *icons = @{@"squircle": @"squircle", @"oval": @"oval", @"star": @"star"}; + NSDictionary *icons = @{ + @"squircle": @"squircle", + @"oval": @"oval", + @"star": @"star"}; // Use the stops dictionary to assign an icon based on the "POITYPE" for each feature. self.layer.iconImageName = [NSExpression expressionWithFormat:@"FUNCTION(%@, 'valueForKeyPath:', id)", icons]; self.layer.iconAllowsOverlap = [NSExpression expressionForConstantValue:@(YES)]; self.layer.symbolZOrder = [NSExpression expressionForConstantValue:@"source"]; [style addLayer:self.layer]; + [self addToggleButton]; +} + +- (void)addToggleButton { UISegmentedControl *styleToggle =[[UISegmentedControl alloc] initWithItems:@[@"viewport-y", @"source"]]; styleToggle.translatesAutoresizingMaskIntoConstraints = NO; styleToggle.backgroundColor = [UIColor colorWithRed:0.83 green:0.84 blue:0.95 alpha:1.0]; @@ -73,14 +82,14 @@ - (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style { styleToggle.selectedSegmentIndex = 1; [self.view insertSubview:styleToggle aboveSubview:self.mapView]; [styleToggle addTarget:self action:@selector(changeStyle:) forControlEvents:UIControlEventValueChanged]; - + // Configure autolayout constraints for the UISegmentedControl to align // at the bottom of the map view and above the Mapbox logo and attribution NSMutableArray *constraints = [NSMutableArray array]; - + [constraints addObject:[NSLayoutConstraint constraintWithItem:styleToggle attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.mapView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:1.0]]; [constraints addObject:[NSLayoutConstraint constraintWithItem:styleToggle attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.mapView.logoView attribute:NSLayoutAttributeTop multiplier:1 constant:-20]]; - + [self.view addConstraints:constraints]; } diff --git a/Examples/Swift/SymbolLayerZOrderExample.swift b/Examples/Swift/SymbolLayerZOrderExample.swift index 4dcc813e..025b32d6 100644 --- a/Examples/Swift/SymbolLayerZOrderExample.swift +++ b/Examples/Swift/SymbolLayerZOrderExample.swift @@ -25,6 +25,7 @@ override func viewDidLoad() { // Wait until the style is loaded before modifying the map style. func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) { // Add icons to the map's style. + // Note that adding icons to the map's style does not mean they have been added to the map yet. style.setImage(UIImage(named: "oval")!, forName: "oval") style.setImage(UIImage(named: "squircle")!, forName: "squircle") style.setImage(UIImage(named: "star")!, forName: "star") @@ -46,7 +47,10 @@ func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) { layer.sourceLayerIdentifier = "symbol-layer-z-order-example" // Create a stops dictionary with keys that are possible values for 'id', paired with icon images that will represent those features. - let icons = ["squircle": "squircle", "oval": "oval", "star": "star"] + let icons = + ["squircle": "squircle", + "oval": "oval", + "star": "star"] // Use the stops dictionary to assign an icon based on the "POITYPE" for each feature. layer.iconImageName = NSExpression(format: "FUNCTION(%@, 'valueForKeyPath:', id)", icons) @@ -56,6 +60,9 @@ func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) { self.symbolLayer = layer + addToggleButton() + } + func addToggleButton() { // Create a UISegmentedControl to toggle between map styles let styleToggle = UISegmentedControl(items: ["viewport-y", "source"]) styleToggle.translatesAutoresizingMaskIntoConstraints = false @@ -66,12 +73,13 @@ func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) { styleToggle.selectedSegmentIndex = 1 view.insertSubview(styleToggle, aboveSubview: mapView) styleToggle.addTarget(self, action: #selector(toggleLayer(sender:)), for: .valueChanged) - + // Configure autolayout constraints for the UISegmentedControl to align // at the bottom of the map view and above the Mapbox logo and attribution NSLayoutConstraint.activate([NSLayoutConstraint(item: styleToggle, attribute: NSLayoutAttribute.centerX, relatedBy: NSLayoutRelation.equal, toItem: mapView, attribute: NSLayoutAttribute.centerX, multiplier: 1.0, constant: 0.0)]) NSLayoutConstraint.activate([NSLayoutConstraint(item: styleToggle, attribute: .bottom, relatedBy: .equal, toItem: mapView.logoView, attribute: .top, multiplier: 1, constant: -20)]) } + // Change the map style based on the selected index of the UISegmentedControl @objc func toggleLayer(sender: UISegmentedControl) { switch sender.selectedSegmentIndex { From 197d90ad153dd0caed97d998d7d14a245da0a6c8 Mon Sep 17 00:00:00 2001 From: Nadia Barbosa Date: Wed, 28 Nov 2018 17:03:36 -0800 Subject: [PATCH 08/10] New images --- Examples.xcodeproj/project.pbxproj | 4 ++ .../symbol-z-order.xcassets/Contents.json | 6 +++ .../Contents.json | 21 +++++++++ .../green-triangle.png | Bin 0 -> 3203 bytes .../Contents.json | 21 +++++++++ .../purple-triangle.png | Bin 0 -> 2647 bytes .../Contents.json | 21 +++++++++ .../yellow-triangle.pdf | Bin 0 -> 3929 bytes Examples/Swift/SymbolLayerZOrderExample.swift | 41 ++++++++++-------- 9 files changed, 95 insertions(+), 19 deletions(-) create mode 100644 Examples/Files/symbol-z-order.xcassets/Contents.json create mode 100644 Examples/Files/symbol-z-order.xcassets/green-triangle-image.imageset/Contents.json create mode 100644 Examples/Files/symbol-z-order.xcassets/green-triangle-image.imageset/green-triangle.png create mode 100644 Examples/Files/symbol-z-order.xcassets/purple-triangle-image.imageset/Contents.json create mode 100644 Examples/Files/symbol-z-order.xcassets/purple-triangle-image.imageset/purple-triangle.png create mode 100644 Examples/Files/symbol-z-order.xcassets/yellow-triangle-image.imageset/Contents.json create mode 100644 Examples/Files/symbol-z-order.xcassets/yellow-triangle-image.imageset/yellow-triangle.pdf diff --git a/Examples.xcodeproj/project.pbxproj b/Examples.xcodeproj/project.pbxproj index 019fa07b..488dfe67 100644 --- a/Examples.xcodeproj/project.pbxproj +++ b/Examples.xcodeproj/project.pbxproj @@ -32,6 +32,7 @@ 05FA53A91FE2FB46001F3D7D /* CustomCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = 05FA53A81FE2FB46001F3D7D /* CustomCalloutView.m */; }; 05FA53AB1FE2FB9C001F3D7D /* CustomCalloutViewExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 05FA53AA1FE2FB9B001F3D7D /* CustomCalloutViewExample.m */; }; 05FA53AD1FE2FBB3001F3D7D /* DefaultCalloutExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 05FA53AC1FE2FBB2001F3D7D /* DefaultCalloutExample.m */; }; + 072BC2A121AF5D0D0056F4AE /* symbol-z-order.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 072BC2A021AF5D0D0056F4AE /* symbol-z-order.xcassets */; }; 079E77C51E1C4E2100F92FA8 /* camera.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 079E77C41E1C4E2100F92FA8 /* camera.xcassets */; }; 07C138C01E6F646F00D6F678 /* MultipleShapesExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 07C138BF1E6F646F00D6F678 /* MultipleShapesExample.m */; }; 07C138C21E6F65D000D6F678 /* MultipleShapesExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07C138C11E6F65D000D6F678 /* MultipleShapesExample.swift */; }; @@ -218,6 +219,7 @@ 05FA53A81FE2FB46001F3D7D /* CustomCalloutView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomCalloutView.m; sourceTree = ""; }; 05FA53AA1FE2FB9B001F3D7D /* CustomCalloutViewExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomCalloutViewExample.m; sourceTree = ""; }; 05FA53AC1FE2FBB2001F3D7D /* DefaultCalloutExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DefaultCalloutExample.m; sourceTree = ""; }; + 072BC2A021AF5D0D0056F4AE /* symbol-z-order.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "symbol-z-order.xcassets"; sourceTree = ""; }; 079E77C41E1C4E2100F92FA8 /* camera.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = camera.xcassets; sourceTree = ""; }; 07C138BE1E6F646F00D6F678 /* MultipleShapesExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MultipleShapesExample.h; sourceTree = ""; }; 07C138BF1E6F646F00D6F678 /* MultipleShapesExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MultipleShapesExample.m; sourceTree = ""; }; @@ -818,6 +820,7 @@ 3EC92DB61E78C431001D0503 /* metro-line.geojson */, 3E25C5DE2056E7E2005B031E /* nps-icons.xcassets */, 96D432051C84B9CF007D09D1 /* pisavector.xcassets */, + 072BC2A021AF5D0D0056F4AE /* symbol-z-order.xcassets */, DDF9432A1E5DEACC00545D0F /* ports.geojson */, 3E4574EC1FA3D8F1000C8CF1 /* radar.gif */, 64BBDAEF1DF22D9600BB705D /* third_party_vector_style.json */, @@ -1135,6 +1138,7 @@ 3EC92DB71E78C431001D0503 /* metro-line.geojson in Resources */, 9619629F1C581700002D3DAB /* LaunchScreen.storyboard in Resources */, DD5939E61E6778480009BEB2 /* clustering.xcassets in Resources */, + 072BC2A121AF5D0D0056F4AE /* symbol-z-order.xcassets in Resources */, 079E77C51E1C4E2100F92FA8 /* camera.xcassets in Resources */, 9619629C1C581700002D3DAB /* Assets.xcassets in Resources */, 9682471D1C5C123B00494AB8 /* example.geojson in Resources */, diff --git a/Examples/Files/symbol-z-order.xcassets/Contents.json b/Examples/Files/symbol-z-order.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Examples/Files/symbol-z-order.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/Files/symbol-z-order.xcassets/green-triangle-image.imageset/Contents.json b/Examples/Files/symbol-z-order.xcassets/green-triangle-image.imageset/Contents.json new file mode 100644 index 00000000..5360e172 --- /dev/null +++ b/Examples/Files/symbol-z-order.xcassets/green-triangle-image.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "green-triangle.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/Files/symbol-z-order.xcassets/green-triangle-image.imageset/green-triangle.png b/Examples/Files/symbol-z-order.xcassets/green-triangle-image.imageset/green-triangle.png new file mode 100644 index 0000000000000000000000000000000000000000..b32032338be8cd0afc0011250e3234012227891b GIT binary patch literal 3203 zcmV-}41Dv6P)Px>JxN4CRCodHT}hJ^#}&@%b@l}$u?xiPAh_t{aLB6^Qs9txunUftu8#242kYqY0U-^8C2Wgf5sVlHF`DV6D*ayeWcADHuAc7d>guYR z&P!!wWxjmx`#P(>&dlm&EW~MeqW3o;4v$5`8r;Z4??J|lKjx0%j8Y3@SihXu-@2kL zUFV!{*EDUeiMI~E_tw>=u*Dk6k+;m2{(!_GS$M?run~vxgl^=GT<#y_S^X-|7S9u= zWwcmy|HU_MT+f#UKNq@@$94UpN*s~|L}s%Wf=`zkL8!j4| zlLG@f%U%U?5|WUPXJV{#Q;aQsk!6qXXJs*vsimVVw*TDG*;%tNpqWsNJe_4OP~xI- zjdeU76O`Z)&t<}TSYMt8`51We#wL3Yan4?*By?|$F>N(6JmNV`SRdQbvLNOIP2Q=$ zzR;p`{vHKB*%oEZ9Z^~&&as>(Y=`Y>SJz0~`2&iE@7?C!1booU_Go)6WR-+cu}LE5&1Mfzp(H- znDTnobWeyBbu^jRY%(}X>3RyeVJNk5cI0lR%JnV)`4+oaw4a zX+@Eu&YDyTGq!I6J2YWG*dHzPYhLx-r(UL0_kRlub33JbxZKmd%`$4_#R`vT2kn^& z`Vsw^1^&%Yw|(j5iOHVc3}@Hqv#$NA80)g$@~ZIu(cLWjYF-sDun_V5_|eZkt-@^0 zoBDp_r8zrCi9?amxv9F_r4?1QXB98lueF}v&V5bZ@TH!gzy$IE3R)L@EzlzF-Z0P} z+Eo)jkn3M9_0ySe$rGZ%;O|qgk{~Wxy4)Rg(mvWn`$~fT{VZNA-YTxw^(39X|1LPN zOFAJ$ie*t%UUTax7ID=c*!ptLEDu?G`4sA$c>wo*zuySFGpU+$l^?gNn8XTM>r$mMZ$itKa!eO z{UJsE$oh`Fv8mo4!5)(zP(x8&EAr;&ZoLbi^5-NdUWgRgm-T2BFX$KgXRTMyb8qfNWkfhK z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NjW%&hv)@g}Yh>aGFI(nX}QC&IqDzmh_bf_bYR%W;G zgi`dDzW(hjt=Oql&GuMOW)OWgk`>>#zvk9;`-uQP)!HpV6Kl5X zN<&N4LCmWgnR~fox2}Csti8Bl_fCB>Xo%ItQ?%Vq^F^R4%b7)(8NDM5H936iu4W0V zcctI4h`u;;yWfFP@uyQlWRq1#tjDEUu>T5h@*9n zM%2lDf3%$1Rh$*QnZc1@>io*XKyRa@&@a-Sf69P9QY&*c}y3>DXEE`_nO z*9nWQiIX!XD<-K~@tS^@_`ZGimvMI-A6^dsvi@&=W>e@UG%Ldqzkrv`uWTC#xrVyB zIyi3<5nuzXIbi$Cg$>canD}qT_6C$rlZa%Tj;B9h4Fg@^2vq4 z(Hq2PHl%}kzacW5z2Tplx;QG%&C}@zz0wA|?$>GHzea{bdPfm3xGEfs8-YZ@ zP$(-HOcwn7?fF}b;4DD&A%LUQW*p#Tr3+3_R4@QNHpp*kg2vOH#NU7a9lbw=iBS31dy&Y0$AUzvfy3J`Jt_r9b|X1bc?v7hoa{Jsds32Kw==2e#000+FbULlAH Date: Thu, 29 Nov 2018 10:44:19 -0800 Subject: [PATCH 09/10] Updates --- .../ObjectiveC/SymbolLayerZOrderExample.m | 32 +++++++++---------- Examples/Swift/SymbolLayerZOrderExample.swift | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Examples/ObjectiveC/SymbolLayerZOrderExample.m b/Examples/ObjectiveC/SymbolLayerZOrderExample.m index bb1fc4aa..0da8bf2f 100644 --- a/Examples/ObjectiveC/SymbolLayerZOrderExample.m +++ b/Examples/ObjectiveC/SymbolLayerZOrderExample.m @@ -36,23 +36,23 @@ - (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style { // Add icons to the map's style. // Note that adding icons to the map's style does not mean they have // been added to the map yet. - [style setImage:([UIImage imageNamed:@"oval"]) forName:@"oval"]; - [style setImage:([UIImage imageNamed:@"squircle"]) forName:@"squircle"]; - [style setImage:([UIImage imageNamed:@"star"]) forName:@"star"]; + [style setImage:([UIImage imageNamed:@"yellow-triangle-image"]) forName:@"yellow-triangle"]; + [style setImage:([UIImage imageNamed:@"green-triangle-image"]) forName:@"green-triangle"]; + [style setImage:([UIImage imageNamed:@"purple-triangle-image"]) forName:@"purple-triangle"]; - MGLPointFeature *feature1 = [MGLPointFeature alloc]; - feature1.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768); - feature1.attributes = @{@"id": @"squircle"}; + MGLPointFeature *yellow = [MGLPointFeature alloc]; + yellow.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768); + yellow.attributes = @{@"id": @"yellow-triangle"}; - MGLPointFeature *feature2 = [MGLPointFeature alloc]; - feature2.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768); - feature2.attributes = @{@"id": @"oval"}; + MGLPointFeature *green = [MGLPointFeature alloc]; + green.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768); + green.attributes = @{@"id": @"green-triangle"}; - MGLPointFeature *feature3 = [MGLPointFeature alloc]; - feature3.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768); - feature3.attributes = @{@"id": @"star"}; + MGLPointFeature *purple = [MGLPointFeature alloc]; + purple.coordinate = CLLocationCoordinate2DMake(-41.292650, 174.778768); + purple.attributes = @{@"id": @"purple-triangle"}; - MGLShapeCollectionFeature *shapeCollection = [MGLShapeCollectionFeature shapeCollectionWithShapes:@[feature1, feature2, feature3]]; + MGLShapeCollectionFeature *shapeCollection = [MGLShapeCollectionFeature shapeCollectionWithShapes:@[yellow, green, purple]]; MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"symbol-layer-z-order-example" shape:shapeCollection options:nil]; [style addSource:source]; @@ -60,9 +60,9 @@ - (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style { self.layer.sourceLayerIdentifier = @"symbol-layer-z-order-example"; // Create a stops dictionary with keys that are possible values for 'id', paired with icon images that will represent those features. NSDictionary *icons = @{ - @"squircle": @"squircle", - @"oval": @"oval", - @"star": @"star"}; + @"yellow-triangle": @"yellow-triangle", + @"green-triangle": @"green-triangle", + @"purple-triangle": @"purple-triangle"}; // Use the stops dictionary to assign an icon based on the "POITYPE" for each feature. self.layer.iconImageName = [NSExpression expressionWithFormat:@"FUNCTION(%@, 'valueForKeyPath:', id)", icons]; self.layer.iconAllowsOverlap = [NSExpression expressionForConstantValue:@(YES)]; diff --git a/Examples/Swift/SymbolLayerZOrderExample.swift b/Examples/Swift/SymbolLayerZOrderExample.swift index b3a5cd9d..bb915393 100644 --- a/Examples/Swift/SymbolLayerZOrderExample.swift +++ b/Examples/Swift/SymbolLayerZOrderExample.swift @@ -43,7 +43,7 @@ func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) { yellow.coordinate = CLLocationCoordinate2DMake(-41.26, 174.77) yellow.attributes = ["id": "yellow-triangle"] - let shapeCollection = MGLShapeCollectionFeature(shapes: [purple, green, yellow]) + let shapeCollection = MGLShapeCollectionFeature(shapes: [yellow, green, purple]) let source = MGLShapeSource(identifier: "symbol-layer-z-order-example", shape: shapeCollection, options: nil) style.addSource(source) let layer = MGLSymbolStyleLayer(identifier: "points-style", source: source) From e1483d9bc126bd5a66d8745002d79c201fe4ae45 Mon Sep 17 00:00:00 2001 From: Nadia Barbosa Date: Thu, 29 Nov 2018 10:54:00 -0800 Subject: [PATCH 10/10] Replace yellow triangle image (PDF -> PNG) --- .../yellow-triangle-image.imageset/Contents.json | 2 +- .../yellow-triangle-image.png | Bin 0 -> 1816 bytes .../yellow-triangle.pdf | Bin 3929 -> 0 bytes 3 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 Examples/Files/symbol-z-order.xcassets/yellow-triangle-image.imageset/yellow-triangle-image.png delete mode 100644 Examples/Files/symbol-z-order.xcassets/yellow-triangle-image.imageset/yellow-triangle.pdf diff --git a/Examples/Files/symbol-z-order.xcassets/yellow-triangle-image.imageset/Contents.json b/Examples/Files/symbol-z-order.xcassets/yellow-triangle-image.imageset/Contents.json index 510a6611..ae04fbd1 100644 --- a/Examples/Files/symbol-z-order.xcassets/yellow-triangle-image.imageset/Contents.json +++ b/Examples/Files/symbol-z-order.xcassets/yellow-triangle-image.imageset/Contents.json @@ -2,7 +2,7 @@ "images" : [ { "idiom" : "universal", - "filename" : "yellow-triangle.pdf", + "filename" : "yellow-triangle-image.png", "scale" : "1x" }, { diff --git a/Examples/Files/symbol-z-order.xcassets/yellow-triangle-image.imageset/yellow-triangle-image.png b/Examples/Files/symbol-z-order.xcassets/yellow-triangle-image.imageset/yellow-triangle-image.png new file mode 100644 index 0000000000000000000000000000000000000000..78121da62fc835caf315fbb2b43a8fa7c865b6da GIT binary patch literal 1816 zcmXX{dpMg}9zF>oNchI3+eAyUPaC0h5Z6ZeCT?|k!k`qBx|J$*>1t71nS_)Ui$$?D zipiF?QUkox?0+uQmNI1R-0)Xf--4^?q{C)2pKs@OTuE1{_K4C*T{g%2=ZotwuwEz0f70hkHO14RdL5BBLK64)9P6xgX6~VE z{BS$2fiUTuVd;6TM1E)TLIacCd2+$hFWWiCxlgx&*GDqGPQ37~sw4POam(UZRj|D9 z1U_B0pkP)TJ(qS-TTXFZMmnOttSpAD>6va@7R91h-k#t7a(_knZX|8{6TN%;h^^YA z0H#UULcTPxp!eC&h1r$kzVmmNvp94q ze~Fal9)z*(_+9w#&GrKX@|M^f5{O)+1^}Rc&we9sO_<6=O?i z)MfLZQtSMi7d8JgRY8Qf^&nl0&9s-k-dpBm&m+ z1fU7mzH%9DRljYr9xB;vtA`UO#P{ZQm!3@H=&Onry!&WBc@Jc=8afTIkDd3s*e0X^ zQ$*U+0_t?&e7z&{6;{k>OxrW- z#R!F*3=u9JH9s-&=|Ihc+%0W7MUWFph^8urJu*=9znQm(kDkU!(SuuyuXX)Nl6AmK z$8W@@`gHZW|1tys+cQ)Zn`P(!dZvq#H8aboo+rMm^p!^V9mAg|@0}dk2`L`T2=~yE zqM=>mL7GFWX(ww-$R#G|sDb|MhpM*icsF@|_`uBT(k6eA5tcs*z)^wnSy|3a+%PhA zfJ+c31qUFnWKOL}kB0Ill}v*>`KAeIGiaNgtvCC<>@$^Iu7ec+40?!41AjsM3bn9& z8Zi44*#d8*EQM_M3XHT8$W@Uh(L{d3j8Pj}eFP8rhU{w9gC87E% zs|>{0Rr>yDE!0<~ieqtGH=aMJc8yoZrj4vNSBUT=EtNIji3`09)fd(IVjMYk$O+H^ zNLQO1gk;H8!+xQ~VcT_`3(}w9NJc7aH7AY&dMgk9A0Ghq36AJwi-RmN@j7=?y&3TneOO2>{Ssd{I@d=aYjTEKGM{9J(I&Dr8A zlV8?UqQ&Kx+qjh~OV{bushAN?DU=zeGY?&{5MeW@jQv@ l70m~gWGT-fxjFW(Xtgb=Ep4V+*CSsY@bP4Nv@xRd{twl5Ii>&r literal 0 HcmV?d00001 diff --git a/Examples/Files/symbol-z-order.xcassets/yellow-triangle-image.imageset/yellow-triangle.pdf b/Examples/Files/symbol-z-order.xcassets/yellow-triangle-image.imageset/yellow-triangle.pdf deleted file mode 100644 index 5d72ac7c8c92c957aef1fa5e07d7c207bd957c1b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3929 zcmai%2{@E}_s1<$7?MgvsymM*5wlt<`!Xq6Ta0}+jJ+||vX$krC0m1%WKWi&5)Ii& zk4d&vNDSFR$=c+9kLv&Qyw7`G?|scR_dVx#e&752&N*{kpCfImXK)0rh=fWvF+Ve> z3%=Zb+0+6>0WiQ5?*cu398fYMc{ov>0W@eb2b2uRZd4Klyu0D3Bs~(rlSl$IG@#y8 z3JK>9_2)dDpbc$=2|(ronuCENW}7dylV3+LC^S3wy|9iTE4bg7U*Dl!KFxNYr5A9x zDPTsZZ2nNyP?=5n$W_sILJLjq8e3Mw=QZ=XbWDwtT7;UakvXCb=2x&cp!Xw#rD!#M zD#tVKe_$nK_Cp`;dAioQP0rY*z3_>{RDrXlQ%fE?_MW`&(2io$(PKxCin9W3sb51= zgFASxPQd?yl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