From d72cd766c81e7bc5bb514b7ee27f7c98e03466e1 Mon Sep 17 00:00:00 2001 From: Alex Cristici Date: Tue, 21 Mar 2023 14:18:26 +0200 Subject: [PATCH] Files prefix changed from MGL to MLN (#919) --- bin/offline.cpp | 2 +- bin/render.cpp | 2 +- platform/android/DEVELOPING.md | 2 +- .../mapboxsdk/testapp/MapLibreApplication.kt | 2 +- platform/android/gradle/gradle-config.gradle | 4 +- platform/darwin/BUILD.bazel | 4 +- .../mbgl/interface/native_apple_interface.h | 14 +- .../include/mbgl/storage/reachability.h | 10 +- ...GLAdditions.hpp => image+MLNAdditions.hpp} | 4 +- platform/darwin/src/http_file_source.mm | 22 +- platform/darwin/src/image.mm | 8 +- platform/darwin/src/local_glyph_rasterizer.mm | 6 +- platform/darwin/src/native_apple_interface.m | 14 +- platform/darwin/src/reachability.m | 12 +- .../src/mbgl/gfx/headless_frontend.cpp | 2 +- platform/glfw/glfw_renderer_frontend.cpp | 2 +- platform/glfw/main.cpp | 2 +- platform/ios/.gitignore | 78 +- platform/ios/BUILD.bazel | 330 +- .../platform/darwin/app/LimeGreenStyleLayer.h | 2 +- .../platform/darwin/app/LimeGreenStyleLayer.m | 6 +- .../darwin/docs/guides/Customizing Fonts.md | 10 +- .../docs/guides/For Style Authors.md.ejs | 96 +- .../guides/Migrating to Expressions.md.ejs | 84 +- .../docs/guides/Predicates and Expressions.md | 84 +- .../docs/guides/Tile URL Templates.md.ejs | 12 +- .../docs/guides/Working with GeoJSON Data.md | 74 +- .../docs/theme/assets/css/jazzy.css.scss | 16 +- ...GLAdditions.hpp => image+MLNAdditions.hpp} | 4 +- .../darwin/scripts/check-public-symbols.js | 2 +- .../darwin/scripts/generate-style-code.js | 68 +- .../scripts/style-spec-overrides-v8.json | 34 +- .../darwin/scripts/update-examples.js | 8 +- .../ios/platform/darwin/src/MGLFoundation.h | 5 - .../platform/darwin/src/MGLGeometry_Private.h | 156 - .../darwin/src/MGLLocationManager_Private.h | 5 - .../src/MGLLoggingConfiguration_Private.h | 67 - .../platform/darwin/src/MGLShapeCollection.h | 56 - .../darwin/src/MGLShapeSource_Private.h | 32 - .../platform/darwin/src/MGLStyle_Private.h | 40 - platform/ios/platform/darwin/src/MGLTypes.m | 5 - .../src/{MGLAnnotation.h => MLNAnnotation.h} | 6 +- ...Expression.h => MLNAttributedExpression.h} | 52 +- ...Expression.m => MLNAttributedExpression.m} | 32 +- ...AttributionInfo.h => MLNAttributionInfo.h} | 20 +- ...tributionInfo.mm => MLNAttributionInfo.mm} | 44 +- ...Private.h => MLNAttributionInfo_Private.h} | 14 +- ...rmatter.h => MLNClockDirectionFormatter.h} | 12 +- ...rmatter.m => MLNClockDirectionFormatter.m} | 10 +- .../darwin/src/{MGLCluster.h => MLNCluster.h} | 30 +- ...atter.h => MLNCompassDirectionFormatter.h} | 12 +- ...atter.m => MLNCompassDirectionFormatter.m} | 12 +- ...ShapeSource.h => MLNComputedShapeSource.h} | 96 +- ...apeSource.mm => MLNComputedShapeSource.mm} | 110 +- ...ate.h => MLNComputedShapeSource_Private.h} | 10 +- .../src/{MGLConversion.h => MLNConversion.h} | 2 +- ...teFormatter.h => MLNCoordinateFormatter.h} | 10 +- ...teFormatter.m => MLNCoordinateFormatter.m} | 14 +- .../{MGLDefaultStyle.h => MLNDefaultStyle.h} | 8 +- ...{MGLDefaultStyle.mm => MLNDefaultStyle.mm} | 4 +- ...anceFormatter.h => MLNDistanceFormatter.h} | 8 +- ...anceFormatter.m => MLNDistanceFormatter.m} | 6 +- .../darwin/src/{MGLFeature.h => MLNFeature.h} | 162 +- .../src/{MGLFeature.mm => MLNFeature.mm} | 250 +- ...Feature_Private.h => MLNFeature_Private.h} | 38 +- ...StyleLayer.h => MLNForegroundStyleLayer.h} | 22 +- ...yleLayer.mm => MLNForegroundStyleLayer.mm} | 10 +- .../ios/platform/darwin/src/MLNFoundation.h | 5 + .../{MGLFoundation.mm => MLNFoundation.mm} | 4 +- ...tion_Private.h => MLNFoundation_Private.h} | 8 +- .../src/{MGLGeometry.h => MLNGeometry.h} | 98 +- .../src/{MGLGeometry.mm => MLNGeometry.mm} | 58 +- .../platform/darwin/src/MLNGeometry_Private.h | 156 + .../{MGLImageSource.h => MLNImageSource.h} | 46 +- .../{MGLImageSource.mm => MLNImageSource.mm} | 54 +- .../src/{MGLLight.h.ejs => MLNLight.h.ejs} | 30 +- .../src/{MGLLight.mm.ejs => MLNLight.mm.ejs} | 44 +- ...{MGLLight_Private.h => MLNLight_Private.h} | 8 +- ...LocationManager.h => MLNLocationManager.h} | 48 +- ...LocationManager.m => MLNLocationManager.m} | 6 +- .../darwin/src/MLNLocationManager_Private.h | 5 + ...figuration.h => MLNLoggingConfiguration.h} | 46 +- ...guration.mm => MLNLoggingConfiguration.mm} | 64 +- .../src/MLNLoggingConfiguration_Private.h | 67 + .../src/{MGLMapCamera.h => MLNMapCamera.h} | 14 +- .../src/{MGLMapCamera.mm => MLNMapCamera.mm} | 42 +- ...GLMapSnapshotter.h => MLNMapSnapshotter.h} | 106 +- ...MapSnapshotter.mm => MLNMapSnapshotter.mm} | 264 +- ..._Private.h => MLNMapSnapshotter_Private.h} | 4 +- .../src/{MGLMultiPoint.h => MLNMultiPoint.h} | 36 +- .../{MGLMultiPoint.mm => MLNMultiPoint.mm} | 54 +- ...oint_Private.h => MLNMultiPoint_Private.h} | 28 +- ...figuration.h => MLNNetworkConfiguration.h} | 28 +- ...guration.mm => MLNNetworkConfiguration.mm} | 50 +- ...te.h => MLNNetworkConfiguration_Private.h} | 14 +- .../{MGLOfflinePack.h => MLNOfflinePack.h} | 74 +- .../{MGLOfflinePack.mm => MLNOfflinePack.mm} | 180 +- ...ack_Private.h => MLNOfflinePack_Private.h} | 6 +- ...{MGLOfflineRegion.h => MLNOfflineRegion.h} | 8 +- ...n_Private.h => MLNOfflineRegion_Private.h} | 4 +- ...GLOfflineStorage.h => MLNOfflineStorage.h} | 148 +- ...OfflineStorage.mm => MLNOfflineStorage.mm} | 208 +- ..._Private.h => MLNOfflineStorage_Private.h} | 10 +- ...enGLStyleLayer.h => MLNOpenGLStyleLayer.h} | 30 +- ...GLStyleLayer.mm => MLNOpenGLStyleLayer.mm} | 68 +- ...rivate.h => MLNOpenGLStyleLayer_Private.h} | 4 +- .../darwin/src/{MGLOverlay.h => MLNOverlay.h} | 12 +- ...PointAnnotation.h => MLNPointAnnotation.h} | 36 +- ...intAnnotation.mm => MLNPointAnnotation.mm} | 20 +- ...PointCollection.h => MLNPointCollection.h} | 34 +- ...intCollection.mm => MLNPointCollection.mm} | 34 +- ...Private.h => MLNPointCollection_Private.h} | 4 +- .../darwin/src/{MGLPolygon.h => MLNPolygon.h} | 70 +- .../src/{MGLPolygon.mm => MLNPolygon.mm} | 74 +- ...Polygon_Private.h => MLNPolygon_Private.h} | 4 +- .../src/{MGLPolyline.h => MLNPolyline.h} | 62 +- .../src/{MGLPolyline.mm => MLNPolyline.mm} | 82 +- ...lyline_Private.h => MLNPolyline_Private.h} | 4 +- ...RasterDEMSource.h => MLNRasterDEMSource.h} | 30 +- ...sterDEMSource.mm => MLNRasterDEMSource.mm} | 8 +- ...sterTileSource.h => MLNRasterTileSource.h} | 46 +- ...erTileSource.mm => MLNRasterTileSource.mm} | 38 +- ...rivate.h => MLNRasterTileSource_Private.h} | 4 +- .../{MGLReachability.h => MLNReachability.h} | 10 +- .../{MGLReachability.m => MLNReachability.m} | 14 +- ...iguration.h => MLNRendererConfiguration.h} | 16 +- ...iguration.m => MLNRendererConfiguration.m} | 16 +- ...ndererFrontend.h => MLNRendererFrontend.h} | 8 +- .../src/{MGLSettings.h => MLNSettings.h} | 28 +- .../src/{MGLSettings.mm => MLNSettings.mm} | 64 +- ...ttings_Private.h => MLNSettings_Private.h} | 8 +- .../darwin/src/{MGLShape.h => MLNShape.h} | 60 +- .../darwin/src/{MGLShape.mm => MLNShape.mm} | 28 +- .../platform/darwin/src/MLNShapeCollection.h | 56 + ...apeCollection.mm => MLNShapeCollection.mm} | 26 +- ...fflineRegion.h => MLNShapeOfflineRegion.h} | 28 +- ...lineRegion.mm => MLNShapeOfflineRegion.mm} | 42 +- ...vate.h => MLNShapeOfflineRegion_Private.h} | 4 +- .../{MGLShapeSource.h => MLNShapeSource.h} | 208 +- .../{MGLShapeSource.mm => MLNShapeSource.mm} | 172 +- .../darwin/src/MLNShapeSource_Private.h | 32 + ...{MGLShape_Private.h => MLNShape_Private.h} | 8 +- .../darwin/src/{MGLSource.h => MLNSource.h} | 28 +- .../darwin/src/{MGLSource.mm => MLNSource.mm} | 36 +- ...GLSource_Private.h => MLNSource_Private.h} | 36 +- .../darwin/src/{MGLStyle.h => MLNStyle.h} | 150 +- .../darwin/src/{MGLStyle.mm => MLNStyle.mm} | 302 +- .../src/{MGLStyleLayer.h => MLNStyleLayer.h} | 26 +- ...GLStyleLayer.h.ejs => MLNStyleLayer.h.ejs} | 50 +- .../{MGLStyleLayer.mm => MLNStyleLayer.mm} | 28 +- ...StyleLayer.mm.ejs => MLNStyleLayer.mm.ejs} | 102 +- ...eLayerManager.h => MLNStyleLayerManager.h} | 4 +- ...ayerManager.mm => MLNStyleLayerManager.mm} | 24 +- ...ayer_Private.h => MLNStyleLayer_Private.h} | 32 +- ...vate.h.ejs => MLNStyleLayer_Private.h.ejs} | 4 +- .../src/{MGLStyleValue.h => MLNStyleValue.h} | 46 +- .../{MGLStyleValue.mm => MLNStyleValue.mm} | 24 +- ...alue_Private.h => MLNStyleValue_Private.h} | 110 +- .../platform/darwin/src/MLNStyle_Private.h | 40 + ...Region.h => MLNTilePyramidOfflineRegion.h} | 28 +- ...gion.mm => MLNTilePyramidOfflineRegion.mm} | 46 +- ... => MLNTilePyramidOfflineRegion_Private.h} | 4 +- ...ServerOptions.h => MLNTileServerOptions.h} | 14 +- ...rverOptions.mm => MLNTileServerOptions.mm} | 8 +- .../src/{MGLTileSource.h => MLNTileSource.h} | 78 +- .../{MGLTileSource.mm => MLNTileSource.mm} | 92 +- ...urce_Private.h => MLNTileSource_Private.h} | 14 +- .../darwin/src/{MGLTypes.h => MLNTypes.h} | 82 +- platform/ios/platform/darwin/src/MLNTypes.m | 5 + ...GLValueEvaluator.h => MLNValueEvaluator.h} | 0 ...ctorStyleLayer.h => MLNVectorStyleLayer.h} | 22 +- ...orStyleLayer.mm => MLNVectorStyleLayer.mm} | 14 +- ...ctorTileSource.h => MLNVectorTileSource.h} | 50 +- ...orTileSource.mm => MLNVectorTileSource.mm} | 52 +- ...rivate.h => MLNVectorTileSource_Private.h} | 4 +- ...+MGLAdditions.h => NSArray+MLNAdditions.h} | 2 +- ...GLAdditions.mm => NSArray+MLNAdditions.mm} | 12 +- ...MGLAdditions.h => NSBundle+MLNAdditions.h} | 6 +- ...LAdditions.mm => NSBundle+MLNAdditions.mm} | 14 +- ...+MGLAdditions.h => NSCoder+MLNAdditions.h} | 6 +- ...GLAdditions.mm => NSCoder+MLNAdditions.mm} | 12 +- ...h => NSComparisonPredicate+MLNAdditions.h} | 2 +- ... => NSComparisonPredicate+MLNAdditions.mm} | 14 +- ...s.h => NSCompoundPredicate+MLNAdditions.h} | 2 +- ...mm => NSCompoundPredicate+MLNAdditions.mm} | 16 +- ...e+MGLAdditions.h => NSDate+MLNAdditions.h} | 10 +- ...MGLAdditions.mm => NSDate+MLNAdditions.mm} | 6 +- ...dditions.h => NSDictionary+MLNAdditions.h} | 2 +- ...itions.mm => NSDictionary+MLNAdditions.mm} | 8 +- ...Additions.h => NSException+MLNAdditions.h} | 4 +- ...dditions.h => NSExpression+MLNAdditions.h} | 36 +- ...itions.mm => NSExpression+MLNAdditions.mm} | 270 +- ...s.h => NSExpression+MLNPrivateAdditions.h} | 22 +- ...Additions.h => NSPredicate+MLNAdditions.h} | 6 +- ...ditions.mm => NSPredicate+MLNAdditions.mm} | 48 +- ...ns.h => NSPredicate+MLNPrivateAdditions.h} | 6 +- ...MGLAdditions.h => NSString+MLNAdditions.h} | 4 +- ...MGLAdditions.m => NSString+MLNAdditions.m} | 6 +- ...RL+MGLAdditions.h => NSURL+MLNAdditions.h} | 2 +- ...RL+MGLAdditions.m => NSURL+MLNAdditions.m} | 4 +- .../darwin/src/NSValue+MGLAdditions.m | 104 - ...+MGLAdditions.h => NSValue+MLNAdditions.h} | 62 +- .../darwin/src/NSValue+MLNAdditions.m | 104 + ...h => NSValue+MLNStyleAttributeAdditions.h} | 2 +- ... => NSValue+MLNStyleAttributeAdditions.mm} | 24 +- ...nInfoTests.m => MLNAttributionInfoTests.m} | 26 +- ...ts.m => MLNClockDirectionFormatterTests.m} | 10 +- .../{MGLCodingTests.mm => MLNCodingTests.mm} | 186 +- ....m => MLNCompassDirectionFormatterTests.m} | 10 +- ...eTests.m => MLNComputedShapeSourceTests.m} | 8 +- ...rTests.m => MLNCoordinateFormatterTests.m} | 10 +- ...terTests.m => MLNDistanceFormatterTests.m} | 8 +- ...ift => MLNDocumentationExampleTests.swift} | 232 +- ...swift => MLNDocumentationGuideTests.swift} | 74 +- ...pressionTests.mm => MLNExpressionTests.mm} | 636 +-- ...{MGLFeatureTests.mm => MLNFeatureTests.mm} | 114 +- ...GLGeometryTests.mm => MLNGeometryTests.mm} | 154 +- ...pColorTests.mm => MLNHeatmapColorTests.mm} | 24 +- ...ageSourceTests.m => MLNImageSourceTests.m} | 20 +- .../{MGLImageTests.mm => MLNImageTests.mm} | 28 +- ...GLLightTest.mm.ejs => MLNLightTest.mm.ejs} | 48 +- ...GLMapCameraTests.m => MLNMapCameraTests.m} | 18 +- ...jectionTests.m => MLNMapProjectionTests.m} | 34 +- ...hotterTests.m => MLNMapSnapshotterTests.m} | 88 +- .../{MGLMapViewTests.m => MLNMapViewTests.m} | 46 +- ...onsTests.mm => MLNNSDateAdditionsTests.mm} | 24 +- ...onsTests.m => MLNNSStringAdditionsTests.m} | 6 +- ...inePackTests.mm => MLNOfflinePackTests.mm} | 28 +- ...eRegionTests.m => MLNOfflineRegionTests.m} | 38 +- ...rageTests.mm => MLNOfflineStorageTests.mm} | 232 +- ...PredicateTests.mm => MLNPredicateTests.mm} | 158 +- ...ests.m => MLNRendererConfigurationTests.m} | 68 +- ...GLResourceTests.mm => MLNResourceTests.mm} | 4 +- ...tHelpers.swift => MLNSDKTestHelpers.swift} | 4 +- ...eSourceTests.mm => MLNShapeSourceTests.mm} | 190 +- ...urceQueryTests.m => MLNSourceQueryTests.m} | 8 +- ...StyleLayerTests.h => MLNStyleLayerTests.h} | 12 +- ...StyleLayerTests.m => MLNStyleLayerTests.m} | 20 +- ...Tests.mm.ejs => MLNStyleLayerTests.mm.ejs} | 46 +- .../{MGLStyleTests.mm => MLNStyleTests.mm} | 188 +- ...ionHandler.h => MLNTestAssertionHandler.h} | 2 +- ...ionHandler.m => MLNTestAssertionHandler.m} | 4 +- .../{MGLTestUtility.h => MLNTestUtility.h} | 4 +- ...{MGLTileSetTests.mm => MLNTileSetTests.mm} | 64 +- ...{MGLVersionNumber.m => MLNVersionNumber.m} | 4 +- .../Contents.json | 0 .../PingFang.imageset/Contents.json | 0 .../PingFang.imageset/actualImage.png | Bin .../PingFang.imageset/expected.png | Bin .../background.imageset/Contents.json | 0 .../background.imageset/background.png | Bin platform/ios/platform/ios/CHANGELOG.md | 709 ++-- platform/ios/platform/ios/CONTRIBUTING.md | 20 +- platform/ios/platform/ios/INSTALL.md | 8 +- ...m => MLNAnnotationViewIntegrationTests.mm} | 112 +- ...s.mm => MLNCameraTransitionFinishTests.mm} | 46 +- ...onTests.mm => MLNCameraTransitionTests.mm} | 94 +- .../Integration Tests/MBGLIntegrationTests.mm | 48 +- .../MGLMapViewIntegrationTest.h | 21 - .../MGLStyleURLIntegrationTest.m | 22 - .../MGLTestLocationManager.h | 10 - ...ionTestCase.h => MLNIntegrationTestCase.h} | 16 +- ...ionTestCase.m => MLNIntegrationTestCase.m} | 14 +- .../MLNMapViewIntegrationTest.h | 21 + ...tionTest.m => MLNMapViewIntegrationTest.m} | 34 +- ...kTests.m => MLNMapViewPendingBlockTests.m} | 48 +- ...LNNetworkConfigurationIntegrationTests.mm} | 106 +- ...apeSourceTests.m => MLNShapeSourceTests.m} | 50 +- ...SourceTests.swift => MLNSourceTests.swift} | 8 +- ...ests.m => MLNStyleLayerIntegrationTests.m} | 34 +- .../MLNStyleURLIntegrationTest.m | 22 + .../MLNTestLocationManager.h | 10 + ...tionManager.m => MLNTestLocationManager.m} | 4 +- ...wift => MLNMapSnapshotterSwiftTests.swift} | 20 +- ...pshotterTest.m => MLNMapSnapshotterTest.m} | 174 +- .../integration-Bridging-Header.h | 2 +- .../ios/Mapbox.playground/Contents.swift | 24 +- .../contents.xcworkspacedata | 7 + platform/ios/platform/ios/app/Info.plist | 2 +- .../ios/platform/ios/app/MBXAnnotationView.h | 2 +- .../ios/platform/ios/app/MBXAnnotationView.m | 12 +- .../ios/platform/ios/app/MBXAppDelegate.m | 6 +- .../platform/ios/app/MBXCustomCalloutView.h | 2 +- .../platform/ios/app/MBXCustomCalloutView.m | 4 +- .../ios/app/MBXCustomLocationViewController.m | 6 +- .../ios/app/MBXEmbeddedMapViewController.m | 2 +- .../app/MBXOfflinePacksTableViewController.h | 4 +- .../app/MBXOfflinePacksTableViewController.m | 92 +- .../ios/app/MBXOrnamentsViewController.m | 48 +- .../ios/app/MBXSnapshotsViewController.m | 22 +- platform/ios/platform/ios/app/MBXState.h | 6 +- platform/ios/platform/ios/app/MBXState.m | 2 +- .../ios/app/MBXUserLocationAnnotationView.h | 2 +- .../ios/app/MBXUserLocationAnnotationView.m | 4 +- .../ios/platform/ios/app/MBXViewController.m | 332 +- ...perimental.h => MLNMapView_Experimental.h} | 2 +- platform/ios/platform/ios/app/Main.storyboard | 4 +- .../ios/app/Settings.bundle/Root.plist | 2 +- .../platform/ios/app/insert_access_token.sh | 4 +- .../ios/platform/ios/benchmark/Info.plist | 2 +- .../ios/benchmark/MBXBenchAppDelegate.m | 2 +- .../ios/benchmark/MBXBenchViewController.mm | 16 +- .../ios/benchmark/assets/glyphs/download.sh | 2 +- .../ios/benchmark/assets/tiles/download.sh | 4 +- .../ios/benchmark/insert_access_token.sh | 4 +- platform/ios/platform/ios/core-files.json | 2 +- .../ios/docs/guides/Gesture Recognizers.md | 14 +- .../ios/docs/guides/Info.plist Keys.md | 36 +- platform/ios/platform/ios/docs/pod-README.md | 8 +- .../platform/ios/framework/Info-static.plist | 4 +- .../ios/platform/ios/framework/Info.plist | 4 +- .../ios/ios.xcodeproj/project.pbxproj | 3592 ++++++++--------- .../xcshareddata/xcschemes/CI.xcscheme | 2 +- .../xcschemes/dynamic+static.xcscheme | 6 +- .../xcshareddata/xcschemes/dynamic.xcscheme | 6 +- platform/ios/platform/ios/jazzy.yml | 180 +- .../ios/platform/ios/scripts/bazel-package.sh | 8 +- platform/ios/platform/ios/sdk-files.json | 484 +-- .../ios/src/MGLAnnotationContainerView.h | 17 - .../src/MGLAnnotationContainerView_Private.h | 14 - .../ios/src/MGLAnnotationView_Private.h | 15 - .../ios/src/MGLCompassButton_Private.h | 19 - .../src/MGLFaux3DUserLocationAnnotationView.h | 15 - .../MGLUserLocationAnnotationView_Private.h | 15 - .../src/MGLUserLocationHeadingArrowLayer.h | 11 - .../ios/src/MGLUserLocationHeadingBeamLayer.h | 11 - .../ios/src/MLNAnnotationContainerView.h | 17 + ...nerView.m => MLNAnnotationContainerView.m} | 18 +- .../src/MLNAnnotationContainerView_Private.h | 14 + ...AnnotationImage.h => MLNAnnotationImage.h} | 10 +- ...AnnotationImage.m => MLNAnnotationImage.m} | 22 +- ...Private.h => MLNAnnotationImage_Private.h} | 10 +- ...GLAnnotationView.h => MLNAnnotationView.h} | 52 +- ...AnnotationView.mm => MLNAnnotationView.mm} | 90 +- .../ios/src/MLNAnnotationView_Private.h | 15 + .../{MGLCalloutView.h => MLNCalloutView.h} | 36 +- ...ChangeReason.h => MLNCameraChangeReason.h} | 42 +- ...tCalloutView.h => MLNCompactCalloutView.h} | 6 +- ...tCalloutView.m => MLNCompactCalloutView.m} | 10 +- ...{MGLCompassButton.h => MLNCompassButton.h} | 8 +- ...GLCompassButton.mm => MLNCompassButton.mm} | 42 +- .../ios/src/MLNCompassButton_Private.h | 19 + .../src/MLNFaux3DUserLocationAnnotationView.h | 15 + ...=> MLNFaux3DUserLocationAnnotationView.mm} | 94 +- ...Element.h => MLNMapAccessibilityElement.h} | 38 +- ...ement.mm => MLNMapAccessibilityElement.mm} | 58 +- ...{MGLMapProjection.h => MLNMapProjection.h} | 20 +- ...GLMapProjection.mm => MLNMapProjection.mm} | 36 +- ...IBAdditions.h => MLNMapView+IBAdditions.h} | 8 +- .../{MGLMapView+Impl.h => MLNMapView+Impl.h} | 12 +- ...{MGLMapView+Impl.mm => MLNMapView+Impl.mm} | 60 +- ...GLMapView+OpenGL.h => MLNMapView+OpenGL.h} | 20 +- ...MapView+OpenGL.mm => MLNMapView+OpenGL.mm} | 104 +- .../ios/src/{MGLMapView.h => MLNMapView.h} | 434 +- .../ios/src/{MGLMapView.mm => MLNMapView.mm} | 1762 ++++---- ...MapViewDelegate.h => MLNMapViewDelegate.h} | 144 +- ...MapView_Private.h => MLNMapView_Private.h} | 30 +- .../ios/src/{MGLScaleBar.h => MLNScaleBar.h} | 2 +- .../src/{MGLScaleBar.mm => MLNScaleBar.mm} | 114 +- .../{MGLUserLocation.h => MLNUserLocation.h} | 16 +- .../{MGLUserLocation.m => MLNUserLocation.m} | 20 +- ...View.h => MLNUserLocationAnnotationView.h} | 18 +- ...View.m => MLNUserLocationAnnotationView.m} | 28 +- ...h => MLNUserLocationAnnotationViewStyle.h} | 6 +- ...m => MLNUserLocationAnnotationViewStyle.m} | 24 +- .../MLNUserLocationAnnotationView_Private.h | 15 + .../src/MLNUserLocationHeadingArrowLayer.h | 11 + ...r.m => MLNUserLocationHeadingArrowLayer.m} | 16 +- .../ios/src/MLNUserLocationHeadingBeamLayer.h | 11 + ...er.m => MLNUserLocationHeadingBeamLayer.m} | 22 +- ...or.h => MLNUserLocationHeadingIndicator.h} | 6 +- ...on_Private.h => MLNUserLocation_Private.h} | 10 +- platform/ios/platform/ios/src/Mapbox.h | 142 +- ...ditions.h => NSOrthography+MLNAdditions.h} | 2 +- ...ditions.m => NSOrthography+MLNAdditions.m} | 4 +- ...+MGLAdditions.h => UIColor+MLNAdditions.h} | 4 +- ...GLAdditions.mm => UIColor+MLNAdditions.mm} | 6 +- ...MGLAdditions.h => UIDevice+MLNAdditions.h} | 2 +- ...MGLAdditions.m => UIDevice+MLNAdditions.m} | 4 +- ...+MGLAdditions.h => UIImage+MLNAdditions.h} | 10 +- ...GLAdditions.mm => UIImage+MLNAdditions.mm} | 26 +- ...w+MGLAdditions.h => UIView+MLNAdditions.h} | 2 +- ...w+MGLAdditions.m => UIView+MLNAdditions.m} | 4 +- ...ions.h => UIViewController+MLNAdditions.h} | 2 +- ...ions.m => UIViewController+MLNAdditions.m} | 4 +- .../ios/test/CI-Expressions.xctestplan | 82 +- platform/ios/platform/ios/test/CI.xctestplan | 6 +- .../MGLMapViewDelegateIntegrationTests.swift | 107 - ...> MLNAnnotationViewIntegrationTests.swift} | 4 +- ...onViewTests.m => MLNAnnotationViewTests.m} | 106 +- ...ts.m => MLNMapAccessibilityElementTests.m} | 34 +- ...Tests.mm => MLNMapViewCompassViewTests.mm} | 30 +- ...tTests.m => MLNMapViewContentInsetTests.m} | 14 +- .../MLNMapViewDelegateIntegrationTests.swift | 107 + ...onTests.mm => MLNMapViewDirectionTests.mm} | 30 +- ...mm => MLNMapViewGestureRecognizerTests.mm} | 56 +- ...wLayoutTests.m => MLNMapViewLayoutTests.m} | 72 +- ...iewPitchTests.m => MLNMapViewPitchTests.m} | 18 +- ...leBarTests.m => MLNMapViewScaleBarTests.m} | 12 +- ...iewZoomTests.mm => MLNMapViewZoomTests.mm} | 34 +- ...ognizers.h => MLNMockGestureRecognizers.h} | 0 ...ognizers.m => MLNMockGestureRecognizers.m} | 2 +- ...sts.m => MLNNSOrthographyAdditionsTests.m} | 10 +- ...Tests.m => MLNNetworkConfigurationTests.m} | 8 +- .../ios/vendor/SMCalloutView/SMCalloutView.h | 60 +- .../ios/vendor/SMCalloutView/SMCalloutView.m | 64 +- platform/ios/platform/macos/CHANGELOG.md | 424 +- platform/ios/platform/macos/DEVELOPING.md | 12 +- platform/ios/platform/macos/INSTALL.md | 10 +- platform/ios/platform/macos/app/AppDelegate.h | 10 +- platform/ios/platform/macos/app/AppDelegate.m | 86 +- .../macos/app/Base.lproj/MainMenu.xib | 6 +- .../macos/app/Base.lproj/MapDocument.xib | 8 +- .../platform/macos/app/DroppedPinAnnotation.h | 2 +- .../platform/macos/app/DroppedPinAnnotation.m | 4 +- .../app/LocationCoordinate2DTransformer.m | 4 +- .../macos/app/MGLStyle+MBXAdditions.h | 7 - .../macos/app/MLNStyle+MBXAdditions.h | 7 + ...MBXAdditions.m => MLNStyle+MBXAdditions.m} | 14 +- platform/ios/platform/macos/app/MapDocument.h | 4 +- platform/ios/platform/macos/app/MapDocument.m | 276 +- .../macos/app/StyleLayerIconTransformer.m | 20 +- platform/ios/platform/macos/core-files.json | 2 +- .../macos/docs/guides/Info.plist Keys.md | 24 +- .../ios/platform/macos/docs/pod-README.md | 10 +- platform/ios/platform/macos/jazzy.yml | 150 +- .../macos/macos.xcodeproj/project.pbxproj | 2084 +++++----- .../xcshareddata/xcschemes/CI.xcscheme | 2 +- .../xcshareddata/xcschemes/dynamic.xcscheme | 2 +- .../xcshareddata/xcschemes/macosapp.xcscheme | 2 +- platform/ios/platform/macos/sdk-files.json | 410 +- ...onCallout.xib => MLNAnnotationCallout.xib} | 0 platform/ios/platform/macos/sdk/Info.plist | 4 +- ...AnnotationImage.h => MLNAnnotationImage.h} | 10 +- ...AnnotationImage.m => MLNAnnotationImage.m} | 10 +- ...Private.h => MLNAnnotationImage_Private.h} | 2 +- ...ibutionButton.h => MLNAttributionButton.h} | 14 +- ...utionButton.mm => MLNAttributionButton.mm} | 12 +- .../{MGLCompassCell.h => MLNCompassCell.h} | 2 +- .../{MGLCompassCell.m => MLNCompassCell.m} | 4 +- ...IBAdditions.h => MLNMapView+IBAdditions.h} | 8 +- ...Additions.mm => MLNMapView+IBAdditions.mm} | 10 +- .../{MGLMapView+Impl.h => MLNMapView+Impl.h} | 12 +- ...{MGLMapView+Impl.mm => MLNMapView+Impl.mm} | 56 +- ...GLMapView+OpenGL.h => MLNMapView+OpenGL.h} | 14 +- ...MapView+OpenGL.mm => MLNMapView+OpenGL.mm} | 44 +- .../macos/src/{MGLMapView.h => MLNMapView.h} | 212 +- .../src/{MGLMapView.mm => MLNMapView.mm} | 822 ++-- ...MapViewDelegate.h => MLNMapViewDelegate.h} | 72 +- ...MapView_Private.h => MLNMapView_Private.h} | 8 +- .../{MGLOpenGLLayer.h => MLNOpenGLLayer.h} | 2 +- .../{MGLOpenGLLayer.mm => MLNOpenGLLayer.mm} | 10 +- platform/ios/platform/macos/src/Mapbox.h | 126 +- ...+MGLAdditions.h => NSColor+MLNAdditions.h} | 4 +- ...GLAdditions.mm => NSColor+MLNAdditions.mm} | 6 +- ...+MGLAdditions.h => NSImage+MLNAdditions.h} | 6 +- ...GLAdditions.mm => NSImage+MLNAdditions.mm} | 20 +- ...ditions.h => NSProcessInfo+MLNAdditions.h} | 2 +- ...ditions.m => NSProcessInfo+MLNAdditions.m} | 4 +- .../ios/platform/macos/test/CI.xctestplan | 4 +- .../MGLMapViewDelegateIntegrationTests.swift | 63 - ...AnnotationTests.m => MLNAnnotationTests.m} | 14 +- ...tonTests.m => MLNAttributionButtonTests.m} | 12 +- .../MLNMapViewDelegateIntegrationTests.swift | 63 + platform/qt/app/mapwindow.cpp | 2 +- platform/qt/src/settings.cpp | 4 +- render-test/manifest_parser.cpp | 2 +- 467 files changed, 13884 insertions(+), 13872 deletions(-) rename platform/darwin/include/mbgl/util/{image+MGLAdditions.hpp => image+MLNAdditions.hpp} (71%) rename platform/ios/platform/darwin/include/mbgl/util/{image+MGLAdditions.hpp => image+MLNAdditions.hpp} (71%) delete mode 100644 platform/ios/platform/darwin/src/MGLFoundation.h delete mode 100644 platform/ios/platform/darwin/src/MGLGeometry_Private.h delete mode 100644 platform/ios/platform/darwin/src/MGLLocationManager_Private.h delete mode 100644 platform/ios/platform/darwin/src/MGLLoggingConfiguration_Private.h delete mode 100644 platform/ios/platform/darwin/src/MGLShapeCollection.h delete mode 100644 platform/ios/platform/darwin/src/MGLShapeSource_Private.h delete mode 100644 platform/ios/platform/darwin/src/MGLStyle_Private.h delete mode 100644 platform/ios/platform/darwin/src/MGLTypes.m rename platform/ios/platform/darwin/src/{MGLAnnotation.h => MLNAnnotation.h} (94%) rename platform/ios/platform/darwin/src/{MGLAttributedExpression.h => MLNAttributedExpression.h} (55%) rename platform/ios/platform/darwin/src/{MGLAttributedExpression.m => MLNAttributedExpression.m} (62%) rename platform/ios/platform/darwin/src/{MGLAttributionInfo.h => MLNAttributionInfo.h} (83%) rename platform/ios/platform/darwin/src/{MGLAttributionInfo.mm => MLNAttributionInfo.mm} (88%) rename platform/ios/platform/darwin/src/{MGLAttributionInfo_Private.h => MLNAttributionInfo_Private.h} (74%) rename platform/ios/platform/darwin/src/{MGLClockDirectionFormatter.h => MLNClockDirectionFormatter.h} (80%) rename platform/ios/platform/darwin/src/{MGLClockDirectionFormatter.m => MLNClockDirectionFormatter.m} (89%) rename platform/ios/platform/darwin/src/{MGLCluster.h => MLNCluster.h} (50%) rename platform/ios/platform/darwin/src/{MGLCompassDirectionFormatter.h => MLNCompassDirectionFormatter.h} (79%) rename platform/ios/platform/darwin/src/{MGLCompassDirectionFormatter.m => MLNCompassDirectionFormatter.m} (97%) rename platform/ios/platform/darwin/src/{MGLComputedShapeSource.h => MLNComputedShapeSource.h} (62%) rename platform/ios/platform/darwin/src/{MGLComputedShapeSource.mm => MLNComputedShapeSource.mm} (69%) rename platform/ios/platform/darwin/src/{MGLComputedShapeSource_Private.h => MLNComputedShapeSource_Private.h} (53%) rename platform/ios/platform/darwin/src/{MGLConversion.h => MLNConversion.h} (99%) rename platform/ios/platform/darwin/src/{MGLCoordinateFormatter.h => MLNCoordinateFormatter.h} (87%) rename platform/ios/platform/darwin/src/{MGLCoordinateFormatter.m => MLNCoordinateFormatter.m} (96%) rename platform/ios/platform/darwin/src/{MGLDefaultStyle.h => MLNDefaultStyle.h} (68%) rename platform/ios/platform/darwin/src/{MGLDefaultStyle.mm => MLNDefaultStyle.mm} (51%) rename platform/ios/platform/darwin/src/{MGLDistanceFormatter.h => MLNDistanceFormatter.h} (78%) rename platform/ios/platform/darwin/src/{MGLDistanceFormatter.m => MLNDistanceFormatter.m} (90%) rename platform/ios/platform/darwin/src/{MGLFeature.h => MLNFeature.h} (65%) rename platform/ios/platform/darwin/src/{MGLFeature.mm => MLNFeature.mm} (67%) rename platform/ios/platform/darwin/src/{MGLFeature_Private.h => MLNFeature_Private.h} (71%) rename platform/ios/platform/darwin/src/{MGLForegroundStyleLayer.h => MLNForegroundStyleLayer.h} (50%) rename platform/ios/platform/darwin/src/{MGLForegroundStyleLayer.mm => MLNForegroundStyleLayer.mm} (74%) create mode 100644 platform/ios/platform/darwin/src/MLNFoundation.h rename platform/ios/platform/darwin/src/{MGLFoundation.mm => MLNFoundation.mm} (62%) rename platform/ios/platform/darwin/src/{MGLFoundation_Private.h => MLNFoundation_Private.h} (73%) rename platform/ios/platform/darwin/src/{MGLGeometry.h => MLNGeometry.h} (70%) rename platform/ios/platform/darwin/src/{MGLGeometry.mm => MLNGeometry.mm} (71%) create mode 100644 platform/ios/platform/darwin/src/MLNGeometry_Private.h rename platform/ios/platform/darwin/src/{MGLImageSource.h => MLNImageSource.h} (72%) rename platform/ios/platform/darwin/src/{MGLImageSource.mm => MLNImageSource.mm} (66%) rename platform/ios/platform/darwin/src/{MGLLight.h.ejs => MLNLight.h.ejs} (80%) rename platform/ios/platform/darwin/src/{MGLLight.mm.ejs => MLNLight.mm.ejs} (74%) rename platform/ios/platform/darwin/src/{MGLLight_Private.h => MLNLight_Private.h} (57%) rename platform/ios/platform/darwin/src/{MGLLocationManager.h => MLNLocationManager.h} (80%) rename platform/ios/platform/darwin/src/{MGLLocationManager.m => MLNLocationManager.m} (96%) create mode 100644 platform/ios/platform/darwin/src/MLNLocationManager_Private.h rename platform/ios/platform/darwin/src/{MGLLoggingConfiguration.h => MLNLoggingConfiguration.h} (65%) rename platform/ios/platform/darwin/src/{MGLLoggingConfiguration.mm => MLNLoggingConfiguration.mm} (73%) create mode 100644 platform/ios/platform/darwin/src/MLNLoggingConfiguration_Private.h rename platform/ios/platform/darwin/src/{MGLMapCamera.h => MLNMapCamera.h} (95%) rename platform/ios/platform/darwin/src/{MGLMapCamera.mm => MLNMapCamera.mm} (84%) rename platform/ios/platform/darwin/src/{MGLMapSnapshotter.h => MLNMapSnapshotter.h} (76%) rename platform/ios/platform/darwin/src/{MGLMapSnapshotter.mm => MLNMapSnapshotter.mm} (73%) rename platform/ios/platform/darwin/src/{MGLMapSnapshotter_Private.h => MLNMapSnapshotter_Private.h} (80%) rename platform/ios/platform/darwin/src/{MGLMultiPoint.h => MLNMultiPoint.h} (86%) rename platform/ios/platform/darwin/src/{MGLMultiPoint.mm => MLNMultiPoint.mm} (79%) rename platform/ios/platform/darwin/src/{MGLMultiPoint_Private.h => MLNMultiPoint_Private.h} (53%) rename platform/ios/platform/darwin/src/{MGLNetworkConfiguration.h => MLNNetworkConfiguration.h} (66%) rename platform/ios/platform/darwin/src/{MGLNetworkConfiguration.mm => MLNNetworkConfiguration.mm} (82%) rename platform/ios/platform/darwin/src/{MGLNetworkConfiguration_Private.h => MLNNetworkConfiguration_Private.h} (60%) rename platform/ios/platform/darwin/src/{MGLOfflinePack.h => MLNOfflinePack.h} (76%) rename platform/ios/platform/darwin/src/{MGLOfflinePack.mm => MLNOfflinePack.mm} (59%) rename platform/ios/platform/darwin/src/{MGLOfflinePack_Private.h => MLNOfflinePack_Private.h} (76%) rename platform/ios/platform/darwin/src/{MGLOfflineRegion.h => MLNOfflineRegion.h} (81%) rename platform/ios/platform/darwin/src/{MGLOfflineRegion_Private.h => MLNOfflineRegion_Private.h} (83%) rename platform/ios/platform/darwin/src/{MGLOfflineStorage.h => MLNOfflineStorage.h} (82%) rename platform/ios/platform/darwin/src/{MGLOfflineStorage.mm => MLNOfflineStorage.mm} (79%) rename platform/ios/platform/darwin/src/{MGLOfflineStorage_Private.h => MLNOfflineStorage_Private.h} (79%) rename platform/ios/platform/darwin/src/{MGLOpenGLStyleLayer.h => MLNOpenGLStyleLayer.h} (57%) rename platform/ios/platform/darwin/src/{MGLOpenGLStyleLayer.mm => MLNOpenGLStyleLayer.mm} (76%) rename platform/ios/platform/darwin/src/{MGLOpenGLStyleLayer_Private.h => MLNOpenGLStyleLayer_Private.h} (76%) rename platform/ios/platform/darwin/src/{MGLOverlay.h => MLNOverlay.h} (87%) rename platform/ios/platform/darwin/src/{MGLPointAnnotation.h => MLNPointAnnotation.h} (57%) rename platform/ios/platform/darwin/src/{MGLPointAnnotation.mm => MLNPointAnnotation.mm} (76%) rename platform/ios/platform/darwin/src/{MGLPointCollection.h => MLNPointCollection.h} (69%) rename platform/ios/platform/darwin/src/{MGLPointCollection.mm => MLNPointCollection.mm} (79%) rename platform/ios/platform/darwin/src/{MGLPointCollection_Private.h => MLNPointCollection_Private.h} (68%) rename platform/ios/platform/darwin/src/{MGLPolygon.h => MLNPolygon.h} (66%) rename platform/ios/platform/darwin/src/{MGLPolygon.mm => MLNPolygon.mm} (75%) rename platform/ios/platform/darwin/src/{MGLPolygon_Private.h => MLNPolygon_Private.h} (62%) rename platform/ios/platform/darwin/src/{MGLPolyline.h => MLNPolyline.h} (62%) rename platform/ios/platform/darwin/src/{MGLPolyline.mm => MLNPolyline.mm} (70%) rename platform/ios/platform/darwin/src/{MGLPolyline_Private.h => MLNPolyline_Private.h} (61%) rename platform/ios/platform/darwin/src/{MGLRasterDEMSource.h => MLNRasterDEMSource.h} (62%) rename platform/ios/platform/darwin/src/{MGLRasterDEMSource.mm => MLNRasterDEMSource.mm} (79%) rename platform/ios/platform/darwin/src/{MGLRasterTileSource.h => MLNRasterTileSource.h} (79%) rename platform/ios/platform/darwin/src/{MGLRasterTileSource.mm => MLNRasterTileSource.mm} (74%) rename platform/ios/platform/darwin/src/{MGLRasterTileSource_Private.h => MLNRasterTileSource_Private.h} (86%) rename platform/ios/platform/darwin/src/{MGLReachability.h => MLNReachability.h} (92%) rename platform/ios/platform/darwin/src/{MGLReachability.m => MLNReachability.m} (97%) rename platform/ios/platform/darwin/src/{MGLRendererConfiguration.h => MLNRendererConfiguration.h} (82%) rename platform/ios/platform/darwin/src/{MGLRendererConfiguration.m => MLNRendererConfiguration.m} (85%) rename platform/ios/platform/darwin/src/{MGLRendererFrontend.h => MLNRendererFrontend.h} (87%) rename platform/ios/platform/darwin/src/{MGLSettings.h => MLNSettings.h} (60%) rename platform/ios/platform/darwin/src/{MGLSettings.mm => MLNSettings.mm} (83%) rename platform/ios/platform/darwin/src/{MGLSettings_Private.h => MLNSettings_Private.h} (78%) rename platform/ios/platform/darwin/src/{MGLShape.h => MLNShape.h} (61%) rename platform/ios/platform/darwin/src/{MGLShape.mm => MLNShape.mm} (78%) create mode 100644 platform/ios/platform/darwin/src/MLNShapeCollection.h rename platform/ios/platform/darwin/src/{MGLShapeCollection.mm => MLNShapeCollection.mm} (72%) rename platform/ios/platform/darwin/src/{MGLShapeOfflineRegion.h => MLNShapeOfflineRegion.h} (78%) rename platform/ios/platform/darwin/src/{MGLShapeOfflineRegion.mm => MLNShapeOfflineRegion.mm} (80%) rename platform/ios/platform/darwin/src/{MGLShapeOfflineRegion_Private.h => MLNShapeOfflineRegion_Private.h} (83%) rename platform/ios/platform/darwin/src/{MGLShapeSource.h => MLNShapeSource.h} (68%) rename platform/ios/platform/darwin/src/{MGLShapeSource.mm => MLNShapeSource.mm} (66%) create mode 100644 platform/ios/platform/darwin/src/MLNShapeSource_Private.h rename platform/ios/platform/darwin/src/{MGLShape_Private.h => MLNShape_Private.h} (69%) rename platform/ios/platform/darwin/src/{MGLSource.h => MLNSource.h} (61%) rename platform/ios/platform/darwin/src/{MGLSource.mm => MLNSource.mm} (79%) rename platform/ios/platform/darwin/src/{MGLSource_Private.h => MLNSource_Private.h} (74%) rename platform/ios/platform/darwin/src/{MGLStyle.h => MLNStyle.h} (73%) rename platform/ios/platform/darwin/src/{MGLStyle.mm => MLNStyle.mm} (66%) rename platform/ios/platform/darwin/src/{MGLStyleLayer.h => MLNStyleLayer.h} (67%) rename platform/ios/platform/darwin/src/{MGLStyleLayer.h.ejs => MLNStyleLayer.h.ejs} (79%) rename platform/ios/platform/darwin/src/{MGLStyleLayer.mm => MLNStyleLayer.mm} (82%) rename platform/ios/platform/darwin/src/{MGLStyleLayer.mm.ejs => MLNStyleLayer.mm.ejs} (73%) rename platform/ios/platform/darwin/src/{MGLStyleLayerManager.h => MLNStyleLayerManager.h} (94%) rename platform/ios/platform/darwin/src/{MGLStyleLayerManager.mm => MLNStyleLayerManager.mm} (90%) rename platform/ios/platform/darwin/src/{MGLStyleLayer_Private.h => MLNStyleLayer_Private.h} (78%) rename platform/ios/platform/darwin/src/{MGLStyleLayer_Private.h.ejs => MLNStyleLayer_Private.h.ejs} (87%) rename platform/ios/platform/darwin/src/{MGLStyleValue.h => MLNStyleValue.h} (51%) rename platform/ios/platform/darwin/src/{MGLStyleValue.mm => MLNStyleValue.mm} (66%) rename platform/ios/platform/darwin/src/{MGLStyleValue_Private.h => MLNStyleValue_Private.h} (76%) create mode 100644 platform/ios/platform/darwin/src/MLNStyle_Private.h rename platform/ios/platform/darwin/src/{MGLTilePyramidOfflineRegion.h => MLNTilePyramidOfflineRegion.h} (79%) rename platform/ios/platform/darwin/src/{MGLTilePyramidOfflineRegion.mm => MLNTilePyramidOfflineRegion.mm} (78%) rename platform/ios/platform/darwin/src/{MGLTilePyramidOfflineRegion_Private.h => MLNTilePyramidOfflineRegion_Private.h} (82%) rename platform/ios/platform/darwin/src/{MGLTileServerOptions.h => MLNTileServerOptions.h} (86%) rename platform/ios/platform/darwin/src/{MGLTileServerOptions.mm => MLNTileServerOptions.mm} (81%) rename platform/ios/platform/darwin/src/{MGLTileSource.h => MLNTileSource.h} (71%) rename platform/ios/platform/darwin/src/{MGLTileSource.mm => MLNTileSource.mm} (56%) rename platform/ios/platform/darwin/src/{MGLTileSource_Private.h => MLNTileSource_Private.h} (65%) rename platform/ios/platform/darwin/src/{MGLTypes.h => MLNTypes.h} (64%) create mode 100644 platform/ios/platform/darwin/src/MLNTypes.m rename platform/ios/platform/darwin/src/{MGLValueEvaluator.h => MLNValueEvaluator.h} (100%) rename platform/ios/platform/darwin/src/{MGLVectorStyleLayer.h => MLNVectorStyleLayer.h} (71%) rename platform/ios/platform/darwin/src/{MGLVectorStyleLayer.mm => MLNVectorStyleLayer.mm} (73%) rename platform/ios/platform/darwin/src/{MGLVectorTileSource.h => MLNVectorTileSource.h} (80%) rename platform/ios/platform/darwin/src/{MGLVectorTileSource.mm => MLNVectorTileSource.mm} (79%) rename platform/ios/platform/darwin/src/{MGLVectorTileSource_Private.h => MLNVectorTileSource_Private.h} (82%) rename platform/ios/platform/darwin/src/{NSArray+MGLAdditions.h => NSArray+MLNAdditions.h} (96%) rename platform/ios/platform/darwin/src/{NSArray+MGLAdditions.mm => NSArray+MLNAdditions.mm} (89%) rename platform/ios/platform/darwin/src/{NSBundle+MGLAdditions.h => NSBundle+MLNAdditions.h} (92%) rename platform/ios/platform/darwin/src/{NSBundle+MGLAdditions.mm => NSBundle+MLNAdditions.mm} (82%) rename platform/ios/platform/darwin/src/{NSCoder+MGLAdditions.h => NSCoder+MLNAdditions.h} (68%) rename platform/ios/platform/darwin/src/{NSCoder+MGLAdditions.mm => NSCoder+MLNAdditions.mm} (74%) rename platform/ios/platform/darwin/src/{NSComparisonPredicate+MGLAdditions.h => NSComparisonPredicate+MLNAdditions.h} (60%) rename platform/ios/platform/darwin/src/{NSComparisonPredicate+MGLAdditions.mm => NSComparisonPredicate+MLNAdditions.mm} (97%) rename platform/ios/platform/darwin/src/{NSCompoundPredicate+MGLAdditions.h => NSCompoundPredicate+MLNAdditions.h} (61%) rename platform/ios/platform/darwin/src/{NSCompoundPredicate+MGLAdditions.mm => NSCompoundPredicate+MLNAdditions.mm} (75%) rename platform/ios/platform/darwin/src/{NSDate+MGLAdditions.h => NSDate+MLNAdditions.h} (60%) rename platform/ios/platform/darwin/src/{NSDate+MGLAdditions.mm => NSDate+MLNAdditions.mm} (58%) rename platform/ios/platform/darwin/src/{NSDictionary+MGLAdditions.h => NSDictionary+MLNAdditions.h} (80%) rename platform/ios/platform/darwin/src/{NSDictionary+MGLAdditions.mm => NSDictionary+MLNAdditions.mm} (80%) rename platform/ios/platform/darwin/src/{NSException+MGLAdditions.h => NSException+MLNAdditions.h} (58%) rename platform/ios/platform/darwin/src/{NSExpression+MGLAdditions.h => NSExpression+MLNAdditions.h} (89%) rename platform/ios/platform/darwin/src/{NSExpression+MGLAdditions.mm => NSExpression+MLNAdditions.mm} (90%) rename platform/ios/platform/darwin/src/{NSExpression+MGLPrivateAdditions.h => NSExpression+MLNPrivateAdditions.h} (76%) rename platform/ios/platform/darwin/src/{NSPredicate+MGLAdditions.h => NSPredicate+MLNAdditions.h} (90%) rename platform/ios/platform/darwin/src/{NSPredicate+MGLAdditions.mm => NSPredicate+MLNAdditions.mm} (86%) rename platform/ios/platform/darwin/src/{NSPredicate+MGLPrivateAdditions.h => NSPredicate+MLNPrivateAdditions.h} (72%) rename platform/ios/platform/darwin/src/{NSString+MGLAdditions.h => NSString+MLNAdditions.h} (94%) rename platform/ios/platform/darwin/src/{NSString+MGLAdditions.m => NSString+MLNAdditions.m} (96%) rename platform/ios/platform/darwin/src/{NSURL+MGLAdditions.h => NSURL+MLNAdditions.h} (89%) rename platform/ios/platform/darwin/src/{NSURL+MGLAdditions.m => NSURL+MLNAdditions.m} (84%) delete mode 100644 platform/ios/platform/darwin/src/NSValue+MGLAdditions.m rename platform/ios/platform/darwin/src/{NSValue+MGLAdditions.h => NSValue+MLNAdditions.h} (59%) create mode 100644 platform/ios/platform/darwin/src/NSValue+MLNAdditions.m rename platform/ios/platform/darwin/src/{NSValue+MGLStyleAttributeAdditions.h => NSValue+MLNStyleAttributeAdditions.h} (88%) rename platform/ios/platform/darwin/src/{NSValue+MGLStyleAttributeAdditions.mm => NSValue+MLNStyleAttributeAdditions.mm} (75%) rename platform/ios/platform/darwin/test/{MGLAttributionInfoTests.m => MLNAttributionInfoTests.m} (83%) rename platform/ios/platform/darwin/test/{MGLClockDirectionFormatterTests.m => MLNClockDirectionFormatterTests.m} (91%) rename platform/ios/platform/darwin/test/{MGLCodingTests.mm => MLNCodingTests.mm} (79%) rename platform/ios/platform/darwin/test/{MGLCompassDirectionFormatterTests.m => MLNCompassDirectionFormatterTests.m} (93%) rename platform/ios/platform/darwin/test/{MGLComputedShapeSourceTests.m => MLNComputedShapeSourceTests.m} (60%) rename platform/ios/platform/darwin/test/{MGLCoordinateFormatterTests.m => MLNCoordinateFormatterTests.m} (90%) rename platform/ios/platform/darwin/test/{MGLDistanceFormatterTests.m => MLNDistanceFormatterTests.m} (83%) rename platform/ios/platform/darwin/test/{MGLDocumentationExampleTests.swift => MLNDocumentationExampleTests.swift} (74%) rename platform/ios/platform/darwin/test/{MGLDocumentationGuideTests.swift => MLNDocumentationGuideTests.swift} (81%) rename platform/ios/platform/darwin/test/{MGLExpressionTests.mm => MLNExpressionTests.mm} (81%) rename platform/ios/platform/darwin/test/{MGLFeatureTests.mm => MLNFeatureTests.mm} (80%) rename platform/ios/platform/darwin/test/{MGLGeometryTests.mm => MLNGeometryTests.mm} (55%) rename platform/ios/platform/darwin/test/{MGLHeatmapColorTests.mm => MLNHeatmapColorTests.mm} (85%) rename platform/ios/platform/darwin/test/{MGLImageSourceTests.m => MLNImageSourceTests.m} (59%) rename platform/ios/platform/darwin/test/{MGLImageTests.mm => MLNImageTests.mm} (85%) rename platform/ios/platform/darwin/test/{MGLLightTest.mm.ejs => MLNLightTest.mm.ejs} (61%) rename platform/ios/platform/darwin/test/{MGLMapCameraTests.m => MLNMapCameraTests.m} (91%) rename platform/ios/platform/darwin/test/{MGLMapProjectionTests.m => MLNMapProjectionTests.m} (77%) rename platform/ios/platform/darwin/test/{MGLMapSnapshotterTests.m => MLNMapSnapshotterTests.m} (74%) rename platform/ios/platform/darwin/test/{MGLMapViewTests.m => MLNMapViewTests.m} (81%) rename platform/ios/platform/darwin/test/{MGLNSDateAdditionsTests.mm => MLNNSDateAdditionsTests.mm} (54%) rename platform/ios/platform/darwin/test/{MGLNSStringAdditionsTests.m => MLNNSStringAdditionsTests.m} (98%) rename platform/ios/platform/darwin/test/{MGLOfflinePackTests.mm => MLNOfflinePackTests.mm} (73%) rename platform/ios/platform/darwin/test/{MGLOfflineRegionTests.m => MLNOfflineRegionTests.m} (68%) rename platform/ios/platform/darwin/test/{MGLOfflineStorageTests.mm => MLNOfflineStorageTests.mm} (80%) rename platform/ios/platform/darwin/test/{MGLPredicateTests.mm => MLNPredicateTests.mm} (89%) rename platform/ios/platform/darwin/test/{MGLRendererConfigurationTests.m => MLNRendererConfigurationTests.m} (72%) rename platform/ios/platform/darwin/test/{MGLResourceTests.mm => MLNResourceTests.mm} (97%) rename platform/ios/platform/darwin/test/{MGLSDKTestHelpers.swift => MLNSDKTestHelpers.swift} (96%) rename platform/ios/platform/darwin/test/{MGLShapeSourceTests.mm => MLNShapeSourceTests.mm} (66%) rename platform/ios/platform/darwin/test/{MGLSourceQueryTests.m => MLNSourceQueryTests.m} (69%) rename platform/ios/platform/darwin/test/{MGLStyleLayerTests.h => MLNStyleLayerTests.h} (56%) rename platform/ios/platform/darwin/test/{MGLStyleLayerTests.m => MLNStyleLayerTests.m} (90%) rename platform/ios/platform/darwin/test/{MGLStyleLayerTests.mm.ejs => MLNStyleLayerTests.mm.ejs} (88%) rename platform/ios/platform/darwin/test/{MGLStyleTests.mm => MLNStyleTests.mm} (71%) rename platform/ios/platform/darwin/test/{MGLTestAssertionHandler.h => MLNTestAssertionHandler.h} (89%) rename platform/ios/platform/darwin/test/{MGLTestAssertionHandler.m => MLNTestAssertionHandler.m} (96%) rename platform/ios/platform/darwin/test/{MGLTestUtility.h => MLNTestUtility.h} (92%) rename platform/ios/platform/darwin/test/{MGLTileSetTests.mm => MLNTileSetTests.mm} (71%) rename platform/ios/platform/darwin/test/{MGLVersionNumber.m => MLNVersionNumber.m} (68%) rename platform/ios/platform/darwin/test/Media.xcassets/Fixtures/{MGLMapSnapshotterTests => MLNMapSnapshotterTests}/Contents.json (100%) rename platform/ios/platform/darwin/test/Media.xcassets/Fixtures/{MGLMapSnapshotterTests => MLNMapSnapshotterTests}/PingFang.imageset/Contents.json (100%) rename platform/ios/platform/darwin/test/Media.xcassets/Fixtures/{MGLMapSnapshotterTests => MLNMapSnapshotterTests}/PingFang.imageset/actualImage.png (100%) rename platform/ios/platform/darwin/test/Media.xcassets/Fixtures/{MGLMapSnapshotterTests => MLNMapSnapshotterTests}/PingFang.imageset/expected.png (100%) rename platform/ios/platform/darwin/test/Media.xcassets/Fixtures/{MGLMapSnapshotterTests => MLNMapSnapshotterTests}/background.imageset/Contents.json (100%) rename platform/ios/platform/darwin/test/Media.xcassets/Fixtures/{MGLMapSnapshotterTests => MLNMapSnapshotterTests}/background.imageset/background.png (100%) rename platform/ios/platform/ios/Integration Tests/Annotation Tests/{MGLAnnotationViewIntegrationTests.mm => MLNAnnotationViewIntegrationTests.mm} (90%) rename platform/ios/platform/ios/Integration Tests/Camera Tests/{MGLCameraTransitionFinishTests.mm => MLNCameraTransitionFinishTests.mm} (66%) rename platform/ios/platform/ios/Integration Tests/Camera Tests/{MGLCameraTransitionTests.mm => MLNCameraTransitionTests.mm} (81%) delete mode 100644 platform/ios/platform/ios/Integration Tests/MGLMapViewIntegrationTest.h delete mode 100644 platform/ios/platform/ios/Integration Tests/MGLStyleURLIntegrationTest.m delete mode 100644 platform/ios/platform/ios/Integration Tests/MGLTestLocationManager.h rename platform/ios/platform/ios/Integration Tests/{MGLIntegrationTestCase.h => MLNIntegrationTestCase.h} (67%) rename platform/ios/platform/ios/Integration Tests/{MGLIntegrationTestCase.m => MLNIntegrationTestCase.m} (78%) create mode 100644 platform/ios/platform/ios/Integration Tests/MLNMapViewIntegrationTest.h rename platform/ios/platform/ios/Integration Tests/{MGLMapViewIntegrationTest.m => MLNMapViewIntegrationTest.m} (78%) rename platform/ios/platform/ios/Integration Tests/{MGLMapViewPendingBlockTests.m => MLNMapViewPendingBlockTests.m} (89%) rename platform/ios/platform/ios/Integration Tests/{MGLNetworkConfigurationIntegrationTests.mm => MLNNetworkConfigurationIntegrationTests.mm} (77%) rename platform/ios/platform/ios/Integration Tests/{MGLShapeSourceTests.m => MLNShapeSourceTests.m} (76%) rename platform/ios/platform/ios/Integration Tests/{MGLSourceTests.swift => MLNSourceTests.swift} (84%) rename platform/ios/platform/ios/Integration Tests/{MGLStyleLayerIntegrationTests.m => MLNStyleLayerIntegrationTests.m} (83%) create mode 100644 platform/ios/platform/ios/Integration Tests/MLNStyleURLIntegrationTest.m create mode 100644 platform/ios/platform/ios/Integration Tests/MLNTestLocationManager.h rename platform/ios/platform/ios/Integration Tests/{MGLTestLocationManager.m => MLNTestLocationManager.m} (94%) rename platform/ios/platform/ios/Integration Tests/Snapshotter Tests/{MGLMapSnapshotterSwiftTests.swift => MLNMapSnapshotterSwiftTests.swift} (77%) rename platform/ios/platform/ios/Integration Tests/Snapshotter Tests/{MGLMapSnapshotterTest.m => MLNMapSnapshotterTest.m} (75%) create mode 100644 platform/ios/platform/ios/Mapbox.playground/playground.xcworkspace/contents.xcworkspacedata rename platform/ios/platform/ios/app/{MGLMapView_Experimental.h => MLNMapView_Experimental.h} (95%) delete mode 100644 platform/ios/platform/ios/src/MGLAnnotationContainerView.h delete mode 100644 platform/ios/platform/ios/src/MGLAnnotationContainerView_Private.h delete mode 100644 platform/ios/platform/ios/src/MGLAnnotationView_Private.h delete mode 100644 platform/ios/platform/ios/src/MGLCompassButton_Private.h delete mode 100644 platform/ios/platform/ios/src/MGLFaux3DUserLocationAnnotationView.h delete mode 100644 platform/ios/platform/ios/src/MGLUserLocationAnnotationView_Private.h delete mode 100644 platform/ios/platform/ios/src/MGLUserLocationHeadingArrowLayer.h delete mode 100644 platform/ios/platform/ios/src/MGLUserLocationHeadingBeamLayer.h create mode 100644 platform/ios/platform/ios/src/MLNAnnotationContainerView.h rename platform/ios/platform/ios/src/{MGLAnnotationContainerView.m => MLNAnnotationContainerView.m} (61%) create mode 100644 platform/ios/platform/ios/src/MLNAnnotationContainerView_Private.h rename platform/ios/platform/ios/src/{MGLAnnotationImage.h => MLNAnnotationImage.h} (90%) rename platform/ios/platform/ios/src/{MGLAnnotationImage.m => MLNAnnotationImage.m} (78%) rename platform/ios/platform/ios/src/{MGLAnnotationImage_Private.h => MLNAnnotationImage_Private.h} (51%) rename platform/ios/platform/ios/src/{MGLAnnotationView.h => MLNAnnotationView.h} (88%) rename platform/ios/platform/ios/src/{MGLAnnotationView.mm => MLNAnnotationView.mm} (82%) create mode 100644 platform/ios/platform/ios/src/MLNAnnotationView_Private.h rename platform/ios/platform/ios/src/{MGLCalloutView.h => MLNCalloutView.h} (81%) rename platform/ios/platform/ios/src/{MGLCameraChangeReason.h => MLNCameraChangeReason.h} (53%) rename platform/ios/platform/ios/src/{MGLCompactCalloutView.h => MLNCompactCalloutView.h} (65%) rename platform/ios/platform/ios/src/{MGLCompactCalloutView.m => MLNCompactCalloutView.m} (72%) rename platform/ios/platform/ios/src/{MGLCompassButton.h => MLNCompassButton.h} (70%) rename platform/ios/platform/ios/src/{MGLCompassButton.mm => MLNCompassButton.mm} (78%) create mode 100644 platform/ios/platform/ios/src/MLNCompassButton_Private.h create mode 100644 platform/ios/platform/ios/src/MLNFaux3DUserLocationAnnotationView.h rename platform/ios/platform/ios/src/{MGLFaux3DUserLocationAnnotationView.mm => MLNFaux3DUserLocationAnnotationView.mm} (87%) rename platform/ios/platform/ios/src/{MGLMapAccessibilityElement.h => MLNMapAccessibilityElement.h} (50%) rename platform/ios/platform/ios/src/{MGLMapAccessibilityElement.mm => MLNMapAccessibilityElement.mm} (84%) rename platform/ios/platform/ios/src/{MGLMapProjection.h => MLNMapProjection.h} (81%) rename platform/ios/platform/ios/src/{MGLMapProjection.mm => MLNMapProjection.mm} (74%) rename platform/ios/platform/ios/src/{MGLMapView+IBAdditions.h => MLNMapView+IBAdditions.h} (91%) rename platform/ios/platform/ios/src/{MGLMapView+Impl.h => MLNMapView+Impl.h} (91%) rename platform/ios/platform/ios/src/{MGLMapView+Impl.mm => MLNMapView+Impl.mm} (64%) rename platform/ios/platform/ios/src/{MGLMapView+OpenGL.h => MLNMapView+OpenGL.h} (75%) rename platform/ios/platform/ios/src/{MGLMapView+OpenGL.mm => MLNMapView+OpenGL.mm} (68%) rename platform/ios/platform/ios/src/{MGLMapView.h => MLNMapView.h} (86%) rename platform/ios/platform/ios/src/{MGLMapView.mm => MLNMapView.mm} (81%) rename platform/ios/platform/ios/src/{MGLMapViewDelegate.h => MLNMapViewDelegate.h} (84%) rename platform/ios/platform/ios/src/{MGLMapView_Private.h => MLNMapView_Private.h} (74%) rename platform/ios/platform/ios/src/{MGLScaleBar.h => MLNScaleBar.h} (92%) rename platform/ios/platform/ios/src/{MGLScaleBar.mm => MLNScaleBar.mm} (87%) rename platform/ios/platform/ios/src/{MGLUserLocation.h => MLNUserLocation.h} (80%) rename platform/ios/platform/ios/src/{MGLUserLocation.m => MLNUserLocation.m} (88%) rename platform/ios/platform/ios/src/{MGLUserLocationAnnotationView.h => MLNUserLocationAnnotationView.h} (83%) rename platform/ios/platform/ios/src/{MGLUserLocationAnnotationView.m => MLNUserLocationAnnotationView.m} (76%) rename platform/ios/platform/ios/src/{MGLUserLocationAnnotationViewStyle.h => MLNUserLocationAnnotationViewStyle.h} (93%) rename platform/ios/platform/ios/src/{MGLUserLocationAnnotationViewStyle.m => MLNUserLocationAnnotationViewStyle.m} (66%) create mode 100644 platform/ios/platform/ios/src/MLNUserLocationAnnotationView_Private.h create mode 100644 platform/ios/platform/ios/src/MLNUserLocationHeadingArrowLayer.h rename platform/ios/platform/ios/src/{MGLUserLocationHeadingArrowLayer.m => MLNUserLocationHeadingArrowLayer.m} (77%) create mode 100644 platform/ios/platform/ios/src/MLNUserLocationHeadingBeamLayer.h rename platform/ios/platform/ios/src/{MGLUserLocationHeadingBeamLayer.m => MLNUserLocationHeadingBeamLayer.m} (82%) rename platform/ios/platform/ios/src/{MGLUserLocationHeadingIndicator.h => MLNUserLocationHeadingIndicator.h} (53%) rename platform/ios/platform/ios/src/{MGLUserLocation_Private.h => MLNUserLocation_Private.h} (54%) rename platform/ios/platform/ios/src/{NSOrthography+MGLAdditions.h => NSOrthography+MLNAdditions.h} (90%) rename platform/ios/platform/ios/src/{NSOrthography+MGLAdditions.m => NSOrthography+MLNAdditions.m} (93%) rename platform/ios/platform/ios/src/{UIColor+MGLAdditions.h => UIColor+MLNAdditions.h} (87%) rename platform/ios/platform/ios/src/{UIColor+MGLAdditions.mm => UIColor+MLNAdditions.mm} (96%) rename platform/ios/platform/ios/src/{UIDevice+MGLAdditions.h => UIDevice+MLNAdditions.h} (71%) rename platform/ios/platform/ios/src/{UIDevice+MGLAdditions.m => UIDevice+MLNAdditions.m} (94%) rename platform/ios/platform/ios/src/{UIImage+MGLAdditions.h => UIImage+MLNAdditions.h} (65%) rename platform/ios/platform/ios/src/{UIImage+MGLAdditions.mm => UIImage+MLNAdditions.mm} (86%) rename platform/ios/platform/ios/src/{UIView+MGLAdditions.h => UIView+MLNAdditions.h} (92%) rename platform/ios/platform/ios/src/{UIView+MGLAdditions.m => UIView+MLNAdditions.m} (95%) rename platform/ios/platform/ios/src/{UIViewController+MGLAdditions.h => UIViewController+MLNAdditions.h} (77%) rename platform/ios/platform/ios/src/{UIViewController+MGLAdditions.m => UIViewController+MLNAdditions.m} (85%) delete mode 100644 platform/ios/platform/ios/test/MGLMapViewDelegateIntegrationTests.swift rename platform/ios/platform/ios/test/{MGLAnnotationViewIntegrationTests.swift => MLNAnnotationViewIntegrationTests.swift} (81%) rename platform/ios/platform/ios/test/{MGLAnnotationViewTests.m => MLNAnnotationViewTests.m} (68%) rename platform/ios/platform/ios/test/{MGLMapAccessibilityElementTests.m => MLNMapAccessibilityElementTests.m} (72%) rename platform/ios/platform/ios/test/{MGLMapViewCompassViewTests.mm => MLNMapViewCompassViewTests.mm} (83%) rename platform/ios/platform/ios/test/{MGLMapViewContentInsetTests.m => MLNMapViewContentInsetTests.m} (95%) create mode 100644 platform/ios/platform/ios/test/MLNMapViewDelegateIntegrationTests.swift rename platform/ios/platform/ios/test/{MGLMapViewDirectionTests.mm => MLNMapViewDirectionTests.mm} (87%) rename platform/ios/platform/ios/test/{MGLMapViewGestureRecognizerTests.mm => MLNMapViewGestureRecognizerTests.mm} (89%) rename platform/ios/platform/ios/test/{MGLMapViewLayoutTests.m => MLNMapViewLayoutTests.m} (89%) rename platform/ios/platform/ios/test/{MGLMapViewPitchTests.m => MLNMapViewPitchTests.m} (94%) rename platform/ios/platform/ios/test/{MGLMapViewScaleBarTests.m => MLNMapViewScaleBarTests.m} (86%) rename platform/ios/platform/ios/test/{MGLMapViewZoomTests.mm => MLNMapViewZoomTests.mm} (90%) rename platform/ios/platform/ios/test/{MGLMockGestureRecognizers.h => MLNMockGestureRecognizers.h} (100%) rename platform/ios/platform/ios/test/{MGLMockGestureRecognizers.m => MLNMockGestureRecognizers.m} (97%) rename platform/ios/platform/ios/test/{MGLNSOrthographyAdditionsTests.m => MLNNSOrthographyAdditionsTests.m} (56%) rename platform/ios/platform/ios/test/{MGLNetworkConfigurationTests.m => MLNNetworkConfigurationTests.m} (87%) delete mode 100644 platform/ios/platform/macos/app/MGLStyle+MBXAdditions.h create mode 100644 platform/ios/platform/macos/app/MLNStyle+MBXAdditions.h rename platform/ios/platform/macos/app/{MGLStyle+MBXAdditions.m => MLNStyle+MBXAdditions.m} (69%) rename platform/ios/platform/macos/sdk/Base.lproj/{MGLAnnotationCallout.xib => MLNAnnotationCallout.xib} (100%) rename platform/ios/platform/macos/src/{MGLAnnotationImage.h => MLNAnnotationImage.h} (89%) rename platform/ios/platform/macos/src/{MGLAnnotationImage.m => MLNAnnotationImage.m} (89%) rename platform/ios/platform/macos/src/{MGLAnnotationImage_Private.h => MLNAnnotationImage_Private.h} (83%) rename platform/ios/platform/macos/src/{MGLAttributionButton.h => MLNAttributionButton.h} (54%) rename platform/ios/platform/macos/src/{MGLAttributionButton.mm => MLNAttributionButton.mm} (85%) rename platform/ios/platform/macos/src/{MGLCompassCell.h => MLNCompassCell.h} (66%) rename platform/ios/platform/macos/src/{MGLCompassCell.m => MLNCompassCell.m} (95%) rename platform/ios/platform/macos/src/{MGLMapView+IBAdditions.h => MLNMapView+IBAdditions.h} (93%) rename platform/ios/platform/macos/src/{MGLMapView+IBAdditions.mm => MLNMapView+IBAdditions.mm} (94%) rename platform/ios/platform/macos/src/{MGLMapView+Impl.h => MLNMapView+Impl.h} (84%) rename platform/ios/platform/macos/src/{MGLMapView+Impl.mm => MLNMapView+Impl.mm} (65%) rename platform/ios/platform/macos/src/{MGLMapView+OpenGL.h => MLNMapView+OpenGL.h} (76%) rename platform/ios/platform/macos/src/{MGLMapView+OpenGL.mm => MLNMapView+OpenGL.mm} (61%) rename platform/ios/platform/macos/src/{MGLMapView.h => MLNMapView.h} (89%) rename platform/ios/platform/macos/src/{MGLMapView.mm => MLNMapView.mm} (81%) rename platform/ios/platform/macos/src/{MGLMapViewDelegate.h => MLNMapViewDelegate.h} (82%) rename platform/ios/platform/macos/src/{MGLMapView_Private.h => MLNMapView_Private.h} (93%) rename platform/ios/platform/macos/src/{MGLOpenGLLayer.h => MLNOpenGLLayer.h} (81%) rename platform/ios/platform/macos/src/{MGLOpenGLLayer.mm => MLNOpenGLLayer.mm} (91%) rename platform/ios/platform/macos/src/{NSColor+MGLAdditions.h => NSColor+MLNAdditions.h} (89%) rename platform/ios/platform/macos/src/{NSColor+MGLAdditions.mm => NSColor+MLNAdditions.mm} (97%) rename platform/ios/platform/macos/src/{NSImage+MGLAdditions.h => NSImage+MLNAdditions.h} (65%) rename platform/ios/platform/macos/src/{NSImage+MGLAdditions.mm => NSImage+MLNAdditions.mm} (85%) rename platform/ios/platform/macos/src/{NSProcessInfo+MGLAdditions.h => NSProcessInfo+MLNAdditions.h} (83%) rename platform/ios/platform/macos/src/{NSProcessInfo+MGLAdditions.m => NSProcessInfo+MLNAdditions.m} (70%) delete mode 100644 platform/ios/platform/macos/test/MGLMapViewDelegateIntegrationTests.swift rename platform/ios/platform/macos/test/{MGLAnnotationTests.m => MLNAnnotationTests.m} (80%) rename platform/ios/platform/macos/test/{MGLAttributionButtonTests.m => MLNAttributionButtonTests.m} (75%) create mode 100644 platform/ios/platform/macos/test/MLNMapViewDelegateIntegrationTests.swift diff --git a/bin/offline.cpp b/bin/offline.cpp index d5f9ad708..102560800 100644 --- a/bin/offline.cpp +++ b/bin/offline.cpp @@ -160,7 +160,7 @@ int main(int argc, char *argv[]) { } }(); - const char* apiEnv = getenv("MGL_API_KEY"); + const char* apiEnv = getenv("MLN_API_KEY"); const std::string apiKey = tokenValue ? args::get(tokenValue) : (apiEnv ? apiEnv : std::string()); if (apiBaseValue) { diff --git a/bin/render.cpp b/bin/render.cpp index b185b924c..3f704fe02 100644 --- a/bin/render.cpp +++ b/bin/render.cpp @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) { const std::string asset_root = assetsValue ? args::get(assetsValue) : "."; // Try to load the apikey from the environment. - const char* apikeyEnv = getenv("MGL_API_KEY"); + const char* apikeyEnv = getenv("MLN_API_KEY"); const std::string apikey = apikeyValue ? args::get(apikeyValue) : (apikeyEnv ? apikeyEnv : std::string()); const bool debug = debugFlag ? args::get(debugFlag) : false; diff --git a/platform/android/DEVELOPING.md b/platform/android/DEVELOPING.md index 7ee31a3f2..e6770430a 100644 --- a/platform/android/DEVELOPING.md +++ b/platform/android/DEVELOPING.md @@ -89,7 +89,7 @@ With buck build support, Android Studio can complain about duplicate source file _The test application (used for development purposes) uses MapTiler vector tiles, which require a MapTiler account and API key._ -With the first gradle invocation, gradle will take the value of the `MGL_API_KEY` environment variable and save it to `MapboxGLAndroidSDKTestApp/src/main/res/values/developer-config.xml`. If the environment variable wasn't set, you can edit `developer-config.xml` manually and add your api key to the `api_key` resource. +With the first gradle invocation, gradle will take the value of the `MLN_API_KEY` environment variable and save it to `MapboxGLAndroidSDKTestApp/src/main/res/values/developer-config.xml`. If the environment variable wasn't set, you can edit `developer-config.xml` manually and add your api key to the `api_key` resource. ## Running project diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapLibreApplication.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapLibreApplication.kt index 18656685d..bf7c68c10 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapLibreApplication.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapLibreApplication.kt @@ -71,7 +71,7 @@ open class MapLibreApplication : MultiDexApplication() { private const val API_KEY_NOT_SET_MESSAGE = ( "In order to run the Test App you need to set a valid " + - "API key. During development, you can set the MGL_API_KEY environment variable for the SDK to " + + "API key. During development, you can set the MLN_API_KEY environment variable for the SDK to " + "automatically include it in the Test App. Otherwise, you can manually include it in the " + "res/values/developer-config.xml file in the MapboxGLAndroidSDKTestApp folder." ) diff --git a/platform/android/gradle/gradle-config.gradle b/platform/android/gradle/gradle-config.gradle index cb51edfd4..c9028e8d5 100644 --- a/platform/android/gradle/gradle-config.gradle +++ b/platform/android/gradle/gradle-config.gradle @@ -5,9 +5,9 @@ task apiKey { def tokenFile = new File("${projectDir}/src/main/res/values/developer-config.xml") if (!tokenFile.exists()) { - String apiKey = "$System.env.MGL_API_KEY" + String apiKey = "$System.env.MLN_API_KEY" if (apiKey == "null") { - System.out.println("You should set the MGL_API_KEY environment variable.") + System.out.println("You should set the MLN_API_KEY environment variable.") apiKey = "YOUR_API_KEY_GOES_HERE" } String tokenFileContents = "\n" + diff --git a/platform/darwin/BUILD.bazel b/platform/darwin/BUILD.bazel index 2e47b3043..c19709a68 100644 --- a/platform/darwin/BUILD.bazel +++ b/platform/darwin/BUILD.bazel @@ -9,7 +9,7 @@ objc_library( hdrs = [ "include/mbgl/interface/native_apple_interface.h", "include/mbgl/storage/reachability.h", - "include/mbgl/util/image+MGLAdditions.hpp", + "include/mbgl/util/image+MLNAdditions.hpp", ], copts = WARNING_FLAGS + MAPLIBRE_FLAGS + [ "-fmodules", @@ -42,7 +42,7 @@ objc_library( hdrs = [ "include/mbgl/interface/native_apple_interface.h", "include/mbgl/storage/reachability.h", - "include/mbgl/util/image+MGLAdditions.hpp", + "include/mbgl/util/image+MLNAdditions.hpp", ], copts = CPP_FLAGS + MAPLIBRE_FLAGS + [ "-fcxx-modules", diff --git a/platform/darwin/include/mbgl/interface/native_apple_interface.h b/platform/darwin/include/mbgl/interface/native_apple_interface.h index 407a2e0ad..1a6eba8db 100644 --- a/platform/darwin/include/mbgl/interface/native_apple_interface.h +++ b/platform/darwin/include/mbgl/interface/native_apple_interface.h @@ -2,13 +2,13 @@ NS_ASSUME_NONNULL_BEGIN -@class MGLNativeNetworkManager; +@class MLNNativeNetworkManager; -@protocol MGLNativeNetworkDelegate +@protocol MLNNativeNetworkDelegate @optional -- (NSURLSession *)sessionForNetworkManager:(MGLNativeNetworkManager *)networkManager; +- (NSURLSession *)sessionForNetworkManager:(MLNNativeNetworkManager *)networkManager; @required @@ -26,13 +26,13 @@ NS_ASSUME_NONNULL_BEGIN @end -#define MGL_APPLE_EXPORT __attribute__((visibility ("default"))) +#define MLN_APPLE_EXPORT __attribute__((visibility ("default"))) -@interface MGLNativeNetworkManager: NSObject +@interface MLNNativeNetworkManager: NSObject -+ (MGLNativeNetworkManager *)sharedManager; ++ (MLNNativeNetworkManager *)sharedManager; -@property (nonatomic, weak) id delegate; +@property (nonatomic, weak) id delegate; @property (nonatomic, readonly) NSURLSessionConfiguration *sessionConfiguration; diff --git a/platform/darwin/include/mbgl/storage/reachability.h b/platform/darwin/include/mbgl/storage/reachability.h index e7a00008b..bfcf78059 100644 --- a/platform/darwin/include/mbgl/storage/reachability.h +++ b/platform/darwin/include/mbgl/storage/reachability.h @@ -38,7 +38,7 @@ #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type #endif -extern NSString *const kMGLReachabilityChangedNotification; +extern NSString *const kMLNReachabilityChangedNotification; typedef NS_ENUM(NSInteger, NetworkStatus) { // Apple NetworkStatus Compatible Names. @@ -47,13 +47,13 @@ typedef NS_ENUM(NSInteger, NetworkStatus) { ReachableViaWWAN = 1 }; -@class MGLReachability; +@class MLNReachability; -typedef void (^NetworkReachable)(MGLReachability * reachability); -typedef void (^NetworkUnreachable)(MGLReachability * reachability); +typedef void (^NetworkReachable)(MLNReachability * reachability); +typedef void (^NetworkUnreachable)(MLNReachability * reachability); -@interface MGLReachability : NSObject +@interface MLNReachability : NSObject @property (nonatomic, copy) NetworkReachable reachableBlock; @property (nonatomic, copy) NetworkUnreachable unreachableBlock; diff --git a/platform/darwin/include/mbgl/util/image+MGLAdditions.hpp b/platform/darwin/include/mbgl/util/image+MLNAdditions.hpp similarity index 71% rename from platform/darwin/include/mbgl/util/image+MGLAdditions.hpp rename to platform/darwin/include/mbgl/util/image+MLNAdditions.hpp index c5343af4d..2ec75dae2 100644 --- a/platform/darwin/include/mbgl/util/image+MGLAdditions.hpp +++ b/platform/darwin/include/mbgl/util/image+MLNAdditions.hpp @@ -5,8 +5,8 @@ #include // Creates a CGImage from a PremultipliedImage, taking over the memory ownership. -CGImageRef CGImageCreateWithMGLPremultipliedImage(mbgl::PremultipliedImage&&); +CGImageRef CGImageCreateWithMLNPremultipliedImage(mbgl::PremultipliedImage&&); // Creates a PremultipliedImage by copying the pixels of the CGImage. // Does not alter the retain count of the supplied CGImage. -mbgl::PremultipliedImage MGLPremultipliedImageFromCGImage(CGImageRef); +mbgl::PremultipliedImage MLNPremultipliedImageFromCGImage(CGImageRef); diff --git a/platform/darwin/src/http_file_source.mm b/platform/darwin/src/http_file_source.mm index 8fc7e1b55..10f50fe98 100644 --- a/platform/darwin/src/http_file_source.mm +++ b/platform/darwin/src/http_file_source.mm @@ -87,7 +87,7 @@ public: Impl(const ResourceOptions& resourceOptions_, const ClientOptions& clientOptions_) : resourceOptions(resourceOptions_.clone()), clientOptions(clientOptions_.clone()) { @autoreleasepool { - NSURLSessionConfiguration *sessionConfig = MGLNativeNetworkManager.sharedManager.sessionConfiguration; + NSURLSessionConfiguration *sessionConfig = MLNNativeNetworkManager.sharedManager.sessionConfiguration; session = [NSURLSession sessionWithConfiguration:sessionConfig]; userAgent = getUserAgent(); @@ -141,7 +141,7 @@ NSString *HTTPFileSource::Impl::getUserAgent() const { NSBundle *sdkBundle = HTTPFileSource::Impl::getSDKBundle(); if (sdkBundle) { - NSString *versionString = sdkBundle.infoDictionary[@"MGLSemanticVersionString"]; + NSString *versionString = sdkBundle.infoDictionary[@"MLNSemanticVersionString"]; if (!versionString) { versionString = sdkBundle.infoDictionary[@"CFBundleShortVersionString"]; } @@ -213,7 +213,7 @@ HTTPFileSource::HTTPFileSource(const ResourceOptions& resourceOptions, const Cli HTTPFileSource::~HTTPFileSource() = default; -MGL_APPLE_EXPORT +MLN_APPLE_EXPORT BOOL isValidMapboxEndpoint(NSURL *url) { return ([url.host isEqualToString:@"mapbox.com"] || [url.host hasSuffix:@".mapbox.com"] || @@ -221,7 +221,7 @@ BOOL isValidMapboxEndpoint(NSURL *url) { [url.host hasSuffix:@".mapbox.cn"]); } -MGL_APPLE_EXPORT +MLN_APPLE_EXPORT NSURL *resourceURL(const Resource& resource) { NSURL *url = [NSURL URLWithString:@(resource.url.c_str())]; @@ -252,7 +252,7 @@ std::unique_ptr HTTPFileSource::request(const Resource& resource, @autoreleasepool { NSURL *url = resourceURL(resource); - [MGLNativeNetworkManager.sharedManager debugLog:@"Requesting URI: %@", url.relativePath]; + [MLNNativeNetworkManager.sharedManager debugLog:@"Requesting URI: %@", url.relativePath]; NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url]; if (resource.priorEtag) { @@ -268,14 +268,14 @@ std::unique_ptr HTTPFileSource::request(const Resource& resource, const bool isTile = resource.kind == mbgl::Resource::Kind::Tile; if (isTile) { - [MGLNativeNetworkManager.sharedManager startDownloadEvent:url.relativePath type:@"tile"]; + [MLNNativeNetworkManager.sharedManager startDownloadEvent:url.relativePath type:@"tile"]; } __block NSURLSession *session; // Use the delegate's session if there is one, otherwise use the one that // was created when this class was constructed. - MGLNativeNetworkManager *networkManager = MGLNativeNetworkManager.sharedManager; + MLNNativeNetworkManager *networkManager = MLNNativeNetworkManager.sharedManager; if ([networkManager.delegate respondsToSelector:@selector(sessionForNetworkManager:)]) { session = [networkManager.delegate sessionForNetworkManager:networkManager]; } @@ -292,15 +292,15 @@ std::unique_ptr HTTPFileSource::request(const Resource& resource, session = nil; if (error && [error code] == NSURLErrorCancelled) { - [MGLNativeNetworkManager.sharedManager cancelDownloadEventForResponse:res]; + [MLNNativeNetworkManager.sharedManager cancelDownloadEventForResponse:res]; return; } - [MGLNativeNetworkManager.sharedManager stopDownloadEventForResponse:res]; + [MLNNativeNetworkManager.sharedManager stopDownloadEventForResponse:res]; Response response; using Error = Response::Error; if (error) { - [MGLNativeNetworkManager.sharedManager errorLog:@"Requesting: %@ failed with error: %@", req.URL, error.debugDescription]; + [MLNNativeNetworkManager.sharedManager errorLog:@"Requesting: %@ failed with error: %@", req.URL, error.debugDescription]; if (data) { response.data = @@ -333,7 +333,7 @@ std::unique_ptr HTTPFileSource::request(const Resource& resource, } } else if ([res isKindOfClass:[NSHTTPURLResponse class]]) { const long responseCode = [(NSHTTPURLResponse *)res statusCode]; - [MGLNativeNetworkManager.sharedManager debugLog:@"Requesting %@ returned responseCode: %lu", res.URL.relativePath, responseCode]; + [MLNNativeNetworkManager.sharedManager debugLog:@"Requesting %@ returned responseCode: %lu", res.URL.relativePath, responseCode]; NSDictionary *headers = [(NSHTTPURLResponse *)res allHeaderFields]; NSString *cache_control = [headers objectForKey:@"Cache-Control"]; diff --git a/platform/darwin/src/image.mm b/platform/darwin/src/image.mm index 3a5adcca0..3abd70fa6 100644 --- a/platform/darwin/src/image.mm +++ b/platform/darwin/src/image.mm @@ -1,4 +1,4 @@ -#include +#include #import @@ -11,7 +11,7 @@ using CGDataProviderHandle = CFHandle; using CGContextHandle = CFHandle; -CGImageRef CGImageCreateWithMGLPremultipliedImage(mbgl::PremultipliedImage&& src) { +CGImageRef CGImageCreateWithMLNPremultipliedImage(mbgl::PremultipliedImage&& src) { // We're converting the PremultipliedImage's backing store to a CGDataProvider, and are taking // over ownership of the memory. CGDataProviderHandle provider(CGDataProviderCreateWithData( @@ -41,7 +41,7 @@ CGImageRef CGImageCreateWithMGLPremultipliedImage(mbgl::PremultipliedImage&& src NULL, false, kCGRenderingIntentDefault); } -mbgl::PremultipliedImage MGLPremultipliedImageFromCGImage(CGImageRef src) { +mbgl::PremultipliedImage MLNPremultipliedImageFromCGImage(CGImageRef src) { const size_t width = CGImageGetWidth(src); const size_t height = CGImageGetHeight(src); @@ -89,7 +89,7 @@ PremultipliedImage decodeImage(const std::string& source) { throw std::runtime_error("CGImageSourceCreateImageAtIndex failed"); } - return MGLPremultipliedImageFromCGImage(*image); + return MLNPremultipliedImageFromCGImage(*image); } } // namespace mbgl diff --git a/platform/darwin/src/local_glyph_rasterizer.mm b/platform/darwin/src/local_glyph_rasterizer.mm index e06ccb355..b724d56ec 100644 --- a/platform/darwin/src/local_glyph_rasterizer.mm +++ b/platform/darwin/src/local_glyph_rasterizer.mm @@ -64,9 +64,9 @@ public: Creates a new rasterizer with the given font names as a fallback. The fallback font names can also be specified in the style as a font stack - or in the `MGLIdeographicFontFamilyName` key of + or in the `MLNIdeographicFontFamilyName` key of `NSUserDefaults.standardUserDefaults`. The font stack takes precedence, - followed by the `MGLIdeographicFontFamilyName` user default, then finally + followed by the `MLNIdeographicFontFamilyName` user default, then finally the `fallbackFontNames_` parameter as a last resort. @param fallbackFontNames_ A list of font names, one per line. Each font @@ -77,7 +77,7 @@ public: */ Impl(const std::optional fallbackFontNames_) { - fallbackFontNames = [[NSUserDefaults standardUserDefaults] stringArrayForKey:@"MGLIdeographicFontFamilyName"]; + fallbackFontNames = [[NSUserDefaults standardUserDefaults] stringArrayForKey:@"MLNIdeographicFontFamilyName"]; if (fallbackFontNames_) { fallbackFontNames = [fallbackFontNames ?: @[] arrayByAddingObjectsFromArray:[@(fallbackFontNames_->c_str()) componentsSeparatedByString:@"\n"]]; } diff --git a/platform/darwin/src/native_apple_interface.m b/platform/darwin/src/native_apple_interface.m index 361ee181b..94fb1d5de 100644 --- a/platform/darwin/src/native_apple_interface.m +++ b/platform/darwin/src/native_apple_interface.m @@ -1,14 +1,14 @@ #import #import -@implementation MGLNativeNetworkManager +@implementation MLNNativeNetworkManager -static MGLNativeNetworkManager *instance = nil; +static MLNNativeNetworkManager *instance = nil; -+ (MGLNativeNetworkManager *)sharedManager { ++ (MLNNativeNetworkManager *)sharedManager { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - instance = [[MGLNativeNetworkManager alloc] init]; + instance = [[MLNNativeNetworkManager alloc] init]; }); return instance; } @@ -32,9 +32,9 @@ static MGLNativeNetworkManager *instance = nil; if (!configuration) { // For testing. Since we get a `nil` return when SDK is modular, we use // this for testing requests. - // Same as `[MGLNetworkConfiguration defaultSessionConfiguration]` in - // `MGLNetworkConfiguration.mm`. - configuration = [MGLNativeNetworkManager testSessionConfiguration]; + // Same as `[MLNNetworkConfiguration defaultSessionConfiguration]` in + // `MLNNetworkConfiguration.mm`. + configuration = [MLNNativeNetworkManager testSessionConfiguration]; } return configuration; diff --git a/platform/darwin/src/reachability.m b/platform/darwin/src/reachability.m index 4f7b83e62..84b69c974 100644 --- a/platform/darwin/src/reachability.m +++ b/platform/darwin/src/reachability.m @@ -35,10 +35,10 @@ #import -NSString *const kMGLReachabilityChangedNotification = @"kMGLReachabilityChangedNotification"; +NSString *const kMLNReachabilityChangedNotification = @"kMLNReachabilityChangedNotification"; -@interface MGLReachability () +@interface MLNReachability () @property (nonatomic, assign) SCNetworkReachabilityRef reachabilityRef; @property (nonatomic, strong) dispatch_queue_t reachabilitySerialQueue; @@ -73,7 +73,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea { #pragma unused (target) - MGLReachability *reachability = ((__bridge MGLReachability*)info); + MLNReachability *reachability = ((__bridge MLNReachability*)info); // We probably don't need an autoreleasepool here, as GCD docs state each queue has its own autorelease pool, // but what the heck eh? @@ -84,13 +84,13 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea } -@implementation MGLReachability +@implementation MLNReachability // MARK: - Class Constructor Methods +(instancetype)reachabilityWithHostName:(NSString*)hostname { - return [MGLReachability reachabilityWithHostname:hostname]; + return [MLNReachability reachabilityWithHostname:hostname]; } +(instancetype)reachabilityWithHostname:(NSString*)hostname @@ -456,7 +456,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea // this makes sure the change notification happens on the MAIN THREAD dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:kMGLReachabilityChangedNotification + [[NSNotificationCenter defaultCenter] postNotificationName:kMLNReachabilityChangedNotification object:self]; }); } diff --git a/platform/default/src/mbgl/gfx/headless_frontend.cpp b/platform/default/src/mbgl/gfx/headless_frontend.cpp index e5bed4479..3c700abdf 100644 --- a/platform/default/src/mbgl/gfx/headless_frontend.cpp +++ b/platform/default/src/mbgl/gfx/headless_frontend.cpp @@ -35,7 +35,7 @@ HeadlessFrontend::HeadlessFrontend(Size size_, gfx::BackendScope guard {*getBackend()}; // onStyleImageMissing might be called during a render. The user implemented method - // could trigger a call to MGLRenderFrontend#update which overwrites `updateParameters`. + // could trigger a call to MLNRenderFrontend#update which overwrites `updateParameters`. // Copy the shared pointer here so that the parameters aren't destroyed while `render(...)` is // still using them. auto updateParameters_ = updateParameters; diff --git a/platform/glfw/glfw_renderer_frontend.cpp b/platform/glfw/glfw_renderer_frontend.cpp index 46f130990..6c7335d6a 100644 --- a/platform/glfw/glfw_renderer_frontend.cpp +++ b/platform/glfw/glfw_renderer_frontend.cpp @@ -34,7 +34,7 @@ void GLFWRendererFrontend::render() { mbgl::gfx::BackendScope guard { glfwView.getRendererBackend(), mbgl::gfx::BackendScope::ScopeType::Implicit }; // onStyleImageMissing might be called during a render. The user implemented method - // could trigger a call to MGLRenderFrontend#update which overwrites `updateParameters`. + // could trigger a call to MLNRenderFrontend#update which overwrites `updateParameters`. // Copy the shared pointer here so that the parameters aren't destroyed while `render(...)` is // still using them. auto updateParameters_ = updateParameters; diff --git a/platform/glfw/main.cpp b/platform/glfw/main.cpp index c7df099c1..876486bf6 100644 --- a/platform/glfw/main.cpp +++ b/platform/glfw/main.cpp @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) { } // Set access token if present - const char* apikeyEnv = getenv("MGL_API_KEY"); + const char* apikeyEnv = getenv("MLN_API_KEY"); const std::string apikey = apikeyValue ? args::get(apikeyValue) : (apikeyEnv ? apikeyEnv : std::string()); auto mapTilerConfiguration = mbgl::TileServerOptions::MapTilerConfiguration(); diff --git a/platform/ios/.gitignore b/platform/ios/.gitignore index d24dbe510..f554384c3 100644 --- a/platform/ios/.gitignore +++ b/platform/ios/.gitignore @@ -53,45 +53,45 @@ mapbox-gl-native.code-workspace # generated file list will be in: # platform/ios/platform/darwin/scripts/generate-style-code.list -platform/darwin/src/MGLLight.h -platform/darwin/src/MGLLight.mm -platform/darwin/test/MGLLightTest.mm -platform/darwin/src/MGLBackgroundStyleLayer.h -platform/darwin/src/MGLBackgroundStyleLayer_Private.h -platform/darwin/src/MGLBackgroundStyleLayer.mm -platform/darwin/test/MGLBackgroundStyleLayerTests.mm -platform/darwin/src/MGLCircleStyleLayer.h -platform/darwin/src/MGLCircleStyleLayer_Private.h -platform/darwin/src/MGLCircleStyleLayer.mm -platform/darwin/test/MGLCircleStyleLayerTests.mm -platform/darwin/src/MGLFillStyleLayer.h -platform/darwin/src/MGLFillStyleLayer_Private.h -platform/darwin/src/MGLFillStyleLayer.mm -platform/darwin/test/MGLFillStyleLayerTests.mm -platform/darwin/src/MGLFillExtrusionStyleLayer.h -platform/darwin/src/MGLFillExtrusionStyleLayer_Private.h -platform/darwin/src/MGLFillExtrusionStyleLayer.mm -platform/darwin/test/MGLFillExtrusionStyleLayerTests.mm -platform/darwin/src/MGLHeatmapStyleLayer.h -platform/darwin/src/MGLHeatmapStyleLayer_Private.h -platform/darwin/src/MGLHeatmapStyleLayer.mm -platform/darwin/test/MGLHeatmapStyleLayerTests.mm -platform/darwin/src/MGLHillshadeStyleLayer.h -platform/darwin/src/MGLHillshadeStyleLayer_Private.h -platform/darwin/src/MGLHillshadeStyleLayer.mm -platform/darwin/test/MGLHillshadeStyleLayerTests.mm -platform/darwin/src/MGLLineStyleLayer.h -platform/darwin/src/MGLLineStyleLayer_Private.h -platform/darwin/src/MGLLineStyleLayer.mm -platform/darwin/test/MGLLineStyleLayerTests.mm -platform/darwin/src/MGLRasterStyleLayer.h -platform/darwin/src/MGLRasterStyleLayer_Private.h -platform/darwin/src/MGLRasterStyleLayer.mm -platform/darwin/test/MGLRasterStyleLayerTests.mm -platform/darwin/src/MGLSymbolStyleLayer.h -platform/darwin/src/MGLSymbolStyleLayer_Private.h -platform/darwin/src/MGLSymbolStyleLayer.mm -platform/darwin/test/MGLSymbolStyleLayerTests.mm +platform/darwin/src/MLNLight.h +platform/darwin/src/MLNLight.mm +platform/darwin/test/MLNLightTest.mm +platform/darwin/src/MLNBackgroundStyleLayer.h +platform/darwin/src/MLNBackgroundStyleLayer_Private.h +platform/darwin/src/MLNBackgroundStyleLayer.mm +platform/darwin/test/MLNBackgroundStyleLayerTests.mm +platform/darwin/src/MLNCircleStyleLayer.h +platform/darwin/src/MLNCircleStyleLayer_Private.h +platform/darwin/src/MLNCircleStyleLayer.mm +platform/darwin/test/MLNCircleStyleLayerTests.mm +platform/darwin/src/MLNFillStyleLayer.h +platform/darwin/src/MLNFillStyleLayer_Private.h +platform/darwin/src/MLNFillStyleLayer.mm +platform/darwin/test/MLNFillStyleLayerTests.mm +platform/darwin/src/MLNFillExtrusionStyleLayer.h +platform/darwin/src/MLNFillExtrusionStyleLayer_Private.h +platform/darwin/src/MLNFillExtrusionStyleLayer.mm +platform/darwin/test/MLNFillExtrusionStyleLayerTests.mm +platform/darwin/src/MLNHeatmapStyleLayer.h +platform/darwin/src/MLNHeatmapStyleLayer_Private.h +platform/darwin/src/MLNHeatmapStyleLayer.mm +platform/darwin/test/MLNHeatmapStyleLayerTests.mm +platform/darwin/src/MLNHillshadeStyleLayer.h +platform/darwin/src/MLNHillshadeStyleLayer_Private.h +platform/darwin/src/MLNHillshadeStyleLayer.mm +platform/darwin/test/MLNHillshadeStyleLayerTests.mm +platform/darwin/src/MLNLineStyleLayer.h +platform/darwin/src/MLNLineStyleLayer_Private.h +platform/darwin/src/MLNLineStyleLayer.mm +platform/darwin/test/MLNLineStyleLayerTests.mm +platform/darwin/src/MLNRasterStyleLayer.h +platform/darwin/src/MLNRasterStyleLayer_Private.h +platform/darwin/src/MLNRasterStyleLayer.mm +platform/darwin/test/MLNRasterStyleLayerTests.mm +platform/darwin/src/MLNSymbolStyleLayer.h +platform/darwin/src/MLNSymbolStyleLayer_Private.h +platform/darwin/src/MLNSymbolStyleLayer.mm +platform/darwin/test/MLNSymbolStyleLayerTests.mm platform/ios/docs/guides/For Style Authors.md platform/macos/docs/guides/For Style Authors.md platform/ios/docs/guides/Migrating to Expressions.md diff --git a/platform/ios/BUILD.bazel b/platform/ios/BUILD.bazel index 63f4abad2..6361b73f2 100644 --- a/platform/ios/BUILD.bazel +++ b/platform/ios/BUILD.bazel @@ -9,78 +9,78 @@ load("//bazel:flags.bzl", "CPP_FLAGS", "MAPLIBRE_FLAGS", "WARNING_FLAGS") # this wrong # A combination of Mapbox.h and all its headers' imports as recursively _PUBLIC_HEADERS = [ - "platform/darwin/src/MGLAnnotation.h", - "platform/darwin/src/MGLAttributedExpression.h", - "platform/darwin/src/MGLAttributionInfo.h", - "platform/darwin/src/MGLBackgroundStyleLayer.h", - "platform/darwin/src/MGLCircleStyleLayer.h", - "platform/darwin/src/MGLClockDirectionFormatter.h", - "platform/darwin/src/MGLCluster.h", - "platform/darwin/src/MGLCompassDirectionFormatter.h", - "platform/darwin/src/MGLComputedShapeSource.h", - "platform/darwin/src/MGLCoordinateFormatter.h", - "platform/darwin/src/MGLDefaultStyle.h", - "platform/darwin/src/MGLDistanceFormatter.h", - "platform/darwin/src/MGLFeature.h", - "platform/darwin/src/MGLFillExtrusionStyleLayer.h", - "platform/darwin/src/MGLFillStyleLayer.h", - "platform/darwin/src/MGLForegroundStyleLayer.h", - "platform/darwin/src/MGLFoundation.h", - "platform/darwin/src/MGLGeometry.h", - "platform/darwin/src/MGLHeatmapStyleLayer.h", - "platform/darwin/src/MGLHillshadeStyleLayer.h", - "platform/darwin/src/MGLImageSource.h", - "platform/darwin/src/MGLLight.h", - "platform/darwin/src/MGLLineStyleLayer.h", - "platform/darwin/src/MGLLocationManager.h", - "platform/darwin/src/MGLLoggingConfiguration.h", - "platform/darwin/src/MGLMapCamera.h", - "platform/darwin/src/MGLMapSnapshotter.h", - "platform/darwin/src/MGLMultiPoint.h", - "platform/darwin/src/MGLNetworkConfiguration.h", - "platform/darwin/src/MGLOfflinePack.h", - "platform/darwin/src/MGLOfflineRegion.h", - "platform/darwin/src/MGLOfflineStorage.h", - "platform/darwin/src/MGLOpenGLStyleLayer.h", - "platform/darwin/src/MGLOverlay.h", - "platform/darwin/src/MGLPointAnnotation.h", - "platform/darwin/src/MGLPointCollection.h", - "platform/darwin/src/MGLPolygon.h", - "platform/darwin/src/MGLPolyline.h", - "platform/darwin/src/MGLRasterDEMSource.h", - "platform/darwin/src/MGLRasterStyleLayer.h", - "platform/darwin/src/MGLRasterTileSource.h", - "platform/darwin/src/MGLSettings.h", - "platform/darwin/src/MGLShape.h", - "platform/darwin/src/MGLShapeCollection.h", - "platform/darwin/src/MGLShapeOfflineRegion.h", - "platform/darwin/src/MGLShapeSource.h", - "platform/darwin/src/MGLSource.h", - "platform/darwin/src/MGLStyle.h", - "platform/darwin/src/MGLStyleLayer.h", - "platform/darwin/src/MGLStyleValue.h", - "platform/darwin/src/MGLSymbolStyleLayer.h", - "platform/darwin/src/MGLTilePyramidOfflineRegion.h", - "platform/darwin/src/MGLTileServerOptions.h", - "platform/darwin/src/MGLTileSource.h", - "platform/darwin/src/MGLTypes.h", - "platform/darwin/src/MGLVectorStyleLayer.h", - "platform/darwin/src/MGLVectorTileSource.h", - "platform/darwin/src/NSExpression+MGLAdditions.h", - "platform/darwin/src/NSPredicate+MGLAdditions.h", - "platform/darwin/src/NSValue+MGLAdditions.h", - "platform/ios/src/MGLAnnotationImage.h", - "platform/ios/src/MGLAnnotationView.h", - "platform/ios/src/MGLCalloutView.h", - "platform/ios/src/MGLCameraChangeReason.h", - "platform/ios/src/MGLCompassButton.h", - "platform/ios/src/MGLMapProjection.h", - "platform/ios/src/MGLMapView+IBAdditions.h", - "platform/ios/src/MGLMapView.h", - "platform/ios/src/MGLMapViewDelegate.h", - "platform/ios/src/MGLUserLocation.h", - "platform/ios/src/MGLUserLocationAnnotationView.h", - "platform/ios/src/MGLUserLocationAnnotationViewStyle.h", + "platform/darwin/src/MLNAnnotation.h", + "platform/darwin/src/MLNAttributedExpression.h", + "platform/darwin/src/MLNAttributionInfo.h", + "platform/darwin/src/MLNBackgroundStyleLayer.h", + "platform/darwin/src/MLNCircleStyleLayer.h", + "platform/darwin/src/MLNClockDirectionFormatter.h", + "platform/darwin/src/MLNCluster.h", + "platform/darwin/src/MLNCompassDirectionFormatter.h", + "platform/darwin/src/MLNComputedShapeSource.h", + "platform/darwin/src/MLNCoordinateFormatter.h", + "platform/darwin/src/MLNDefaultStyle.h", + "platform/darwin/src/MLNDistanceFormatter.h", + "platform/darwin/src/MLNFeature.h", + "platform/darwin/src/MLNFillExtrusionStyleLayer.h", + "platform/darwin/src/MLNFillStyleLayer.h", + "platform/darwin/src/MLNForegroundStyleLayer.h", + "platform/darwin/src/MLNFoundation.h", + "platform/darwin/src/MLNGeometry.h", + "platform/darwin/src/MLNHeatmapStyleLayer.h", + "platform/darwin/src/MLNHillshadeStyleLayer.h", + "platform/darwin/src/MLNImageSource.h", + "platform/darwin/src/MLNLight.h", + "platform/darwin/src/MLNLineStyleLayer.h", + "platform/darwin/src/MLNLocationManager.h", + "platform/darwin/src/MLNLoggingConfiguration.h", + "platform/darwin/src/MLNMapCamera.h", + "platform/darwin/src/MLNMapSnapshotter.h", + "platform/darwin/src/MLNMultiPoint.h", + "platform/darwin/src/MLNNetworkConfiguration.h", + "platform/darwin/src/MLNOfflinePack.h", + "platform/darwin/src/MLNOfflineRegion.h", + "platform/darwin/src/MLNOfflineStorage.h", + "platform/darwin/src/MLNOpenGLStyleLayer.h", + "platform/darwin/src/MLNOverlay.h", + "platform/darwin/src/MLNPointAnnotation.h", + "platform/darwin/src/MLNPointCollection.h", + "platform/darwin/src/MLNPolygon.h", + "platform/darwin/src/MLNPolyline.h", + "platform/darwin/src/MLNRasterDEMSource.h", + "platform/darwin/src/MLNRasterStyleLayer.h", + "platform/darwin/src/MLNRasterTileSource.h", + "platform/darwin/src/MLNSettings.h", + "platform/darwin/src/MLNShape.h", + "platform/darwin/src/MLNShapeCollection.h", + "platform/darwin/src/MLNShapeOfflineRegion.h", + "platform/darwin/src/MLNShapeSource.h", + "platform/darwin/src/MLNSource.h", + "platform/darwin/src/MLNStyle.h", + "platform/darwin/src/MLNStyleLayer.h", + "platform/darwin/src/MLNStyleValue.h", + "platform/darwin/src/MLNSymbolStyleLayer.h", + "platform/darwin/src/MLNTilePyramidOfflineRegion.h", + "platform/darwin/src/MLNTileServerOptions.h", + "platform/darwin/src/MLNTileSource.h", + "platform/darwin/src/MLNTypes.h", + "platform/darwin/src/MLNVectorStyleLayer.h", + "platform/darwin/src/MLNVectorTileSource.h", + "platform/darwin/src/NSExpression+MLNAdditions.h", + "platform/darwin/src/NSPredicate+MLNAdditions.h", + "platform/darwin/src/NSValue+MLNAdditions.h", + "platform/ios/src/MLNAnnotationImage.h", + "platform/ios/src/MLNAnnotationView.h", + "platform/ios/src/MLNCalloutView.h", + "platform/ios/src/MLNCameraChangeReason.h", + "platform/ios/src/MLNCompassButton.h", + "platform/ios/src/MLNMapProjection.h", + "platform/ios/src/MLNMapView+IBAdditions.h", + "platform/ios/src/MLNMapView.h", + "platform/ios/src/MLNMapViewDelegate.h", + "platform/ios/src/MLNUserLocation.h", + "platform/ios/src/MLNUserLocationAnnotationView.h", + "platform/ios/src/MLNUserLocationAnnotationViewStyle.h", ] apple_static_xcframework( @@ -190,74 +190,74 @@ apple_resource_bundle( objc_library( name = "objcpp-sdk", srcs = [ - "platform/darwin/src/MGLAttributionInfo.mm", - "platform/darwin/src/MGLBackgroundStyleLayer.mm", - "platform/darwin/src/MGLCircleStyleLayer.mm", - "platform/darwin/src/MGLComputedShapeSource.mm", - "platform/darwin/src/MGLDefaultStyle.mm", - "platform/darwin/src/MGLFeature.mm", - "platform/darwin/src/MGLFillExtrusionStyleLayer.mm", - "platform/darwin/src/MGLFillStyleLayer.mm", - "platform/darwin/src/MGLForegroundStyleLayer.mm", - "platform/darwin/src/MGLFoundation.mm", - "platform/darwin/src/MGLGeometry.mm", - "platform/darwin/src/MGLHeatmapStyleLayer.mm", - "platform/darwin/src/MGLHillshadeStyleLayer.mm", - "platform/darwin/src/MGLImageSource.mm", - "platform/darwin/src/MGLLight.mm", - "platform/darwin/src/MGLLineStyleLayer.mm", - "platform/darwin/src/MGLLoggingConfiguration.mm", - "platform/darwin/src/MGLMapCamera.mm", - "platform/darwin/src/MGLMapSnapshotter.mm", - "platform/darwin/src/MGLMultiPoint.mm", - "platform/darwin/src/MGLNetworkConfiguration.mm", - "platform/darwin/src/MGLOfflinePack.mm", - "platform/darwin/src/MGLOfflineStorage.mm", - "platform/darwin/src/MGLOpenGLStyleLayer.mm", - "platform/darwin/src/MGLPointAnnotation.mm", - "platform/darwin/src/MGLPointCollection.mm", - "platform/darwin/src/MGLPolygon.mm", - "platform/darwin/src/MGLPolyline.mm", - "platform/darwin/src/MGLRasterDEMSource.mm", - "platform/darwin/src/MGLRasterStyleLayer.mm", - "platform/darwin/src/MGLRasterTileSource.mm", - "platform/darwin/src/MGLSettings.mm", - "platform/darwin/src/MGLShape.mm", - "platform/darwin/src/MGLShapeCollection.mm", - "platform/darwin/src/MGLShapeOfflineRegion.mm", - "platform/darwin/src/MGLShapeSource.mm", - "platform/darwin/src/MGLSource.mm", - "platform/darwin/src/MGLStyle.mm", - "platform/darwin/src/MGLStyleLayer.mm", - "platform/darwin/src/MGLStyleLayerManager.mm", - "platform/darwin/src/MGLStyleValue.mm", - "platform/darwin/src/MGLSymbolStyleLayer.mm", - "platform/darwin/src/MGLTilePyramidOfflineRegion.mm", - "platform/darwin/src/MGLTileServerOptions.mm", - "platform/darwin/src/MGLTileSource.mm", - "platform/darwin/src/MGLVectorStyleLayer.mm", - "platform/darwin/src/MGLVectorTileSource.mm", - "platform/darwin/src/NSArray+MGLAdditions.mm", - "platform/darwin/src/NSBundle+MGLAdditions.mm", - "platform/darwin/src/NSCoder+MGLAdditions.mm", - "platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm", - "platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm", - "platform/darwin/src/NSDate+MGLAdditions.mm", - "platform/darwin/src/NSDictionary+MGLAdditions.mm", - "platform/darwin/src/NSExpression+MGLAdditions.mm", - "platform/darwin/src/NSPredicate+MGLAdditions.mm", - "platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm", - "platform/ios/src/MGLAnnotationView.mm", - "platform/ios/src/MGLCompassButton.mm", - "platform/ios/src/MGLFaux3DUserLocationAnnotationView.mm", - "platform/ios/src/MGLMapAccessibilityElement.mm", - "platform/ios/src/MGLMapProjection.mm", - "platform/ios/src/MGLMapView.mm", - "platform/ios/src/MGLMapView+Impl.mm", - "platform/ios/src/MGLMapView+OpenGL.mm", - "platform/ios/src/MGLScaleBar.mm", - "platform/ios/src/UIColor+MGLAdditions.mm", - "platform/ios/src/UIImage+MGLAdditions.mm", + "platform/darwin/src/MLNAttributionInfo.mm", + "platform/darwin/src/MLNBackgroundStyleLayer.mm", + "platform/darwin/src/MLNCircleStyleLayer.mm", + "platform/darwin/src/MLNComputedShapeSource.mm", + "platform/darwin/src/MLNDefaultStyle.mm", + "platform/darwin/src/MLNFeature.mm", + "platform/darwin/src/MLNFillExtrusionStyleLayer.mm", + "platform/darwin/src/MLNFillStyleLayer.mm", + "platform/darwin/src/MLNForegroundStyleLayer.mm", + "platform/darwin/src/MLNFoundation.mm", + "platform/darwin/src/MLNGeometry.mm", + "platform/darwin/src/MLNHeatmapStyleLayer.mm", + "platform/darwin/src/MLNHillshadeStyleLayer.mm", + "platform/darwin/src/MLNImageSource.mm", + "platform/darwin/src/MLNLight.mm", + "platform/darwin/src/MLNLineStyleLayer.mm", + "platform/darwin/src/MLNLoggingConfiguration.mm", + "platform/darwin/src/MLNMapCamera.mm", + "platform/darwin/src/MLNMapSnapshotter.mm", + "platform/darwin/src/MLNMultiPoint.mm", + "platform/darwin/src/MLNNetworkConfiguration.mm", + "platform/darwin/src/MLNOfflinePack.mm", + "platform/darwin/src/MLNOfflineStorage.mm", + "platform/darwin/src/MLNOpenGLStyleLayer.mm", + "platform/darwin/src/MLNPointAnnotation.mm", + "platform/darwin/src/MLNPointCollection.mm", + "platform/darwin/src/MLNPolygon.mm", + "platform/darwin/src/MLNPolyline.mm", + "platform/darwin/src/MLNRasterDEMSource.mm", + "platform/darwin/src/MLNRasterStyleLayer.mm", + "platform/darwin/src/MLNRasterTileSource.mm", + "platform/darwin/src/MLNSettings.mm", + "platform/darwin/src/MLNShape.mm", + "platform/darwin/src/MLNShapeCollection.mm", + "platform/darwin/src/MLNShapeOfflineRegion.mm", + "platform/darwin/src/MLNShapeSource.mm", + "platform/darwin/src/MLNSource.mm", + "platform/darwin/src/MLNStyle.mm", + "platform/darwin/src/MLNStyleLayer.mm", + "platform/darwin/src/MLNStyleLayerManager.mm", + "platform/darwin/src/MLNStyleValue.mm", + "platform/darwin/src/MLNSymbolStyleLayer.mm", + "platform/darwin/src/MLNTilePyramidOfflineRegion.mm", + "platform/darwin/src/MLNTileServerOptions.mm", + "platform/darwin/src/MLNTileSource.mm", + "platform/darwin/src/MLNVectorStyleLayer.mm", + "platform/darwin/src/MLNVectorTileSource.mm", + "platform/darwin/src/NSArray+MLNAdditions.mm", + "platform/darwin/src/NSBundle+MLNAdditions.mm", + "platform/darwin/src/NSCoder+MLNAdditions.mm", + "platform/darwin/src/NSComparisonPredicate+MLNAdditions.mm", + "platform/darwin/src/NSCompoundPredicate+MLNAdditions.mm", + "platform/darwin/src/NSDate+MLNAdditions.mm", + "platform/darwin/src/NSDictionary+MLNAdditions.mm", + "platform/darwin/src/NSExpression+MLNAdditions.mm", + "platform/darwin/src/NSPredicate+MLNAdditions.mm", + "platform/darwin/src/NSValue+MLNStyleAttributeAdditions.mm", + "platform/ios/src/MLNAnnotationView.mm", + "platform/ios/src/MLNCompassButton.mm", + "platform/ios/src/MLNFaux3DUserLocationAnnotationView.mm", + "platform/ios/src/MLNMapAccessibilityElement.mm", + "platform/ios/src/MLNMapProjection.mm", + "platform/ios/src/MLNMapView.mm", + "platform/ios/src/MLNMapView+Impl.mm", + "platform/ios/src/MLNMapView+OpenGL.mm", + "platform/ios/src/MLNScaleBar.mm", + "platform/ios/src/UIColor+MLNAdditions.mm", + "platform/ios/src/UIImage+MLNAdditions.mm", ], copts = CPP_FLAGS + MAPLIBRE_FLAGS + [ "-fcxx-modules", @@ -291,33 +291,33 @@ objc_library( objc_library( name = "objc-sdk", srcs = [ - "platform/darwin/src/MGLAttributedExpression.m", - "platform/darwin/src/MGLClockDirectionFormatter.m", - "platform/darwin/src/MGLCompassDirectionFormatter.m", - "platform/darwin/src/MGLCoordinateFormatter.m", - "platform/darwin/src/MGLDistanceFormatter.m", - "platform/darwin/src/MGLLocationManager.m", - "platform/darwin/src/MGLReachability.m", - "platform/darwin/src/MGLRendererConfiguration.m", - "platform/darwin/src/MGLTypes.m", - "platform/darwin/src/NSString+MGLAdditions.m", - "platform/darwin/src/NSURL+MGLAdditions.m", - "platform/darwin/src/NSValue+MGLAdditions.m", - "platform/ios/src/MGLAnnotationContainerView.m", - "platform/ios/src/MGLAnnotationImage.m", - "platform/ios/src/MGLCompactCalloutView.m", - "platform/ios/src/MGLUserLocation.m", - "platform/ios/src/MGLUserLocationAnnotationView.m", - "platform/ios/src/MGLUserLocationAnnotationViewStyle.m", - "platform/ios/src/MGLUserLocationHeadingArrowLayer.m", - "platform/ios/src/MGLUserLocationHeadingBeamLayer.m", - "platform/ios/src/NSOrthography+MGLAdditions.m", - "platform/ios/src/UIDevice+MGLAdditions.m", - "platform/ios/src/UIView+MGLAdditions.m", - "platform/ios/src/UIViewController+MGLAdditions.m", + "platform/darwin/src/MLNAttributedExpression.m", + "platform/darwin/src/MLNClockDirectionFormatter.m", + "platform/darwin/src/MLNCompassDirectionFormatter.m", + "platform/darwin/src/MLNCoordinateFormatter.m", + "platform/darwin/src/MLNDistanceFormatter.m", + "platform/darwin/src/MLNLocationManager.m", + "platform/darwin/src/MLNReachability.m", + "platform/darwin/src/MLNRendererConfiguration.m", + "platform/darwin/src/MLNTypes.m", + "platform/darwin/src/NSString+MLNAdditions.m", + "platform/darwin/src/NSURL+MLNAdditions.m", + "platform/darwin/src/NSValue+MLNAdditions.m", + "platform/ios/src/MLNAnnotationContainerView.m", + "platform/ios/src/MLNAnnotationImage.m", + "platform/ios/src/MLNCompactCalloutView.m", + "platform/ios/src/MLNUserLocation.m", + "platform/ios/src/MLNUserLocationAnnotationView.m", + "platform/ios/src/MLNUserLocationAnnotationViewStyle.m", + "platform/ios/src/MLNUserLocationHeadingArrowLayer.m", + "platform/ios/src/MLNUserLocationHeadingBeamLayer.m", + "platform/ios/src/NSOrthography+MLNAdditions.m", + "platform/ios/src/UIDevice+MLNAdditions.m", + "platform/ios/src/UIView+MLNAdditions.m", + "platform/ios/src/UIViewController+MLNAdditions.m", ], hdrs = [ - "platform/darwin/include/mbgl/util/image+MGLAdditions.hpp", + "platform/darwin/include/mbgl/util/image+MLNAdditions.hpp", ], copts = WARNING_FLAGS + MAPLIBRE_FLAGS + [ "-fmodules", diff --git a/platform/ios/platform/darwin/app/LimeGreenStyleLayer.h b/platform/ios/platform/darwin/app/LimeGreenStyleLayer.h index 35480963a..c497b767e 100644 --- a/platform/ios/platform/darwin/app/LimeGreenStyleLayer.h +++ b/platform/ios/platform/darwin/app/LimeGreenStyleLayer.h @@ -1,5 +1,5 @@ #import -@interface LimeGreenStyleLayer : MGLOpenGLStyleLayer +@interface LimeGreenStyleLayer : MLNOpenGLStyleLayer @end diff --git a/platform/ios/platform/darwin/app/LimeGreenStyleLayer.m b/platform/ios/platform/darwin/app/LimeGreenStyleLayer.m index 98e96381b..b7e41a658 100644 --- a/platform/ios/platform/darwin/app/LimeGreenStyleLayer.m +++ b/platform/ios/platform/darwin/app/LimeGreenStyleLayer.m @@ -9,7 +9,7 @@ GLuint _aPos; } -- (void)didMoveToMapView:(MGLMapView *)mapView { +- (void)didMoveToMapView:(MLNMapView *)mapView { static const GLchar *vertexShaderSource = "attribute vec2 a_pos; void main() { gl_Position = vec4(a_pos, 1, 1); }"; static const GLchar *fragmentShaderSource = "void main() { gl_FragColor = vec4(0, 0.5, 0, 0.5); }"; @@ -32,7 +32,7 @@ glBufferData(GL_ARRAY_BUFFER, 6 * sizeof(GLfloat), triangle, GL_STATIC_DRAW); } -- (void)drawInMapView:(MGLMapView *)mapView withContext:(MGLStyleLayerDrawingContext)context { +- (void)drawInMapView:(MLNMapView *)mapView withContext:(MLNStyleLayerDrawingContext)context { glUseProgram(_program); glBindBuffer(GL_ARRAY_BUFFER, _buffer); glEnableVertexAttribArray(_aPos); @@ -42,7 +42,7 @@ glDrawArrays(GL_TRIANGLE_STRIP, 0, 3); } -- (void)willMoveFromMapView:(MGLMapView *)mapView { +- (void)willMoveFromMapView:(MLNMapView *)mapView { if (!_program) { return; } diff --git a/platform/ios/platform/darwin/docs/guides/Customizing Fonts.md b/platform/ios/platform/darwin/docs/guides/Customizing Fonts.md index 37b1c2da9..52038c9fa 100644 --- a/platform/ios/platform/darwin/docs/guides/Customizing Fonts.md +++ b/platform/ios/platform/darwin/docs/guides/Customizing Fonts.md @@ -1,10 +1,10 @@ # Customizing Fonts -The Mapbox Maps SDK can render text that is part of an `MGLSymbolStyleLayer` in a font of your choice. The font customization options discussed in this document do not apply to user interface elements such as the scale bar or annotation callout views. +The Mapbox Maps SDK can render text that is part of an `MLNSymbolStyleLayer` in a font of your choice. The font customization options discussed in this document do not apply to user interface elements such as the scale bar or annotation callout views. ## Server-side fonts -By default, the map renders characters using glyphs downloaded from the [Mapbox Fonts API](https://docs.mapbox.com/api/maps/#fonts). You apply fonts in [Mapbox Studio](https://studio.mapbox.com/), in the `text-font` layout property in style JSON, or in the `MGLSymbolStyleLayer.textFontNames` property at runtime. The values in these properties must be font display names, not font family names or PostScript names. +By default, the map renders characters using glyphs downloaded from the [Mapbox Fonts API](https://docs.mapbox.com/api/maps/#fonts). You apply fonts in [Mapbox Studio](https://studio.mapbox.com/), in the `text-font` layout property in style JSON, or in the `MLNSymbolStyleLayer.textFontNames` property at runtime. The values in these properties must be font display names, not font family names or PostScript names. Each font name in the list must match a font that is registered in Mapbox Studio; otherwise, the text will not load, even if one of the fonts is available. Each font name must be included in the `{fontstack}` portion of the JSON stylesheet’s [`glyphs`](https://docs.mapbox.com/mapbox-gl-js/style-spec/glyphs/) property. @@ -12,10 +12,10 @@ Each font name in the list must match a font that is registered in Mapbox Studio By default, Chinese hanzi, Japanese kana, and Korean hangul characters (CJK) are rendered on the client side. Client-side text rendering uses less bandwidth than server-side text rendering, especially when viewing regions of the map that feature a wide variety of CJK characters. -First, the map attempts to apply a font that you specify the same way as you would specify a server-side font: in [Mapbox Studio](https://studio.mapbox.com/), in the `text-font` layout property in style JSON, or in the `MGLSymbolStyleLayer.textFontNames` property at runtime. Instead of downloading the glyphs, the map tries to find a [system font](https://developer.apple.com/fonts/system-fonts/) or a font [bundled with your application](https://developer.apple.com/documentation/uikit/text_display_and_fonts/adding_a_custom_font_to_your_app) that matches one of these fonts based on its family name (for example, “PingFang TC”), display name (“PingFang TC Ultralight”), or PostScript name (“PingFangTC-Ultralight”). +First, the map attempts to apply a font that you specify the same way as you would specify a server-side font: in [Mapbox Studio](https://studio.mapbox.com/), in the `text-font` layout property in style JSON, or in the `MLNSymbolStyleLayer.textFontNames` property at runtime. Instead of downloading the glyphs, the map tries to find a [system font](https://developer.apple.com/fonts/system-fonts/) or a font [bundled with your application](https://developer.apple.com/documentation/uikit/text_display_and_fonts/adding_a_custom_font_to_your_app) that matches one of these fonts based on its family name (for example, “PingFang TC”), display name (“PingFang TC Ultralight”), or PostScript name (“PingFangTC-Ultralight”). -If the symbol layer does not specify an available font that contains the required glyphs, then the map tries to find a matching font in the [`MGLIdeographicFontFamilyName`](infoplist-keys.html#mglideographicfontfamilyname) Info.plist key. Like the `MGLSymbolStyleLayer.textFontNames` property, this key can contain a family name, display name, or PostScript name. This key is a global fallback that applies to all layers uniformly. It can either be a single string or an array of strings, which the map tries to apply in order from most preferred to least preferred. +If the symbol layer does not specify an available font that contains the required glyphs, then the map tries to find a matching font in the [`MLNIdeographicFontFamilyName`](infoplist-keys.html#mglideographicfontfamilyname) Info.plist key. Like the `MLNSymbolStyleLayer.textFontNames` property, this key can contain a family name, display name, or PostScript name. This key is a global fallback that applies to all layers uniformly. It can either be a single string or an array of strings, which the map tries to apply in order from most preferred to least preferred. Each character is rendered in the first font you specify that has a glyph for the character. If the entire list of fonts is exhausted, the map uses the system’s font cascade list, which may vary based on the device model and system language. -To disable client-side rendering of CJK characters, set the `MGLIdeographicFontFamilyName` key to the Boolean value `NO`. The map will revert to server-side font rendering. +To disable client-side rendering of CJK characters, set the `MLNIdeographicFontFamilyName` key to the Boolean value `NO`. The map will revert to server-side font rendering. diff --git a/platform/ios/platform/darwin/docs/guides/For Style Authors.md.ejs b/platform/ios/platform/darwin/docs/guides/For Style Authors.md.ejs index ea487f7de..9e899fd65 100644 --- a/platform/ios/platform/darwin/docs/guides/For Style Authors.md.ejs +++ b/platform/ios/platform/darwin/docs/guides/For Style Authors.md.ejs @@ -82,8 +82,8 @@ By default, this SDK makes it easy for your users to rotate or tilt the map using multitouch trackpad gestures or keyboard shortcuts. <% } -%> If you do not intend your design to accommodate rotation and tilting, disable -these gestures using the `MGLMapView.rotateEnabled` and -`MGLMapView.pitchEnabled` properties, respectively, or the corresponding +these gestures using the `MLNMapView.rotateEnabled` and +`MLNMapView.pitchEnabled` properties, respectively, or the corresponding inspectables in Interface Builder. ### Interactivity @@ -97,7 +97,7 @@ An icon with a shadow or shading effect may appear to be clickable. <% } -%> You can make an icon or text label interactive by installing a gesture recognizer and performing feature querying (e.g., -`-[MGLMapView visibleFeaturesAtPoint:]`) to get details about the selected +`-[MLNMapView visibleFeaturesAtPoint:]`) to get details about the selected feature. <% if (macOS) { -%> You can install cursor or tooltip tracking rectangles to indicate interactive @@ -130,8 +130,8 @@ For more information about user interface design, consult Apple’s ## Applying your style -You set an `MGLMapView` object’s style either in code, by setting the -`MGLMapView.styleURL` property, or in Interface Builder, by setting the “Style +You set an `MLNMapView` object’s style either in code, by setting the +`MLNMapView.styleURL` property, or in Interface Builder, by setting the “Style URL” inspectable. The URL must point to a local or remote style JSON file. The style JSON file format is defined by the [Mapbox Style Specification](https://www.mapbox.com/mapbox-gl-style-spec/). This @@ -143,8 +143,8 @@ otherwise noted in the The _runtime styling API_ enables you to modify every aspect of a style dynamically as a user interacts with your application. The style itself is -represented at runtime by an `MGLStyle` object, which provides access to various -`MGLSource` and `MGLStyleLayer` objects that represent content sources and style +represented at runtime by an `MLNStyle` object, which provides access to various +`MLNSource` and `MLNStyleLayer` objects that represent content sources and style layers, respectively. <% if (iOS) { -%> For more information about the capabilities exposed by the runtime styling API, @@ -174,15 +174,15 @@ source | content source Each source defined by a style JSON file is represented at runtime by a content source object that you can use to initialize new style layers. The content -source object is a member of one of the following subclasses of `MGLSource`: +source object is a member of one of the following subclasses of `MLNSource`: In style JSON | In the SDK --------------|----------- -`vector` | `MGLVectorTileSource` -`raster` | `MGLRasterTileSource` -`raster-dem` | `MGLRasterDEMSource` -`geojson` | `MGLShapeSource` -`image` | `MGLImageSource` +`vector` | `MLNVectorTileSource` +`raster` | `MLNRasterTileSource` +`raster-dem` | `MLNRasterDEMSource` +`geojson` | `MLNShapeSource` +`image` | `MLNImageSource` `canvas` and `video` sources are not supported. @@ -194,56 +194,56 @@ subset of the keys defined in version 2.1.0 of the [TileJSON](https://github.com/mapbox/tilejson-spec/tree/master/2.1.0) specification. As an alternative to authoring a custom TileJSON file, you may supply various tile source options when creating a raster or vector tile source. -These options are detailed in the `MGLTileSourceOption` documentation: +These options are detailed in the `MLNTileSourceOption` documentation: In style JSON | In TileJSON | In the SDK --------------|---------------|----------- -`url` | — | `configurationURL` parameter in `-[MGLTileSource initWithIdentifier:configurationURL:]` -`tiles` | `tiles` | `tileURLTemplates` parameter in `-[MGLTileSource initWithIdentifier:tileURLTemplates:options:]` -`minzoom` | `minzoom` | `MGLTileSourceOptionMinimumZoomLevel` -`maxzoom` | `maxzoom` | `MGLTileSourceOptionMaximumZoomLevel` -`bounds` | `bounds` | `MGLTileSourceOptionCoordinateBounds` -`tileSize` | — | `MGLTileSourceOptionTileSize` -`attribution` | `attribution` | `MGLTileSourceOptionAttributionHTMLString` (but consider specifying `MGLTileSourceOptionAttributionInfos` instead for improved security) -`scheme` | `scheme` | `MGLTileSourceOptionTileCoordinateSystem` -`encoding` | – | `MGLTileSourceOptionDEMEncoding` +`url` | — | `configurationURL` parameter in `-[MLNTileSource initWithIdentifier:configurationURL:]` +`tiles` | `tiles` | `tileURLTemplates` parameter in `-[MLNTileSource initWithIdentifier:tileURLTemplates:options:]` +`minzoom` | `minzoom` | `MLNTileSourceOptionMinimumZoomLevel` +`maxzoom` | `maxzoom` | `MLNTileSourceOptionMaximumZoomLevel` +`bounds` | `bounds` | `MLNTileSourceOptionCoordinateBounds` +`tileSize` | — | `MLNTileSourceOptionTileSize` +`attribution` | `attribution` | `MLNTileSourceOptionAttributionHTMLString` (but consider specifying `MLNTileSourceOptionAttributionInfos` instead for improved security) +`scheme` | `scheme` | `MLNTileSourceOptionTileCoordinateSystem` +`encoding` | – | `MLNTileSourceOptionDEMEncoding` ### Shape sources Shape sources also accept various options. These options are detailed in the -`MGLShapeSourceOption` documentation: +`MLNShapeSourceOption` documentation: In style JSON | In the SDK -----------------|----------- -`data` | `url` parameter in `-[MGLShapeSource initWithIdentifier:URL:options:]` -`maxzoom` | `MGLShapeSourceOptionMaximumZoomLevel` -`buffer` | `MGLShapeSourceOptionBuffer` -`tolerance` | `MGLShapeSourceOptionSimplificationTolerance` -`cluster` | `MGLShapeSourceOptionClustered` -`clusterRadius` | `MGLShapeSourceOptionClusterRadius` -`clusterMaxZoom` | `MGLShapeSourceOptionMaximumZoomLevelForClustering` -`lineMetrics` | `MGLShapeSourceOptionLineDistanceMetrics` +`data` | `url` parameter in `-[MLNShapeSource initWithIdentifier:URL:options:]` +`maxzoom` | `MLNShapeSourceOptionMaximumZoomLevel` +`buffer` | `MLNShapeSourceOptionBuffer` +`tolerance` | `MLNShapeSourceOptionSimplificationTolerance` +`cluster` | `MLNShapeSourceOptionClustered` +`clusterRadius` | `MLNShapeSourceOptionClusterRadius` +`clusterMaxZoom` | `MLNShapeSourceOptionMaximumZoomLevelForClustering` +`lineMetrics` | `MLNShapeSourceOptionLineDistanceMetrics` To create a shape source from local GeoJSON data, first [convert the GeoJSON data into a shape](working-with-geojson-data.html#converting-geojson-data-into-shape-objects), -then use the `-[MGLShapeSource initWithIdentifier:shape:options:]` method. +then use the `-[MLNShapeSource initWithIdentifier:shape:options:]` method. ### Image sources Image sources accept a non-axis aligned quadrilateral as their geographic coordinates. -These coordinates, in `MGLCoordinateQuad`, are described in counterclockwise order, +These coordinates, in `MLNCoordinateQuad`, are described in counterclockwise order, in contrast to the clockwise order defined in the style specification. ## Configuring the map content’s appearance Each layer defined by the style JSON file is represented at runtime by a style layer object, which you can use to refine the map’s appearance. The style layer -object is a member of one of the following subclasses of `MGLStyleLayer`: +object is a member of one of the following subclasses of `MLNStyleLayer`: In style JSON | In the SDK --------------|----------- <% for (const layer of layers) { -%> -`<%- layer.type %>` | `MGL<%- camelize(layer.type) %>StyleLayer` +`<%- layer.type %>` | `MLN<%- camelize(layer.type) %>StyleLayer` <% } -%> You configure layout and paint attributes by setting properties on these style @@ -259,7 +259,7 @@ In style JSON | In Objective-C | In Swift --------------|----------------|--------- <% for (const name in renamedProperties[type]) { -%> <% if (renamedProperties[type].hasOwnProperty(name)) { -%> -`<%- originalPropertyName(renamedProperties[type][name]) %>` | `MGL<%- camelize(type) %>StyleLayer.<%- objCName(renamedProperties[type][name]) %>` | `MGL<%- camelize(type) %>StyleLayer.<%- objCGetter(renamedProperties[type][name]) %>` +`<%- originalPropertyName(renamedProperties[type][name]) %>` | `MLN<%- camelize(type) %>StyleLayer.<%- objCName(renamedProperties[type][name]) %>` | `MLN<%- camelize(type) %>StyleLayer.<%- objCGetter(renamedProperties[type][name]) %>` <% } -%> <% } -%> <% } -%> @@ -358,13 +358,13 @@ In style specification | Method, function, or predicate type | Format string syn `>=` | `NSGreaterThanOrEqualToPredicateOperatorType` | `key >= value` `all` | `NSAndPredicateType` | `p0 AND … AND pn` `any` | `NSOrPredicateType` | `p0 OR … OR pn` -`case` | `+[NSExpression expressionForConditional:trueExpression:falseExpression:]` or `MGL_IF` or `+[NSExpression mgl_expressionForConditional:trueExpression:falseExpresssion:]` | `TERNARY(1 = 2, YES, NO)` or `MGL_IF(1 = 2, YES, 2 = 2, YES, NO)` +`case` | `+[NSExpression expressionForConditional:trueExpression:falseExpression:]` or `MLN_IF` or `+[NSExpression mgl_expressionForConditional:trueExpression:falseExpresssion:]` | `TERNARY(1 = 2, YES, NO)` or `MLN_IF(1 = 2, YES, 2 = 2, YES, NO)` `coalesce` | `mgl_coalesce:` | `mgl_coalesce({x, y, z})` -`match` | `MGL_MATCH` or `+[NSExpression mgl_expressionForMatchingExpression:inDictionary:defaultExpression:]` | `MGL_MATCH(x, 0, 'zero match', 1, 'one match', 'two match', 'default')` -`within` | `NSInPredicateOperatorType` | `SELF IN %@` or `%@ CONTAINS SELF` where `%@` is an `MGLShape` +`match` | `MLN_MATCH` or `+[NSExpression mgl_expressionForMatchingExpression:inDictionary:defaultExpression:]` | `MLN_MATCH(x, 0, 'zero match', 1, 'one match', 'two match', 'default')` +`within` | `NSInPredicateOperatorType` | `SELF IN %@` or `%@ CONTAINS SELF` where `%@` is an `MLNShape` `interpolate` | `mgl_interpolate:withCurveType:parameters:stops:` or `+[NSExpression mgl_expressionForInterpolatingExpression:withCurveType:parameters:stops:]` | `step` | `mgl_step:from:stops:` or `+[NSExpression mgl_expressionForSteppingExpression:fromExpression:stops:]` | -`let` | `mgl_expressionWithContext:` | `MGL_LET('ios', 11, 'macos', 10.13, $ios + $macos)` +`let` | `mgl_expressionWithContext:` | `MLN_LET('ios', 11, 'macos', 10.13, $ios + $macos)` `var` | `+[NSExpression expressionForVariable:]` | `$variable` `concat` | `mgl_join:` or `-[NSExpression mgl_expressionByAppendingExpression:]` | `mgl_join({'Old', ' ', 'MacDonald'})` `downcase` | `lowercase:` | `lowercase('DOWNTOWN')` @@ -389,7 +389,7 @@ In style specification | Method, function, or predicate type | Format string syn `atan` | `mgl_atan:` | `mgl_atan(20)` `ceil` | `ceiling:` | `ceiling(0.99999)` `cos` | `mgl_cos:` | `mgl_cos(0)` -`distance` | | `mgl_distanceFrom(%@)` where `%@` is an `MGLShape` +`distance` | | `mgl_distanceFrom(%@)` where `%@` is an `MLNShape` `e` | | `%@` representing `NSNumber` containing `M_E` `floor` | `floor:` | `floor(-0.99999)` `ln` | `ln:` | `ln(2)` @@ -409,12 +409,12 @@ In style specification | Method, function, or predicate type | Format string syn `format` | `+[NSExpression mgl_expressionForAttributedExpressions:]` or `mgl_attributed:` | `mgl_attributed({x, y, z})` For operators that have no corresponding `NSExpression` symbol, use the -`MGL_FUNCTION()` format string syntax. +`MLN_FUNCTION()` format string syntax. ## Filtering sources You can filter a shape or vector tile source by setting the -`MGLVectorStyleLayer.predicate` property to an `NSPredicate` object. Below is a +`MLNVectorStyleLayer.predicate` property to an `NSPredicate` object. Below is a table of style JSON operators and the corresponding operators used in the predicate format string: @@ -437,13 +437,13 @@ In style JSON | In the format string ## Specifying the text format The following format attributes are defined as `NSString` constans that you -can use to update the formatting of `MGLSymbolStyleLayer.text` property. +can use to update the formatting of `MLNSymbolStyleLayer.text` property. In style JSON | In Objective-C | In Swift --------------|-----------------------|--------- -`text-font` | `MGLFontNamesAttribute` | `.fontNamesAttribute` -`font-scale` | `MGLFontScaleAttribute` | `.fontScaleAttribute` -`text-color` | `MGLFontColorAttribute` | `.fontColorAttribute` +`text-font` | `MLNFontNamesAttribute` | `.fontNamesAttribute` +`font-scale` | `MLNFontScaleAttribute` | `.fontScaleAttribute` +`text-color` | `MLNFontColorAttribute` | `.fontColorAttribute` See the “[Predicates and Expressions](predicates-and-expressions.html)” guide for a full description of the supported operators and operand types. diff --git a/platform/ios/platform/darwin/docs/guides/Migrating to Expressions.md.ejs b/platform/ios/platform/darwin/docs/guides/Migrating to Expressions.md.ejs index 3ea5b33d7..4b751c71a 100644 --- a/platform/ios/platform/darwin/docs/guides/Migrating to Expressions.md.ejs +++ b/platform/ios/platform/darwin/docs/guides/Migrating to Expressions.md.ejs @@ -34,11 +34,11 @@ Style function syntax: ```swift let stops = [ - 0: MGLStyleValue(rawValue: .yellow), - 2.5: MGLStyleValue(rawValue: .orange), - 5: MGLStyleValue(rawValue: .red), - 7.5: MGLStyleValue(rawValue: .blue), - 10: MGLStyleValue(rawValue: .white), + 0: MLNStyleValue(rawValue: .yellow), + 2.5: MLNStyleValue(rawValue: .orange), + 5: MLNStyleValue(rawValue: .red), + 7.5: MLNStyleValue(rawValue: .blue), + 10: MLNStyleValue(rawValue: .white), ] ``` @@ -52,7 +52,7 @@ Style functions supported four interpolation modes: exponential/linear, interval ### Linear -`+[NSExpression(MGLAdditions) mgl_expressionForInterpolatingExpression:withCurveType:parameters:stops:]` takes the interpolation type as a parameter. If you previously used the default interpolation base, use the curve type `MGLExpressionInterpolationMode.linear`. See the [`mgl_interpolate:withCurveType:parameters:stops:`](predicates-and-expressions.html#code-mgl_interpolate-withcurvetype-parameters-stops-code) documentation for more details. +`+[NSExpression(MLNAdditions) mgl_expressionForInterpolatingExpression:withCurveType:parameters:stops:]` takes the interpolation type as a parameter. If you previously used the default interpolation base, use the curve type `MLNExpressionInterpolationMode.linear`. See the [`mgl_interpolate:withCurveType:parameters:stops:`](predicates-and-expressions.html#code-mgl_interpolate-withcurvetype-parameters-stops-code) documentation for more details. The stops dictionary below, shows colors that continuously shift from yellow to orange to red to blue to white based on the attribute value. @@ -60,26 +60,26 @@ Style function syntax: ```swift let url = URL(string: "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.geojson")! -let symbolSource = MGLSource(identifier: "source") -let symbolLayer = MGLSymbolStyleLayer(identifier: "place-city-sm", source: symbolSource) +let symbolSource = MLNSource(identifier: "source") +let symbolLayer = MLNSymbolStyleLayer(identifier: "place-city-sm", source: symbolSource) -let source = MGLShapeSource(identifier: "earthquakes", url: url, options: nil) +let source = MLNShapeSource(identifier: "earthquakes", url: url, options: nil) mapView.style?.addSource(source) let stops = [ - 0: MGLStyleValue(rawValue: .yellow), - 2.5: MGLStyleValue(rawValue: .orange), - 5: MGLStyleValue(rawValue: .red), - 7.5: MGLStyleValue(rawValue: .blue), - 10: MGLStyleValue(rawValue: .white), + 0: MLNStyleValue(rawValue: .yellow), + 2.5: MLNStyleValue(rawValue: .orange), + 5: MLNStyleValue(rawValue: .red), + 7.5: MLNStyleValue(rawValue: .blue), + 10: MLNStyleValue(rawValue: .white), ] -let layer = MGLCircleStyleLayer(identifier: "circles", source: source) -layer.circleColor = MGLStyleValue(interpolationMode: .exponential, +let layer = MLNCircleStyleLayer(identifier: "circles", source: source) +layer.circleColor = MLNStyleValue(interpolationMode: .exponential, sourceStops: stops, attributeName: "mag", - options: [.defaultValue: MGLStyleValue(rawValue: .green)]) -layer.circleRadius = MGLStyleValue(rawValue: 10) + options: [.defaultValue: MLNStyleValue(rawValue: .green)]) +layer.circleRadius = MLNStyleValue(rawValue: 10) mapView.style?.insertLayer(layer, below: symbolLayer) ``` @@ -89,9 +89,9 @@ Current syntax: ### Exponential -If you previously used an interpolation base greater than `0` (other than `1`), you can use `MGLExpressionInterpolationMode.exponential` as the curve type for `+[NSExpression(MGLAdditions) mgl_expressionForInterpolatingExpression:withCurveType:parameters:stops:]` or `'exponential'` as the curve type for [`mgl_interpolate:withCurveType:parameters:stops:`](predicates-and-expressions.html#code-mgl_interpolate-withcurvetype-parameters-stops-code). The `parameters` argument takes that interpolation base. This interpolates between values exponentially, creating an accelerated ramp effect. +If you previously used an interpolation base greater than `0` (other than `1`), you can use `MLNExpressionInterpolationMode.exponential` as the curve type for `+[NSExpression(MLNAdditions) mgl_expressionForInterpolatingExpression:withCurveType:parameters:stops:]` or `'exponential'` as the curve type for [`mgl_interpolate:withCurveType:parameters:stops:`](predicates-and-expressions.html#code-mgl_interpolate-withcurvetype-parameters-stops-code). The `parameters` argument takes that interpolation base. This interpolates between values exponentially, creating an accelerated ramp effect. -Here’s a visualization from Mapbox Studio (see [Mapbox Studio and iOS](https://www.mapbox.com/ios-sdk/maps/overview/mapbox-studio/)) comparing interpolation base values of `1.5` and `0.5` based on zoom. In order to convert camera style functions, use `$zoomLevel` or `MGL_FUNCTION('zoomLevel')` as the attribute key. +Here’s a visualization from Mapbox Studio (see [Mapbox Studio and iOS](https://www.mapbox.com/ios-sdk/maps/overview/mapbox-studio/)) comparing interpolation base values of `1.5` and `0.5` based on zoom. In order to convert camera style functions, use `$zoomLevel` or `MLN_FUNCTION('zoomLevel')` as the attribute key. @@ -102,12 +102,12 @@ Style function syntax: ```swift let stops = [ - 12: MGLStyleValue(rawValue: 0.5), - 14: MGLStyleValue(rawValue: 2), - 18: MGLStyleValue(rawValue: 18), + 12: MLNStyleValue(rawValue: 0.5), + 14: MLNStyleValue(rawValue: 2), + 18: MLNStyleValue(rawValue: 18), ] -layer.circleRadius = MGLStyleValue(interpolationMode: .exponential, +layer.circleRadius = MLNStyleValue(interpolationMode: .exponential, cameraStops: stops, options: [.interpolationBase: 1.5]) ``` @@ -118,7 +118,7 @@ Current syntax: ### Interval -Steps, or intervals, create a range using the keys from the stops dictionary. The range is from the given key to just less than the next key. The attribute values that fall into that range are then styled using the layout or paint value assigned to that key. You can use the `+[NSExpression(MGLAdditions) mgl_expressionForSteppingExpression:fromExpression:stops:]` method or the custom function [`mgl_step:from:stops:`](predicates-and-expressions.html#code-mgl_step-from-stops-code) for cases where you previously used interval interpolation mode. The first parameter takes the feature attribute name and the second parameter (`from:`) optionally takes the default or fallback value for that function. The final parameter takes a stops dictionary as an argument. +Steps, or intervals, create a range using the keys from the stops dictionary. The range is from the given key to just less than the next key. The attribute values that fall into that range are then styled using the layout or paint value assigned to that key. You can use the `+[NSExpression(MLNAdditions) mgl_expressionForSteppingExpression:fromExpression:stops:]` method or the custom function [`mgl_step:from:stops:`](predicates-and-expressions.html#code-mgl_step-from-stops-code) for cases where you previously used interval interpolation mode. The first parameter takes the feature attribute name and the second parameter (`from:`) optionally takes the default or fallback value for that function. The final parameter takes a stops dictionary as an argument. When we use the stops dictionary given above with an `'mgl_step:from:stops:'`, we create ranges where earthquakes with a magnitude of 0 to just less than 2.5 would be yellow, 2.5 to just less than 5 would be orange, and so on. @@ -126,17 +126,17 @@ Style function syntax: ```swift let stops = [ - 0: MGLStyleValue(rawValue: .yellow), - 2.5: MGLStyleValue(rawValue: .orange), - 5: MGLStyleValue(rawValue: .red), - 7.5: MGLStyleValue(rawValue: .blue), - 10: MGLStyleValue(rawValue: .white), + 0: MLNStyleValue(rawValue: .yellow), + 2.5: MLNStyleValue(rawValue: .orange), + 5: MLNStyleValue(rawValue: .red), + 7.5: MLNStyleValue(rawValue: .blue), + 10: MLNStyleValue(rawValue: .white), ] -layer.circleColor = MGLStyleValue(interpolationMode: .interval, +layer.circleColor = MLNStyleValue(interpolationMode: .interval, sourceStops: stops, attributeName: "mag", - options: [.defaultValue: MGLStyleValue(rawValue: .green)]) + options: [.defaultValue: MLNStyleValue(rawValue: .green)]) ```` Current syntax: @@ -145,9 +145,9 @@ Current syntax: ### Categorical -Categorical interpolation mode took a stops dictionary. If the value for a specified feature attribute name matched one in that stops dictionary, the style value for that attribute value would be used. Categorical style functions can now be replaced with `MGL_MATCH`. +Categorical interpolation mode took a stops dictionary. If the value for a specified feature attribute name matched one in that stops dictionary, the style value for that attribute value would be used. Categorical style functions can now be replaced with `MLN_MATCH`. -`MGL_MATCH` takes an initial condition, which in this case is an attribute key. This is followed by possible matches for that key and the value to assign to the layer property if there is a match. The final argument can be a default style value that is to be used if none of the specified values match. +`MLN_MATCH` takes an initial condition, which in this case is an attribute key. This is followed by possible matches for that key and the value to assign to the layer property if there is a match. The final argument can be a default style value that is to be used if none of the specified values match. There are three main types of events in the USGS dataset: earthquakes, explosions, and quarry blasts. In this case, the color of the circle layer will be determined by the type of event, with a default value of blue to catch any events that do not fall into any of those categories. @@ -155,15 +155,15 @@ Style function syntax: ```swift let categoricalStops = [ - "earthquake": MGLStyleValue(rawValue: .orange), - "explosion": MGLStyleValue(rawValue: .red), - "quarry blast": MGLStyleValue(rawValue: .yellow), + "earthquake": MLNStyleValue(rawValue: .orange), + "explosion": MLNStyleValue(rawValue: .red), + "quarry blast": MLNStyleValue(rawValue: .yellow), ] -layer.circleColor = MGLStyleValue(interpolationMode: .categorical, +layer.circleColor = MLNStyleValue(interpolationMode: .categorical, sourceStops: categoricalStops, attributeName: "type", - options: [.defaultValue: MGLStyleValue(rawValue: .blue)]) + options: [.defaultValue: MLNStyleValue(rawValue: .blue)]) ``` Current syntax: @@ -178,10 +178,10 @@ Identity interpolation mode used the attribute’s value as the style layer prop Style function syntax: ```swift -layer.circleRadius = MGLStyleValue(interpolationMode: .identity, +layer.circleRadius = MLNStyleValue(interpolationMode: .identity, sourceStops: nil, attributeName: "mag", - options: [.defaultValue: MGLStyleValue(rawValue: 0)]) + options: [.defaultValue: MLNStyleValue(rawValue: 0)]) ``` Current syntax: @@ -203,7 +203,7 @@ You can also cast attribute values in order to use them. One example is to cast ### Constant Values -For constant values that do not necessarily change based on camera or attribute values, use `[NSExpression expressionForConstantValue:]` (previously `[MGLStyleValue valueWithRawValue:]`). +For constant values that do not necessarily change based on camera or attribute values, use `[NSExpression expressionForConstantValue:]` (previously `[MLNStyleValue valueWithRawValue:]`). ## Resources diff --git a/platform/ios/platform/darwin/docs/guides/Predicates and Expressions.md b/platform/ios/platform/darwin/docs/guides/Predicates and Expressions.md index 758eedd20..36308caf2 100644 --- a/platform/ios/platform/darwin/docs/guides/Predicates and Expressions.md +++ b/platform/ios/platform/darwin/docs/guides/Predicates and Expressions.md @@ -11,13 +11,13 @@ syntax supported by this SDK. For a more general introduction to predicates and expressions, consult the _[Predicate Programming Guide](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Predicates/AdditionalChapters/Introduction.html)_ in Apple developer documentation. For additional detail on how this SDK has -extended the `NSExpression` class, consult the [`NSExpression(MGLAdditions)`](./Categories/NSExpression(MGLAdditions).html) +extended the `NSExpression` class, consult the [`NSExpression(MLNAdditions)`](./Categories/NSExpression(MLNAdditions).html) section of this documentation. ## Using predicates to filter vector data -Most style layer classes display `MGLFeature` objects that you can show or hide -based on the feature’s attributes. Use the `MGLVectorStyleLayer.predicate` +Most style layer classes display `MLNFeature` objects that you can show or hide +based on the feature’s attributes. Use the `MLNVectorStyleLayer.predicate` property to include only the features in the source layer that satisfy a condition that you define. @@ -55,15 +55,15 @@ The following aggregate operators are supported: `NSInPredicateOperatorType` | `key IN { 'iOS', 'macOS', 'tvOS', 'watchOS' }` `NSContainsPredicateOperatorType` | `{ 'iOS', 'macOS', 'tvOS', 'watchOS' } CONTAINS key` -You can use the `IN` and `CONTAINS` operators to test whether a value appears in a collection, whether a string is a substring of a larger string, or whether the evaluated feature (`SELF`) lies within a given `MGLShape` or `MGLFeature`. For example, to show one delicious local chain of sandwich shops, but not similarly named steakhouses and pizzerias: +You can use the `IN` and `CONTAINS` operators to test whether a value appears in a collection, whether a string is a substring of a larger string, or whether the evaluated feature (`SELF`) lies within a given `MLNShape` or `MLNFeature`. For example, to show one delicious local chain of sandwich shops, but not similarly named steakhouses and pizzerias: ```objc -MGLPolygon *cincinnati = [MGLPolygon polygonWithCoordinates:cincinnatiCoordinates count:sizeof(cincinnatiCoordinates) / sizeof(cincinnatiCoordinates[0])]; +MLNPolygon *cincinnati = [MLNPolygon polygonWithCoordinates:cincinnatiCoordinates count:sizeof(cincinnatiCoordinates) / sizeof(cincinnatiCoordinates[0])]; deliLayer.predicate = [NSPredicate predicateWithFormat:@"class = 'food_and_drink' AND name CONTAINS 'Izzy' AND SELF IN %@", cincinnati]; ``` ```swift -let cincinnati = MGLPolygon(coordinates: &cincinnatiCoordinates, count: UInt(cincinnatiCoordinates.count)) +let cincinnati = MLNPolygon(coordinates: &cincinnatiCoordinates, count: UInt(cincinnatiCoordinates.count)) deliLayer.predicate = NSPredicate(format: "class = 'food_and_drink' AND name CONTAINS 'Izzy' AND SELF IN %@", cincinnati) ``` @@ -135,8 +135,8 @@ of `-[NSNumber numberWithFloat:]` to avoid precision issues. ### Key paths -A key path expression refers to an attribute of the `MGLFeature` object being -evaluated for display. For example, if a polygon’s `MGLFeature.attributes` +A key path expression refers to an attribute of the `MLNFeature` object being +evaluated for display. For example, if a polygon’s `MLNFeature.attributes` dictionary contains the `floorCount` key, then the key path `floorCount` refers to the value of the `floorCount` attribute when evaluating that particular polygon. @@ -247,7 +247,7 @@ Conditionals are supported via the built-in `+[NSExpression expressionForConditional:trueExpression:falseExpression:]` method and `TERNARY()` operator. If you need to express multiple cases (“else-if”), you can either nest a conditional within a conditional or use the -[`MGL_IF()`](#code-mgl_if-code) or [`MGL_MATCH()`](#code-mgl_match-code) function. +[`MLN_IF()`](#code-mgl_if-code) or [`MLN_MATCH()`](#code-mgl_match-code) function. ### Aggregates @@ -285,15 +285,15 @@ The following variables are defined by this SDK for use with style layers:
  • Point for point features, corresponding to the - MGLPointAnnotation class + MLNPointAnnotation class
  • LineString for polyline features, corresponding to - the MGLPolyline class + the MLNPolyline class
  • Polygon for polygon features, corresponding to the - MGLPolygon class + MLNPolygon class
This variable corresponds to the @@ -330,7 +330,7 @@ The following variables are defined by this SDK for use with style layers: A number that indicates the relative distance along a line at a given point along the line. This variable evaluates to 0 at the beginning of the line and 1 at the end of the line. It can only be used with the - `MGLLineStyleLayer.lineGradient` property. It corresponds to the + `MLNLineStyleLayer.lineGradient` property. It corresponds to the NSExpression.lineProgressVariableExpression property. @@ -343,11 +343,11 @@ of a [Mapbox-specific function](#mapbox-specific-functions) that takes an `NSDictionary` as an argument: ```objc -[NSExpression expressionWithFormat:@"MGL_LET('floorCount', 2, $floorCount + 1)"]; +[NSExpression expressionWithFormat:@"MLN_LET('floorCount', 2, $floorCount + 1)"]; ``` ```swift -NSExpression(format: "MGL_LET(floorCount, 2, $floorCount + 1)") +NSExpression(format: "MLN_LET(floorCount, 2, $floorCount + 1)") ``` ## Mapbox-specific functions @@ -546,7 +546,7 @@ operator in the Mapbox Style Specification.
Selector:
mgl_distanceFrom:
Format string syntax:
-
mgl_distanceFrom(%@) with an MGLShape
+
mgl_distanceFrom(%@) with an MLNShape
Returns the straight-line distance from the evaluated object to the given shape. @@ -579,28 +579,28 @@ operator in the Mapbox Style Specification.
mgl_attributed({x, y, z})
-Concatenates and returns the array of `MGLAttributedExpression` objects, for use -with the `MGLSymbolStyleLayer.text` property. +Concatenates and returns the array of `MLNAttributedExpression` objects, for use +with the `MLNSymbolStyleLayer.text` property. -`MGLAttributedExpression.attributes` valid attributes. +`MLNAttributedExpression.attributes` valid attributes. Key | Value Type --- | --- - `MGLFontNamesAttribute` | An `NSExpression` evaluating to an `NSString` array. - `MGLFontScaleAttribute` | An `NSExpression` evaluating to an `NSNumber` value. - `MGLFontColorAttribute` | An `NSExpression` evaluating to an `UIColor` (iOS) or `NSColor` (macOS). + `MLNFontNamesAttribute` | An `NSExpression` evaluating to an `NSString` array. + `MLNFontScaleAttribute` | An `NSExpression` evaluating to an `NSNumber` value. + `MLNFontColorAttribute` | An `NSExpression` evaluating to an `UIColor` (iOS) or `NSColor` (macOS). This function corresponds to the [`format`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-types-format) operator in the Mapbox Style Specification. -### `MGL_LET` +### `MLN_LET`
Selector:
-
MGL_LET:
+
MLN_LET:
Format string syntax:
-
MGL_LET('age', uppercase('old'), 'name', uppercase('MacDonald'), mgl_join({$age, $name}))
+
MLN_LET('age', uppercase('old'), 'name', uppercase('MacDonald'), mgl_join({$age, $name}))
Arguments:
Any number of variable names interspersed with their assigned @@ -615,13 +615,13 @@ Compared to the function, this function takes the variable names and values inline before the expression that contains references to those variables. -### `MGL_MATCH` +### `MLN_MATCH`
Selector:
-
MGL_MATCH:
+
MLN_MATCH:
Format string syntax:
-
MGL_MATCH(x, 0, 'zero match', 1, 'one match', 2, 'two match', 'default')
+
MLN_MATCH(x, 0, 'zero match', 1, 'one match', 2, 'two match', 'default')
Arguments:
An input expression, then any number of argument pairs, followed by a default @@ -638,18 +638,18 @@ Returns the result of matching the input expression against the given constant values. This function corresponds to the -`+[NSExpression(MGLAdditions) mgl_expressionForMatchingExpression:inDictionary:defaultExpression:]` +`+[NSExpression(MLNAdditions) mgl_expressionForMatchingExpression:inDictionary:defaultExpression:]` method and the [`match`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-match) operator in the Mapbox Style Specification. -### `MGL_IF` +### `MLN_IF`
Selector:
-
MGL_IF:
+
MLN_IF:
Format string syntax:
-
MGL_IF(1 = 2, YES, 2 = 2, YES, NO)
+
MLN_IF(1 = 2, YES, 2 = 2, YES, NO)
Arguments:
Alternating NSPredicate conditionals and resulting expressions, @@ -665,18 +665,18 @@ and is supported on iOS 8._x_ and macOS 10.10._x_; however, each conditional passed into this function must be wrapped in a constant expression. This function corresponds to the -`+[NSExpression(MGLAdditions) mgl_expressionForConditional:trueExpression:falseExpresssion:]` +`+[NSExpression(MLNAdditions) mgl_expressionForConditional:trueExpression:falseExpresssion:]` method and the [`case`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-case) operator in the Mapbox Style Specification. -### `MGL_FUNCTION` +### `MLN_FUNCTION`
Selector:
-
MGL_FUNCTION:
+
MLN_FUNCTION:
Format string syntax:
-
MGL_FUNCTION('typeof', mystery)
+
MLN_FUNCTION('typeof', mystery)
Arguments:
Any arguments required by the expression operator. @@ -699,7 +699,7 @@ or may result in undefined behavior. The Mapbox Style Specification defines some operators for which no custom function is available. To use these operators in an `NSExpression`, call the -[`MGL_FUNCTION()`](#code-mgl_function-code) function with the same arguments +[`MLN_FUNCTION()`](#code-mgl_function-code) function with the same arguments that the operator expects. ### `boolValue` @@ -737,7 +737,7 @@ otherwise TRUE.
An NSExpression that evaluates to an NSString representing the key to look up in the dictionary or the feature attribute to - look up in the evaluated object (see MGLFeature.attributes). + look up in the evaluated object (see MLNFeature.attributes).
@@ -781,7 +781,7 @@ defined in the context dictionary. This function corresponds to the [`let`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-let) operator in the Mapbox Style Specification. See also the -[`MGL_LET`](#code-mgl_let-code) function, which is used on its own without the +[`MLN_LET`](#code-mgl_let-code) function, which is used on its own without the `FUNCTION()` operator. ### `mgl_interpolateWithCurveType:parameters:stops:` @@ -837,7 +837,7 @@ use a stop dictionary with the zoom levels 0, 10, and 20 as keys and the colors yellow, orange, and red as the values. This function corresponds to the -`+[NSExpression(MGLAdditions) mgl_expressionForInterpolatingExpression:withCurveType:parameters:stops:]` +`+[NSExpression(MLNAdditions) mgl_expressionForInterpolatingExpression:withCurveType:parameters:stops:]` method and the [`interpolate`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-interpolate) operator in the Mapbox Style Specification. See also the @@ -921,7 +921,7 @@ use a stop dictionary with the zoom levels 0, 10, and 20 as keys and the colors yellow, orange, and red as the values. This function corresponds to the -`+[NSExpression(MGLAdditions) mgl_expressionForSteppingExpression:fromExpression:stops:]` +`+[NSExpression(MLNAdditions) mgl_expressionForSteppingExpression:fromExpression:stops:]` method and the [`step`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-step) operator in the Mapbox Style Specification. @@ -942,7 +942,7 @@ operator in the Mapbox Style Specification. The target string with each of the argument strings appended in order. This function corresponds to the -`-[NSExpression(MGLAdditions) mgl_expressionByAppendingExpression:]` +`-[NSExpression(MLNAdditions) mgl_expressionByAppendingExpression:]` method and is similar to the [`concat`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#expressions-concat) operator in the Mapbox Style Specification. See also the diff --git a/platform/ios/platform/darwin/docs/guides/Tile URL Templates.md.ejs b/platform/ios/platform/darwin/docs/guides/Tile URL Templates.md.ejs index abfb9dc89..a8a194bc3 100644 --- a/platform/ios/platform/darwin/docs/guides/Tile URL Templates.md.ejs +++ b/platform/ios/platform/darwin/docs/guides/Tile URL Templates.md.ejs @@ -10,8 +10,8 @@ --> # Tile URL Templates -`MGLTileSource` objects, specifically `MGLRasterTileSource` and -`MGLVectorTileSource` objects, can be created using an initializer that accepts +`MLNTileSource` objects, specifically `MLNRasterTileSource` and +`MLNVectorTileSource` objects, can be created using an initializer that accepts an array of tile URL templates. Tile URL templates are strings that specify the URLs of the vector tiles or raster tile images to load. A template resembles an absolute URL, but with any number of placeholder strings that the source @@ -54,18 +54,18 @@ all of which are optional: is 2z−1, the tile’s bottom edge corresponds to −arctan(sinh(π)), or approximately 85.0511 degrees south. The y axis is inverted if the options parameter contains - MGLTileSourceOptionTileCoordinateSystem with a value of - MGLTileCoordinateSystemTMS. + MLNTileSourceOptionTileCoordinateSystem with a value of + MLNTileCoordinateSystemTMS. {z} The tile’s zoom level. At zoom level 0, each tile covers the entire world map; at zoom level 1, it covers ¼ of the world; at zoom level 2, 1⁄16 of the world, and so on. For tiles loaded by - a MGLRasterTileSource object, whether the tile zoom level + a MLNRasterTileSource object, whether the tile zoom level matches the map’s current zoom level depends on the value of the source’s tile size as specified in the - MGLTileSourceOptionTileSize key of the options + MLNTileSourceOptionTileSize key of the options parameter. diff --git a/platform/ios/platform/darwin/docs/guides/Working with GeoJSON Data.md b/platform/ios/platform/darwin/docs/guides/Working with GeoJSON Data.md index 269bb8603..4b3f934a9 100644 --- a/platform/ios/platform/darwin/docs/guides/Working with GeoJSON Data.md +++ b/platform/ios/platform/darwin/docs/guides/Working with GeoJSON Data.md @@ -12,52 +12,52 @@ will be hosted on Mapbox servers. When a user loads your style, the SDK automatically loads the GeoJSON data for display. Alternatively, if you need to host the GeoJSON file elsewhere or bundle it with -your application, you can use a GeoJSON file as the basis of an `MGLShapeSource` +your application, you can use a GeoJSON file as the basis of an `MLNShapeSource` object. Pass the file’s URL into the -`-[MGLShapeSource initWithIdentifier:URL:options:]` initializer and add the -shape source to the map using the `-[MGLStyle addSource:]` method. The URL may +`-[MLNShapeSource initWithIdentifier:URL:options:]` initializer and add the +shape source to the map using the `-[MLNStyle addSource:]` method. The URL may be a local file URL, an HTTP URL, or an HTTPS URL. -Once you’ve added the GeoJSON file to the map via an `MGLShapeSource` object, +Once you’ve added the GeoJSON file to the map via an `MLNShapeSource` object, you can configure the appearance of its data and control what data is visible -using `MGLStyleLayer` objects. You can also +using `MLNStyleLayer` objects. You can also [access the data programmatically](#extracting-geojson-data-from-the-map). ## Converting GeoJSON data into shape objects If you have GeoJSON data in the form of source code (also known as “GeoJSON -text”), you can convert it into an `MGLShape`, `MGLFeature`, or -`MGLShapeCollectionFeature` object that the `MGLShapeSource` class understands +text”), you can convert it into an `MLNShape`, `MLNFeature`, or +`MLNShapeCollectionFeature` object that the `MLNShapeSource` class understands natively. First, create an `NSData` object out of the source code string or file contents, then pass that data object into the -`+[MGLShape shapeWithData:encoding:error:]` method. Finally, you can pass the +`+[MLNShape shapeWithData:encoding:error:]` method. Finally, you can pass the resulting shape or feature object into the -`-[MGLShapeSource initWithIdentifier:shape:options:]` initializer and add it to +`-[MLNShapeSource initWithIdentifier:shape:options:]` initializer and add it to the map, or you can use the object and its properties to power non-map-related functionality in your application. -To include multiple shapes in the source, create and pass an `MGLShapeCollection` or - `MGLShapeCollectionFeature` object to - `-[MGLShapeSource initWithIdentifier:shape:options:]`. Alternatively, use the - `-[MGLShapeSource initWithIdentifier:features:options:]` or - `-[MGLShapeSource initWithIdentifier:shapes:options:]` method to create a shape source - with an array. `-[MGLShapeSource initWithIdentifier:features:options:]` accepts only `MGLFeature` - instances, such as `MGLPointFeature` objects, whose attributes you can use when - applying a predicate to `MGLVectorStyleLayer` or configuring a style layer’s +To include multiple shapes in the source, create and pass an `MLNShapeCollection` or + `MLNShapeCollectionFeature` object to + `-[MLNShapeSource initWithIdentifier:shape:options:]`. Alternatively, use the + `-[MLNShapeSource initWithIdentifier:features:options:]` or + `-[MLNShapeSource initWithIdentifier:shapes:options:]` method to create a shape source + with an array. `-[MLNShapeSource initWithIdentifier:features:options:]` accepts only `MLNFeature` + instances, such as `MLNPointFeature` objects, whose attributes you can use when + applying a predicate to `MLNVectorStyleLayer` or configuring a style layer’s appearance. ## Extracting GeoJSON data from the map -Any `MGLShape`, `MGLFeature`, or `MGLShapeCollectionFeature` object has an -`-[MGLShape geoJSONDataUsingEncoding:]` method that you can use to create a +Any `MLNShape`, `MLNFeature`, or `MLNShapeCollectionFeature` object has an +`-[MLNShape geoJSONDataUsingEncoding:]` method that you can use to create a GeoJSON source code representation of the object. You can extract a feature object from the map using a method such as -`-[MGLMapView visibleFeaturesAtPoint:]`. +`-[MLNMapView visibleFeaturesAtPoint:]`. ## About GeoJSON deserialization -The process of converting GeoJSON text into `MGLShape`, `MGLFeature`, or -`MGLShapeCollectionFeature` objects is known as “GeoJSON deserialization”. +The process of converting GeoJSON text into `MLNShape`, `MLNFeature`, or +`MLNShapeCollectionFeature` objects is known as “GeoJSON deserialization”. GeoJSON geometries, features, and feature collections are known in this SDK as shapes, features, and shape collection features, respectively. @@ -67,27 +67,27 @@ the Core Location framework: GeoJSON object type | SDK type --------------------|--------- `Position` (longitude, latitude) | `CLLocationCoordinate2D` (latitude, longitude) -`Point` | `MGLPointAnnotation` -`MultiPoint` | `MGLPointCollection` -`LineString` | `MGLPolyline` -`MultiLineString` | `MGLMultiPolyline` -`Polygon` | `MGLPolygon` -Linear ring | `MGLPolygon.coordinates`, `MGLPolygon.interiorPolygons` -`MultiPolygon` | `MGLMultiPolygon` -`GeometryCollection` | `MGLShapeCollection` -`Feature` | `MGLFeature` -`FeatureCollection` | `MGLShapeCollectionFeature` +`Point` | `MLNPointAnnotation` +`MultiPoint` | `MLNPointCollection` +`LineString` | `MLNPolyline` +`MultiLineString` | `MLNMultiPolyline` +`Polygon` | `MLNPolygon` +Linear ring | `MLNPolygon.coordinates`, `MLNPolygon.interiorPolygons` +`MultiPolygon` | `MLNMultiPolygon` +`GeometryCollection` | `MLNShapeCollection` +`Feature` | `MLNFeature` +`FeatureCollection` | `MLNShapeCollectionFeature` -A `Feature` object in GeoJSON corresponds to an instance of an `MGLShape` -subclass conforming to the `MGLFeature` protocol. There is a distinct -`MGLFeature`-conforming class for each type of geometry that a GeoJSON feature +A `Feature` object in GeoJSON corresponds to an instance of an `MLNShape` +subclass conforming to the `MLNFeature` protocol. There is a distinct +`MLNFeature`-conforming class for each type of geometry that a GeoJSON feature can contain. This allows features to be used as raw shapes where convenient. For example, some features can be added to a map view as annotations. Note that identifiers and attributes will not be available for feature querying when a feature is used as an annotation. -In contrast to the GeoJSON standard, it is possible for `MGLShape` subclasses -other than `MGLPointAnnotation` to straddle the antimeridian. +In contrast to the GeoJSON standard, it is possible for `MLNShape` subclasses +other than `MLNPointAnnotation` to straddle the antimeridian. The following GeoJSON data types correspond straightforwardly to Foundation data types when they occur as feature identifiers or property values: diff --git a/platform/ios/platform/darwin/docs/theme/assets/css/jazzy.css.scss b/platform/ios/platform/darwin/docs/theme/assets/css/jazzy.css.scss index efbd2e994..e3b78b8de 100644 --- a/platform/ios/platform/darwin/docs/theme/assets/css/jazzy.css.scss +++ b/platform/ios/platform/darwin/docs/theme/assets/css/jazzy.css.scss @@ -384,14 +384,14 @@ pre code { content: "(Protocol)"; } -.nav-group-task[data-name="MGLForegroundStyleLayer"], -.nav-group-task[data-name="MGLMultiPoint"], -.nav-group-task[data-name="MGLShape"], -.nav-group-task[data-name="MGLSource"], -.nav-group-task[data-name="MGLStyleFunction"], -.nav-group-task[data-name="MGLStyleLayer"], -.nav-group-task[data-name="MGLTileSource"], -.nav-group-task[data-name="MGLVectorStyleLayer"] { +.nav-group-task[data-name="MLNForegroundStyleLayer"], +.nav-group-task[data-name="MLNMultiPoint"], +.nav-group-task[data-name="MLNShape"], +.nav-group-task[data-name="MLNSource"], +.nav-group-task[data-name="MLNStyleFunction"], +.nav-group-task[data-name="MLNStyleLayer"], +.nav-group-task[data-name="MLNTileSource"], +.nav-group-task[data-name="MLNVectorStyleLayer"] { .nav-group-task-link::after { @extend %nav-group-task-gloss; content: "(Abstract Class)"; diff --git a/platform/ios/platform/darwin/include/mbgl/util/image+MGLAdditions.hpp b/platform/ios/platform/darwin/include/mbgl/util/image+MLNAdditions.hpp similarity index 71% rename from platform/ios/platform/darwin/include/mbgl/util/image+MGLAdditions.hpp rename to platform/ios/platform/darwin/include/mbgl/util/image+MLNAdditions.hpp index c5343af4d..2ec75dae2 100644 --- a/platform/ios/platform/darwin/include/mbgl/util/image+MGLAdditions.hpp +++ b/platform/ios/platform/darwin/include/mbgl/util/image+MLNAdditions.hpp @@ -5,8 +5,8 @@ #include // Creates a CGImage from a PremultipliedImage, taking over the memory ownership. -CGImageRef CGImageCreateWithMGLPremultipliedImage(mbgl::PremultipliedImage&&); +CGImageRef CGImageCreateWithMLNPremultipliedImage(mbgl::PremultipliedImage&&); // Creates a PremultipliedImage by copying the pixels of the CGImage. // Does not alter the retain count of the supplied CGImage. -mbgl::PremultipliedImage MGLPremultipliedImageFromCGImage(CGImageRef); +mbgl::PremultipliedImage MLNPremultipliedImageFromCGImage(CGImageRef); diff --git a/platform/ios/platform/darwin/scripts/check-public-symbols.js b/platform/ios/platform/darwin/scripts/check-public-symbols.js index a2045f81e..f46b9fb7b 100755 --- a/platform/ios/platform/darwin/scripts/check-public-symbols.js +++ b/platform/ios/platform/darwin/scripts/check-public-symbols.js @@ -7,7 +7,7 @@ const path = require('path'); const execFileSync = require('child_process').execFileSync; const _ = require('lodash'); -const keyword = /\bMGL_EXPORT\b/; +const keyword = /\bMLN_EXPORT\b/; let scanned = []; diff --git a/platform/ios/platform/darwin/scripts/generate-style-code.js b/platform/ios/platform/darwin/scripts/generate-style-code.js index efbb3035d..b3496071e 100755 --- a/platform/ios/platform/darwin/scripts/generate-style-code.js +++ b/platform/ios/platform/darwin/scripts/generate-style-code.js @@ -10,7 +10,7 @@ const assert = require('assert'); require('../../../../../scripts/style-code'); const cocoaConventions = require('./style-spec-cocoa-conventions-v8.json'); -const prefix = 'MGL'; +const prefix = 'MLN'; const suffix = 'StyleLayer'; let spec = _.merge(require('../../../scripts/style-spec'), require('./style-spec-overrides-v8.json')); @@ -140,7 +140,7 @@ global.arrayType = function (property) { global.testImplementation = function (property, layerType, isFunction) { let helperMsg = testHelperMessage(property, layerType, isFunction); - return `layer.${objCName(property)} = [MGLRuntimeStylingHelper ${helperMsg}];`; + return `layer.${objCName(property)} = [MLNRuntimeStylingHelper ${helperMsg}];`; }; global.objCTestValue = function (property, layerType, arraysAsStructs, indent) { @@ -159,13 +159,13 @@ global.objCTestValue = function (property, layerType, arraysAsStructs, indent) { case 'resolvedImage': return layerType === 'string' ? `@"${_.startCase(propertyName)}"` : - `@"MGL_FUNCTION('image', '${_.startCase(propertyName)}')"`; + `@"MLN_FUNCTION('image', '${_.startCase(propertyName)}')"`; case 'string': return `@"'${_.startCase(propertyName)}'"`; case 'enum': return `@"'${_.last(_.keys(property.values))}'"`; case 'color': - return '@"%@", [MGLColor redColor]'; + return '@"%@", [MLNColor redColor]'; case 'array': switch (arrayType(property)) { case 'dasharray': @@ -184,7 +184,7 @@ global.objCTestValue = function (property, layerType, arraysAsStructs, indent) { case 'translate': { if (arraysAsStructs) { let iosValue = '[NSValue valueWithCGVector:CGVectorMake(1, 1)]'.indent(indent * 4); - let macosValue = '[NSValue valueWithMGLVector:CGVectorMake(1, -1)]'.indent(indent * 4); + let macosValue = '[NSValue valueWithMLNVector:CGVectorMake(1, -1)]'.indent(indent * 4); return `@"%@",\n#if TARGET_OS_IPHONE\n${iosValue}\n#else\n${macosValue}\n#endif\n${''.indent((indent - 1) * 4)}`; } return '@"{1, 1}"'; @@ -277,12 +277,12 @@ global.mbglExpressionTestValue = function (property, layerType) { global.testGetterImplementation = function (property, layerType, isFunction) { let helperMsg = testHelperMessage(property, layerType, isFunction); - let value = `[MGLRuntimeStylingHelper ${helperMsg}]`; + let value = `[MLNRuntimeStylingHelper ${helperMsg}]`; if (property.type === 'enum') { if (isFunction) { return `XCTAssertEqualObjects(gLayer.${objCName(property)}, ${value});`; } - return `XCTAssert([gLayer.${objCName(property)} isKindOfClass:[MGLConstantStyleValue class]]); + return `XCTAssert([gLayer.${objCName(property)} isKindOfClass:[MLNConstantStyleValue class]]); XCTAssertEqualObjects(gLayer.${objCName(property)}, ${value});`; } return `XCTAssertEqualObjects(gLayer.${objCName(property)}, ${value});`; @@ -358,7 +358,7 @@ global.propertyDoc = function (propertyName, property, layerType, kind) { let layoutProperties = spec[`layout_${layerType}`] || []; let paintProperties = spec[`paint_${layerType}`] || []; if (symbol in layoutProperties || symbol in paintProperties) { - return '`MGL' + camelize(layerType) + 'StyleLayer.' + camelizeWithLeadingLowercase(symbol) + '`'; + return '`MLN' + camelize(layerType) + 'StyleLayer.' + camelizeWithLeadingLowercase(symbol) + '`'; } } if ('values' in property && Object.keys(property.values).indexOf(symbol) !== -1) { @@ -484,7 +484,7 @@ global.describeType = function (property) { case 'resolvedImage': return 'string'; case 'enum': - return '`MGL' + camelize(property.name) + '`'; + return '`MLN' + camelize(property.name) + '`'; case 'color': return '`UIColor`'; case 'array': @@ -495,11 +495,11 @@ global.describeType = function (property) { case 'translate': return '`CGVector`'; case 'position': - return '`MGLSphericalPosition`'; + return '`MLNSphericalPosition`'; case 'anchor': - return '`MGLTextAnchor` array'; + return '`MLNTextAnchor` array'; case 'mode': - return '`MGLTextWritingMode` array'; + return '`MLNTextWritingMode` array'; default: return 'array'; } @@ -580,7 +580,7 @@ global.describeValue = function (value, property, layerType) { case 'translate': return 'an `NSValue` object containing a `CGVector` struct set to' + ` ${formatNumber(value[0])}${units} rightward and ${formatNumber(value[1])}${units} downward`; case 'position': - return 'an `MGLSphericalPosition` struct set to' + ` ${formatNumber(value[0])} radial, ${formatNumber(value[1])} azimuthal and ${formatNumber(value[2])} polar`; + return 'an `MLNSphericalPosition` struct set to' + ` ${formatNumber(value[0])} radial, ${formatNumber(value[1])} azimuthal and ${formatNumber(value[2])} polar`; default: return 'the array `' + value.join('`, `') + '`'; } @@ -622,7 +622,7 @@ global.propertyType = function (property) { case 'enum': return 'NSValue *'; case 'color': - return 'MGLColor *'; + return 'MLNColor *'; case 'array': switch (arrayType(property)) { case 'dasharray': @@ -668,7 +668,7 @@ global.valueTransformerArguments = function (property) { case 'string': return ['std::string', objCType]; case 'enum': - return [mbglType(property), 'NSValue *', mbglType(property), `MGL${camelize(property.name)}`]; + return [mbglType(property), 'NSValue *', mbglType(property), `MLN${camelize(property.name)}`]; case 'color': return ['mbgl::Color', objCType]; case 'array': @@ -685,9 +685,9 @@ global.valueTransformerArguments = function (property) { case 'translate': return ['std::array', objCType]; case 'anchor': - return ['std::vector', objCType, 'mbgl::style::SymbolAnchorType', 'MGLTextAnchor']; + return ['std::vector', objCType, 'mbgl::style::SymbolAnchorType', 'MLNTextAnchor']; case 'mode': - return ['std::vector', objCType, 'mbgl::style::TextWritingModeType', 'MGLTextWritingMode']; + return ['std::vector', objCType, 'mbgl::style::TextWritingModeType', 'MLNTextWritingMode']; default: throw new Error(`unknown array type for ${property.name}`); } @@ -774,20 +774,20 @@ const lightProperties = Object.keys(spec['light']).reduce((memo, name) => { const lightDoc = spec['light-cocoa-doc']; const lightType = 'light'; -const layerH = ejs.compile(fs.readFileSync('platform/darwin/src/MGLStyleLayer.h.ejs', 'utf8'), { strict: true }); -const layerPrivateH = ejs.compile(fs.readFileSync('platform/darwin/src/MGLStyleLayer_Private.h.ejs', 'utf8'), { strict: true }); -const layerM = ejs.compile(fs.readFileSync('platform/darwin/src/MGLStyleLayer.mm.ejs', 'utf8'), { strict: true}); -const testLayers = ejs.compile(fs.readFileSync('platform/darwin/test/MGLStyleLayerTests.mm.ejs', 'utf8'), { strict: true}); +const layerH = ejs.compile(fs.readFileSync('platform/darwin/src/MLNStyleLayer.h.ejs', 'utf8'), { strict: true }); +const layerPrivateH = ejs.compile(fs.readFileSync('platform/darwin/src/MLNStyleLayer_Private.h.ejs', 'utf8'), { strict: true }); +const layerM = ejs.compile(fs.readFileSync('platform/darwin/src/MLNStyleLayer.mm.ejs', 'utf8'), { strict: true}); +const testLayers = ejs.compile(fs.readFileSync('platform/darwin/test/MLNStyleLayerTests.mm.ejs', 'utf8'), { strict: true}); const forStyleAuthorsMD = ejs.compile(fs.readFileSync('platform/darwin/docs/guides/For Style Authors.md.ejs', 'utf8'), { strict: true }); const ddsGuideMD = ejs.compile(fs.readFileSync('platform/darwin/docs/guides/Migrating to Expressions.md.ejs', 'utf8'), { strict: true }); const templatesMD = ejs.compile(fs.readFileSync('platform/darwin/docs/guides/Tile URL Templates.md.ejs', 'utf8'), { strict: true }); -const lightH = ejs.compile(fs.readFileSync('platform/darwin/src/MGLLight.h.ejs', 'utf8'), {strict: true}); -const lightM = ejs.compile(fs.readFileSync('platform/darwin/src/MGLLight.mm.ejs', 'utf8'), {strict: true}); -const testLight = ejs.compile(fs.readFileSync('platform/darwin/test/MGLLightTest.mm.ejs', 'utf8'), { strict: true}); -writeIfModified(`platform/darwin/src/MGLLight.h`, duplicatePlatformDecls(lightH({ properties: lightProperties, doc: lightDoc, type: lightType }))); -writeIfModified(`platform/darwin/src/MGLLight.mm`, lightM({ properties: lightProperties, doc: lightDoc, type: lightType })); -writeIfModified(`platform/darwin/test/MGLLightTest.mm`, testLight({ properties: lightProperties, doc: lightDoc, type: lightType })); +const lightH = ejs.compile(fs.readFileSync('platform/darwin/src/MLNLight.h.ejs', 'utf8'), {strict: true}); +const lightM = ejs.compile(fs.readFileSync('platform/darwin/src/MLNLight.mm.ejs', 'utf8'), {strict: true}); +const testLight = ejs.compile(fs.readFileSync('platform/darwin/test/MLNLightTest.mm.ejs', 'utf8'), { strict: true}); +writeIfModified(`platform/darwin/src/MLNLight.h`, duplicatePlatformDecls(lightH({ properties: lightProperties, doc: lightDoc, type: lightType }))); +writeIfModified(`platform/darwin/src/MLNLight.mm`, lightM({ properties: lightProperties, doc: lightDoc, type: lightType })); +writeIfModified(`platform/darwin/test/MLNLightTest.mm`, testLight({ properties: lightProperties, doc: lightDoc, type: lightType })); const layers = _(spec.layer.type.values).map((value, layerType) => { @@ -815,16 +815,16 @@ const layers = _(spec.layer.type.values).map((value, layerType) => { }).sortBy(['type']).value(); function duplicatePlatformDecls(src) { - // Look for a documentation comment that contains “MGLColor” or “UIColor” + // Look for a documentation comment that contains “MLNColor” or “UIColor” // and the subsequent function, method, or property declaration. Try not to // match greedily. - return src.replace(/(\/\*\*(?:\*[^\/]|[^*])*?\b(?:MGL|NS|UI)Color\b[\s\S]*?\*\/)(\s*.+?;)/g, + return src.replace(/(\/\*\*(?:\*[^\/]|[^*])*?\b(?:MLN|NS|UI)Color\b[\s\S]*?\*\/)(\s*.+?;)/g, (match, comment, decl) => { - let macosComment = comment.replace(/\b(?:MGL|UI)Color\b/g, 'NSColor') + let macosComment = comment.replace(/\b(?:MLN|UI)Color\b/g, 'NSColor') // Use the correct indefinite article. .replace(/\ba(\s+`?NSColor)\b/gi, 'an$1'); - let iosDecl = decl.replace(/\bMGLColor\b/g, 'UIColor'); - let macosDecl = decl.replace(/\b(?:MGL|UI)Color\b/g, 'NSColor'); + let iosDecl = decl.replace(/\bMLNColor\b/g, 'UIColor'); + let macosDecl = decl.replace(/\b(?:MLN|UI)Color\b/g, 'NSColor'); return `\ #if TARGET_OS_IPHONE ${comment}${iosDecl} @@ -868,7 +868,7 @@ for (var layer of layers) { } // Extract examples for guides from unit tests. -let examplesSrc = fs.readFileSync('platform/darwin/test/MGLDocumentationGuideTests.swift', 'utf8'); +let examplesSrc = fs.readFileSync('platform/darwin/test/MLNDocumentationGuideTests.swift', 'utf8'); const exampleRegex = /func test([\w$]+)\s*\(\)\s*\{[^]*?\n([ \t]+)\/\/#-example-code\n([^]+?)\n\2\/\/#-end-example-code\n/gm; let examples = {}; @@ -889,7 +889,7 @@ global.guideExample = function (guide, exampleId, os) { let testMethodName = `${guide}$${exampleId}`; let example = examples[testMethodName]; if (!example) { - console.error(`MGLDocumentationExampleTests.test${testMethodName}() not found.`); + console.error(`MLNDocumentationExampleTests.test${testMethodName}() not found.`); process.exit(1); } diff --git a/platform/ios/platform/darwin/scripts/style-spec-overrides-v8.json b/platform/ios/platform/darwin/scripts/style-spec-overrides-v8.json index 37adc87fb..80ef6fde4 100644 --- a/platform/ios/platform/darwin/scripts/style-spec-overrides-v8.json +++ b/platform/ios/platform/darwin/scripts/style-spec-overrides-v8.json @@ -1,47 +1,47 @@ { - "light-cocoa-doc": "An `MGLLight` object represents the light source for extruded geometries in `MGLStyle`.\n\n### Example\n```swift\n```\n\n#### Related examples\nSee the Adjust light of 3D buildings to learn how to create and modify the light source for 3D geometries.", + "light-cocoa-doc": "An `MLNLight` object represents the light source for extruded geometries in `MLNStyle`.\n\n### Example\n```swift\n```\n\n#### Related examples\nSee the Adjust light of 3D buildings to learn how to create and modify the light source for 3D geometries.", "light": { "position": { - "doc": "Position of the `MGLLight` source relative to lit (extruded) geometries, in a `MGLSphericalPosition` struct [radial coordinate, azimuthal angle, polar angle] where radial indicates the distance from the center of the base of an object to its light, azimuthal indicates the position of the light relative to 0° (0° when `MGLLight.anchor` is set to `MGLLightAnchorViewport` corresponds to the top of the viewport, or 0° when `MGLLight.anchor` is set to `MGLLightAnchorMap` corresponds to due north, and degrees proceed clockwise), and polar indicates the height of the light (from 0°, directly above, to 180°, directly below).", - "examples": "See the Adjust light of 3D buildings example to learn how to create and modify the position of value of an `MGLLight` object for 3D geometries." + "doc": "Position of the `MLNLight` source relative to lit (extruded) geometries, in a `MLNSphericalPosition` struct [radial coordinate, azimuthal angle, polar angle] where radial indicates the distance from the center of the base of an object to its light, azimuthal indicates the position of the light relative to 0° (0° when `MLNLight.anchor` is set to `MLNLightAnchorViewport` corresponds to the top of the viewport, or 0° when `MLNLight.anchor` is set to `MLNLightAnchorMap` corresponds to due north, and degrees proceed clockwise), and polar indicates the height of the light (from 0°, directly above, to 180°, directly below).", + "examples": "See the Adjust light of 3D buildings example to learn how to create and modify the position of value of an `MLNLight` object for 3D geometries." } }, "layer": { "type": { "values": { "fill": { - "doc": "An `MGLFillStyleLayer` is a style layer that renders one or more filled (and optionally stroked) polygons on the map.\n\nUse a fill style layer to configure the visual appearance of polygon or multipolygon features. These features can come from vector tiles loaded by an `MGLVectorTileSource` object, or they can be `MGLPolygon`, `MGLPolygonFeature`, `MGLMultiPolygon`, or `MGLMultiPolygonFeature` instances in an `MGLShapeSource` or `MGLComputedShapeSource` object.", - "examples": "See the Select a feature within a layer example to learn how to use a `TERNARY` expression to modify the `fillOpacity` of an `MGLFillStyleLayer` object. See the Add a pattern to a polygon example to learn how to use an image to add pattern to the features styled by a `MGLFillStyleLayer`." + "doc": "An `MLNFillStyleLayer` is a style layer that renders one or more filled (and optionally stroked) polygons on the map.\n\nUse a fill style layer to configure the visual appearance of polygon or multipolygon features. These features can come from vector tiles loaded by an `MLNVectorTileSource` object, or they can be `MLNPolygon`, `MLNPolygonFeature`, `MLNMultiPolygon`, or `MLNMultiPolygonFeature` instances in an `MLNShapeSource` or `MLNComputedShapeSource` object.", + "examples": "See the Select a feature within a layer example to learn how to use a `TERNARY` expression to modify the `fillOpacity` of an `MLNFillStyleLayer` object. See the Add a pattern to a polygon example to learn how to use an image to add pattern to the features styled by a `MLNFillStyleLayer`." }, "fill-extrusion": { - "doc": "An `MGLFillExtrusionStyleLayer` is a style layer that renders one or more 3D extruded polygons on the map.\n\nUse a fill-extrusion style layer to configure the visual appearance of polygon or multipolygon features. These features can come from vector tiles loaded by an `MGLVectorTileSource` object, or they can be `MGLPolygon`, `MGLPolygonFeature`, `MGLMultiPolygon`, or `MGLMultiPolygonFeature` instances in an `MGLShapeSource` or `MGLComputedShapeSource` object.", + "doc": "An `MLNFillExtrusionStyleLayer` is a style layer that renders one or more 3D extruded polygons on the map.\n\nUse a fill-extrusion style layer to configure the visual appearance of polygon or multipolygon features. These features can come from vector tiles loaded by an `MLNVectorTileSource` object, or they can be `MLNPolygon`, `MLNPolygonFeature`, `MLNMultiPolygon`, or `MLNMultiPolygonFeature` instances in an `MLNShapeSource` or `MLNComputedShapeSource` object.", "examples": "See the Display 3D buildings example to learn how to add and style 3D layers on a map." }, "line": { - "doc": "An `MGLLineStyleLayer` is a style layer that renders one or more stroked polylines on the map.\n\nUse a line style layer to configure the visual appearance of polyline or multipolyline features. These features can come from vector tiles loaded by an `MGLVectorTileSource` object, or they can be `MGLPolyline`, `MGLPolylineFeature`, `MGLMultiPolyline`, or `MGLMultiPolylineFeature` instances in an `MGLShapeSource` or `MGLComputedShapeSource` object.", - "examples": "See the Add multiple shapes from a single shape source example to learn how to add a line to your map using this style layer. See the Add a line style layer from GeoJSON example to learn how to add and style line data to an `MGLMapView` object at runtime." + "doc": "An `MLNLineStyleLayer` is a style layer that renders one or more stroked polylines on the map.\n\nUse a line style layer to configure the visual appearance of polyline or multipolyline features. These features can come from vector tiles loaded by an `MLNVectorTileSource` object, or they can be `MLNPolyline`, `MLNPolylineFeature`, `MLNMultiPolyline`, or `MLNMultiPolylineFeature` instances in an `MLNShapeSource` or `MLNComputedShapeSource` object.", + "examples": "See the Add multiple shapes from a single shape source example to learn how to add a line to your map using this style layer. See the Add a line style layer from GeoJSON example to learn how to add and style line data to an `MLNMapView` object at runtime." }, "symbol": { - "doc": "An `MGLSymbolStyleLayer` is a style layer that renders icon and text labels at points or along lines on the map.\n\nUse a symbol style layer to configure the visual appearance of feature labels. These features can come from vector tiles loaded by an `MGLVectorTileSource` object, or they can be `MGLShape` or `MGLFeature` instances in an `MGLShapeSource` or `MGLComputedShapeSource` object.", + "doc": "An `MLNSymbolStyleLayer` is a style layer that renders icon and text labels at points or along lines on the map.\n\nUse a symbol style layer to configure the visual appearance of feature labels. These features can come from vector tiles loaded by an `MLNVectorTileSource` object, or they can be `MLNShape` or `MLNFeature` instances in an `MLNShapeSource` or `MLNComputedShapeSource` object.", "examples": "See the Dynamically style interactive points and Use images to cluster point data examples learn how to style data on your map using this layer." }, "circle": { - "doc": "An `MGLCircleStyleLayer` is a style layer that renders one or more filled circles on the map.\n\nUse a circle style layer to configure the visual appearance of point or point collection features. These features can come from vector tiles loaded by an `MGLVectorTileSource` object, or they can be `MGLPointAnnotation`, `MGLPointFeature`, `MGLPointCollection`, or `MGLPointCollectionFeature` instances in an `MGLShapeSource` or `MGLComputedShapeSource` object.\n\nA circle style layer renders circles whose radii are measured in screen units. To display circles on the map whose radii correspond to real-world distances, use many-sided regular polygons and configure their appearance using an `MGLFillStyleLayer` object.", + "doc": "An `MLNCircleStyleLayer` is a style layer that renders one or more filled circles on the map.\n\nUse a circle style layer to configure the visual appearance of point or point collection features. These features can come from vector tiles loaded by an `MLNVectorTileSource` object, or they can be `MLNPointAnnotation`, `MLNPointFeature`, `MLNPointCollection`, or `MLNPointCollectionFeature` instances in an `MLNShapeSource` or `MLNComputedShapeSource` object.\n\nA circle style layer renders circles whose radii are measured in screen units. To display circles on the map whose radii correspond to real-world distances, use many-sided regular polygons and configure their appearance using an `MLNFillStyleLayer` object.", "examples": "See the Data-driven circles, Add multiple shapes from a single shape source, and Cluster point data examples to learn how to add circles to your map using this style layer." }, "heatmap": { - "doc": "An `MGLHeatmapStyleLayer` is a style layer that renders a heatmap.\n\nA heatmap visualizes the spatial distribution of a large, dense set of point data, using color to avoid cluttering the map with individual points at low zoom levels. The points are weighted by an attribute you specify. Use a heatmap style layer in conjunction with point or point collection features. These features can come from vector tiles loaded by an `MGLVectorTileSource` object, or they can be `MGLPointAnnotation`, `MGLPointFeature`, `MGLPointCollection`, or `MGLPointCollectionFeature` instances in an `MGLShapeSource` or `MGLComputedShapeSource` object.\n\nConsider accompanying a heatmap style layer with an `MGLCircleStyleLayer` or `MGLSymbolStyleLayer` at high zoom levels. If you are unsure whether the point data in an `MGLShapeSource` is dense enough to warrant a heatmap, you can alternatively cluster the source using the `MGLShapeSourceOptionClustered` option and render the data using an `MGLCircleStyleLayer` or `MGLSymbolStyleLayer`.", + "doc": "An `MLNHeatmapStyleLayer` is a style layer that renders a heatmap.\n\nA heatmap visualizes the spatial distribution of a large, dense set of point data, using color to avoid cluttering the map with individual points at low zoom levels. The points are weighted by an attribute you specify. Use a heatmap style layer in conjunction with point or point collection features. These features can come from vector tiles loaded by an `MLNVectorTileSource` object, or they can be `MLNPointAnnotation`, `MLNPointFeature`, `MLNPointCollection`, or `MLNPointCollectionFeature` instances in an `MLNShapeSource` or `MLNComputedShapeSource` object.\n\nConsider accompanying a heatmap style layer with an `MLNCircleStyleLayer` or `MLNSymbolStyleLayer` at high zoom levels. If you are unsure whether the point data in an `MLNShapeSource` is dense enough to warrant a heatmap, you can alternatively cluster the source using the `MLNShapeSourceOptionClustered` option and render the data using an `MLNCircleStyleLayer` or `MLNSymbolStyleLayer`.", "examples": "See the Create a heatmap layer example to learn how to add this style layer to your map." }, "raster": { - "doc": "An `MGLRasterStyleLayer` is a style layer that renders georeferenced raster imagery on the map, especially raster tiles.\n\nUse a raster style layer to configure the color parameters of raster tiles loaded by an `MGLRasterTileSource` object or raster images loaded by an `MGLImageSource` object. For example, you could use a raster style layer to render Mapbox Satellite imagery, a raster tile set uploaded to Mapbox Studio, or a raster map authored in TileMill, the classic Mapbox Editor, or Mapbox Studio Classic.\n\nRaster images may also be used as icons or patterns in a style layer. To register an image for use as an icon or pattern, use the `-[MGLStyle setImage:forName:]` method. To configure a point annotation’s image, use the `MGLAnnotationImage` class.", + "doc": "An `MLNRasterStyleLayer` is a style layer that renders georeferenced raster imagery on the map, especially raster tiles.\n\nUse a raster style layer to configure the color parameters of raster tiles loaded by an `MLNRasterTileSource` object or raster images loaded by an `MLNImageSource` object. For example, you could use a raster style layer to render Mapbox Satellite imagery, a raster tile set uploaded to Mapbox Studio, or a raster map authored in TileMill, the classic Mapbox Editor, or Mapbox Studio Classic.\n\nRaster images may also be used as icons or patterns in a style layer. To register an image for use as an icon or pattern, use the `-[MLNStyle setImage:forName:]` method. To configure a point annotation’s image, use the `MLNAnnotationImage` class.", "examples": "See the Add an image and Add raster imagery examples to learn how to add imagery with this style layer." }, "hillshade": { - "doc": "An `MGLHillshadeStyleLayer` is a style layer that renders raster digital elevation model (DEM) tiles on the map.\n\nUse a hillshade style layer to configure the color parameters of raster tiles loaded by an `MGLRasterDEMSource` object. For example, you could use a hillshade style layer to render Mapbox Terrain-RGB data.\n\nTo display posterized hillshading based on vector shapes, as with the Mapbox Terrain source, use an `MGLVectorTileSource` object in conjunction with several `MGLFillStyleLayer` objects." + "doc": "An `MLNHillshadeStyleLayer` is a style layer that renders raster digital elevation model (DEM) tiles on the map.\n\nUse a hillshade style layer to configure the color parameters of raster tiles loaded by an `MLNRasterDEMSource` object. For example, you could use a hillshade style layer to render Mapbox Terrain-RGB data.\n\nTo display posterized hillshading based on vector shapes, as with the Mapbox Terrain source, use an `MLNVectorTileSource` object in conjunction with several `MLNFillStyleLayer` objects." }, "background": { - "doc": "An `MGLBackgroundStyleLayer` is a style layer that covers the entire map. Use a background style layer to configure a color or pattern to show below all other map content. If the style’s other layers use the Mapbox Streets source, the background style layer is responsible for drawing land, whereas the oceans and other bodies of water are drawn by `MGLFillStyleLayer` objects.\n\nA background style layer is typically the bottommost layer in a style, because it covers the entire map and can occlude any layers below it. You can therefore access it by getting the last item in the `MGLStyle.layers` array.\n\nIf the background style layer is transparent or omitted from the style, any portion of the map view that does not show another style layer is transparent." + "doc": "An `MLNBackgroundStyleLayer` is a style layer that covers the entire map. Use a background style layer to configure a color or pattern to show below all other map content. If the style’s other layers use the Mapbox Streets source, the background style layer is responsible for drawing land, whereas the oceans and other bodies of water are drawn by `MLNFillStyleLayer` objects.\n\nA background style layer is typically the bottommost layer in a style, because it covers the entire map and can occlude any layers below it. You can therefore access it by getting the last item in the `MLNStyle.layers` array.\n\nIf the background style layer is transparent or omitted from the style, any portion of the map view that does not show another style layer is transparent." } } } @@ -67,11 +67,11 @@ "doc": "Offset distance of icon from its anchor." }, "icon-image": { - "doc": "Name of a style image to use for drawing an image background.\n\nUse the `+[MGLStyle setImage:forName:]` method to associate an image with a name that you can set this property to.\n\nWithin a constant string value, a feature attribute name enclosed in curly braces (e.g., `{token}`) is replaced with the value of the named attribute. Tokens inside non-constant expressions are ignored; instead, use `mgl_join:` and key path expressions.", + "doc": "Name of a style image to use for drawing an image background.\n\nUse the `+[MLNStyle setImage:forName:]` method to associate an image with a name that you can set this property to.\n\nWithin a constant string value, a feature attribute name enclosed in curly braces (e.g., `{token}`) is replaced with the value of the named attribute. Tokens inside non-constant expressions are ignored; instead, use `mgl_join:` and key path expressions.", "examples": "See the Use images to cluster point data example to learn how to dynamically set your icons with an expression." }, "symbol-avoid-edges": { - "doc": "Whether symbols in this layer avoid colliding with symbols in adjacent tiles.\n\nIf this property is set to `true`, symbols in this layer avoid crossing the edge of a tile. You should set this property to `true` if the backing vector tiles don’t have enough padding to prevent collisions, or if this layer’s `symbolPlacement` property is set to `MGLSymbolPlacementPoint` but this layer is above a symbol layer whose `symbolPlacement` property is set to `MGLSymbolPlacementLine`. You do not need to enable this property to prevent clipped labels at tile boundaries." + "doc": "Whether symbols in this layer avoid colliding with symbols in adjacent tiles.\n\nIf this property is set to `true`, symbols in this layer avoid crossing the edge of a tile. You should set this property to `true` if the backing vector tiles don’t have enough padding to prevent collisions, or if this layer’s `symbolPlacement` property is set to `MLNSymbolPlacementPoint` but this layer is above a symbol layer whose `symbolPlacement` property is set to `MLNSymbolPlacementLine`. You do not need to enable this property to prevent clipped labels at tile boundaries." }, "text-field": { "doc": "Value to use for a text label.\n\nWithin a constant string value, a feature attribute name enclosed in curly braces (e.g., `{token}`) is replaced with the value of the named attribute. Tokens inside non-constant expressions are ignored; instead, use `mgl_join:` and key path expressions.", @@ -115,7 +115,7 @@ }, "paint_line": { "line-gradient": { - "doc": "The color gradient with which the line will be drawn. This property only has an effect on lines defined by an `MGLShapeSource` whose `MGLShapeSourceOptionLineDistanceMetrics` option is set to `YES`." + "doc": "The color gradient with which the line will be drawn. This property only has an effect on lines defined by an `MLNShapeSource` whose `MLNShapeSourceOptionLineDistanceMetrics` option is set to `YES`." }, "line-pattern": { "doc": "Name of image in style images to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512)." diff --git a/platform/ios/platform/darwin/scripts/update-examples.js b/platform/ios/platform/darwin/scripts/update-examples.js index 63acf18bf..eec8e75a9 100755 --- a/platform/ios/platform/darwin/scripts/update-examples.js +++ b/platform/ios/platform/darwin/scripts/update-examples.js @@ -7,11 +7,11 @@ const _ = require('lodash'); require('../../../../../scripts/style-code'); -const examplesSrc = fs.readFileSync('platform/darwin/test/MGLDocumentationExampleTests.swift', 'utf8'); +const examplesSrc = fs.readFileSync('platform/darwin/test/MLNDocumentationExampleTests.swift', 'utf8'); // Regex extracts the following block // /** Front matter to describe the example. **/ -// func testMGLClass$member() { +// func testMLNClass$member() { // ... // // #-example-code // let sampleCode: String? @@ -20,7 +20,7 @@ const examplesSrc = fs.readFileSync('platform/darwin/test/MGLDocumentationExampl // } // // into the following regex groups: -// 1 (test method name): "MGLClass" or "MGLClass$member" or "MGLClass$initWithArg_anotherArg_" +// 1 (test method name): "MLNClass" or "MLNClass$member" or "MLNClass$initWithArg_anotherArg_" // 2 (indentation): " " // 3 (sample code): "let sampleCode: String?" const exampleRegex = /func test([\w$]+)\s*\(\)\s*\{[^]*?\n([ \t]+)\/\/#-example-code\n([^]+?)\n\2\/\/#-end-example-code\n/gm; @@ -106,7 +106,7 @@ function completeExamples(os) { let testMethodName = symbolPath.join('$').replace(/\$[+-]/, '$').replace(/:/g, '_'); let example = examples[testMethodName]; if (!example) { - console.error(`MGLDocumentationExampleTests.test${testMethodName}() not found.`); + console.error(`MLNDocumentationExampleTests.test${testMethodName}() not found.`); process.exit(1); } diff --git a/platform/ios/platform/darwin/src/MGLFoundation.h b/platform/ios/platform/darwin/src/MGLFoundation.h deleted file mode 100644 index 3400c6397..000000000 --- a/platform/ios/platform/darwin/src/MGLFoundation.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#import - -#define MGL_EXPORT __attribute__((visibility ("default"))) diff --git a/platform/ios/platform/darwin/src/MGLGeometry_Private.h b/platform/ios/platform/darwin/src/MGLGeometry_Private.h deleted file mode 100644 index c85915381..000000000 --- a/platform/ios/platform/darwin/src/MGLGeometry_Private.h +++ /dev/null @@ -1,156 +0,0 @@ -#import "MGLGeometry.h" - -#import -#if TARGET_OS_IPHONE - #import -#endif - -#import -#import - -#import -typedef double MGLLocationRadians; -typedef double MGLRadianDistance; -typedef double MGLRadianDirection; - -/** Defines the coordinate by a `MGLRadianCoordinate2D`. */ -typedef struct MGLRadianCoordinate2D { - MGLLocationRadians latitude; - MGLLocationRadians longitude; -} MGLRadianCoordinate2D; - -/** - Creates a new `MGLRadianCoordinate2D` from the given latitudinal and longitudinal. - */ -NS_INLINE MGLRadianCoordinate2D MGLRadianCoordinate2DMake(MGLLocationRadians latitude, MGLLocationRadians longitude) { - MGLRadianCoordinate2D radianCoordinate; - radianCoordinate.latitude = latitude; - radianCoordinate.longitude = longitude; - return radianCoordinate; -} - -/// Returns the smallest rectangle that contains both the given rectangle and -/// the given point. -CGRect MGLExtendRect(CGRect rect, CGPoint point); - -#if TARGET_OS_IPHONE -NS_INLINE NSString *MGLStringFromSize(CGSize size) { - return NSStringFromCGSize(size); -} -#else -NS_INLINE NSString *MGLStringFromSize(NSSize size) { - return NSStringFromSize(size); -} -#endif - -NS_INLINE NSString *MGLStringFromCLLocationCoordinate2D(CLLocationCoordinate2D coordinate) { - return [NSString stringWithFormat:@"(lat: %f, lon: %f)", coordinate.latitude, coordinate.longitude]; -} - -mbgl::LatLng MGLLatLngFromLocationCoordinate2D(CLLocationCoordinate2D coordinate); - -NS_INLINE mbgl::Point MGLPointFromLocationCoordinate2D(CLLocationCoordinate2D coordinate) { - return mbgl::Point(coordinate.longitude, coordinate.latitude); -} - -NS_INLINE CLLocationCoordinate2D MGLLocationCoordinate2DFromPoint(mbgl::Point point) { - return CLLocationCoordinate2DMake(point.y, point.x); -} - -NS_INLINE CLLocationCoordinate2D MGLLocationCoordinate2DFromLatLng(mbgl::LatLng latLng) { - return CLLocationCoordinate2DMake(latLng.latitude(), latLng.longitude()); -} - -NS_INLINE MGLCoordinateBounds MGLCoordinateBoundsFromLatLngBounds(mbgl::LatLngBounds latLngBounds) { - return MGLCoordinateBoundsMake(MGLLocationCoordinate2DFromLatLng(latLngBounds.southwest()), - MGLLocationCoordinate2DFromLatLng(latLngBounds.northeast())); -} - -NS_INLINE mbgl::LatLngBounds MGLLatLngBoundsFromCoordinateBounds(MGLCoordinateBounds coordinateBounds) { - return mbgl::LatLngBounds::hull(MGLLatLngFromLocationCoordinate2D(coordinateBounds.sw), - MGLLatLngFromLocationCoordinate2D(coordinateBounds.ne)); -} - -NS_INLINE std::array MGLLatLngArrayFromCoordinateQuad(MGLCoordinateQuad quad) { - return { MGLLatLngFromLocationCoordinate2D(quad.topLeft), - MGLLatLngFromLocationCoordinate2D(quad.topRight), - MGLLatLngFromLocationCoordinate2D(quad.bottomRight), - MGLLatLngFromLocationCoordinate2D(quad.bottomLeft) }; -} - -NS_INLINE MGLCoordinateQuad MGLCoordinateQuadFromLatLngArray(std::array quad) { - return { MGLLocationCoordinate2DFromLatLng(quad[0]), - MGLLocationCoordinate2DFromLatLng(quad[3]), - MGLLocationCoordinate2DFromLatLng(quad[2]), - MGLLocationCoordinate2DFromLatLng(quad[1]) }; -} - -/** - YES if the coordinate is valid or NO if it is not. - Considers extended coordinates. - */ -NS_INLINE BOOL MGLLocationCoordinate2DIsValid(CLLocationCoordinate2D coordinate) { - return (coordinate.latitude <= 90.0 && - coordinate.latitude >= -90.0 && - coordinate.longitude <= 360.0 && - coordinate.longitude >= -360.0); -} - -#if TARGET_OS_IPHONE - #define MGLEdgeInsets UIEdgeInsets - #define MGLEdgeInsetsMake UIEdgeInsetsMake -#else - #define MGLEdgeInsets NSEdgeInsets - #define MGLEdgeInsetsMake NSEdgeInsetsMake -#endif - -NS_INLINE mbgl::EdgeInsets MGLEdgeInsetsFromNSEdgeInsets(MGLEdgeInsets insets) { - return { insets.top, insets.left, insets.bottom, insets.right }; -} - -NS_INLINE MGLEdgeInsets NSEdgeInsetsFromMGLEdgeInsets(const mbgl::EdgeInsets& insets) { - return MGLEdgeInsetsMake(insets.top(), insets.left(), insets.bottom(), insets.right()); -} - -/// Returns the combination of two edge insets. -NS_INLINE MGLEdgeInsets MGLEdgeInsetsInsetEdgeInset(MGLEdgeInsets base, MGLEdgeInsets inset) { - return MGLEdgeInsetsMake(base.top + inset.top, - base.left + inset.left, - base.bottom + inset.bottom, - base.right + inset.right); -} - -/** Returns MGLRadianCoordinate2D, converted from CLLocationCoordinate2D. */ -NS_INLINE MGLRadianCoordinate2D MGLRadianCoordinateFromLocationCoordinate(CLLocationCoordinate2D locationCoordinate) { - return MGLRadianCoordinate2DMake(MGLRadiansFromDegrees(locationCoordinate.latitude), - MGLRadiansFromDegrees(locationCoordinate.longitude)); -} - -/** - Returns the distance in radians given two coordinates. - */ -MGLRadianDistance MGLDistanceBetweenRadianCoordinates(MGLRadianCoordinate2D from, MGLRadianCoordinate2D to); - -/** - Returns direction in radians given two coordinates. - */ -MGLRadianDirection MGLRadianCoordinatesDirection(MGLRadianCoordinate2D from, MGLRadianCoordinate2D to); - -/** - Returns a coordinate at a given distance and direction away from coordinate. - */ -MGLRadianCoordinate2D MGLRadianCoordinateAtDistanceFacingDirection(MGLRadianCoordinate2D coordinate, - MGLRadianDistance distance, - MGLRadianDirection direction); - -/** - Returns the direction from one coordinate to another. - */ -CLLocationDirection MGLDirectionBetweenCoordinates(CLLocationCoordinate2D firstCoordinate, CLLocationCoordinate2D secondCoordinate); - -/** - Returns a point with coordinates rounded to the nearest logical pixel. - */ -CGPoint MGLPointRounded(CGPoint point); - -MGLMatrix4 MGLMatrix4Make(std::array mat); diff --git a/platform/ios/platform/darwin/src/MGLLocationManager_Private.h b/platform/ios/platform/darwin/src/MGLLocationManager_Private.h deleted file mode 100644 index 4f09405e7..000000000 --- a/platform/ios/platform/darwin/src/MGLLocationManager_Private.h +++ /dev/null @@ -1,5 +0,0 @@ -#import "MGLLocationManager.h" - -@interface MGLCLLocationManager : NSObject - -@end diff --git a/platform/ios/platform/darwin/src/MGLLoggingConfiguration_Private.h b/platform/ios/platform/darwin/src/MGLLoggingConfiguration_Private.h deleted file mode 100644 index 40b4df440..000000000 --- a/platform/ios/platform/darwin/src/MGLLoggingConfiguration_Private.h +++ /dev/null @@ -1,67 +0,0 @@ -#import "MGLLoggingConfiguration.h" - -NS_INLINE NSString *MGLStringFromBOOL(BOOL value) { - return value ? @"YES" : @"NO"; -} - -#if TARGET_OS_OSX -NS_INLINE NSString *MGLStringFromNSEdgeInsets(NSEdgeInsets insets) { - return [NSString stringWithFormat:@"{ top: %f, left: %f, bottom: %f, right: %f", insets.top, insets.left, insets.bottom, insets.right]; -} -#endif - -#ifdef MGL_LOGGING_DISABLED - -#define MGLLogInfo(...) -#define MGLLogDebug(...) -#define MGLLogWarning(...) -#define MGLLogError(...) -#define MGLLogFault(...) - -#else - -#if MGL_LOGGING_ENABLE_DEBUG - #define MGLLogDebug(message, ...) MGLLogWithType(MGLLoggingLevelDebug, __PRETTY_FUNCTION__, __LINE__, message, ##__VA_ARGS__) -#else - #define MGLLogDebug(...) -#endif - -#define MGLLogInfo(message, ...) MGLLogWithType(MGLLoggingLevelInfo, __PRETTY_FUNCTION__, __LINE__, message, ##__VA_ARGS__) -#define MGLLogWarning(message, ...) MGLLogWithType(MGLLoggingLevelWarning, __PRETTY_FUNCTION__, __LINE__, message, ##__VA_ARGS__) -#define MGLLogError(message, ...) MGLLogWithType(MGLLoggingLevelError, __PRETTY_FUNCTION__, __LINE__, message, ##__VA_ARGS__) -#define MGLLogFault(message, ...) MGLLogWithType(MGLLoggingLevelFault, __PRETTY_FUNCTION__, __LINE__, message, ##__VA_ARGS__) - -#endif - -#define MGLAssert(expression, message, ...) \ - __extension__({ \ - if (__builtin_expect(!(expression), 0)) { \ - MGLLogFault(message, ##__VA_ARGS__); \ - } \ - NSAssert(expression, message, ##__VA_ARGS__); \ - }) -#define MGLCAssert(expression, message, ...) \ - __extension__({ \ - if (__builtin_expect(!(expression), 0)) { \ - MGLLogFault(message, ##__VA_ARGS__); \ - } \ - NSCAssert(expression, message, ##__VA_ARGS__); \ - }) - - -#ifndef MGL_LOGGING_DISABLED - -#define MGLLogWithType(type, function, line, message, ...) \ -{ \ - if ([MGLLoggingConfiguration sharedConfiguration].loggingLevel != MGLLoggingLevelNone && type <= [MGLLoggingConfiguration sharedConfiguration].loggingLevel) \ - { \ - [[MGLLoggingConfiguration sharedConfiguration] logCallingFunction:function functionLine:line messageType:type format:(message), ##__VA_ARGS__]; \ - } \ -} - -@interface MGLLoggingConfiguration (Private) - -- (void)logCallingFunction:(const char *)callingFunction functionLine:(NSUInteger)functionLine messageType:(MGLLoggingLevel)type format:(id)messageFormat, ...; - -@end -#endif diff --git a/platform/ios/platform/darwin/src/MGLShapeCollection.h b/platform/ios/platform/darwin/src/MGLShapeCollection.h deleted file mode 100644 index 08f327649..000000000 --- a/platform/ios/platform/darwin/src/MGLShapeCollection.h +++ /dev/null @@ -1,56 +0,0 @@ -#import - -#import "MGLFoundation.h" -#import "MGLShape.h" - -#import "MGLTypes.h" - -NS_ASSUME_NONNULL_BEGIN - -/** - An `MGLShapeCollection` object represents a shape consisting of zero or more - distinct but related shapes that are instances of `MGLShape`. The constituent - shapes can be a mixture of different kinds of shapes. - - `MGLShapeCollection` is most commonly used to add multiple shapes to a single - `MGLShapeSource`. Configure the appearance of an `MGLShapeSource`’s or - `MGLVectorTileSource`’s shape collection collectively using an - `MGLSymbolStyleLayer` object, or use multiple instances of - `MGLCircleStyleLayer`, `MGLFillStyleLayer`, and `MGLLineStyleLayer` to - configure the appearance of each kind of shape inside the collection. - - You cannot add an `MGLShapeCollection` object directly to a map view as an - annotation. However, you can create individual `MGLPointAnnotation`, - `MGLPolyline`, and `MGLPolygon` objects from the `shapes` array and add those - annotation objects to the map view using the `-[MGLMapView addAnnotations:]` - method. - - To represent a collection of point, polyline, or polygon shapes, it may be more - convenient to use an `MGLPointCollection`, `MGLMultiPolyline`, or - `MGLMultiPolygon` object, respectively. To access a shape collection’s - attributes, use the corresponding `MGLFeature` object. - - A shape collection is known as a - GeometryCollection - geometry in GeoJSON. - */ -MGL_EXPORT -@interface MGLShapeCollection : MGLShape - -/** - An array of shapes forming the shape collection. - */ -@property (nonatomic, copy, readonly) NSArray *shapes; - -/** - Creates and returns a shape collection consisting of the given shapes. - - @param shapes The array of shapes defining the shape collection. The data in - this array is copied to the new object. - @return A new shape collection object. - */ -+ (instancetype)shapeCollectionWithShapes:(NSArray *)shapes; - -@end - -NS_ASSUME_NONNULL_END diff --git a/platform/ios/platform/darwin/src/MGLShapeSource_Private.h b/platform/ios/platform/darwin/src/MGLShapeSource_Private.h deleted file mode 100644 index fd288ef68..000000000 --- a/platform/ios/platform/darwin/src/MGLShapeSource_Private.h +++ /dev/null @@ -1,32 +0,0 @@ -#import "MGLFoundation.h" -#import "MGLShapeSource.h" -#include - -NS_ASSUME_NONNULL_BEGIN - -namespace mbgl { - namespace style { - struct GeoJSONOptions; - } -} - -MGL_EXPORT -mbgl::Immutable MGLGeoJSONOptionsFromDictionary(NSDictionary *options); - -@interface MGLShapeSource (Private) - -/** - :nodoc: - Debug log showing structure of an `MGLFeature`. This method recurses in the case - that the feature conforms to `MGLCluster`. This method is used for testing and - should be considered experimental, likely to be removed or changed in future - releases. - - @param feature An object that conforms to the `MGLFeature` protocol. - @param indent Used during recursion. Specify 0. - */ - -- (void)debugRecursiveLogForFeature:(id)feature indent:(NSUInteger)indent; -@end - -NS_ASSUME_NONNULL_END diff --git a/platform/ios/platform/darwin/src/MGLStyle_Private.h b/platform/ios/platform/darwin/src/MGLStyle_Private.h deleted file mode 100644 index 360552c56..000000000 --- a/platform/ios/platform/darwin/src/MGLStyle_Private.h +++ /dev/null @@ -1,40 +0,0 @@ -#import "MGLStyle.h" - -#import "MGLStyleLayer.h" -#import "MGLFillStyleLayer.h" - -NS_ASSUME_NONNULL_BEGIN - -namespace mbgl { - namespace style { - class Style; - } -} - -@class MGLAttributionInfo; -@class MGLMapView; -@class MGLOpenGLStyleLayer; -@class MGLVectorTileSource; -@class MGLVectorStyleLayer; - -@interface MGLStyle (Private) - -- (instancetype)initWithRawStyle:(mbgl::style::Style *)rawStyle stylable:(id )stylable; - -@property (nonatomic, readonly, weak) id stylable; -@property (nonatomic, readonly) mbgl::style::Style *rawStyle; - -- (nullable NSArray *)attributionInfosWithFontSize:(CGFloat)fontSize linkColor:(nullable MGLColor *)linkColor; -@property (nonatomic, readonly, strong) NSMutableDictionary *openGLLayers; -- (void)setStyleClasses:(NSArray *)appliedClasses transitionDuration:(NSTimeInterval)transitionDuration; - -@end - -@interface MGLStyle (MGLStreetsAdditions) - -@property (nonatomic, readonly, copy) NSArray *placeStyleLayers; -@property (nonatomic, readonly, copy) NSArray *roadStyleLayers; - -@end - -NS_ASSUME_NONNULL_END diff --git a/platform/ios/platform/darwin/src/MGLTypes.m b/platform/ios/platform/darwin/src/MGLTypes.m deleted file mode 100644 index 89f88a9c1..000000000 --- a/platform/ios/platform/darwin/src/MGLTypes.m +++ /dev/null @@ -1,5 +0,0 @@ -#import "MGLTypes.h" - -const MGLExceptionName MGLAbstractClassException = @"MGLAbstractClassException"; - -NSString * const MGLErrorDomain = @"MGLErrorDomain"; diff --git a/platform/ios/platform/darwin/src/MGLAnnotation.h b/platform/ios/platform/darwin/src/MLNAnnotation.h similarity index 94% rename from platform/ios/platform/darwin/src/MGLAnnotation.h rename to platform/ios/platform/darwin/src/MLNAnnotation.h index b170eeb51..5734f14e8 100644 --- a/platform/ios/platform/darwin/src/MGLAnnotation.h +++ b/platform/ios/platform/darwin/src/MLNAnnotation.h @@ -5,7 +5,7 @@ NS_ASSUME_NONNULL_BEGIN /** - The `MGLAnnotation` protocol is used to provide annotation-related information + The `MLNAnnotation` protocol is used to provide annotation-related information to a map view. To use this protocol, you adopt it in any custom objects that store or represent annotation data. Each object then serves as the source of information about a single map annotation and provides critical information, @@ -21,9 +21,9 @@ NS_ASSUME_NONNULL_BEGIN See the Annotation models and Annotation views examples to learn how to add objects that follow the - `MGLAnnotation` protocol. + `MLNAnnotation` protocol. */ -@protocol MGLAnnotation +@protocol MLNAnnotation // MARK: Position Attributes diff --git a/platform/ios/platform/darwin/src/MGLAttributedExpression.h b/platform/ios/platform/darwin/src/MLNAttributedExpression.h similarity index 55% rename from platform/ios/platform/darwin/src/MGLAttributedExpression.h rename to platform/ios/platform/darwin/src/MLNAttributedExpression.h index ea298c7a4..a5e7d9888 100644 --- a/platform/ios/platform/darwin/src/MGLAttributedExpression.h +++ b/platform/ios/platform/darwin/src/MLNAttributedExpression.h @@ -1,37 +1,37 @@ -#import "MGLFoundation.h" +#import "MLNFoundation.h" NS_ASSUME_NONNULL_BEGIN -/** Options for `MGLAttributedExpression.attributes`. */ -typedef NSString * MGLAttributedExpressionKey NS_TYPED_ENUM; +/** Options for `MLNAttributedExpression.attributes`. */ +typedef NSString * MLNAttributedExpressionKey NS_TYPED_ENUM; /** The font name string array expression used to format the text. */ -FOUNDATION_EXTERN MGL_EXPORT MGLAttributedExpressionKey const MGLFontNamesAttribute; +FOUNDATION_EXTERN MLN_EXPORT MLNAttributedExpressionKey const MLNFontNamesAttribute; -/** The font scale number expression relative to `MGLSymbolStyleLayer.textFontSize` used to format the text. */ -FOUNDATION_EXTERN MGL_EXPORT MGLAttributedExpressionKey const MGLFontScaleAttribute; +/** The font scale number expression relative to `MLNSymbolStyleLayer.textFontSize` used to format the text. */ +FOUNDATION_EXTERN MLN_EXPORT MLNAttributedExpressionKey const MLNFontScaleAttribute; /** The font color expression used to format the text. */ -FOUNDATION_EXTERN MGL_EXPORT MGLAttributedExpressionKey const MGLFontColorAttribute; +FOUNDATION_EXTERN MLN_EXPORT MLNAttributedExpressionKey const MLNFontColorAttribute; /** - An `MGLAttributedExpression` object associates text formatting attibutes (such as font size or + An `MLNAttributedExpression` object associates text formatting attibutes (such as font size or font names) to an `NSExpression`. ### Example ```swift let redColor = UIColor.red let expression = NSExpression(forConstantValue: "Foo") - let attributes: [MGLAttributedExpressionKey: NSExpression] = [.fontNamesAttribute : NSExpression(forConstantValue: ["DIN Offc Pro Italic", + let attributes: [MLNAttributedExpressionKey: NSExpression] = [.fontNamesAttribute : NSExpression(forConstantValue: ["DIN Offc Pro Italic", "Arial Unicode MS Regular"]), .fontScaleAttribute: NSExpression(forConstantValue: 1.2), .fontColorAttribute: NSExpression(forConstantValue: redColor)] - let attributedExpression = MGLAttributedExpression(expression, attributes:attributes) + let attributedExpression = MLNAttributedExpression(expression, attributes:attributes) ``` */ -MGL_EXPORT -@interface MGLAttributedExpression : NSObject +MLN_EXPORT +@interface MLNAttributedExpression : NSObject /** The expression content of the receiver as `NSExpression`. @@ -43,44 +43,44 @@ MGL_EXPORT The formatting attributes dictionary. Key | Value Type --- | --- - `MGLFontNamesAttribute` | An `NSExpression` evaluating to an `NSString` array. - `MGLFontScaleAttribute` | An `NSExpression` evaluating to an `NSNumber` value. - `MGLFontColorAttribute` | An `NSExpression` evaluating to an `UIColor`. + `MLNFontNamesAttribute` | An `NSExpression` evaluating to an `NSString` array. + `MLNFontScaleAttribute` | An `NSExpression` evaluating to an `NSNumber` value. + `MLNFontColorAttribute` | An `NSExpression` evaluating to an `UIColor`. */ -@property (strong, nonatomic, readonly) NSDictionary *attributes; +@property (strong, nonatomic, readonly) NSDictionary *attributes; #else /** The formatting attributes dictionary. Key | Value Type --- | --- - `MGLFontNamesAttribute` | An `NSExpression` evaluating to an `NSString` array. - `MGLFontScaleAttribute` | An `NSExpression` evaluating to an `NSNumber` value. - `MGLFontColorAttribute` | An `NSExpression` evaluating to an `NSColor` on macos. + `MLNFontNamesAttribute` | An `NSExpression` evaluating to an `NSString` array. + `MLNFontScaleAttribute` | An `NSExpression` evaluating to an `NSNumber` value. + `MLNFontColorAttribute` | An `NSExpression` evaluating to an `NSColor` on macos. */ -@property (strong, nonatomic, readonly) NSDictionary *attributes; +@property (strong, nonatomic, readonly) NSDictionary *attributes; #endif /** - Returns an `MGLAttributedExpression` object initialized with an expression and no attribute information. + Returns an `MLNAttributedExpression` object initialized with an expression and no attribute information. */ - (instancetype)initWithExpression:(NSExpression *)expression; /** - Returns an `MGLAttributedExpression` object initialized with an expression and text format attributes. + Returns an `MLNAttributedExpression` object initialized with an expression and text format attributes. */ -- (instancetype)initWithExpression:(NSExpression *)expression attributes:(nonnull NSDictionary *)attrs; +- (instancetype)initWithExpression:(NSExpression *)expression attributes:(nonnull NSDictionary *)attrs; /** - Creates an `MGLAttributedExpression` object initialized with an expression and the format attributes for font names and font size. + Creates an `MLNAttributedExpression` object initialized with an expression and the format attributes for font names and font size. */ + (instancetype)attributedExpression:(NSExpression *)expression fontNames:(nullable NSArray *)fontNames fontScale:(nullable NSNumber *)fontScale; /** - Creates an `MGLAttributedExpression` object initialized with an expression and the format attributes dictionary. + Creates an `MLNAttributedExpression` object initialized with an expression and the format attributes dictionary. */ -+ (instancetype)attributedExpression:(NSExpression *)expression attributes:(nonnull NSDictionary *)attrs; ++ (instancetype)attributedExpression:(NSExpression *)expression attributes:(nonnull NSDictionary *)attrs; @end diff --git a/platform/ios/platform/darwin/src/MGLAttributedExpression.m b/platform/ios/platform/darwin/src/MLNAttributedExpression.m similarity index 62% rename from platform/ios/platform/darwin/src/MGLAttributedExpression.m rename to platform/ios/platform/darwin/src/MLNAttributedExpression.m index a34480a95..3e42158d7 100644 --- a/platform/ios/platform/darwin/src/MGLAttributedExpression.m +++ b/platform/ios/platform/darwin/src/MLNAttributedExpression.m @@ -1,11 +1,11 @@ -#import "MGLAttributedExpression.h" -#import "MGLLoggingConfiguration_Private.h" +#import "MLNAttributedExpression.h" +#import "MLNLoggingConfiguration_Private.h" -const MGLAttributedExpressionKey MGLFontNamesAttribute = @"text-font"; -const MGLAttributedExpressionKey MGLFontScaleAttribute = @"font-scale"; -const MGLAttributedExpressionKey MGLFontColorAttribute = @"text-color"; +const MLNAttributedExpressionKey MLNFontNamesAttribute = @"text-font"; +const MLNAttributedExpressionKey MLNFontScaleAttribute = @"font-scale"; +const MLNAttributedExpressionKey MLNFontColorAttribute = @"text-color"; -@implementation MGLAttributedExpression +@implementation MLNAttributedExpression - (instancetype)initWithExpression:(NSExpression *)expression { self = [self initWithExpression:expression attributes:@{}]; @@ -13,38 +13,38 @@ const MGLAttributedExpressionKey MGLFontColorAttribute = @"text-color"; } + (instancetype)attributedExpression:(NSExpression *)expression fontNames:(nullable NSArray *)fontNames fontScale:(nullable NSNumber *)fontScale { - MGLAttributedExpression *attributedExpression; + MLNAttributedExpression *attributedExpression; NSMutableDictionary *attrs = [NSMutableDictionary dictionary]; if (fontNames && fontNames.count > 0) { - attrs[MGLFontNamesAttribute] = [NSExpression expressionForConstantValue:fontNames]; + attrs[MLNFontNamesAttribute] = [NSExpression expressionForConstantValue:fontNames]; } if (fontScale) { - attrs[MGLFontScaleAttribute] = [NSExpression expressionForConstantValue:fontScale]; + attrs[MLNFontScaleAttribute] = [NSExpression expressionForConstantValue:fontScale]; } attributedExpression = [[self alloc] initWithExpression:expression attributes:attrs]; return attributedExpression; } -+ (instancetype)attributedExpression:(NSExpression *)expression attributes:(nonnull NSDictionary *)attrs { - MGLAttributedExpression *attributedExpression; ++ (instancetype)attributedExpression:(NSExpression *)expression attributes:(nonnull NSDictionary *)attrs { + MLNAttributedExpression *attributedExpression; attributedExpression = [[self alloc] initWithExpression:expression attributes:attrs]; return attributedExpression; } -- (instancetype)initWithExpression:(NSExpression *)expression attributes:(nonnull NSDictionary *)attrs { +- (instancetype)initWithExpression:(NSExpression *)expression attributes:(nonnull NSDictionary *)attrs { if (self = [super init]) { - MGLLogInfo(@"Starting %@ initialization.", NSStringFromClass([self class])); + MLNLogInfo(@"Starting %@ initialization.", NSStringFromClass([self class])); _expression = expression; _attributes = attrs; - MGLLogInfo(@"Finalizing %@ initialization.", NSStringFromClass([self class])); + MLNLogInfo(@"Finalizing %@ initialization.", NSStringFromClass([self class])); } return self; } @@ -53,7 +53,7 @@ const MGLAttributedExpressionKey MGLFontColorAttribute = @"text-color"; BOOL result = NO; if ([object isKindOfClass:[self class]]) { - MGLAttributedExpression *otherObject = object; + MLNAttributedExpression *otherObject = object; result = [self.expression isEqual:otherObject.expression] && [_attributes isEqual:otherObject.attributes]; } @@ -62,7 +62,7 @@ const MGLAttributedExpressionKey MGLFontColorAttribute = @"text-color"; } - (NSString *)description { - return [NSString stringWithFormat:@"MGLAttributedExpression", self.expression, self.attributes]; + return [NSString stringWithFormat:@"MLNAttributedExpression", self.expression, self.attributes]; } @end diff --git a/platform/ios/platform/darwin/src/MGLAttributionInfo.h b/platform/ios/platform/darwin/src/MLNAttributionInfo.h similarity index 83% rename from platform/ios/platform/darwin/src/MGLAttributionInfo.h rename to platform/ios/platform/darwin/src/MLNAttributionInfo.h index 5451a35d8..14264d059 100644 --- a/platform/ios/platform/darwin/src/MGLAttributionInfo.h +++ b/platform/ios/platform/darwin/src/MLNAttributionInfo.h @@ -2,35 +2,35 @@ #import #import -#import "MGLFoundation.h" -#import "MGLTypes.h" +#import "MLNFoundation.h" +#import "MLNTypes.h" NS_ASSUME_NONNULL_BEGIN /** The attribution info is represented in the longest format available. */ -typedef NS_ENUM(NSUInteger, MGLAttributionInfoStyle) { +typedef NS_ENUM(NSUInteger, MLNAttributionInfoStyle) { /** Specifies a short attribution info style. */ - MGLAttributionInfoStyleShort = 1, + MLNAttributionInfoStyleShort = 1, /** Specifies a medium attribution info style. */ - MGLAttributionInfoStyleMedium, + MLNAttributionInfoStyleMedium, /** Specifies a long attribution info style. */ - MGLAttributionInfoStyleLong + MLNAttributionInfoStyleLong }; /** Information about an attribution statement, usually a copyright or trademark statement, associated with a map content source. */ -MGL_EXPORT -@interface MGLAttributionInfo : NSObject +MLN_EXPORT +@interface MLNAttributionInfo : NSObject /** Returns an initialized attribution info object with the given title and URL. @@ -67,14 +67,14 @@ MGL_EXPORT /** Returns a copy of the current `title` formatted accordingly to `style`. - Example: If the `style` property is set to `MGLAttributionInfoStyleShort` and the + Example: If the `style` property is set to `MLNAttributionInfoStyleShort` and the `title` property is set to `OpenStreetMap`, then this method returns `OSM`. @param style The attribution info style. @return The `NSAttributedString` styled title. */ -- (NSAttributedString *)titleWithStyle:(MGLAttributionInfoStyle)style; +- (NSAttributedString *)titleWithStyle:(MLNAttributionInfoStyle)style; @end diff --git a/platform/ios/platform/darwin/src/MGLAttributionInfo.mm b/platform/ios/platform/darwin/src/MLNAttributionInfo.mm similarity index 88% rename from platform/ios/platform/darwin/src/MGLAttributionInfo.mm rename to platform/ios/platform/darwin/src/MLNAttributionInfo.mm index 7721319fa..d8df053b1 100644 --- a/platform/ios/platform/darwin/src/MGLAttributionInfo.mm +++ b/platform/ios/platform/darwin/src/MLNAttributionInfo.mm @@ -1,4 +1,4 @@ -#import "MGLAttributionInfo_Private.h" +#import "MLNAttributionInfo_Private.h" #if TARGET_OS_IPHONE #import @@ -6,18 +6,18 @@ #import #endif -#import "MGLSettings.h" -#import "MGLMapCamera.h" -#import "NSArray+MGLAdditions.h" -#import "NSBundle+MGLAdditions.h" -#import "NSString+MGLAdditions.h" -#import "MGLLoggingConfiguration_Private.h" +#import "MLNSettings.h" +#import "MLNMapCamera.h" +#import "NSArray+MLNAdditions.h" +#import "NSBundle+MLNAdditions.h" +#import "NSString+MLNAdditions.h" +#import "MLNLoggingConfiguration_Private.h" #include -@implementation MGLAttributionInfo +@implementation MLNAttributionInfo -+ (NSArray *)attributionInfosFromHTMLString:(nullable NSString *)htmlString fontSize:(CGFloat)fontSize linkColor:(nullable MGLColor *)linkColor { ++ (NSArray *)attributionInfosFromHTMLString:(nullable NSString *)htmlString fontSize:(CGFloat)fontSize linkColor:(nullable MLNColor *)linkColor { if (!htmlString) { return @[]; } @@ -92,7 +92,7 @@ options:0 usingBlock: ^(id _Nullable value, NSRange range, BOOL * _Nonnull stop) { - MGLCAssert(!value || [value isKindOfClass:[NSURL class]], @"If present, URL attribute must be an NSURL."); + MLNCAssert(!value || [value isKindOfClass:[NSURL class]], @"If present, URL attribute must be an NSURL."); // Detect feedback links by the bogus style rule applied above. NSNumber *strokeWidth = [attributedString attribute:NSStrokeWidthAttributeName @@ -116,16 +116,16 @@ NSMutableAttributedString *unlinkedTitle = [title mutableCopy]; [unlinkedTitle removeAttribute:NSLinkAttributeName range:unlinkedTitle.mgl_wholeRange]; - MGLAttributionInfo *info = [[MGLAttributionInfo alloc] initWithTitle:unlinkedTitle URL:value]; + MLNAttributionInfo *info = [[MLNAttributionInfo alloc] initWithTitle:unlinkedTitle URL:value]; info.feedbackLink = isFeedbackLink; [infos addObject:info]; }]; return infos; } -+ (NSAttributedString *)attributedStringForAttributionInfos:(NSArray *)attributionInfos { ++ (NSAttributedString *)attributedStringForAttributionInfos:(NSArray *)attributionInfos { NSMutableArray *titles = [NSMutableArray arrayWithCapacity:attributionInfos.count]; - for (MGLAttributionInfo *info in attributionInfos) { + for (MLNAttributionInfo *info in attributionInfos) { NSMutableAttributedString *title = info.title.mutableCopy; if (info.URL) { [title addAttribute:NSLinkAttributeName value:info.URL range:title.mgl_wholeRange]; @@ -145,14 +145,14 @@ - (id)copyWithZone:(nullable NSZone *)zone { - MGLAttributionInfo *info = [[[self class] allocWithZone:zone] initWithTitle:_title + MLNAttributionInfo *info = [[[self class] allocWithZone:zone] initWithTitle:_title URL:_URL]; info.feedbackLink = _feedbackLink; return info; } -- (NSAttributedString *)titleWithStyle:(MGLAttributionInfoStyle)style +- (NSAttributedString *)titleWithStyle:(MLNAttributionInfoStyle)style { NSString *openStreetMap = NSLocalizedStringWithDefaultValue(@"OSM_FULL_NAME", @"Foundation", nil, @"OpenStreetMap", @"OpenStreetMap full name attribution"); NSString *OSM = NSLocalizedStringWithDefaultValue(@"OSM_SHORT_NAME", @"Foundation", nil, @"OSM", @"OpenStreetMap short name attribution"); @@ -160,7 +160,7 @@ NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithAttributedString:self.title]; [title removeAttribute:NSUnderlineStyleAttributeName range:NSMakeRange(0, [title.string length])]; - BOOL isAbbreviated = (style == MGLAttributionInfoStyleShort); + BOOL isAbbreviated = (style == MLNAttributionInfoStyleShort); if ([title.string rangeOfString:@"OpenStreetMap"].location != NSNotFound) { [title.mutableString replaceOccurrencesOfString:@"OpenStreetMap" withString:isAbbreviated ? OSM : openStreetMap @@ -187,7 +187,7 @@ `NSOrderedDescending` if it is a subset of the receiver, or `NSOrderedSame` if there is no overlap. */ -- (NSComparisonResult)subsetCompare:(MGLAttributionInfo *)otherInfo { +- (NSComparisonResult)subsetCompare:(MLNAttributionInfo *)otherInfo { NSString *title = self.title.string; NSString *otherTitle = otherInfo.title.string; if ([title containsString:otherTitle]) { @@ -201,12 +201,12 @@ @end -@implementation NSMutableArray (MGLAttributionInfoAdditions) +@implementation NSMutableArray (MLNAttributionInfoAdditions) -- (void)growArrayByAddingAttributionInfo:(MGLAttributionInfo *)info { +- (void)growArrayByAddingAttributionInfo:(MLNAttributionInfo *)info { __block BOOL didInsertInfo = NO; __block BOOL shouldAddInfo = YES; - [self enumerateObjectsUsingBlock:^(MGLAttributionInfo * _Nonnull existingInfo, NSUInteger idx, BOOL * _Nonnull stop) { + [self enumerateObjectsUsingBlock:^(MLNAttributionInfo * _Nonnull existingInfo, NSUInteger idx, BOOL * _Nonnull stop) { switch ([info subsetCompare:existingInfo]) { case NSOrderedDescending: // The existing info object is a subset of the one we’re adding. @@ -237,8 +237,8 @@ } } -- (void)growArrayByAddingAttributionInfosFromArray:(NSArray *)infos { - for (MGLAttributionInfo *info in infos) { +- (void)growArrayByAddingAttributionInfosFromArray:(NSArray *)infos { + for (MLNAttributionInfo *info in infos) { [self growArrayByAddingAttributionInfo:info]; } } diff --git a/platform/ios/platform/darwin/src/MGLAttributionInfo_Private.h b/platform/ios/platform/darwin/src/MLNAttributionInfo_Private.h similarity index 74% rename from platform/ios/platform/darwin/src/MGLAttributionInfo_Private.h rename to platform/ios/platform/darwin/src/MLNAttributionInfo_Private.h index a735b20a9..e2326b4fa 100644 --- a/platform/ios/platform/darwin/src/MGLAttributionInfo_Private.h +++ b/platform/ios/platform/darwin/src/MLNAttributionInfo_Private.h @@ -2,11 +2,11 @@ #import #import -#import "MGLAttributionInfo.h" +#import "MLNAttributionInfo.h" NS_ASSUME_NONNULL_BEGIN -@interface MGLAttributionInfo (Private) +@interface MLNAttributionInfo (Private) /** Parses and returns the attribution infos contained in the given HTML source @@ -16,13 +16,13 @@ NS_ASSUME_NONNULL_BEGIN @param fontSize The default text size in points. @param linkColor The default link color. */ -+ (NSArray *)attributionInfosFromHTMLString:(nullable NSString *)htmlString fontSize:(CGFloat)fontSize linkColor:(nullable MGLColor *)linkColor; ++ (NSArray *)attributionInfosFromHTMLString:(nullable NSString *)htmlString fontSize:(CGFloat)fontSize linkColor:(nullable MLNColor *)linkColor; -+ (NSAttributedString *)attributedStringForAttributionInfos:(NSArray *)attributionInfos; ++ (NSAttributedString *)attributedStringForAttributionInfos:(NSArray *)attributionInfos; @end -@interface NSMutableArray (MGLAttributionInfoAdditions) +@interface NSMutableArray (MLNAttributionInfoAdditions) /** Adds the given attribution info object to the receiver as long as it isn’t @@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN @param info The info object to add to the receiver. */ -- (void)growArrayByAddingAttributionInfo:(MGLAttributionInfo *)info; +- (void)growArrayByAddingAttributionInfo:(MLNAttributionInfo *)info; /** Adds each of the given attribution info objects to the receiver as long as it @@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN @param infos An array of info objects to add to the receiver. */ -- (void)growArrayByAddingAttributionInfosFromArray:(NSArray *)infos; +- (void)growArrayByAddingAttributionInfosFromArray:(NSArray *)infos; @end diff --git a/platform/ios/platform/darwin/src/MGLClockDirectionFormatter.h b/platform/ios/platform/darwin/src/MLNClockDirectionFormatter.h similarity index 80% rename from platform/ios/platform/darwin/src/MGLClockDirectionFormatter.h rename to platform/ios/platform/darwin/src/MLNClockDirectionFormatter.h index 86a945284..53edd0bf6 100644 --- a/platform/ios/platform/darwin/src/MGLClockDirectionFormatter.h +++ b/platform/ios/platform/darwin/src/MLNClockDirectionFormatter.h @@ -1,23 +1,23 @@ #import #import -#import "MGLFoundation.h" +#import "MLNFoundation.h" NS_ASSUME_NONNULL_BEGIN /** - The `MGLClockDirectionFormatter` class provides properly formatted descriptions + The `MLNClockDirectionFormatter` class provides properly formatted descriptions of headings relative to the user, known as clock positions. For example, a value of `90` may be formatted as “3 o’clock”, depending on the locale. Use this class to create localized heading strings when displaying directions relative to the user’s current location and heading. To format a direction - irrespective of the user’s orientation, use `MGLCompassDirectionFormatter` + irrespective of the user’s orientation, use `MLNCompassDirectionFormatter` instead. */ -MGL_EXPORT -@interface MGLClockDirectionFormatter : NSFormatter +MLN_EXPORT +@interface MLNClockDirectionFormatter : NSFormatter /** The unit style used by this formatter. @@ -37,7 +37,7 @@ MGL_EXPORT - (NSString *)stringFromDirection:(CLLocationDirection)direction; /** - This method is not supported for the `MGLDirectionFormatter` class. + This method is not supported for the `MLNDirectionFormatter` class. */ - (BOOL)getObjectValue:(out id __nullable * __nullable)obj forString:(NSString *)string errorDescription:(out NSString * __nullable * __nullable)error; diff --git a/platform/ios/platform/darwin/src/MGLClockDirectionFormatter.m b/platform/ios/platform/darwin/src/MLNClockDirectionFormatter.m similarity index 89% rename from platform/ios/platform/darwin/src/MGLClockDirectionFormatter.m rename to platform/ios/platform/darwin/src/MLNClockDirectionFormatter.m index 922a1db9a..ac9b9e8af 100644 --- a/platform/ios/platform/darwin/src/MGLClockDirectionFormatter.m +++ b/platform/ios/platform/darwin/src/MLNClockDirectionFormatter.m @@ -1,12 +1,12 @@ -#import "MGLClockDirectionFormatter.h" +#import "MLNClockDirectionFormatter.h" -#import "NSBundle+MGLAdditions.h" -#import "MGLLoggingConfiguration_Private.h" +#import "NSBundle+MLNAdditions.h" +#import "MLNLoggingConfiguration_Private.h" #define wrap(value, min, max) \ (fmod((fmod((value - min), (max - min)) + (max - min)), (max - min)) + min) -@implementation MGLClockDirectionFormatter { +@implementation MLNClockDirectionFormatter { NSNumberFormatter *_numberFormatter; } @@ -53,7 +53,7 @@ } - (BOOL)getObjectValue:(out id __nullable * __nullable)obj forString:(NSString *)string errorDescription:(out NSString * __nullable * __nullable)error { - MGLAssert(NO, @"-getObjectValue:forString:errorDescription: has not been implemented"); + MLNAssert(NO, @"-getObjectValue:forString:errorDescription: has not been implemented"); return NO; } diff --git a/platform/ios/platform/darwin/src/MGLCluster.h b/platform/ios/platform/darwin/src/MLNCluster.h similarity index 50% rename from platform/ios/platform/darwin/src/MGLCluster.h rename to platform/ios/platform/darwin/src/MLNCluster.h index 2b99119b2..f59ce577a 100644 --- a/platform/ios/platform/darwin/src/MGLCluster.h +++ b/platform/ios/platform/darwin/src/MLNCluster.h @@ -1,6 +1,6 @@ -#import "MGLFoundation.h" +#import "MLNFoundation.h" -@protocol MGLFeature; +@protocol MLNFeature; NS_ASSUME_NONNULL_BEGIN @@ -8,39 +8,39 @@ NS_ASSUME_NONNULL_BEGIN An `NSUInteger` constant used to indicate an invalid cluster identifier. This indicates a missing cluster feature. */ -FOUNDATION_EXTERN MGL_EXPORT const NSUInteger MGLClusterIdentifierInvalid; +FOUNDATION_EXTERN MLN_EXPORT const NSUInteger MLNClusterIdentifierInvalid; /** A protocol that feature subclasses (i.e. those already conforming to - the `MGLFeature` protocol) conform to if they represent clusters. + the `MLNFeature` protocol) conform to if they represent clusters. - Currently the only class that conforms to `MGLCluster` is - `MGLPointFeatureCluster` (a subclass of `MGLPointFeature`). + Currently the only class that conforms to `MLNCluster` is + `MLNPointFeatureCluster` (a subclass of `MLNPointFeature`). - To check if a feature is a cluster, check conformity to `MGLCluster`, for + To check if a feature is a cluster, check conformity to `MLNCluster`, for example: ```swift - let shape = try! MGLShape(data: clusterShapeData, encoding: String.Encoding.utf8.rawValue) + let shape = try! MLNShape(data: clusterShapeData, encoding: String.Encoding.utf8.rawValue) - guard let pointFeature = shape as? MGLPointFeature else { + guard let pointFeature = shape as? MLNPointFeature else { throw ExampleError.unexpectedFeatureType } // Check for cluster conformance - guard let cluster = pointFeature as? MGLCluster else { + guard let cluster = pointFeature as? MLNCluster else { throw ExampleError.featureIsNotACluster } - // Currently the only supported class that conforms to `MGLCluster` is - // `MGLPointFeatureCluster` - guard cluster is MGLPointFeatureCluster else { + // Currently the only supported class that conforms to `MLNCluster` is + // `MLNPointFeatureCluster` + guard cluster is MLNPointFeatureCluster else { throw ExampleError.unexpectedFeatureType } ``` */ -MGL_EXPORT -@protocol MGLCluster +MLN_EXPORT +@protocol MLNCluster /** The identifier for the cluster. */ @property (nonatomic, readonly) NSUInteger clusterIdentifier; diff --git a/platform/ios/platform/darwin/src/MGLCompassDirectionFormatter.h b/platform/ios/platform/darwin/src/MLNCompassDirectionFormatter.h similarity index 79% rename from platform/ios/platform/darwin/src/MGLCompassDirectionFormatter.h rename to platform/ios/platform/darwin/src/MLNCompassDirectionFormatter.h index b4a308750..f428ae547 100644 --- a/platform/ios/platform/darwin/src/MGLCompassDirectionFormatter.h +++ b/platform/ios/platform/darwin/src/MLNCompassDirectionFormatter.h @@ -1,21 +1,21 @@ #import #import -#import "MGLFoundation.h" +#import "MLNFoundation.h" NS_ASSUME_NONNULL_BEGIN /** - The `MGLCompassDirectionFormatter` class provides properly formatted + The `MLNCompassDirectionFormatter` class provides properly formatted descriptions of absolute headings. For example, a value of `90` may be formatted as “east”, depending on the locale. Use this class to create localized heading strings when displaying directions irrespective of the user’s current location. To format a direction relative to - the user’s current location, use `MGLClockDirectionFormatter` instead. + the user’s current location, use `MLNClockDirectionFormatter` instead. */ -MGL_EXPORT -@interface MGLCompassDirectionFormatter : NSFormatter +MLN_EXPORT +@interface MLNCompassDirectionFormatter : NSFormatter /** The unit style used by this formatter. @@ -34,7 +34,7 @@ MGL_EXPORT - (NSString *)stringFromDirection:(CLLocationDirection)direction; /** - This method is not supported for the `MGLDirectionFormatter` class. + This method is not supported for the `MLNDirectionFormatter` class. */ - (BOOL)getObjectValue:(out id __nullable * __nullable)obj forString:(NSString *)string errorDescription:(out NSString * __nullable * __nullable)error; diff --git a/platform/ios/platform/darwin/src/MGLCompassDirectionFormatter.m b/platform/ios/platform/darwin/src/MLNCompassDirectionFormatter.m similarity index 97% rename from platform/ios/platform/darwin/src/MGLCompassDirectionFormatter.m rename to platform/ios/platform/darwin/src/MLNCompassDirectionFormatter.m index 99de32b77..87513d64e 100644 --- a/platform/ios/platform/darwin/src/MGLCompassDirectionFormatter.m +++ b/platform/ios/platform/darwin/src/MLNCompassDirectionFormatter.m @@ -1,12 +1,12 @@ -#import "MGLCompassDirectionFormatter.h" +#import "MLNCompassDirectionFormatter.h" -#import "NSBundle+MGLAdditions.h" -#import "MGLLoggingConfiguration_Private.h" +#import "NSBundle+MLNAdditions.h" +#import "MLNLoggingConfiguration_Private.h" #define wrap(value, min, max) \ (fmod((fmod((value - min), (max - min)) + (max - min)), (max - min)) + min) -@implementation MGLCompassDirectionFormatter +@implementation MLNCompassDirectionFormatter - (instancetype)init { if (self = [super init]) { @@ -96,7 +96,7 @@ NSLocalizedStringWithDefaultValue(@"COMPASS_NbW_LONG", @"Foundation", nil, @"north by west", @"North by west, long"), ]; - MGLAssert(shortStrings.count == longStrings.count, @"Long and short compass direction string arrays must have the same size."); + MLNAssert(shortStrings.count == longStrings.count, @"Long and short compass direction string arrays must have the same size."); }); NSInteger cardinalPoint = wrap(round(wrap(direction, 0, 360) / 360 * shortStrings.count), 0, shortStrings.count); @@ -118,7 +118,7 @@ } - (BOOL)getObjectValue:(out id __nullable * __nullable)obj forString:(NSString *)string errorDescription:(out NSString * __nullable * __nullable)error { - MGLAssert(NO, @"-getObjectValue:forString:errorDescription: has not been implemented"); + MLNAssert(NO, @"-getObjectValue:forString:errorDescription: has not been implemented"); return NO; } diff --git a/platform/ios/platform/darwin/src/MGLComputedShapeSource.h b/platform/ios/platform/darwin/src/MLNComputedShapeSource.h similarity index 62% rename from platform/ios/platform/darwin/src/MGLComputedShapeSource.h rename to platform/ios/platform/darwin/src/MLNComputedShapeSource.h index 84dc4801a..41d723ea1 100644 --- a/platform/ios/platform/darwin/src/MGLComputedShapeSource.h +++ b/platform/ios/platform/darwin/src/MLNComputedShapeSource.h @@ -1,46 +1,46 @@ -#import "MGLFoundation.h" -#import "MGLGeometry.h" -#import "MGLTypes.h" -#import "MGLShapeSource.h" +#import "MLNFoundation.h" +#import "MLNGeometry.h" +#import "MLNTypes.h" +#import "MLNShapeSource.h" NS_ASSUME_NONNULL_BEGIN -@protocol MGLFeature; +@protocol MLNFeature; /** An `NSNumber` object containing a Boolean value; specifies whether the shape of - an `MGLComputedShapeSource` should be wrapped to accomodate coordinates with + an `MLNComputedShapeSource` should be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value is `NO`. Setting this option to `YES` affects rendering performance. - This option is used with the `MGLComputedShapeSource` class; it is ignored when - creating an `MGLShapeSource` object. + This option is used with the `MLNComputedShapeSource` class; it is ignored when + creating an `MLNShapeSource` object. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionWrapsCoordinates; +FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionWrapsCoordinates; /** An `NSNumber` object containing a Boolean value; specifies whether the shape of - an `MGLComputedShapeSource` should be clipped at the edge of each tile. The + an `MLNComputedShapeSource` should be clipped at the edge of each tile. The default value is `NO`. Setting this option to `YES` affects rendering performance. Use this option to - clip `MGLPolyline`s and `MGLPolygon`s at tile boundaries without artifacts. + clip `MLNPolyline`s and `MLNPolygon`s at tile boundaries without artifacts. - This option is used with the `MGLComputedShapeSource` class; it is ignored when - creating an `MGLShapeSource` object. + This option is used with the `MLNComputedShapeSource` class; it is ignored when + creating an `MLNShapeSource` object. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionClipsCoordinates; +FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionClipsCoordinates; -FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLInvalidDatasourceException; +FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNInvalidDatasourceException; /** - Data source for `MGLComputedShapeSource`. This protocol defines two optional methods for fetching + Data source for `MLNComputedShapeSource`. This protocol defines two optional methods for fetching data, one based on tile coordinates, and one based on a bounding box. Classes that implement this protocol must implement one, and only one of the methods. Methods on this protocol will not be called on main thread, they will be called on the caller's `requestQueue`. */ -@protocol MGLComputedShapeSourceDataSource +@protocol MLNComputedShapeSourceDataSource @optional /** @@ -50,7 +50,7 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLInvalidDatasourceExceptio @param y Tile Y coordinate. @param zoomLevel Tile zoom level. */ -- (NSArray *>*)featuresInTileAtX:(NSUInteger)x y:(NSUInteger)y zoomLevel:(NSUInteger)zoomLevel; +- (NSArray *>*)featuresInTileAtX:(NSUInteger)x y:(NSUInteger)y zoomLevel:(NSUInteger)zoomLevel; /** Fetch features for a tile. This method will not be invoked on the main queue, it @@ -58,33 +58,33 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLInvalidDatasourceExceptio @param bounds The bounds to fetch data for. @param zoomLevel Tile zoom level. */ -- (NSArray *>*)featuresInCoordinateBounds:(MGLCoordinateBounds)bounds zoomLevel:(NSUInteger)zoomLevel; +- (NSArray *>*)featuresInCoordinateBounds:(MLNCoordinateBounds)bounds zoomLevel:(NSUInteger)zoomLevel; @end /** - `MGLComputedShapeSource` is a map content source that supplies vector shapes, + `MLNComputedShapeSource` is a map content source that supplies vector shapes, one tile at a time, to be shown on the map on demand. You implement a class - conforming to the `MGLComputedShapeSourceDataSource` protocol that returns - instances of `MGLShape` or `MGLFeature`, then add a computed shape source to an - `MGLStyle` object along with an `MGLVectorStyleLayer` object. The vector style + conforming to the `MLNComputedShapeSourceDataSource` protocol that returns + instances of `MLNShape` or `MLNFeature`, then add a computed shape source to an + `MLNStyle` object along with an `MLNVectorStyleLayer` object. The vector style layer defines the appearance of any content supplied by the computed shape source. - `MGLComputedShapeSource` is similar to `MGLShapeSource` but is optimized for + `MLNComputedShapeSource` is similar to `MLNShapeSource` but is optimized for data sets that change dynamically or are too large to fit completely in memory. It is also useful for data that is divided into tiles in a format other than Mapbox Vector Tiles. For - GeoJSON data, use the `MGLShapeSource` class. - For static tiles or Mapbox Vector Tiles, use the `MGLVectorTileSource` class. + GeoJSON data, use the `MLNShapeSource` class. + For static tiles or Mapbox Vector Tiles, use the `MLNVectorTileSource` class. You can add and remove sources dynamically using methods such as - `-[MGLStyle addSource:]` and `-[MGLStyle sourceWithIdentifier:]`. This class + `-[MLNStyle addSource:]` and `-[MLNStyle sourceWithIdentifier:]`. This class cannot be represented in a style JSON file; you must add it ot the style at runtime. */ -MGL_EXPORT -@interface MGLComputedShapeSource : MGLSource +MLN_EXPORT +@interface MLNComputedShapeSource : MLNSource /** Returns a custom shape data source initialized with an identifier, and a @@ -93,17 +93,17 @@ MGL_EXPORT specification. This class supports the following options: - `MGLShapeSourceOptionMinimumZoomLevel`, `MGLShapeSourceOptionMaximumZoomLevel`, - `MGLShapeSourceOptionBuffer`, - `MGLShapeSourceOptionSimplificationTolerance`, - `MGLShapeSourceOptionWrapsCoordinates`, and - `MGLShapeSourceOptionClipsCoordinates`. Shapes provided by a computed + `MLNShapeSourceOptionMinimumZoomLevel`, `MLNShapeSourceOptionMaximumZoomLevel`, + `MLNShapeSourceOptionBuffer`, + `MLNShapeSourceOptionSimplificationTolerance`, + `MLNShapeSourceOptionWrapsCoordinates`, and + `MLNShapeSourceOptionClipsCoordinates`. Shapes provided by a computed shape source cannot be clustered. @param identifier A string that uniquely identifies the source. @param options An `NSDictionary` of options for this source. */ -- (instancetype)initWithIdentifier:(NSString *)identifier options:(nullable NSDictionary *)options NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithIdentifier:(NSString *)identifier options:(nullable NSDictionary *)options NS_DESIGNATED_INITIALIZER; /** Returns a custom shape data source initialized with an identifier, data source, and a @@ -112,29 +112,29 @@ MGL_EXPORT specification. This class supports the following options: - `MGLShapeSourceOptionMinimumZoomLevel`, `MGLShapeSourceOptionMaximumZoomLevel`, - `MGLShapeSourceOptionBuffer`, - `MGLShapeSourceOptionSimplificationTolerance`, - `MGLShapeSourceOptionWrapsCoordinates`, and - `MGLShapeSourceOptionClipsCoordinates`. Shapes provided by a computed shape + `MLNShapeSourceOptionMinimumZoomLevel`, `MLNShapeSourceOptionMaximumZoomLevel`, + `MLNShapeSourceOptionBuffer`, + `MLNShapeSourceOptionSimplificationTolerance`, + `MLNShapeSourceOptionWrapsCoordinates`, and + `MLNShapeSourceOptionClipsCoordinates`. Shapes provided by a computed shape source cannot be clustered. @param identifier A string that uniquely identifies the source. @param options An `NSDictionary` of options for this source. */ -- (instancetype)initWithIdentifier:(NSString *)identifier dataSource:(id)dataSource options:(nullable NSDictionary *)options; +- (instancetype)initWithIdentifier:(NSString *)identifier dataSource:(id)dataSource options:(nullable NSDictionary *)options; /** Invalidates all the features and properties intersecting with or contained in the specified bounds. New fetch requests will immediately be invoked on the - `MGLComputedShapeSourceDataSource`. + `MLNComputedShapeSourceDataSource`. @param bounds Coordinate bounds to invalidate. */ -- (void) invalidateBounds:(MGLCoordinateBounds)bounds; +- (void) invalidateBounds:(MLNCoordinateBounds)bounds; /** Invalidates all the feautres and properties of a given tile. A new fetch request - will immediately be invoked on the `MGLComputedShapeSourceDataSource`. + will immediately be invoked on the `MLNComputedShapeSourceDataSource`. @param x Tile X coordinate. @param y Tile Y coordinate. @param zoomLevel Tile zoom level. @@ -144,18 +144,18 @@ MGL_EXPORT /** Set a new set of features for a tile. This method can be invkoed from background threads. For best performance, use this method only to update tiles that have already been requested - through `MGLComputedShapeSourceDataSource.` + through `MLNComputedShapeSourceDataSource.` @param features Features for the tile. @param x Tile X coordinate. @param y Tile Y coordinate. @param zoomLevel Tile zoom level. */ -- (void) setFeatures:(NSArray *>*)features inTileAtX:(NSUInteger)x y:(NSUInteger)y zoomLevel:(NSUInteger)zoomLevel; +- (void) setFeatures:(NSArray *>*)features inTileAtX:(NSUInteger)x y:(NSUInteger)y zoomLevel:(NSUInteger)zoomLevel; /** - An object that implements the `MGLComputedShapeSourceDataSource` protocol that will be queried for tile data. + An object that implements the `MLNComputedShapeSourceDataSource` protocol that will be queried for tile data. */ -@property (nonatomic, weak, nullable) id dataSource; +@property (nonatomic, weak, nullable) id dataSource; /** A queue that calls to the data source will be made on. diff --git a/platform/ios/platform/darwin/src/MGLComputedShapeSource.mm b/platform/ios/platform/darwin/src/MLNComputedShapeSource.mm similarity index 69% rename from platform/ios/platform/darwin/src/MGLComputedShapeSource.mm rename to platform/ios/platform/darwin/src/MLNComputedShapeSource.mm index ceb83b374..2b5c1990d 100644 --- a/platform/ios/platform/darwin/src/MGLComputedShapeSource.mm +++ b/platform/ios/platform/darwin/src/MLNComputedShapeSource.mm @@ -1,68 +1,68 @@ -#import "MGLComputedShapeSource_Private.h" +#import "MLNComputedShapeSource_Private.h" -#import "MGLMapView_Private.h" -#import "MGLSource_Private.h" -#import "MGLShape_Private.h" -#import "MGLGeometry_Private.h" -#import "MGLShapeCollection.h" +#import "MLNMapView_Private.h" +#import "MLNSource_Private.h" +#import "MLNShape_Private.h" +#import "MLNGeometry_Private.h" +#import "MLNShapeCollection.h" #include #include #include #include -const MGLExceptionName MGLInvalidDatasourceException = @"MGLInvalidDatasourceException"; +const MLNExceptionName MLNInvalidDatasourceException = @"MLNInvalidDatasourceException"; -const MGLShapeSourceOption MGLShapeSourceOptionWrapsCoordinates = @"MGLShapeSourceOptionWrapsCoordinates"; -const MGLShapeSourceOption MGLShapeSourceOptionClipsCoordinates = @"MGLShapeSourceOptionClipsCoordinates"; +const MLNShapeSourceOption MLNShapeSourceOptionWrapsCoordinates = @"MLNShapeSourceOptionWrapsCoordinates"; +const MLNShapeSourceOption MLNShapeSourceOptionClipsCoordinates = @"MLNShapeSourceOptionClipsCoordinates"; -mbgl::style::CustomGeometrySource::Options MBGLCustomGeometrySourceOptionsFromDictionary(NSDictionary *options) { +mbgl::style::CustomGeometrySource::Options MBGLCustomGeometrySourceOptionsFromDictionary(NSDictionary *options) { mbgl::style::CustomGeometrySource::Options sourceOptions; - if (NSNumber *value = options[MGLShapeSourceOptionMinimumZoomLevel]) { + if (NSNumber *value = options[MLNShapeSourceOptionMinimumZoomLevel]) { if (![value isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionMinimumZoomLevel must be an NSNumber."]; + format:@"MLNShapeSourceOptionMinimumZoomLevel must be an NSNumber."]; } sourceOptions.zoomRange.min = value.integerValue; } - if (NSNumber *value = options[MGLShapeSourceOptionMaximumZoomLevel]) { + if (NSNumber *value = options[MLNShapeSourceOptionMaximumZoomLevel]) { if (![value isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionMaximumZoomLevel must be an NSNumber."]; + format:@"MLNShapeSourceOptionMaximumZoomLevel must be an NSNumber."]; } sourceOptions.zoomRange.max = value.integerValue; } - if (NSNumber *value = options[MGLShapeSourceOptionBuffer]) { + if (NSNumber *value = options[MLNShapeSourceOptionBuffer]) { if (![value isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionBuffer must be an NSNumber."]; + format:@"MLNShapeSourceOptionBuffer must be an NSNumber."]; } sourceOptions.tileOptions.buffer = value.integerValue; } - if (NSNumber *value = options[MGLShapeSourceOptionSimplificationTolerance]) { + if (NSNumber *value = options[MLNShapeSourceOptionSimplificationTolerance]) { if (![value isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionSimplificationTolerance must be an NSNumber."]; + format:@"MLNShapeSourceOptionSimplificationTolerance must be an NSNumber."]; } sourceOptions.tileOptions.tolerance = value.doubleValue; } - if (NSNumber *value = options[MGLShapeSourceOptionWrapsCoordinates]) { + if (NSNumber *value = options[MLNShapeSourceOptionWrapsCoordinates]) { if (![value isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionWrapsCoordinates must be an NSNumber."]; + format:@"MLNShapeSourceOptionWrapsCoordinates must be an NSNumber."]; } sourceOptions.tileOptions.wrap = value.boolValue; } - if (NSNumber *value = options[MGLShapeSourceOptionClipsCoordinates]) { + if (NSNumber *value = options[MLNShapeSourceOptionClipsCoordinates]) { if (![value isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionClipsCoordinates must be an NSNumber."]; + format:@"MLNShapeSourceOptionClipsCoordinates must be an NSNumber."]; } sourceOptions.tileOptions.clip = value.boolValue; } @@ -70,7 +70,7 @@ mbgl::style::CustomGeometrySource::Options MBGLCustomGeometrySourceOptionsFromDi return sourceOptions; } -@interface MGLComputedShapeSource () { +@interface MLNComputedShapeSource () { std::unique_ptr _pendingSource; } @@ -80,23 +80,23 @@ mbgl::style::CustomGeometrySource::Options MBGLCustomGeometrySourceOptionsFromDi @end -@interface MGLComputedShapeSourceFetchOperation : NSOperation +@interface MLNComputedShapeSourceFetchOperation : NSOperation @property (nonatomic, readonly) uint8_t z; @property (nonatomic, readonly) uint32_t x; @property (nonatomic, readonly) uint32_t y; @property (nonatomic, assign) BOOL dataSourceImplementsFeaturesForTile; @property (nonatomic, assign) BOOL dataSourceImplementsFeaturesForBounds; -@property (nonatomic, weak, nullable) id dataSource; +@property (nonatomic, weak, nullable) id dataSource; @property (nonatomic, nullable) mbgl::style::CustomGeometrySource *rawSource; -- (instancetype)initForSource:(MGLComputedShapeSource*)source tile:(const mbgl::CanonicalTileID&)tileId; +- (instancetype)initForSource:(MLNComputedShapeSource*)source tile:(const mbgl::CanonicalTileID&)tileId; @end -@implementation MGLComputedShapeSourceFetchOperation +@implementation MLNComputedShapeSourceFetchOperation -- (instancetype)initForSource:(MGLComputedShapeSource*)source tile:(const mbgl::CanonicalTileID&)tileID { +- (instancetype)initForSource:(MLNComputedShapeSource*)source tile:(const mbgl::CanonicalTileID&)tileID { self = [super init]; _z = tileID.z; _x = tileID.x; @@ -114,7 +114,7 @@ mbgl::style::CustomGeometrySource::Options MBGLCustomGeometrySourceOptionsFromDi return; } - NSArray *> *data; + NSArray *> *data; if(!self.dataSource) { data = nil; } else if(self.dataSourceImplementsFeaturesForTile) { @@ -124,19 +124,19 @@ mbgl::style::CustomGeometrySource::Options MBGLCustomGeometrySourceOptionsFromDi } else { mbgl::CanonicalTileID tileID = mbgl::CanonicalTileID(self.z, self.x, self.y); mbgl::LatLngBounds tileBounds = mbgl::LatLngBounds(tileID); - data = [self.dataSource featuresInCoordinateBounds:MGLCoordinateBoundsFromLatLngBounds(tileBounds) + data = [self.dataSource featuresInCoordinateBounds:MLNCoordinateBoundsFromLatLngBounds(tileBounds) zoomLevel:self.z]; } if(![self isCancelled]) { mbgl::FeatureCollection featureCollection; featureCollection.reserve(data.count); - for (MGLShape * feature in data) { - if ([feature isMemberOfClass:[MGLShapeCollection class]]) { + for (MLNShape * feature in data) { + if ([feature isMemberOfClass:[MLNShapeCollection class]]) { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - NSLog(@"MGLShapeCollection initialized with MGLFeatures will not retain attributes." - @"Use MGLShapeCollectionFeature to retain attributes instead." + NSLog(@"MLNShapeCollection initialized with MLNFeatures will not retain attributes." + @"Use MLNShapeCollectionFeature to retain attributes instead." @"This will be logged only once."); }); } @@ -157,22 +157,22 @@ mbgl::style::CustomGeometrySource::Options MBGLCustomGeometrySourceOptionsFromDi @end -@implementation MGLComputedShapeSource +@implementation MLNComputedShapeSource -- (instancetype)initWithIdentifier:(NSString *)identifier options:(NSDictionary *)options { +- (instancetype)initWithIdentifier:(NSString *)identifier options:(NSDictionary *)options { NSOperationQueue *requestQueue = [[NSOperationQueue alloc] init]; - requestQueue.name = [NSString stringWithFormat:@"mgl.MGLComputedShapeSource.%@", identifier]; + requestQueue.name = [NSString stringWithFormat:@"mgl.MLNComputedShapeSource.%@", identifier]; requestQueue.qualityOfService = NSQualityOfServiceUtility; requestQueue.maxConcurrentOperationCount = 4; auto sourceOptions = MBGLCustomGeometrySourceOptionsFromDictionary(options); sourceOptions.fetchTileFunction = ^void(const mbgl::CanonicalTileID& tileID) { - NSOperation *operation = [[MGLComputedShapeSourceFetchOperation alloc] initForSource:self tile:tileID]; + NSOperation *operation = [[MLNComputedShapeSourceFetchOperation alloc] initForSource:self tile:tileID]; [requestQueue addOperation:operation]; }; sourceOptions.cancelTileFunction = ^void(const mbgl::CanonicalTileID& tileID) { - for (MGLComputedShapeSourceFetchOperation *operation in requestQueue.operations) { + for (MLNComputedShapeSourceFetchOperation *operation in requestQueue.operations) { if (operation.x == tileID.x && operation.y == tileID.y && operation.z == tileID.z) { [operation cancel]; } @@ -187,7 +187,7 @@ mbgl::style::CustomGeometrySource::Options MBGLCustomGeometrySourceOptionsFromDi return self; } -- (instancetype)initWithIdentifier:(NSString *)identifier dataSource:(id)dataSource options:(NSDictionary *)options { +- (instancetype)initWithIdentifier:(NSString *)identifier dataSource:(id)dataSource options:(NSDictionary *)options { if (self = [self initWithIdentifier:identifier options:options]) { [self setDataSource:dataSource]; } @@ -198,19 +198,19 @@ mbgl::style::CustomGeometrySource::Options MBGLCustomGeometrySourceOptionsFromDi [self.requestQueue cancelAllOperations]; } -- (void)setFeatures:(NSArray *>*)features inTileAtX:(NSUInteger)x y:(NSUInteger)y zoomLevel:(NSUInteger)zoomLevel { - MGLAssertStyleSourceIsValid(); +- (void)setFeatures:(NSArray *>*)features inTileAtX:(NSUInteger)x y:(NSUInteger)y zoomLevel:(NSUInteger)zoomLevel { + MLNAssertStyleSourceIsValid(); mbgl::CanonicalTileID tileID = mbgl::CanonicalTileID((uint8_t)zoomLevel, (uint32_t)x, (uint32_t)y); mbgl::FeatureCollection featureCollection; featureCollection.reserve(features.count); - for (MGLShape * feature in features) { + for (MLNShape * feature in features) { mbgl::GeoJSONFeature geoJsonObject = [feature geoJSONObject].get(); featureCollection.push_back(geoJsonObject); - if ([feature isMemberOfClass:[MGLShapeCollection class]]) { + if ([feature isMemberOfClass:[MLNShapeCollection class]]) { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - NSLog(@"MGLShapeCollection initialized with MGLFeatures will not retain attributes." - @"Use MGLShapeCollectionFeature to retain attributes instead." + NSLog(@"MLNShapeCollection initialized with MLNFeatures will not retain attributes." + @"Use MLNShapeCollectionFeature to retain attributes instead." @"This will be logged only once."); }); } @@ -219,30 +219,30 @@ mbgl::style::CustomGeometrySource::Options MBGLCustomGeometrySourceOptionsFromDi static_cast(self.rawSource)->setTileData(tileID, geojson); } -- (void)setDataSource:(id)dataSource { +- (void)setDataSource:(id)dataSource { [self.requestQueue cancelAllOperations]; // Check which method the datasource implements, to avoid having to check for each tile self.dataSourceImplementsFeaturesForTile = [dataSource respondsToSelector:@selector(featuresInTileAtX:y:zoomLevel:)]; self.dataSourceImplementsFeaturesForBounds = [dataSource respondsToSelector:@selector(featuresInCoordinateBounds:zoomLevel:)]; if (!self.dataSourceImplementsFeaturesForBounds && !self.dataSourceImplementsFeaturesForTile) { - [NSException raise:MGLInvalidDatasourceException - format:@"Datasource does not implement any MGLComputedShapeSourceDataSource methods"]; + [NSException raise:MLNInvalidDatasourceException + format:@"Datasource does not implement any MLNComputedShapeSourceDataSource methods"]; } else if (self.dataSourceImplementsFeaturesForBounds && self.dataSourceImplementsFeaturesForTile) { - [NSException raise:MGLInvalidDatasourceException - format:@"Datasource implements multiple MGLComputedShapeSourceDataSource methods"]; + [NSException raise:MLNInvalidDatasourceException + format:@"Datasource implements multiple MLNComputedShapeSourceDataSource methods"]; } _dataSource = dataSource; } -- (void) invalidateBounds:(MGLCoordinateBounds)bounds { - MGLAssertStyleSourceIsValid(); - ((mbgl::style::CustomGeometrySource *)self.rawSource)->invalidateRegion(MGLLatLngBoundsFromCoordinateBounds(bounds)); +- (void) invalidateBounds:(MLNCoordinateBounds)bounds { + MLNAssertStyleSourceIsValid(); + ((mbgl::style::CustomGeometrySource *)self.rawSource)->invalidateRegion(MLNLatLngBoundsFromCoordinateBounds(bounds)); } - (void) invalidateTileAtX:(NSUInteger)x y:(NSUInteger)y zoomLevel:(NSUInteger)z { - MGLAssertStyleSourceIsValid(); + MLNAssertStyleSourceIsValid(); ((mbgl::style::CustomGeometrySource *)self.rawSource)->invalidateTile(mbgl::CanonicalTileID(z, (unsigned int)x, (unsigned int)y)); } diff --git a/platform/ios/platform/darwin/src/MGLComputedShapeSource_Private.h b/platform/ios/platform/darwin/src/MLNComputedShapeSource_Private.h similarity index 53% rename from platform/ios/platform/darwin/src/MGLComputedShapeSource_Private.h rename to platform/ios/platform/darwin/src/MLNComputedShapeSource_Private.h index ec075e4bd..3dee67c9e 100644 --- a/platform/ios/platform/darwin/src/MGLComputedShapeSource_Private.h +++ b/platform/ios/platform/darwin/src/MLNComputedShapeSource_Private.h @@ -1,12 +1,12 @@ -#import "MGLFoundation.h" -#import "MGLTypes.h" -#import "MGLComputedShapeSource.h" +#import "MLNFoundation.h" +#import "MLNTypes.h" +#import "MLNComputedShapeSource.h" #include NS_ASSUME_NONNULL_BEGIN -MGL_EXPORT -mbgl::style::CustomGeometrySource::Options MBGLCustomGeometrySourceOptionsFromDictionary(NSDictionary *options); +MLN_EXPORT +mbgl::style::CustomGeometrySource::Options MBGLCustomGeometrySourceOptionsFromDictionary(NSDictionary *options); NS_ASSUME_NONNULL_END diff --git a/platform/ios/platform/darwin/src/MGLConversion.h b/platform/ios/platform/darwin/src/MLNConversion.h similarity index 99% rename from platform/ios/platform/darwin/src/MGLConversion.h rename to platform/ios/platform/darwin/src/MLNConversion.h index 7048d3f0b..2150c6036 100644 --- a/platform/ios/platform/darwin/src/MGLConversion.h +++ b/platform/ios/platform/darwin/src/MLNConversion.h @@ -1,4 +1,4 @@ -#import "MGLShape_Private.h" +#import "MLNShape_Private.h" #include diff --git a/platform/ios/platform/darwin/src/MGLCoordinateFormatter.h b/platform/ios/platform/darwin/src/MLNCoordinateFormatter.h similarity index 87% rename from platform/ios/platform/darwin/src/MGLCoordinateFormatter.h rename to platform/ios/platform/darwin/src/MLNCoordinateFormatter.h index 63f0de8f1..f534305ef 100644 --- a/platform/ios/platform/darwin/src/MGLCoordinateFormatter.h +++ b/platform/ios/platform/darwin/src/MLNCoordinateFormatter.h @@ -1,17 +1,17 @@ #import #import -#import "MGLFoundation.h" +#import "MLNFoundation.h" NS_ASSUME_NONNULL_BEGIN /** - The `MGLCoordinateFormatter` class provides properly formatted descriptions of + The `MLNCoordinateFormatter` class provides properly formatted descriptions of geographic coordinate pairs. Use this class to create localized coordinate strings when displaying location information to users. */ -MGL_EXPORT -@interface MGLCoordinateFormatter : NSFormatter +MLN_EXPORT +@interface MLNCoordinateFormatter : NSFormatter /** Determines whether the output may contain minutes of arc when nonzero. @@ -47,7 +47,7 @@ MGL_EXPORT - (NSString *)stringFromCoordinate:(CLLocationCoordinate2D)coordinate; /** - This method is not supported for the `MGLCoordinateFormatter` class. + This method is not supported for the `MLNCoordinateFormatter` class. */ - (BOOL)getObjectValue:(out id __nullable * __nullable)obj forString:(NSString *)string errorDescription:(out NSString * __nullable * __nullable)error; diff --git a/platform/ios/platform/darwin/src/MGLCoordinateFormatter.m b/platform/ios/platform/darwin/src/MLNCoordinateFormatter.m similarity index 96% rename from platform/ios/platform/darwin/src/MGLCoordinateFormatter.m rename to platform/ios/platform/darwin/src/MLNCoordinateFormatter.m index aba34e470..c296866dd 100644 --- a/platform/ios/platform/darwin/src/MGLCoordinateFormatter.m +++ b/platform/ios/platform/darwin/src/MLNCoordinateFormatter.m @@ -1,10 +1,10 @@ -#import "MGLCoordinateFormatter.h" +#import "MLNCoordinateFormatter.h" -#import "NSBundle+MGLAdditions.h" -#import "NSValue+MGLAdditions.h" -#import "MGLLoggingConfiguration_Private.h" +#import "NSBundle+MLNAdditions.h" +#import "NSValue+MLNAdditions.h" +#import "MLNLoggingConfiguration_Private.h" -@implementation MGLCoordinateFormatter +@implementation MLNCoordinateFormatter - (instancetype)init { if (self = [super init]) { @@ -116,11 +116,11 @@ if (![obj isKindOfClass:[NSValue class]]) { return nil; } - return [self stringFromCoordinate:[obj MGLCoordinateValue]]; + return [self stringFromCoordinate:[obj MLNCoordinateValue]]; } - (BOOL)getObjectValue:(out id __nullable * __nullable)obj forString:(NSString *)string errorDescription:(out NSString * __nullable * __nullable)error { - MGLAssert(NO, @"-getObjectValue:forString:errorDescription: has not been implemented"); + MLNAssert(NO, @"-getObjectValue:forString:errorDescription: has not been implemented"); return NO; } diff --git a/platform/ios/platform/darwin/src/MGLDefaultStyle.h b/platform/ios/platform/darwin/src/MLNDefaultStyle.h similarity index 68% rename from platform/ios/platform/darwin/src/MGLDefaultStyle.h rename to platform/ios/platform/darwin/src/MLNDefaultStyle.h index 6a6fd48af..1f019f845 100644 --- a/platform/ios/platform/darwin/src/MGLDefaultStyle.h +++ b/platform/ios/platform/darwin/src/MLNDefaultStyle.h @@ -1,14 +1,14 @@ #import -#import "MGLFoundation.h" +#import "MLNFoundation.h" NS_ASSUME_NONNULL_BEGIN /** - The `MGLDefaultStyle` defines the predefined vendor style + The `MLNDefaultStyle` defines the predefined vendor style */ -MGL_EXPORT -@interface MGLDefaultStyle : NSObject +MLN_EXPORT +@interface MLNDefaultStyle : NSObject /** The style URL diff --git a/platform/ios/platform/darwin/src/MGLDefaultStyle.mm b/platform/ios/platform/darwin/src/MLNDefaultStyle.mm similarity index 51% rename from platform/ios/platform/darwin/src/MGLDefaultStyle.mm rename to platform/ios/platform/darwin/src/MLNDefaultStyle.mm index b706a0beb..b97b86377 100644 --- a/platform/ios/platform/darwin/src/MGLDefaultStyle.mm +++ b/platform/ios/platform/darwin/src/MLNDefaultStyle.mm @@ -1,6 +1,6 @@ -#import "MGLDefaultStyle.h" +#import "MLNDefaultStyle.h" -@implementation MGLDefaultStyle +@implementation MLNDefaultStyle @synthesize url; @synthesize name; diff --git a/platform/ios/platform/darwin/src/MGLDistanceFormatter.h b/platform/ios/platform/darwin/src/MLNDistanceFormatter.h similarity index 78% rename from platform/ios/platform/darwin/src/MGLDistanceFormatter.h rename to platform/ios/platform/darwin/src/MLNDistanceFormatter.h index 46aad9a94..498d03957 100644 --- a/platform/ios/platform/darwin/src/MGLDistanceFormatter.h +++ b/platform/ios/platform/darwin/src/MLNDistanceFormatter.h @@ -1,17 +1,17 @@ #import #import -#import "MGLFoundation.h" +#import "MLNFoundation.h" NS_ASSUME_NONNULL_BEGIN /** - `MGLDistanceFormatter` implements a formatter object meant to be used for + `MLNDistanceFormatter` implements a formatter object meant to be used for geographic distances. The user’s current locale will be used by default but it can be overriden by changing the locale property of the numberFormatter. */ -MGL_EXPORT -@interface MGLDistanceFormatter : NSLengthFormatter +MLN_EXPORT +@interface MLNDistanceFormatter : NSLengthFormatter /** Returns a localized formatted string for the provided distance. diff --git a/platform/ios/platform/darwin/src/MGLDistanceFormatter.m b/platform/ios/platform/darwin/src/MLNDistanceFormatter.m similarity index 90% rename from platform/ios/platform/darwin/src/MGLDistanceFormatter.m rename to platform/ios/platform/darwin/src/MLNDistanceFormatter.m index a7a2f9c9e..7b6d5bce8 100644 --- a/platform/ios/platform/darwin/src/MGLDistanceFormatter.m +++ b/platform/ios/platform/darwin/src/MLNDistanceFormatter.m @@ -1,9 +1,9 @@ -#import "MGLDistanceFormatter.h" +#import "MLNDistanceFormatter.h" -@interface MGLDistanceFormatter() +@interface MLNDistanceFormatter() @end -@implementation MGLDistanceFormatter +@implementation MLNDistanceFormatter static const CLLocationDistance METERS_PER_MILE = 1609.344; static const double YARDS_PER_MILE = 1760.0; diff --git a/platform/ios/platform/darwin/src/MGLFeature.h b/platform/ios/platform/darwin/src/MLNFeature.h similarity index 65% rename from platform/ios/platform/darwin/src/MGLFeature.h rename to platform/ios/platform/darwin/src/MLNFeature.h index a208effba..9ccc7074c 100644 --- a/platform/ios/platform/darwin/src/MGLFeature.h +++ b/platform/ios/platform/darwin/src/MLNFeature.h @@ -1,54 +1,54 @@ #import -#import "MGLFoundation.h" -#import "MGLPolyline.h" -#import "MGLPolygon.h" -#import "MGLPointAnnotation.h" -#import "MGLPointCollection.h" -#import "MGLShapeCollection.h" -#import "MGLCluster.h" +#import "MLNFoundation.h" +#import "MLNPolyline.h" +#import "MLNPolygon.h" +#import "MLNPointAnnotation.h" +#import "MLNPointCollection.h" +#import "MLNShapeCollection.h" +#import "MLNCluster.h" NS_ASSUME_NONNULL_BEGIN /** - The `MGLFeature` protocol is used to provide details about geographic features - contained in an `MGLShapeSource` or `MGLVectorTileSource` object. Each concrete - subclass of `MGLShape` in turn has a subclass that conforms to this protocol. A + The `MLNFeature` protocol is used to provide details about geographic features + contained in an `MLNShapeSource` or `MLNVectorTileSource` object. Each concrete + subclass of `MLNShape` in turn has a subclass that conforms to this protocol. A feature object associates a shape with an optional identifier and attributes. You can add custom data to display on the map by creating feature objects and - adding them to an `MGLShapeSource` using the - `-[MGLShapeSource initWithIdentifier:shape:options:]` method or - `MGLShapeSource.shape` property. + adding them to an `MLNShapeSource` using the + `-[MLNShapeSource initWithIdentifier:shape:options:]` method or + `MLNShapeSource.shape` property. In addition to adding data to the map, you can also extract data from the map: - `-[MGLMapView visibleFeaturesAtPoint:]` and related methods return feature + `-[MLNMapView visibleFeaturesAtPoint:]` and related methods return feature objects that correspond to features in the source. This enables you to inspect - the properties of features in vector tiles loaded by `MGLVectorTileSource` + the properties of features in vector tiles loaded by `MLNVectorTileSource` objects. You also reuse these feature objects as overlay annotations. - While it is possible to add `MGLFeature`-conforming objects to the map as - annotations using `-[MGLMapView addAnnotations:]` and related methods, doing so + While it is possible to add `MLNFeature`-conforming objects to the map as + annotations using `-[MLNMapView addAnnotations:]` and related methods, doing so has trade-offs: - Features added as annotations will not have `identifier` or `attributes` properties when used with feature querying. - Features added as annotations become interactive. Taps and selection can be - handled in `-[MGLMapViewDelegate mapView:didSelectAnnotation:]`. + handled in `-[MLNMapViewDelegate mapView:didSelectAnnotation:]`. */ -@protocol MGLFeature +@protocol MLNFeature /** An object that uniquely identifies the feature in its containing content source. - You can configure an `MGLVectorStyleLayer` object to include or exclude a - specific feature in an `MGLShapeSource` or `MGLVectorTileSource`. In the - `MGLVectorStyleLayer.predicate` property, compare the special `$id` attribute + You can configure an `MLNVectorStyleLayer` object to include or exclude a + specific feature in an `MLNShapeSource` or `MLNVectorTileSource`. In the + `MLNVectorStyleLayer.predicate` property, compare the special `$id` attribute to the feature’s identifier. - In vector tiles loaded by `MGLVectorTileSource` objects, the identifier + In vector tiles loaded by `MLNVectorTileSource` objects, the identifier corresponds to the feature identifier (`id`). If the source does not specify the feature’s identifier, the value of @@ -72,10 +72,10 @@ NS_ASSUME_NONNULL_BEGIN Mapbox Streets layer reference. - The identifier should be set before adding the feature to an `MGLShapeSource` + The identifier should be set before adding the feature to an `MLNShapeSource` object; setting it afterwards has no effect on the map’s contents. While it is possible to change this value on feature instances obtained from - `-[MGLMapView visibleFeaturesAtPoint:]` and related methods, doing so likewise + `-[MLNMapView visibleFeaturesAtPoint:]` and related methods, doing so likewise has no effect on the map’s contents. */ @property (nonatomic, copy, nullable) id identifier; @@ -83,32 +83,32 @@ NS_ASSUME_NONNULL_BEGIN /** A dictionary of attributes for this feature. - You can configure an `MGLVectorStyleLayer` object to include or exclude a - specific feature in an `MGLShapeSource` or `MGLVectorTileSource`. In the - `MGLVectorStyleLayer.predicate` property, compare a key of the attribute + You can configure an `MLNVectorStyleLayer` object to include or exclude a + specific feature in an `MLNShapeSource` or `MLNVectorTileSource`. In the + `MLNVectorStyleLayer.predicate` property, compare a key of the attribute dictionary to the value you want to include. For example, if you want an - `MGLLineStyleLayer` object to display only important features, you might assign + `MLNLineStyleLayer` object to display only important features, you might assign a value above 50 to the important features’ `importance` attribute, then set - `MGLVectorStyleLayer.predicate` to an `NSPredicate` with the format + `MLNVectorStyleLayer.predicate` to an `NSPredicate` with the format `importance > 50`. - You can also configure many layout and paint attributes of an `MGLStyleLayer` + You can also configure many layout and paint attributes of an `MLNStyleLayer` object to match the value of an attribute in this dictionary whenever it renders this feature. For example, if you display features in an - `MGLShapeSource` using an `MGLCircleStyleLayer`, you can assign a `halfway` + `MLNShapeSource` using an `MLNCircleStyleLayer`, you can assign a `halfway` attribute to each of the source’s features, then set - `MGLCircleStyleLayer.circleRadius` to an expression for the key path `halfway`. + `MLNCircleStyleLayer.circleRadius` to an expression for the key path `halfway`. - The `MGLSymbolStyleLayer.text` and `MGLSymbolStyleLayer.iconImageName` + The `MLNSymbolStyleLayer.text` and `MLNSymbolStyleLayer.iconImageName` properties allow you to use attributes yet another way. For example, to label - features in an `MGLShapeSource` object by their names, you can assign a `name` + features in an `MLNShapeSource` object by their names, you can assign a `name` attribute to each of the source’s features, then set - `MGLSymbolStyleLayer.text` to an expression for the constant string value + `MLNSymbolStyleLayer.text` to an expression for the constant string value `{name}`. See the Predicates and Expressions guide for more information about expressions. - In vector tiles loaded by `MGLVectorTileSource` objects, the keys and values of + In vector tiles loaded by `MLNVectorTileSource` objects, the keys and values of each feature’s attribute dictionary are determined by the source. Each attribute name is a string, while each attribute value may be a null value, Boolean value, integer, floating-point number, or string. These data types are @@ -134,19 +134,19 @@ NS_ASSUME_NONNULL_BEGIN Mapbox Terrain layer references. - When adding a feature to an `MGLShapeSource`, use the same Foundation types + When adding a feature to an `MLNShapeSource`, use the same Foundation types listed above for each attribute value. In addition to the Foundation types, you may also set an attribute to an `NSColor` (macOS) or `UIColor` (iOS), which will be converted into its CSS string representation - when the feature is added to an `MGLShapeSource`. This can be convenient when + when the feature is added to an `MLNShapeSource`. This can be convenient when using the attribute to supply a value for a color-typed layout or paint attribute via a key path expression. Note that while it is possible to change this value on feature - instances obtained from `-[MGLMapView visibleFeaturesAtPoint:]` and related + instances obtained from `-[MLNMapView visibleFeaturesAtPoint:]` and related methods, there will be no effect on the map. Setting this value can be useful - when the feature instance is used to initialize an `MGLShapeSource` and that + when the feature instance is used to initialize an `MLNShapeSource` and that source is added to the map and styled. */ @property (nonatomic, copy) NSDictionary *attributes; @@ -161,7 +161,7 @@ NS_ASSUME_NONNULL_BEGIN /** Returns a dictionary that can be serialized as a GeoJSON Feature representation - of an instance of an `MGLFeature` subclass. + of an instance of an `MLNFeature` subclass. The dictionary includes a `geometry` key corresponding to the receiver’s underlying geometry data, a `properties` key corresponding to the receiver’s @@ -173,43 +173,43 @@ NS_ASSUME_NONNULL_BEGIN @end /** - An `MGLEmptyFeature` object associates an empty shape with an optional + An `MLNEmptyFeature` object associates an empty shape with an optional identifier and attributes. */ -MGL_EXPORT -@interface MGLEmptyFeature : MGLShape +MLN_EXPORT +@interface MLNEmptyFeature : MLNShape @end /** - An `MGLPointFeature` object associates a point shape with an optional + An `MLNPointFeature` object associates a point shape with an optional identifier and attributes. #### Related examples See the Dynamically style interactive points example to learn how to initialize - `MGLPointFeature` objects and add them to your map. + `MLNPointFeature` objects and add them to your map. */ -MGL_EXPORT -@interface MGLPointFeature : MGLPointAnnotation +MLN_EXPORT +@interface MLNPointFeature : MLNPointAnnotation @end /** - An `MGLPointFeatureCluster` object associates a point shape (with an optional + An `MLNPointFeatureCluster` object associates a point shape (with an optional identifier and attributes) and represents a point cluster. - @see `MGLCluster` + @see `MLNCluster` #### Related examples See the Clustering point data example to learn how to initialize clusters and add them to your map. */ -MGL_EXPORT -@interface MGLPointFeatureCluster : MGLPointFeature +MLN_EXPORT +@interface MLNPointFeatureCluster : MLNPointFeature @end /** - An `MGLPolylineFeature` object associates a polyline shape with an optional + An `MLNPolylineFeature` object associates a polyline shape with an optional identifier and attributes. A polyline feature is known as a @@ -219,64 +219,64 @@ MGL_EXPORT #### Related examples See the Add a line annotation from GeoJSON example to learn how to initialize an - `MGLPolylineFeature` and add it to an `MGLMapView` object. + `MLNPolylineFeature` and add it to an `MLNMapView` object. */ -MGL_EXPORT -@interface MGLPolylineFeature : MGLPolyline +MLN_EXPORT +@interface MLNPolylineFeature : MLNPolyline @end /** - An `MGLPolygonFeature` object associates a polygon shape with an optional + An `MLNPolygonFeature` object associates a polygon shape with an optional identifier and attributes. */ -MGL_EXPORT -@interface MGLPolygonFeature : MGLPolygon +MLN_EXPORT +@interface MLNPolygonFeature : MLNPolygon @end /** - An `MGLPointCollectionFeature` object associates a point collection with an + An `MLNPointCollectionFeature` object associates a point collection with an optional identifier and attributes. A point collection feature is known as a MultiPoint feature in GeoJSON. */ -MGL_EXPORT -@interface MGLPointCollectionFeature : MGLPointCollection +MLN_EXPORT +@interface MLNPointCollectionFeature : MLNPointCollection @end // https://github.com/mapbox/mapbox-gl-native/issues/7473 -@compatibility_alias MGLMultiPointFeature MGLPointCollectionFeature; +@compatibility_alias MLNMultiPointFeature MLNPointCollectionFeature; /** - An `MGLMultiPolylineFeature` object associates a multipolyline shape with an + An `MLNMultiPolylineFeature` object associates a multipolyline shape with an optional identifier and attributes. A multipolyline feature is known as a MultiLineString feature in GeoJSON. */ -MGL_EXPORT -@interface MGLMultiPolylineFeature : MGLMultiPolyline +MLN_EXPORT +@interface MLNMultiPolylineFeature : MLNMultiPolyline @end /** - An `MGLMultiPolygonFeature` object associates a multipolygon shape with an + An `MLNMultiPolygonFeature` object associates a multipolygon shape with an optional identifier and attributes. */ -MGL_EXPORT -@interface MGLMultiPolygonFeature : MGLMultiPolygon +MLN_EXPORT +@interface MLNMultiPolygonFeature : MLNMultiPolygon @end /** - An `MGLShapeCollectionFeature` object associates a shape collection with an + An `MLNShapeCollectionFeature` object associates a shape collection with an optional identifier and attributes. - `MGLShapeCollectionFeature` is most commonly used to add multiple shapes to a - single `MGLShapeSource`. Configure the appearance of an `MGLSource`’s shape - collection collectively using an `MGLSymbolStyleLayer` object, or use multiple - instances of `MGLCircleStyleLayer`, `MGLFillStyleLayer`, and - `MGLLineStyleLayer` to configure the appearance of each kind of shape inside + `MLNShapeCollectionFeature` is most commonly used to add multiple shapes to a + single `MLNShapeSource`. Configure the appearance of an `MLNSource`’s shape + collection collectively using an `MLNSymbolStyleLayer` object, or use multiple + instances of `MLNCircleStyleLayer`, `MLNFillStyleLayer`, and + `MLNLineStyleLayer` to configure the appearance of each kind of shape inside the collection. A shape collection feature is known as a @@ -286,14 +286,14 @@ MGL_EXPORT #### Related examples See the Add multiple shapes from a single shape source example to learn how to - add shape data to your map using an `MGLShapeCollectionFeature` object. + add shape data to your map using an `MLNShapeCollectionFeature` object. */ -MGL_EXPORT -@interface MGLShapeCollectionFeature : MGLShapeCollection +MLN_EXPORT +@interface MLNShapeCollectionFeature : MLNShapeCollection -@property (nonatomic, copy, readonly) NSArray *> *shapes; +@property (nonatomic, copy, readonly) NSArray *> *shapes; -+ (instancetype)shapeCollectionWithShapes:(NSArray *> *)shapes; ++ (instancetype)shapeCollectionWithShapes:(NSArray *> *)shapes; @end diff --git a/platform/ios/platform/darwin/src/MGLFeature.mm b/platform/ios/platform/darwin/src/MLNFeature.mm similarity index 67% rename from platform/ios/platform/darwin/src/MGLFeature.mm rename to platform/ios/platform/darwin/src/MLNFeature.mm index f8806b3f3..a485e88cd 100644 --- a/platform/ios/platform/darwin/src/MGLFeature.mm +++ b/platform/ios/platform/darwin/src/MLNFeature.mm @@ -1,46 +1,46 @@ -#import "MGLFoundation_Private.h" -#import "MGLFeature_Private.h" -#import "MGLCluster.h" +#import "MLNFoundation_Private.h" +#import "MLNFeature_Private.h" +#import "MLNCluster.h" -#import "MGLPointAnnotation.h" -#import "MGLPolyline.h" -#import "MGLPolygon.h" -#import "MGLValueEvaluator.h" +#import "MLNPointAnnotation.h" +#import "MLNPolyline.h" +#import "MLNPolygon.h" +#import "MLNValueEvaluator.h" -#import "MGLShape_Private.h" -#import "MGLPointCollection_Private.h" -#import "MGLPolyline_Private.h" -#import "MGLPolygon_Private.h" +#import "MLNShape_Private.h" +#import "MLNPointCollection_Private.h" +#import "MLNPolyline_Private.h" +#import "MLNPolygon_Private.h" -#import "NSDictionary+MGLAdditions.h" -#import "NSArray+MGLAdditions.h" -#import "NSExpression+MGLPrivateAdditions.h" -#import "MGLLoggingConfiguration_Private.h" +#import "NSDictionary+MLNAdditions.h" +#import "NSArray+MLNAdditions.h" +#import "NSExpression+MLNPrivateAdditions.h" +#import "MLNLoggingConfiguration_Private.h" #import #import #import // Cluster constants -static NSString * const MGLClusterIdentifierKey = @"cluster_id"; -static NSString * const MGLClusterCountKey = @"point_count"; -const NSUInteger MGLClusterIdentifierInvalid = NSUIntegerMax; +static NSString * const MLNClusterIdentifierKey = @"cluster_id"; +static NSString * const MLNClusterCountKey = @"point_count"; +const NSUInteger MLNClusterIdentifierInvalid = NSUIntegerMax; -@interface MGLEmptyFeature () +@interface MLNEmptyFeature () @end -@implementation MGLEmptyFeature +@implementation MLNEmptyFeature @synthesize identifier; @synthesize attributes = _attributes; -MGL_DEFINE_FEATURE_INIT_WITH_CODER(); -MGL_DEFINE_FEATURE_ENCODE(); -MGL_DEFINE_FEATURE_IS_EQUAL(); -MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER(); +MLN_DEFINE_FEATURE_INIT_WITH_CODER(); +MLN_DEFINE_FEATURE_ENCODE(); +MLN_DEFINE_FEATURE_IS_EQUAL(); +MLN_DEFINE_FEATURE_ATTRIBUTES_GETTER(); - (id)attributeForKey:(NSString *)key { - MGLLogDebug(@"Retrieving attributeForKey: %@", key); + MLNLogDebug(@"Retrieving attributeForKey: %@", key); return self.attributes[key]; } @@ -62,21 +62,21 @@ MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER(); @end -@interface MGLPointFeature () +@interface MLNPointFeature () @end -@implementation MGLPointFeature +@implementation MLNPointFeature @synthesize identifier; @synthesize attributes = _attributes; -MGL_DEFINE_FEATURE_INIT_WITH_CODER(); -MGL_DEFINE_FEATURE_ENCODE(); -MGL_DEFINE_FEATURE_IS_EQUAL(); -MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER(); +MLN_DEFINE_FEATURE_INIT_WITH_CODER(); +MLN_DEFINE_FEATURE_ENCODE(); +MLN_DEFINE_FEATURE_IS_EQUAL(); +MLN_DEFINE_FEATURE_ATTRIBUTES_GETTER(); - (id)attributeForKey:(NSString *)key { - MGLLogDebug(@"Retrieving attributeForKey: %@", key); + MLNLogDebug(@"Retrieving attributeForKey: %@", key); return self.attributes[key]; } @@ -99,46 +99,46 @@ MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER(); @end -@implementation MGLPointFeatureCluster +@implementation MLNPointFeatureCluster - (NSUInteger)clusterIdentifier { - NSNumber *clusterNumber = MGL_OBJC_DYNAMIC_CAST([self attributeForKey:MGLClusterIdentifierKey], NSNumber); - MGLAssert(clusterNumber, @"Clusters should have a cluster_id"); + NSNumber *clusterNumber = MLN_OBJC_DYNAMIC_CAST([self attributeForKey:MLNClusterIdentifierKey], NSNumber); + MLNAssert(clusterNumber, @"Clusters should have a cluster_id"); if (!clusterNumber) { - return MGLClusterIdentifierInvalid; + return MLNClusterIdentifierInvalid; } NSUInteger clusterIdentifier = [clusterNumber unsignedIntegerValue]; - MGLAssert(clusterIdentifier <= UINT32_MAX, @"Cluster identifiers are 32bit"); + MLNAssert(clusterIdentifier <= UINT32_MAX, @"Cluster identifiers are 32bit"); return clusterIdentifier; } - (NSUInteger)clusterPointCount { - NSNumber *count = MGL_OBJC_DYNAMIC_CAST([self attributeForKey:MGLClusterCountKey], NSNumber); - MGLAssert(count, @"Clusters should have a point_count"); + NSNumber *count = MLN_OBJC_DYNAMIC_CAST([self attributeForKey:MLNClusterCountKey], NSNumber); + MLNAssert(count, @"Clusters should have a point_count"); return [count unsignedIntegerValue]; } @end -@interface MGLPolylineFeature () +@interface MLNPolylineFeature () @end -@implementation MGLPolylineFeature +@implementation MLNPolylineFeature @synthesize identifier; @synthesize attributes = _attributes; -MGL_DEFINE_FEATURE_INIT_WITH_CODER(); -MGL_DEFINE_FEATURE_ENCODE(); -MGL_DEFINE_FEATURE_IS_EQUAL(); -MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER(); +MLN_DEFINE_FEATURE_INIT_WITH_CODER(); +MLN_DEFINE_FEATURE_ENCODE(); +MLN_DEFINE_FEATURE_IS_EQUAL(); +MLN_DEFINE_FEATURE_ATTRIBUTES_GETTER(); - (id)attributeForKey:(NSString *)key { - MGLLogDebug(@"Retrieving attributeForKey: %@", key); + MLNLogDebug(@"Retrieving attributeForKey: %@", key); return self.attributes[key]; } @@ -156,27 +156,27 @@ MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER(); NSStringFromClass([self class]), (void *)self, self.identifier ? [NSString stringWithFormat:@"\"%@\"", self.identifier] : self.identifier, (unsigned long)[self pointCount], - MGLStringFromCoordinateBounds(self.overlayBounds), + MLNStringFromCoordinateBounds(self.overlayBounds), self.attributes.count ? self.attributes : @"none"]; } @end -@interface MGLPolygonFeature () +@interface MLNPolygonFeature () @end -@implementation MGLPolygonFeature +@implementation MLNPolygonFeature @synthesize identifier; @synthesize attributes = _attributes; -MGL_DEFINE_FEATURE_INIT_WITH_CODER(); -MGL_DEFINE_FEATURE_ENCODE(); -MGL_DEFINE_FEATURE_IS_EQUAL(); -MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER(); +MLN_DEFINE_FEATURE_INIT_WITH_CODER(); +MLN_DEFINE_FEATURE_ENCODE(); +MLN_DEFINE_FEATURE_IS_EQUAL(); +MLN_DEFINE_FEATURE_ATTRIBUTES_GETTER(); - (id)attributeForKey:(NSString *)key { - MGLLogDebug(@"Retrieving attributeForKey: %@", key); + MLNLogDebug(@"Retrieving attributeForKey: %@", key); return self.attributes[key]; } @@ -194,27 +194,27 @@ MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER(); NSStringFromClass([self class]), (void *)self, self.identifier ? [NSString stringWithFormat:@"\"%@\"", self.identifier] : self.identifier, (unsigned long)[self pointCount], - MGLStringFromCoordinateBounds(self.overlayBounds), + MLNStringFromCoordinateBounds(self.overlayBounds), self.attributes.count ? self.attributes : @"none"]; } @end -@interface MGLPointCollectionFeature () +@interface MLNPointCollectionFeature () @end -@implementation MGLPointCollectionFeature +@implementation MLNPointCollectionFeature @synthesize identifier; @synthesize attributes = _attributes; -MGL_DEFINE_FEATURE_INIT_WITH_CODER(); -MGL_DEFINE_FEATURE_ENCODE(); -MGL_DEFINE_FEATURE_IS_EQUAL(); -MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER(); +MLN_DEFINE_FEATURE_INIT_WITH_CODER(); +MLN_DEFINE_FEATURE_ENCODE(); +MLN_DEFINE_FEATURE_IS_EQUAL(); +MLN_DEFINE_FEATURE_ATTRIBUTES_GETTER(); - (id)attributeForKey:(NSString *)key { - MGLLogDebug(@"Retrieving attributeForKey: %@", key); + MLNLogDebug(@"Retrieving attributeForKey: %@", key); return self.attributes[key]; } @@ -228,21 +228,21 @@ MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER(); @end -@interface MGLMultiPolylineFeature () +@interface MLNMultiPolylineFeature () @end -@implementation MGLMultiPolylineFeature +@implementation MLNMultiPolylineFeature @synthesize identifier; @synthesize attributes = _attributes; -MGL_DEFINE_FEATURE_INIT_WITH_CODER(); -MGL_DEFINE_FEATURE_ENCODE(); -MGL_DEFINE_FEATURE_IS_EQUAL(); -MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER(); +MLN_DEFINE_FEATURE_INIT_WITH_CODER(); +MLN_DEFINE_FEATURE_ENCODE(); +MLN_DEFINE_FEATURE_IS_EQUAL(); +MLN_DEFINE_FEATURE_ATTRIBUTES_GETTER(); - (id)attributeForKey:(NSString *)key { - MGLLogDebug(@"Retrieving attributeForKey: %@", key); + MLNLogDebug(@"Retrieving attributeForKey: %@", key); return self.attributes[key]; } @@ -260,27 +260,27 @@ MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER(); NSStringFromClass([self class]), (void *)self, self.identifier ? [NSString stringWithFormat:@"\"%@\"", self.identifier] : self.identifier, (unsigned long)self.polylines.count, - MGLStringFromCoordinateBounds(self.overlayBounds), + MLNStringFromCoordinateBounds(self.overlayBounds), self.attributes.count ? self.attributes : @"none"]; } @end -@interface MGLMultiPolygonFeature () +@interface MLNMultiPolygonFeature () @end -@implementation MGLMultiPolygonFeature +@implementation MLNMultiPolygonFeature @synthesize identifier; @synthesize attributes = _attributes; -MGL_DEFINE_FEATURE_INIT_WITH_CODER(); -MGL_DEFINE_FEATURE_ENCODE(); -MGL_DEFINE_FEATURE_IS_EQUAL(); -MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER(); +MLN_DEFINE_FEATURE_INIT_WITH_CODER(); +MLN_DEFINE_FEATURE_ENCODE(); +MLN_DEFINE_FEATURE_IS_EQUAL(); +MLN_DEFINE_FEATURE_ATTRIBUTES_GETTER(); - (id)attributeForKey:(NSString *)key { - MGLLogDebug(@"Retrieving attributeForKey: %@", key); + MLNLogDebug(@"Retrieving attributeForKey: %@", key); return self.attributes[key]; } @@ -298,30 +298,30 @@ MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER(); NSStringFromClass([self class]), (void *)self, self.identifier ? [NSString stringWithFormat:@"\"%@\"", self.identifier] : self.identifier, (unsigned long)self.polygons.count, - MGLStringFromCoordinateBounds(self.overlayBounds), + MLNStringFromCoordinateBounds(self.overlayBounds), self.attributes.count ? self.attributes : @"none"]; } @end -@interface MGLShapeCollectionFeature () +@interface MLNShapeCollectionFeature () @end -@implementation MGLShapeCollectionFeature +@implementation MLNShapeCollectionFeature @synthesize identifier; @synthesize attributes = _attributes; @dynamic shapes; -+ (instancetype)shapeCollectionWithShapes:(NSArray *> *)shapes { ++ (instancetype)shapeCollectionWithShapes:(NSArray *> *)shapes { return [super shapeCollectionWithShapes:shapes]; } -MGL_DEFINE_FEATURE_INIT_WITH_CODER(); -MGL_DEFINE_FEATURE_ENCODE(); -MGL_DEFINE_FEATURE_IS_EQUAL(); -MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER(); +MLN_DEFINE_FEATURE_INIT_WITH_CODER(); +MLN_DEFINE_FEATURE_ENCODE(); +MLN_DEFINE_FEATURE_IS_EQUAL(); +MLN_DEFINE_FEATURE_ATTRIBUTES_GETTER(); - (id)attributeForKey:(NSString *)key { return self.attributes[key]; @@ -334,9 +334,9 @@ MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER(); - (mbgl::GeoJSON)geoJSONObject { mbgl::FeatureCollection featureCollection; featureCollection.reserve(self.shapes.count); - for (MGLShape *feature in self.shapes) { + for (MLNShape *feature in self.shapes) { auto geoJSONObject = feature.geoJSONObject; - MGLAssert(geoJSONObject.is(), @"Feature collection must only contain features."); + MLNAssert(geoJSONObject.is(), @"Feature collection must only contain features."); featureCollection.push_back(geoJSONObject.get()); } return featureCollection; @@ -360,12 +360,12 @@ public: is_in_feature(isInFeature) {} - MGLShape * operator()(const mbgl::EmptyGeometry &) const { - return is_in_feature ? [[MGLEmptyFeature alloc] init] : [[MGLShape alloc] init]; + MLNShape * operator()(const mbgl::EmptyGeometry &) const { + return is_in_feature ? [[MLNEmptyFeature alloc] init] : [[MLNShape alloc] init]; } - MGLShape * operator()(const mbgl::Point &geometry) const { - Class shapeClass = is_in_feature ? [MGLPointFeature class] : [MGLPointAnnotation class]; + MLNShape * operator()(const mbgl::Point &geometry) const { + Class shapeClass = is_in_feature ? [MLNPointFeature class] : [MLNPointAnnotation class]; // If we're dealing with a cluster, we should change the class type. // This could be generic and build the subclass at runtime if it turns @@ -376,63 +376,63 @@ public: auto clusterValue = clusterIt->second; if (clusterValue.template is()) { if (clusterValue.template get()) { - shapeClass = [MGLPointFeatureCluster class]; + shapeClass = [MLNPointFeatureCluster class]; } } } } - MGLPointAnnotation *shape = [[shapeClass alloc] init]; + MLNPointAnnotation *shape = [[shapeClass alloc] init]; shape.coordinate = toLocationCoordinate2D(geometry); return shape; } - MGLShape * operator()(const mbgl::LineString &geometry) const { + MLNShape * operator()(const mbgl::LineString &geometry) const { std::vector coordinates = toLocationCoordinates2D(geometry); - Class shapeClass = is_in_feature ? [MGLPolylineFeature class] : [MGLPolyline class]; + Class shapeClass = is_in_feature ? [MLNPolylineFeature class] : [MLNPolyline class]; return [shapeClass polylineWithCoordinates:&coordinates[0] count:coordinates.size()]; } - MGLShape * operator()(const mbgl::Polygon &geometry) const { - return toShape(geometry, is_in_feature); + MLNShape * operator()(const mbgl::Polygon &geometry) const { + return toShape(geometry, is_in_feature); } - MGLShape * operator()(const mbgl::MultiPoint &geometry) const { + MLNShape * operator()(const mbgl::MultiPoint &geometry) const { std::vector coordinates = toLocationCoordinates2D(geometry); - Class shapeClass = is_in_feature ? [MGLPointCollectionFeature class] : [MGLPointCollection class]; + Class shapeClass = is_in_feature ? [MLNPointCollectionFeature class] : [MLNPointCollection class]; return [[shapeClass alloc] initWithCoordinates:&coordinates[0] count:coordinates.size()]; } - MGLShape * operator()(const mbgl::MultiLineString &geometry) const { + MLNShape * operator()(const mbgl::MultiLineString &geometry) const { NSMutableArray *polylines = [NSMutableArray arrayWithCapacity:geometry.size()]; for (auto &lineString : geometry) { std::vector coordinates = toLocationCoordinates2D(lineString); - MGLPolyline *polyline = [MGLPolyline polylineWithCoordinates:&coordinates[0] count:coordinates.size()]; + MLNPolyline *polyline = [MLNPolyline polylineWithCoordinates:&coordinates[0] count:coordinates.size()]; [polylines addObject:polyline]; } - Class shapeClass = is_in_feature ? [MGLMultiPolylineFeature class] : [MGLMultiPolyline class]; + Class shapeClass = is_in_feature ? [MLNMultiPolylineFeature class] : [MLNMultiPolyline class]; return [shapeClass multiPolylineWithPolylines:polylines]; } - MGLShape * operator()(const mbgl::MultiPolygon &geometry) const { + MLNShape * operator()(const mbgl::MultiPolygon &geometry) const { NSMutableArray *polygons = [NSMutableArray arrayWithCapacity:geometry.size()]; for (auto &polygon : geometry) { [polygons addObject:toShape(polygon, false)]; } - Class shapeClass = is_in_feature ? [MGLMultiPolygonFeature class] : [MGLMultiPolygon class]; + Class shapeClass = is_in_feature ? [MLNMultiPolygonFeature class] : [MLNMultiPolygon class]; return [shapeClass multiPolygonWithPolygons:polygons]; } - MGLShape * operator()(const mapbox::geometry::geometry_collection &collection) const { + MLNShape * operator()(const mapbox::geometry::geometry_collection &collection) const { NSMutableArray *shapes = [NSMutableArray arrayWithCapacity:collection.size()]; for (auto &geometry : collection) { - // This is very much like the transformation that happens in MGLFeaturesFromMBGLFeatures(), but these are raw geometries with no associated feature IDs or attributes. - MGLShape *shape = mapbox::geometry::geometry::visit(geometry, *this); + // This is very much like the transformation that happens in MLNFeaturesFromMBGLFeatures(), but these are raw geometries with no associated feature IDs or attributes. + MLNShape *shape = mapbox::geometry::geometry::visit(geometry, *this); [shapes addObject:shape]; } - Class shapeClass = is_in_feature ? [MGLShapeCollectionFeature class] : [MGLShapeCollection class]; + Class shapeClass = is_in_feature ? [MLNShapeCollectionFeature class] : [MLNShapeCollection class]; return [shapeClass shapeCollectionWithShapes:shapes]; } @@ -448,7 +448,7 @@ private: return coordinates; } - template + template static U *toShape(const mbgl::Polygon &geometry, const bool isInFeature) { auto &linearRing = geometry.front(); std::vector coordinates = toLocationCoordinates2D(linearRing); @@ -458,7 +458,7 @@ private: for (auto iter = geometry.begin() + 1; iter != geometry.end(); iter++) { auto &innerRing = *iter; std::vector innerCoordinates = toLocationCoordinates2D(innerRing); - MGLPolygon *innerPolygon = [MGLPolygon polygonWithCoordinates:&innerCoordinates[0] count:innerCoordinates.size()]; + MLNPolygon *innerPolygon = [MLNPolygon polygonWithCoordinates:&innerCoordinates[0] count:innerCoordinates.size()]; [innerPolygons addObject:innerPolygon]; } } @@ -471,43 +471,43 @@ private: template class GeoJSONEvaluator { public: - MGLShape * operator()(const mbgl::Geometry &geometry) const { + MLNShape * operator()(const mbgl::Geometry &geometry) const { GeometryEvaluator evaluator; - MGLShape *shape = mapbox::geometry::geometry::visit(geometry, evaluator); + MLNShape *shape = mapbox::geometry::geometry::visit(geometry, evaluator); return shape; } - MGLShape * operator()(const mbgl::GeoJSONFeature &feature) const { - MGLShape *shape = (MGLShape *)MGLFeatureFromMBGLFeature(feature); + MLNShape * operator()(const mbgl::GeoJSONFeature &feature) const { + MLNShape *shape = (MLNShape *)MLNFeatureFromMBGLFeature(feature); return shape; } - MGLShape * operator()(const mbgl::FeatureCollection &collection) const { + MLNShape * operator()(const mbgl::FeatureCollection &collection) const { NSMutableArray *shapes = [NSMutableArray arrayWithCapacity:collection.size()]; for (const auto &feature : collection) { - [shapes addObject:MGLFeatureFromMBGLFeature(feature)]; + [shapes addObject:MLNFeatureFromMBGLFeature(feature)]; } - return [MGLShapeCollectionFeature shapeCollectionWithShapes:shapes]; + return [MLNShapeCollectionFeature shapeCollectionWithShapes:shapes]; } }; -NSArray *> *MGLFeaturesFromMBGLFeatures(const std::vector &features) { +NSArray *> *MLNFeaturesFromMBGLFeatures(const std::vector &features) { NSMutableArray *shapes = [NSMutableArray arrayWithCapacity:features.size()]; for (const auto &feature : features) { - [shapes addObject:MGLFeatureFromMBGLFeature(static_cast(feature))]; + [shapes addObject:MLNFeatureFromMBGLFeature(static_cast(feature))]; } return shapes; } -NSArray *> *MGLFeaturesFromMBGLFeatures(const std::vector &features) { +NSArray *> *MLNFeaturesFromMBGLFeatures(const std::vector &features) { NSMutableArray *shapes = [NSMutableArray arrayWithCapacity:features.size()]; for (const auto &feature : features) { - [shapes addObject:MGLFeatureFromMBGLFeature(feature)]; + [shapes addObject:MLNFeatureFromMBGLFeature(feature)]; } return shapes; } -id MGLFeatureFromMBGLFeature(const mbgl::GeoJSONFeature &feature) { +id MLNFeatureFromMBGLFeature(const mbgl::GeoJSONFeature &feature) { NSMutableDictionary *attributes = [NSMutableDictionary dictionaryWithCapacity:feature.properties.size()]; for (auto &pair : feature.properties) { auto &value = pair.second; @@ -515,7 +515,7 @@ id MGLFeatureFromMBGLFeature(const mbgl::GeoJSONFeature &feature) { attributes[@(pair.first.c_str())] = mbgl::Value::visit(value, evaluator); } GeometryEvaluator evaluator(&feature.properties, true); - MGLShape *shape = (MGLShape *)mapbox::geometry::geometry::visit(feature.geometry, evaluator); + MLNShape *shape = (MLNShape *)mapbox::geometry::geometry::visit(feature.geometry, evaluator); if (!feature.id.is()) { shape.identifier = mbgl::FeatureIdentifier::visit(feature.id, ValueEvaluator()); } @@ -524,9 +524,9 @@ id MGLFeatureFromMBGLFeature(const mbgl::GeoJSONFeature &feature) { return shape; } -MGLShape* MGLShapeFromGeoJSON(const mapbox::geojson::geojson &geojson) { +MLNShape* MLNShapeFromGeoJSON(const mapbox::geojson::geojson &geojson) { GeoJSONEvaluator evaluator; - MGLShape *shape = mapbox::geojson::geojson::visit(geojson, evaluator); + MLNShape *shape = mapbox::geojson::geojson::visit(geojson, evaluator); return shape; } diff --git a/platform/ios/platform/darwin/src/MGLFeature_Private.h b/platform/ios/platform/darwin/src/MLNFeature_Private.h similarity index 71% rename from platform/ios/platform/darwin/src/MGLFeature_Private.h rename to platform/ios/platform/darwin/src/MLNFeature_Private.h index 599633dd3..b62154736 100644 --- a/platform/ios/platform/darwin/src/MGLFeature_Private.h +++ b/platform/ios/platform/darwin/src/MLNFeature_Private.h @@ -1,6 +1,6 @@ -#import "MGLFoundation.h" -#import "MGLFeature.h" -#import "MGLShape.h" +#import "MLNFoundation.h" +#import "MLNFeature.h" +#import "MLNShape.h" #import #import @@ -9,30 +9,30 @@ NS_ASSUME_NONNULL_BEGIN /** - Returns an array of `MGLFeature` objects converted from the given vector of + Returns an array of `MLNFeature` objects converted from the given vector of vector tile features. */ -MGL_EXPORT -NSArray *> *MGLFeaturesFromMBGLFeatures(const std::vector &features); +MLN_EXPORT +NSArray *> *MLNFeaturesFromMBGLFeatures(const std::vector &features); /** - Returns an array of `MGLFeature` objects converted from the given vector of + Returns an array of `MLNFeature` objects converted from the given vector of vector tile features. */ -MGL_EXPORT -NSArray *> *MGLFeaturesFromMBGLFeatures(const std::vector &features); +MLN_EXPORT +NSArray *> *MLNFeaturesFromMBGLFeatures(const std::vector &features); /** - Returns an `MGLFeature` object converted from the given mbgl::GeoJSONFeature + Returns an `MLNFeature` object converted from the given mbgl::GeoJSONFeature */ -MGL_EXPORT -id MGLFeatureFromMBGLFeature(const mbgl::GeoJSONFeature &feature); +MLN_EXPORT +id MLNFeatureFromMBGLFeature(const mbgl::GeoJSONFeature &feature); /** - Returns an `MGLShape` representing the given geojson. The shape can be + Returns an `MLNShape` representing the given geojson. The shape can be a feature, a collection of features, or a geometry. */ -MGLShape* MGLShapeFromGeoJSON(const mapbox::geojson::geojson &geojson); +MLNShape* MLNShapeFromGeoJSON(const mapbox::geojson::geojson &geojson); /** Takes an `mbgl::GeoJSONFeature` object, an identifer, and attributes dictionary and @@ -42,13 +42,13 @@ MGLShape* MGLShapeFromGeoJSON(const mapbox::geojson::geojson &geojson); mbgl::GeoJSONFeature mbglFeature(mbgl::GeoJSONFeature feature, id identifier, NSDictionary * attributes); /** - Returns an `NSDictionary` representation of an `MGLFeature`. + Returns an `NSDictionary` representation of an `MLNFeature`. */ NSDictionary *NSDictionaryFeatureForGeometry(NSDictionary *geometry, NSDictionary *attributes, id identifier); NS_ASSUME_NONNULL_END -#define MGL_DEFINE_FEATURE_INIT_WITH_CODER() \ +#define MLN_DEFINE_FEATURE_INIT_WITH_CODER() \ - (instancetype)initWithCoder:(NSCoder *)decoder { \ if (self = [super initWithCoder:decoder]) { \ NSSet *identifierClasses = [NSSet setWithArray:@[[NSString class], [NSNumber class]]]; \ @@ -58,14 +58,14 @@ NS_ASSUME_NONNULL_END return self; \ } -#define MGL_DEFINE_FEATURE_ENCODE() \ +#define MLN_DEFINE_FEATURE_ENCODE() \ - (void)encodeWithCoder:(NSCoder *)coder { \ [super encodeWithCoder:coder]; \ [coder encodeObject:identifier forKey:@"identifier"]; \ [coder encodeObject:_attributes forKey:@"attributes"]; \ } -#define MGL_DEFINE_FEATURE_IS_EQUAL() \ +#define MLN_DEFINE_FEATURE_IS_EQUAL() \ - (BOOL)isEqual:(id)other { \ if (other == self) return YES; \ if (![other isKindOfClass:[self class]]) return NO; \ @@ -76,7 +76,7 @@ NS_ASSUME_NONNULL_END return [super hash] + [[self geoJSONDictionary] hash]; \ } -#define MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER() \ +#define MLN_DEFINE_FEATURE_ATTRIBUTES_GETTER() \ - (NSDictionary *) attributes { \ if (!_attributes) { \ return @{}; \ diff --git a/platform/ios/platform/darwin/src/MGLForegroundStyleLayer.h b/platform/ios/platform/darwin/src/MLNForegroundStyleLayer.h similarity index 50% rename from platform/ios/platform/darwin/src/MGLForegroundStyleLayer.h rename to platform/ios/platform/darwin/src/MLNForegroundStyleLayer.h index 8720bf59c..10308218c 100644 --- a/platform/ios/platform/darwin/src/MGLForegroundStyleLayer.h +++ b/platform/ios/platform/darwin/src/MLNForegroundStyleLayer.h @@ -1,24 +1,24 @@ #import -#import "MGLFoundation.h" -#import "MGLStyleLayer.h" +#import "MLNFoundation.h" +#import "MLNStyleLayer.h" NS_ASSUME_NONNULL_BEGIN -@class MGLSource; +@class MLNSource; /** - `MGLForegroundStyleLayer` is an abstract superclass for style layers whose - content is defined by an `MGLSource` object. + `MLNForegroundStyleLayer` is an abstract superclass for style layers whose + content is defined by an `MLNSource` object. - Create instances of `MGLRasterStyleLayer`, `MGLHillshadeStyleLayer`, and the - concrete subclasses of `MGLVectorStyleLayer` in order to use - `MGLForegroundStyleLayer`'s methods. Do not create instances of - `MGLForegroundStyleLayer` directly, and do not create your own subclasses of + Create instances of `MLNRasterStyleLayer`, `MLNHillshadeStyleLayer`, and the + concrete subclasses of `MLNVectorStyleLayer` in order to use + `MLNForegroundStyleLayer`'s methods. Do not create instances of + `MLNForegroundStyleLayer` directly, and do not create your own subclasses of this class. */ -MGL_EXPORT -@interface MGLForegroundStyleLayer : MGLStyleLayer +MLN_EXPORT +@interface MLNForegroundStyleLayer : MLNStyleLayer // MARK: Initializing a Style Layer diff --git a/platform/ios/platform/darwin/src/MGLForegroundStyleLayer.mm b/platform/ios/platform/darwin/src/MLNForegroundStyleLayer.mm similarity index 74% rename from platform/ios/platform/darwin/src/MGLForegroundStyleLayer.mm rename to platform/ios/platform/darwin/src/MLNForegroundStyleLayer.mm index eaa5e83e5..c22d351b4 100644 --- a/platform/ios/platform/darwin/src/MGLForegroundStyleLayer.mm +++ b/platform/ios/platform/darwin/src/MLNForegroundStyleLayer.mm @@ -1,11 +1,11 @@ -#import "MGLForegroundStyleLayer.h" -#import "MGLStyleLayer_Private.h" +#import "MLNForegroundStyleLayer.h" +#import "MLNStyleLayer_Private.h" -@implementation MGLForegroundStyleLayer +@implementation MLNForegroundStyleLayer - (NSString *)sourceIdentifier { - [NSException raise:MGLAbstractClassException - format:@"MGLForegroundStyleLayer is an abstract class"]; + [NSException raise:MLNAbstractClassException + format:@"MLNForegroundStyleLayer is an abstract class"]; return nil; } diff --git a/platform/ios/platform/darwin/src/MLNFoundation.h b/platform/ios/platform/darwin/src/MLNFoundation.h new file mode 100644 index 000000000..f3ec8c27c --- /dev/null +++ b/platform/ios/platform/darwin/src/MLNFoundation.h @@ -0,0 +1,5 @@ +#pragma once + +#import + +#define MLN_EXPORT __attribute__((visibility ("default"))) diff --git a/platform/ios/platform/darwin/src/MGLFoundation.mm b/platform/ios/platform/darwin/src/MLNFoundation.mm similarity index 62% rename from platform/ios/platform/darwin/src/MGLFoundation.mm rename to platform/ios/platform/darwin/src/MLNFoundation.mm index 5cda1dced..17727bd62 100644 --- a/platform/ios/platform/darwin/src/MGLFoundation.mm +++ b/platform/ios/platform/darwin/src/MLNFoundation.mm @@ -1,6 +1,6 @@ -#import "MGLFoundation_Private.h" +#import "MLNFoundation_Private.h" /// Initializes the run loop shim that lives on the main thread. -void MGLInitializeRunLoop() { +void MLNInitializeRunLoop() { static mbgl::util::RunLoop runLoop; } diff --git a/platform/ios/platform/darwin/src/MGLFoundation_Private.h b/platform/ios/platform/darwin/src/MLNFoundation_Private.h similarity index 73% rename from platform/ios/platform/darwin/src/MGLFoundation_Private.h rename to platform/ios/platform/darwin/src/MLNFoundation_Private.h index db81bde3d..31b38cc1a 100644 --- a/platform/ios/platform/darwin/src/MGLFoundation_Private.h +++ b/platform/ios/platform/darwin/src/MLNFoundation_Private.h @@ -1,17 +1,17 @@ -#import "MGLFoundation.h" +#import "MLNFoundation.h" #include -void MGLInitializeRunLoop(); +void MLNInitializeRunLoop(); /* Using a compound statement (GNU Extension, supported by clang) */ -#define MGL_OBJC_DYNAMIC_CAST(object, type) \ +#define MLN_OBJC_DYNAMIC_CAST(object, type) \ ({ \ __typeof__( object ) temp##__LINE__ = (object); \ (type *)([temp##__LINE__ isKindOfClass:[type class]] ? temp##__LINE__ : nil); \ }) -#define MGL_OBJC_DYNAMIC_CAST_AS_PROTOCOL(object, proto) \ +#define MLN_OBJC_DYNAMIC_CAST_AS_PROTOCOL(object, proto) \ ({ \ __typeof__( object ) temp##__LINE__ = (object); \ (id< proto >)([temp##__LINE__ conformsToProtocol:@protocol( proto )] ? temp##__LINE__ : nil); \ diff --git a/platform/ios/platform/darwin/src/MGLGeometry.h b/platform/ios/platform/darwin/src/MLNGeometry.h similarity index 70% rename from platform/ios/platform/darwin/src/MGLGeometry.h rename to platform/ios/platform/darwin/src/MLNGeometry.h index 397cf2a11..1a9e4901e 100644 --- a/platform/ios/platform/darwin/src/MGLGeometry.h +++ b/platform/ios/platform/darwin/src/MLNGeometry.h @@ -2,52 +2,52 @@ #import #import -#import "MGLFoundation.h" +#import "MLNFoundation.h" NS_ASSUME_NONNULL_BEGIN -/** Defines the area spanned by an `MGLCoordinateBounds`. */ -typedef struct __attribute__((objc_boxable)) MGLCoordinateSpan { - /** Latitudes spanned by an `MGLCoordinateBounds`. */ +/** Defines the area spanned by an `MLNCoordinateBounds`. */ +typedef struct __attribute__((objc_boxable)) MLNCoordinateSpan { + /** Latitudes spanned by an `MLNCoordinateBounds`. */ CLLocationDegrees latitudeDelta; - /** Longitudes spanned by an `MGLCoordinateBounds`. */ + /** Longitudes spanned by an `MLNCoordinateBounds`. */ CLLocationDegrees longitudeDelta; -} MGLCoordinateSpan; +} MLNCoordinateSpan; /* Defines a point on the map in Mercator projection for a specific zoom level. */ -typedef struct __attribute__((objc_boxable)) MGLMapPoint { +typedef struct __attribute__((objc_boxable)) MLNMapPoint { /** X coordinate representing a longitude in Mercator projection. */ CGFloat x; /** Y coordinate representing a latitide in Mercator projection. */ CGFloat y; /** Zoom level at which the X and Y coordinates are valid. */ CGFloat zoomLevel; -} MGLMapPoint; +} MLNMapPoint; /* Defines a 4x4 matrix. */ -typedef struct MGLMatrix4 { +typedef struct MLNMatrix4 { double m00, m01, m02, m03; double m10, m11, m12, m13; double m20, m21, m22, m23; double m30, m31, m32, m33; -} MGLMatrix4; +} MLNMatrix4; /** - Creates a new `MGLCoordinateSpan` from the given latitudinal and longitudinal + Creates a new `MLNCoordinateSpan` from the given latitudinal and longitudinal deltas. */ -NS_INLINE MGLCoordinateSpan MGLCoordinateSpanMake(CLLocationDegrees latitudeDelta, CLLocationDegrees longitudeDelta) { - MGLCoordinateSpan span; +NS_INLINE MLNCoordinateSpan MLNCoordinateSpanMake(CLLocationDegrees latitudeDelta, CLLocationDegrees longitudeDelta) { + MLNCoordinateSpan span; span.latitudeDelta = latitudeDelta; span.longitudeDelta = longitudeDelta; return span; } /** - Creates a new `MGLMapPoint` from the given X and Y coordinates, and zoom level. + Creates a new `MLNMapPoint` from the given X and Y coordinates, and zoom level. */ -NS_INLINE MGLMapPoint MGLMapPointMake(CGFloat x, CGFloat y, CGFloat zoomLevel) { - MGLMapPoint point; +NS_INLINE MLNMapPoint MLNMapPointMake(CGFloat x, CGFloat y, CGFloat zoomLevel) { + MLNMapPoint point; point.x = x; point.y = y; point.zoomLevel = zoomLevel; @@ -58,29 +58,29 @@ NS_INLINE MGLMapPoint MGLMapPointMake(CGFloat x, CGFloat y, CGFloat zoomLevel) { Returns `YES` if the two coordinate spans represent the same latitudinal change and the same longitudinal change. */ -NS_INLINE BOOL MGLCoordinateSpanEqualToCoordinateSpan(MGLCoordinateSpan span1, MGLCoordinateSpan span2) { +NS_INLINE BOOL MLNCoordinateSpanEqualToCoordinateSpan(MLNCoordinateSpan span1, MLNCoordinateSpan span2) { return (span1.latitudeDelta == span2.latitudeDelta && span1.longitudeDelta == span2.longitudeDelta); } /** An area of zero width and zero height. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLCoordinateSpan MGLCoordinateSpanZero; +FOUNDATION_EXTERN MLN_EXPORT const MLNCoordinateSpan MLNCoordinateSpanZero; /** A rectangular area as measured on a two-dimensional map projection. */ -typedef struct __attribute__((objc_boxable)) MGLCoordinateBounds { +typedef struct __attribute__((objc_boxable)) MLNCoordinateBounds { /** Coordinate at the southwest corner. */ CLLocationCoordinate2D sw; /** Coordinate at the northeast corner. */ CLLocationCoordinate2D ne; -} MGLCoordinateBounds; +} MLNCoordinateBounds; /** A quadrilateral area as measured on a two-dimensional map projection. - `MGLCoordinateQuad` differs from `MGLCoordinateBounds` in that it allows + `MLNCoordinateQuad` differs from `MLNCoordinateBounds` in that it allows representation of non-axis aligned bounds and non-rectangular quadrilaterals. The coordinates are described in counter clockwise order from top left. */ -typedef struct MGLCoordinateQuad { +typedef struct MLNCoordinateQuad { /** Coordinate at the top left corner. */ CLLocationCoordinate2D topLeft; /** Coordinate at the bottom left corner. */ @@ -89,26 +89,26 @@ typedef struct MGLCoordinateQuad { CLLocationCoordinate2D bottomRight; /** Coordinate at the top right corner. */ CLLocationCoordinate2D topRight; -} MGLCoordinateQuad; +} MLNCoordinateQuad; /** - Creates a new `MGLCoordinateBounds` structure from the given southwest and + Creates a new `MLNCoordinateBounds` structure from the given southwest and northeast coordinates. */ -NS_INLINE MGLCoordinateBounds MGLCoordinateBoundsMake(CLLocationCoordinate2D sw, CLLocationCoordinate2D ne) { - MGLCoordinateBounds bounds; +NS_INLINE MLNCoordinateBounds MLNCoordinateBoundsMake(CLLocationCoordinate2D sw, CLLocationCoordinate2D ne) { + MLNCoordinateBounds bounds; bounds.sw = sw; bounds.ne = ne; return bounds; } /** - Creates a new `MGLCoordinateQuad` structure from the given top left, + Creates a new `MLNCoordinateQuad` structure from the given top left, bottom left, bottom right, and top right coordinates. */ -NS_INLINE MGLCoordinateQuad MGLCoordinateQuadMake(CLLocationCoordinate2D topLeft, CLLocationCoordinate2D bottomLeft, CLLocationCoordinate2D bottomRight, CLLocationCoordinate2D topRight) { - MGLCoordinateQuad quad; +NS_INLINE MLNCoordinateQuad MLNCoordinateQuadMake(CLLocationCoordinate2D topLeft, CLLocationCoordinate2D bottomLeft, CLLocationCoordinate2D bottomRight, CLLocationCoordinate2D topRight) { + MLNCoordinateQuad quad; quad.topLeft = topLeft; quad.bottomLeft = bottomLeft; quad.bottomRight = bottomRight; @@ -117,12 +117,12 @@ NS_INLINE MGLCoordinateQuad MGLCoordinateQuadMake(CLLocationCoordinate2D topLeft } /** - Creates a new `MGLCoordinateQuad` structure from the given `MGLCoordinateBounds`. + Creates a new `MLNCoordinateQuad` structure from the given `MLNCoordinateBounds`. The returned quad uses the bounds' northeast coordinate as the top right, and the southwest coordinate at the bottom left. */ -NS_INLINE MGLCoordinateQuad MGLCoordinateQuadFromCoordinateBounds(MGLCoordinateBounds bounds) { - MGLCoordinateQuad quad; +NS_INLINE MLNCoordinateQuad MLNCoordinateQuadFromCoordinateBounds(MLNCoordinateBounds bounds) { + MLNCoordinateQuad quad; quad.topLeft = CLLocationCoordinate2DMake(bounds.ne.latitude, bounds.sw.longitude); quad.bottomLeft = bounds.sw; quad.bottomRight = CLLocationCoordinate2DMake(bounds.sw.latitude, bounds.ne.longitude); @@ -131,7 +131,7 @@ NS_INLINE MGLCoordinateQuad MGLCoordinateQuadFromCoordinateBounds(MGLCoordinateB } /** Returns `YES` if the two coordinate bounds are equal to each other. */ -NS_INLINE BOOL MGLCoordinateBoundsEqualToCoordinateBounds(MGLCoordinateBounds bounds1, MGLCoordinateBounds bounds2) { +NS_INLINE BOOL MLNCoordinateBoundsEqualToCoordinateBounds(MLNCoordinateBounds bounds1, MLNCoordinateBounds bounds2) { return (bounds1.sw.latitude == bounds2.sw.latitude && bounds1.sw.longitude == bounds2.sw.longitude && bounds1.ne.latitude == bounds2.ne.latitude && @@ -139,7 +139,7 @@ NS_INLINE BOOL MGLCoordinateBoundsEqualToCoordinateBounds(MGLCoordinateBounds bo } /** Returns `YES` if the two coordinate bounds intersect. */ -NS_INLINE BOOL MGLCoordinateBoundsIntersectsCoordinateBounds(MGLCoordinateBounds bounds1, MGLCoordinateBounds bounds2) { +NS_INLINE BOOL MLNCoordinateBoundsIntersectsCoordinateBounds(MLNCoordinateBounds bounds1, MLNCoordinateBounds bounds2) { return (bounds1.ne.latitude > bounds2.sw.latitude && bounds1.sw.latitude < bounds2.ne.latitude && bounds1.ne.longitude > bounds2.sw.longitude && @@ -152,10 +152,10 @@ NS_INLINE BOOL MGLCoordinateBoundsIntersectsCoordinateBounds(MGLCoordinateBounds #### Related examples See the Restrict map panning to an area example to learn how to use - `MGLCoordinateInCoordinateBounds` to determine if a point is within, or + `MLNCoordinateInCoordinateBounds` to determine if a point is within, or intersects, a given bounding box. */ -NS_INLINE BOOL MGLCoordinateInCoordinateBounds(CLLocationCoordinate2D coordinate, MGLCoordinateBounds bounds) { +NS_INLINE BOOL MLNCoordinateInCoordinateBounds(CLLocationCoordinate2D coordinate, MLNCoordinateBounds bounds) { return (coordinate.latitude >= bounds.sw.latitude && coordinate.latitude <= bounds.ne.latitude && coordinate.longitude >= bounds.sw.longitude && @@ -163,8 +163,8 @@ NS_INLINE BOOL MGLCoordinateInCoordinateBounds(CLLocationCoordinate2D coordinate } /** Returns the area spanned by the coordinate bounds. */ -NS_INLINE MGLCoordinateSpan MGLCoordinateBoundsGetCoordinateSpan(MGLCoordinateBounds bounds) { - return MGLCoordinateSpanMake(bounds.ne.latitude - bounds.sw.latitude, +NS_INLINE MLNCoordinateSpan MLNCoordinateBoundsGetCoordinateSpan(MLNCoordinateBounds bounds) { + return MLNCoordinateSpanMake(bounds.ne.latitude - bounds.sw.latitude, bounds.ne.longitude - bounds.sw.longitude); } @@ -172,8 +172,8 @@ NS_INLINE MGLCoordinateSpan MGLCoordinateBoundsGetCoordinateSpan(MGLCoordinateBo Returns a coordinate bounds with southwest and northeast coordinates that are offset from those of the source bounds. */ -NS_INLINE MGLCoordinateBounds MGLCoordinateBoundsOffset(MGLCoordinateBounds bounds, MGLCoordinateSpan offset) { - MGLCoordinateBounds offsetBounds = bounds; +NS_INLINE MLNCoordinateBounds MLNCoordinateBoundsOffset(MLNCoordinateBounds bounds, MLNCoordinateSpan offset) { + MLNCoordinateBounds offsetBounds = bounds; offsetBounds.sw.latitude += offset.latitudeDelta; offsetBounds.sw.longitude += offset.longitudeDelta; offsetBounds.ne.latitude += offset.latitudeDelta; @@ -187,20 +187,20 @@ NS_INLINE MGLCoordinateBounds MGLCoordinateBoundsOffset(MGLCoordinateBounds boun @note A bounds may be empty but have a non-zero coordinate span (e.g., when its northeast point lies due north of its southwest point). */ -NS_INLINE BOOL MGLCoordinateBoundsIsEmpty(MGLCoordinateBounds bounds) { - MGLCoordinateSpan span = MGLCoordinateBoundsGetCoordinateSpan(bounds); +NS_INLINE BOOL MLNCoordinateBoundsIsEmpty(MLNCoordinateBounds bounds) { + MLNCoordinateSpan span = MLNCoordinateBoundsGetCoordinateSpan(bounds); return span.latitudeDelta == 0 || span.longitudeDelta == 0; } /** Returns a formatted string for the given coordinate bounds. */ -NS_INLINE NSString *MGLStringFromCoordinateBounds(MGLCoordinateBounds bounds) { +NS_INLINE NSString *MLNStringFromCoordinateBounds(MLNCoordinateBounds bounds) { return [NSString stringWithFormat:@"{ sw = {%.1f, %.1f}, ne = {%.1f, %.1f}}", bounds.sw.latitude, bounds.sw.longitude, bounds.ne.latitude, bounds.ne.longitude]; } /** Returns a formatted string for the given coordinate quad. */ -NS_INLINE NSString *MGLStringFromCoordinateQuad(MGLCoordinateQuad quad) { +NS_INLINE NSString *MLNStringFromCoordinateQuad(MLNCoordinateQuad quad) { return [NSString stringWithFormat:@"{ topleft = {%.1f, %.1f}, bottomleft = {%.1f, %.1f}}, bottomright = {%.1f, %.1f}, topright = {%.1f, %.1f}", quad.topLeft.latitude, quad.topLeft.longitude, quad.bottomLeft.latitude, quad.bottomLeft.longitude, @@ -209,17 +209,17 @@ NS_INLINE NSString *MGLStringFromCoordinateQuad(MGLCoordinateQuad quad) { } /** Returns radians, converted from degrees. */ -NS_INLINE CGFloat MGLRadiansFromDegrees(CLLocationDegrees degrees) { +NS_INLINE CGFloat MLNRadiansFromDegrees(CLLocationDegrees degrees) { return (CGFloat)(degrees * M_PI) / 180; } /** Returns degrees, converted from radians. */ -NS_INLINE CLLocationDegrees MGLDegreesFromRadians(CGFloat radians) { +NS_INLINE CLLocationDegrees MLNDegreesFromRadians(CGFloat radians) { return radians * 180 / M_PI; } /** Returns Mercator projection of a WGS84 coordinate at the specified zoom level. */ -FOUNDATION_EXTERN MGL_EXPORT MGLMapPoint MGLMapPointForCoordinate(CLLocationCoordinate2D coordinate, double zoomLevel); +FOUNDATION_EXTERN MLN_EXPORT MLNMapPoint MLNMapPointForCoordinate(CLLocationCoordinate2D coordinate, double zoomLevel); /** Converts a map zoom level to a camera altitude. @@ -229,7 +229,7 @@ FOUNDATION_EXTERN MGL_EXPORT MGLMapPoint MGLMapPointForCoordinate(CLLocationCoor @param latitude The latitude of the point at the center of the viewport. @param size The size of the viewport. @return An altitude measured in meters. */ -FOUNDATION_EXTERN MGL_EXPORT CLLocationDistance MGLAltitudeForZoomLevel(double zoomLevel, CGFloat pitch, CLLocationDegrees latitude, CGSize size); +FOUNDATION_EXTERN MLN_EXPORT CLLocationDistance MLNAltitudeForZoomLevel(double zoomLevel, CGFloat pitch, CLLocationDegrees latitude, CGSize size); /** Converts a camera altitude to a map zoom level. @@ -238,6 +238,6 @@ FOUNDATION_EXTERN MGL_EXPORT CLLocationDistance MGLAltitudeForZoomLevel(double z @param latitude The latitude of the point at the center of the viewport. @param size The size of the viewport. @return A zero-based zoom level. */ -FOUNDATION_EXTERN MGL_EXPORT double MGLZoomLevelForAltitude(CLLocationDistance altitude, CGFloat pitch, CLLocationDegrees latitude, CGSize size); +FOUNDATION_EXTERN MLN_EXPORT double MLNZoomLevelForAltitude(CLLocationDistance altitude, CGFloat pitch, CLLocationDegrees latitude, CGSize size); NS_ASSUME_NONNULL_END diff --git a/platform/ios/platform/darwin/src/MGLGeometry.mm b/platform/ios/platform/darwin/src/MLNGeometry.mm similarity index 71% rename from platform/ios/platform/darwin/src/MGLGeometry.mm rename to platform/ios/platform/darwin/src/MLNGeometry.mm index dd6001a28..c87c2b01a 100644 --- a/platform/ios/platform/darwin/src/MGLGeometry.mm +++ b/platform/ios/platform/darwin/src/MLNGeometry.mm @@ -1,6 +1,6 @@ -#import "MGLGeometry_Private.h" +#import "MLNGeometry_Private.h" -#import "MGLFoundation.h" +#import "MLNFoundation.h" #import @@ -14,11 +14,11 @@ TransformState::getProjMatrix() has a variable vertical field of view that defaults to 2 arctan ⅓ rad ≈ 36.9° but MapKit uses a vertical field of view of 30°. flyTo() assumes a field of view of 2 arctan ½ rad. */ -const CLLocationDegrees MGLAngularFieldOfView = 30; +const CLLocationDegrees MLNAngularFieldOfView = 30; -const MGLCoordinateSpan MGLCoordinateSpanZero = {0, 0}; +const MLNCoordinateSpan MLNCoordinateSpanZero = {0, 0}; -CGRect MGLExtendRect(CGRect rect, CGPoint point) { +CGRect MLNExtendRect(CGRect rect, CGPoint point) { if (point.x < rect.origin.x) { rect.size.width += rect.origin.x - point.x; rect.origin.x = point.x; @@ -36,7 +36,7 @@ CGRect MGLExtendRect(CGRect rect, CGPoint point) { return rect; } -mbgl::LatLng MGLLatLngFromLocationCoordinate2D(CLLocationCoordinate2D coordinate) { +mbgl::LatLng MLNLatLngFromLocationCoordinate2D(CLLocationCoordinate2D coordinate) { try { return mbgl::LatLng(coordinate.latitude, coordinate.longitude); } catch (std::domain_error &error) { @@ -45,58 +45,58 @@ mbgl::LatLng MGLLatLngFromLocationCoordinate2D(CLLocationCoordinate2D coordinate } } -CLLocationDistance MGLAltitudeForZoomLevel(double zoomLevel, CGFloat pitch, CLLocationDegrees latitude, CGSize size) { +CLLocationDistance MLNAltitudeForZoomLevel(double zoomLevel, CGFloat pitch, CLLocationDegrees latitude, CGSize size) { CLLocationDistance metersPerPixel = mbgl::Projection::getMetersPerPixelAtLatitude(latitude, zoomLevel); CLLocationDistance metersTall = metersPerPixel * size.height; - CLLocationDistance altitude = metersTall / 2 / std::tan(MGLRadiansFromDegrees(MGLAngularFieldOfView) / 2.); - return altitude * std::sin(M_PI_2 - MGLRadiansFromDegrees(pitch)) / std::sin(M_PI_2); + CLLocationDistance altitude = metersTall / 2 / std::tan(MLNRadiansFromDegrees(MLNAngularFieldOfView) / 2.); + return altitude * std::sin(M_PI_2 - MLNRadiansFromDegrees(pitch)) / std::sin(M_PI_2); } -double MGLZoomLevelForAltitude(CLLocationDistance altitude, CGFloat pitch, CLLocationDegrees latitude, CGSize size) { - CLLocationDistance eyeAltitude = altitude / std::sin(M_PI_2 - MGLRadiansFromDegrees(pitch)) * std::sin(M_PI_2); - CLLocationDistance metersTall = eyeAltitude * 2 * std::tan(MGLRadiansFromDegrees(MGLAngularFieldOfView) / 2.); +double MLNZoomLevelForAltitude(CLLocationDistance altitude, CGFloat pitch, CLLocationDegrees latitude, CGSize size) { + CLLocationDistance eyeAltitude = altitude / std::sin(M_PI_2 - MLNRadiansFromDegrees(pitch)) * std::sin(M_PI_2); + CLLocationDistance metersTall = eyeAltitude * 2 * std::tan(MLNRadiansFromDegrees(MLNAngularFieldOfView) / 2.); CLLocationDistance metersPerPixel = metersTall / size.height; - CGFloat mapPixelWidthAtZoom = std::cos(MGLRadiansFromDegrees(latitude)) * mbgl::util::M2PI * mbgl::util::EARTH_RADIUS_M / metersPerPixel; + CGFloat mapPixelWidthAtZoom = std::cos(MLNRadiansFromDegrees(latitude)) * mbgl::util::M2PI * mbgl::util::EARTH_RADIUS_M / metersPerPixel; return ::log2(mapPixelWidthAtZoom / mbgl::util::tileSize_D); } -MGLRadianDistance MGLDistanceBetweenRadianCoordinates(MGLRadianCoordinate2D from, MGLRadianCoordinate2D to) { +MLNRadianDistance MLNDistanceBetweenRadianCoordinates(MLNRadianCoordinate2D from, MLNRadianCoordinate2D to) { double a = pow(sin((to.latitude - from.latitude) / 2), 2) + pow(sin((to.longitude - from.longitude) / 2), 2) * cos(from.latitude) * cos(to.latitude); return 2 * atan2(sqrt(a), sqrt(1 - a)); } -MGLRadianDirection MGLRadianCoordinatesDirection(MGLRadianCoordinate2D from, MGLRadianCoordinate2D to) { +MLNRadianDirection MLNRadianCoordinatesDirection(MLNRadianCoordinate2D from, MLNRadianCoordinate2D to) { double a = sin(to.longitude - from.longitude) * cos(to.latitude); double b = cos(from.latitude) * sin(to.latitude) - sin(from.latitude) * cos(to.latitude) * cos(to.longitude - from.longitude); return atan2(a, b); } -MGLRadianCoordinate2D MGLRadianCoordinateAtDistanceFacingDirection(MGLRadianCoordinate2D coordinate, - MGLRadianDistance distance, - MGLRadianDirection direction) { +MLNRadianCoordinate2D MLNRadianCoordinateAtDistanceFacingDirection(MLNRadianCoordinate2D coordinate, + MLNRadianDistance distance, + MLNRadianDirection direction) { double otherLatitude = asin(sin(coordinate.latitude) * cos(distance) + cos(coordinate.latitude) * sin(distance) * cos(direction)); double otherLongitude = coordinate.longitude + atan2(sin(direction) * sin(distance) * cos(coordinate.latitude), cos(distance) - sin(coordinate.latitude) * sin(otherLatitude)); - return MGLRadianCoordinate2DMake(otherLatitude, otherLongitude); + return MLNRadianCoordinate2DMake(otherLatitude, otherLongitude); } -CLLocationDirection MGLDirectionBetweenCoordinates(CLLocationCoordinate2D firstCoordinate, CLLocationCoordinate2D secondCoordinate) { +CLLocationDirection MLNDirectionBetweenCoordinates(CLLocationCoordinate2D firstCoordinate, CLLocationCoordinate2D secondCoordinate) { // Ported from https://github.com/mapbox/turf-swift/blob/857e2e8060678ef4a7a9169d4971b0788fdffc37/Turf/Turf.swift#L23-L31 - MGLRadianCoordinate2D firstRadianCoordinate = MGLRadianCoordinateFromLocationCoordinate(firstCoordinate); - MGLRadianCoordinate2D secondRadianCoordinate = MGLRadianCoordinateFromLocationCoordinate(secondCoordinate); + MLNRadianCoordinate2D firstRadianCoordinate = MLNRadianCoordinateFromLocationCoordinate(firstCoordinate); + MLNRadianCoordinate2D secondRadianCoordinate = MLNRadianCoordinateFromLocationCoordinate(secondCoordinate); CGFloat a = sin(secondRadianCoordinate.longitude - firstRadianCoordinate.longitude) * cos(secondRadianCoordinate.latitude); CGFloat b = (cos(firstRadianCoordinate.latitude) * sin(secondRadianCoordinate.latitude) - sin(firstRadianCoordinate.latitude) * cos(secondRadianCoordinate.latitude) * cos(secondRadianCoordinate.longitude - firstRadianCoordinate.longitude)); - MGLRadianDirection radianDirection = atan2(a, b); + MLNRadianDirection radianDirection = atan2(a, b); return radianDirection * 180 / M_PI; } -CGPoint MGLPointRounded(CGPoint point) { +CGPoint MLNPointRounded(CGPoint point) { #if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR CGFloat scaleFactor = [UIScreen mainScreen].nativeScale; #elif TARGET_OS_MAC @@ -105,13 +105,13 @@ CGPoint MGLPointRounded(CGPoint point) { return CGPointMake(round(point.x * scaleFactor) / scaleFactor, round(point.y * scaleFactor) / scaleFactor); } -MGLMapPoint MGLMapPointForCoordinate(CLLocationCoordinate2D coordinate, double zoomLevel) { - mbgl::Point projectedCoordinate = mbgl::Projection::project(MGLLatLngFromLocationCoordinate2D(coordinate), std::pow(2.0, zoomLevel)); - return MGLMapPointMake(projectedCoordinate.x, projectedCoordinate.y, zoomLevel); +MLNMapPoint MLNMapPointForCoordinate(CLLocationCoordinate2D coordinate, double zoomLevel) { + mbgl::Point projectedCoordinate = mbgl::Projection::project(MLNLatLngFromLocationCoordinate2D(coordinate), std::pow(2.0, zoomLevel)); + return MLNMapPointMake(projectedCoordinate.x, projectedCoordinate.y, zoomLevel); } -MGLMatrix4 MGLMatrix4Make(std::array array) { - MGLMatrix4 mat4 = { +MLNMatrix4 MLNMatrix4Make(std::array array) { + MLNMatrix4 mat4 = { .m00 = array[0], .m01 = array[1], .m02 = array[2], .m03 = array[3], .m10 = array[4], .m11 = array[5], .m12 = array[6], .m13 = array[7], .m20 = array[8], .m21 = array[9], .m22 = array[10], .m23 = array[11], diff --git a/platform/ios/platform/darwin/src/MLNGeometry_Private.h b/platform/ios/platform/darwin/src/MLNGeometry_Private.h new file mode 100644 index 000000000..29e3157ff --- /dev/null +++ b/platform/ios/platform/darwin/src/MLNGeometry_Private.h @@ -0,0 +1,156 @@ +#import "MLNGeometry.h" + +#import +#if TARGET_OS_IPHONE + #import +#endif + +#import +#import + +#import +typedef double MLNLocationRadians; +typedef double MLNRadianDistance; +typedef double MLNRadianDirection; + +/** Defines the coordinate by a `MLNRadianCoordinate2D`. */ +typedef struct MLNRadianCoordinate2D { + MLNLocationRadians latitude; + MLNLocationRadians longitude; +} MLNRadianCoordinate2D; + +/** + Creates a new `MLNRadianCoordinate2D` from the given latitudinal and longitudinal. + */ +NS_INLINE MLNRadianCoordinate2D MLNRadianCoordinate2DMake(MLNLocationRadians latitude, MLNLocationRadians longitude) { + MLNRadianCoordinate2D radianCoordinate; + radianCoordinate.latitude = latitude; + radianCoordinate.longitude = longitude; + return radianCoordinate; +} + +/// Returns the smallest rectangle that contains both the given rectangle and +/// the given point. +CGRect MLNExtendRect(CGRect rect, CGPoint point); + +#if TARGET_OS_IPHONE +NS_INLINE NSString *MLNStringFromSize(CGSize size) { + return NSStringFromCGSize(size); +} +#else +NS_INLINE NSString *MLNStringFromSize(NSSize size) { + return NSStringFromSize(size); +} +#endif + +NS_INLINE NSString *MLNStringFromCLLocationCoordinate2D(CLLocationCoordinate2D coordinate) { + return [NSString stringWithFormat:@"(lat: %f, lon: %f)", coordinate.latitude, coordinate.longitude]; +} + +mbgl::LatLng MLNLatLngFromLocationCoordinate2D(CLLocationCoordinate2D coordinate); + +NS_INLINE mbgl::Point MLNPointFromLocationCoordinate2D(CLLocationCoordinate2D coordinate) { + return mbgl::Point(coordinate.longitude, coordinate.latitude); +} + +NS_INLINE CLLocationCoordinate2D MLNLocationCoordinate2DFromPoint(mbgl::Point point) { + return CLLocationCoordinate2DMake(point.y, point.x); +} + +NS_INLINE CLLocationCoordinate2D MLNLocationCoordinate2DFromLatLng(mbgl::LatLng latLng) { + return CLLocationCoordinate2DMake(latLng.latitude(), latLng.longitude()); +} + +NS_INLINE MLNCoordinateBounds MLNCoordinateBoundsFromLatLngBounds(mbgl::LatLngBounds latLngBounds) { + return MLNCoordinateBoundsMake(MLNLocationCoordinate2DFromLatLng(latLngBounds.southwest()), + MLNLocationCoordinate2DFromLatLng(latLngBounds.northeast())); +} + +NS_INLINE mbgl::LatLngBounds MLNLatLngBoundsFromCoordinateBounds(MLNCoordinateBounds coordinateBounds) { + return mbgl::LatLngBounds::hull(MLNLatLngFromLocationCoordinate2D(coordinateBounds.sw), + MLNLatLngFromLocationCoordinate2D(coordinateBounds.ne)); +} + +NS_INLINE std::array MLNLatLngArrayFromCoordinateQuad(MLNCoordinateQuad quad) { + return { MLNLatLngFromLocationCoordinate2D(quad.topLeft), + MLNLatLngFromLocationCoordinate2D(quad.topRight), + MLNLatLngFromLocationCoordinate2D(quad.bottomRight), + MLNLatLngFromLocationCoordinate2D(quad.bottomLeft) }; +} + +NS_INLINE MLNCoordinateQuad MLNCoordinateQuadFromLatLngArray(std::array quad) { + return { MLNLocationCoordinate2DFromLatLng(quad[0]), + MLNLocationCoordinate2DFromLatLng(quad[3]), + MLNLocationCoordinate2DFromLatLng(quad[2]), + MLNLocationCoordinate2DFromLatLng(quad[1]) }; +} + +/** + YES if the coordinate is valid or NO if it is not. + Considers extended coordinates. + */ +NS_INLINE BOOL MLNLocationCoordinate2DIsValid(CLLocationCoordinate2D coordinate) { + return (coordinate.latitude <= 90.0 && + coordinate.latitude >= -90.0 && + coordinate.longitude <= 360.0 && + coordinate.longitude >= -360.0); +} + +#if TARGET_OS_IPHONE + #define MLNEdgeInsets UIEdgeInsets + #define MLNEdgeInsetsMake UIEdgeInsetsMake +#else + #define MLNEdgeInsets NSEdgeInsets + #define MLNEdgeInsetsMake NSEdgeInsetsMake +#endif + +NS_INLINE mbgl::EdgeInsets MLNEdgeInsetsFromNSEdgeInsets(MLNEdgeInsets insets) { + return { insets.top, insets.left, insets.bottom, insets.right }; +} + +NS_INLINE MLNEdgeInsets NSEdgeInsetsFromMLNEdgeInsets(const mbgl::EdgeInsets& insets) { + return MLNEdgeInsetsMake(insets.top(), insets.left(), insets.bottom(), insets.right()); +} + +/// Returns the combination of two edge insets. +NS_INLINE MLNEdgeInsets MLNEdgeInsetsInsetEdgeInset(MLNEdgeInsets base, MLNEdgeInsets inset) { + return MLNEdgeInsetsMake(base.top + inset.top, + base.left + inset.left, + base.bottom + inset.bottom, + base.right + inset.right); +} + +/** Returns MLNRadianCoordinate2D, converted from CLLocationCoordinate2D. */ +NS_INLINE MLNRadianCoordinate2D MLNRadianCoordinateFromLocationCoordinate(CLLocationCoordinate2D locationCoordinate) { + return MLNRadianCoordinate2DMake(MLNRadiansFromDegrees(locationCoordinate.latitude), + MLNRadiansFromDegrees(locationCoordinate.longitude)); +} + +/** + Returns the distance in radians given two coordinates. + */ +MLNRadianDistance MLNDistanceBetweenRadianCoordinates(MLNRadianCoordinate2D from, MLNRadianCoordinate2D to); + +/** + Returns direction in radians given two coordinates. + */ +MLNRadianDirection MLNRadianCoordinatesDirection(MLNRadianCoordinate2D from, MLNRadianCoordinate2D to); + +/** + Returns a coordinate at a given distance and direction away from coordinate. + */ +MLNRadianCoordinate2D MLNRadianCoordinateAtDistanceFacingDirection(MLNRadianCoordinate2D coordinate, + MLNRadianDistance distance, + MLNRadianDirection direction); + +/** + Returns the direction from one coordinate to another. + */ +CLLocationDirection MLNDirectionBetweenCoordinates(CLLocationCoordinate2D firstCoordinate, CLLocationCoordinate2D secondCoordinate); + +/** + Returns a point with coordinates rounded to the nearest logical pixel. + */ +CGPoint MLNPointRounded(CGPoint point); + +MLNMatrix4 MLNMatrix4Make(std::array mat); diff --git a/platform/ios/platform/darwin/src/MGLImageSource.h b/platform/ios/platform/darwin/src/MLNImageSource.h similarity index 72% rename from platform/ios/platform/darwin/src/MGLImageSource.h rename to platform/ios/platform/darwin/src/MLNImageSource.h index 628ca06d5..2e15218c7 100644 --- a/platform/ios/platform/darwin/src/MGLImageSource.h +++ b/platform/ios/platform/darwin/src/MLNImageSource.h @@ -1,54 +1,54 @@ -#import "MGLSource.h" +#import "MLNSource.h" -#import "MGLFoundation.h" -#import "MGLTypes.h" -#import "MGLGeometry.h" +#import "MLNFoundation.h" +#import "MLNTypes.h" +#import "MLNGeometry.h" NS_ASSUME_NONNULL_BEGIN -MGL_EXPORT +MLN_EXPORT /** - `MGLImageSource` is a content source that is used for a georeferenced raster + `MLNImageSource` is a content source that is used for a georeferenced raster image to be shown on the map. The georeferenced image scales and rotates as the user zooms and rotates the map. Images may also be used as icons or patterns in a style layer. To register an image for use as an icon or pattern, - use the `-[MGLStyle setImage:forName:]` method. To configure a point - annotation’s image, use the `MGLAnnotationImage` class. + use the `-[MLNStyle setImage:forName:]` method. To configure a point + annotation’s image, use the `MLNAnnotationImage` class. The geographic location of the raster image content, supplied with - `MGLCoordinateQuad`, can be non-axis aligned. - `MGLImageSource` supports raster content from `NSURL`, `NSImage` (macOS), or + `MLNCoordinateQuad`, can be non-axis aligned. + `MLNImageSource` supports raster content from `NSURL`, `NSImage` (macOS), or `UIImage` (iOS). - An image source is added to an `MGLStyle` object along with one or more - `MGLRasterStyleLayer` objects. Use a raster style layer to control the + An image source is added to an `MLNStyle` object along with one or more + `MLNRasterStyleLayer` objects. Use a raster style layer to control the appearance of content supplied by the image source. Each image source defined by the style JSON file is represented at runtime by an - `MGLImageSource` object that you can use to initialize new style layers. You + `MLNImageSource` object that you can use to initialize new style layers. You can also add and remove sources dynamically using methods such as - `-[MGLStyle addSource:]` and `-[MGLStyle sourceWithIdentifier:]`. + `-[MLNStyle addSource:]` and `-[MLNStyle sourceWithIdentifier:]`. ### Example ```swift - let coordinates = MGLCoordinateQuad( + let coordinates = MLNCoordinateQuad( topLeft: CLLocationCoordinate2D(latitude: 46.437, longitude: -80.425), bottomLeft: CLLocationCoordinate2D(latitude: 37.936, longitude: -80.425), bottomRight: CLLocationCoordinate2D(latitude: 37.936, longitude: -71.516), topRight: CLLocationCoordinate2D(latitude: 46.437, longitude: -71.516)) - let source = MGLImageSource(identifier: "radar", coordinateQuad: coordinates, url: URL(string: "https://maplibre.org/maplibre-gl-js-docs/assets/radar.gif")!) + let source = MLNImageSource(identifier: "radar", coordinateQuad: coordinates, url: URL(string: "https://maplibre.org/maplibre-gl-js-docs/assets/radar.gif")!) mapView.style?.addSource(source) ``` #### Related examples See the Add an image example to learn how to add an image to your map using - `MGLImageSource`. + `MLNImageSource`. */ -MGL_EXPORT -@interface MGLImageSource : MGLSource +MLN_EXPORT +@interface MLNImageSource : MLNSource // MARK: Initializing a Source @@ -61,7 +61,7 @@ MGL_EXPORT current application’s resource bundle. @return An initialized shape source. */ -- (instancetype)initWithIdentifier:(NSString *)identifier coordinateQuad:(MGLCoordinateQuad)coordinateQuad URL:(NSURL *)url; +- (instancetype)initWithIdentifier:(NSString *)identifier coordinateQuad:(MLNCoordinateQuad)coordinateQuad URL:(NSURL *)url; /** Returns a georeferenced image source with an identifier, coordinates and an image. @@ -71,7 +71,7 @@ MGL_EXPORT @param image The image to display for the source. @return An initialized shape source. */ -- (instancetype)initWithIdentifier:(NSString *)identifier coordinateQuad:(MGLCoordinateQuad)coordinateQuad image:(MGLImage *)image; +- (instancetype)initWithIdentifier:(NSString *)identifier coordinateQuad:(MLNCoordinateQuad)coordinateQuad image:(MLNImage *)image; // MARK: Accessing a Source’s Content @@ -88,12 +88,12 @@ MGL_EXPORT If the receiver was initialized using `-initWithIdentifier:coordinateQuad:URL:` or if the `URL` property is set, this property is set to `nil`. */ -@property (nonatomic, retain, nullable)MGLImage *image; +@property (nonatomic, retain, nullable)MLNImage *image; /** The coordinates at which the corners of the source image will be placed. */ -@property (nonatomic) MGLCoordinateQuad coordinates; +@property (nonatomic) MLNCoordinateQuad coordinates; @end NS_ASSUME_NONNULL_END diff --git a/platform/ios/platform/darwin/src/MGLImageSource.mm b/platform/ios/platform/darwin/src/MLNImageSource.mm similarity index 66% rename from platform/ios/platform/darwin/src/MGLImageSource.mm rename to platform/ios/platform/darwin/src/MLNImageSource.mm index 2d2f09007..667c54386 100644 --- a/platform/ios/platform/darwin/src/MGLImageSource.mm +++ b/platform/ios/platform/darwin/src/MLNImageSource.mm @@ -1,44 +1,44 @@ -#import "MGLImageSource.h" +#import "MLNImageSource.h" -#import "MGLGeometry_Private.h" -#import "MGLLoggingConfiguration_Private.h" -#import "MGLSource_Private.h" -#import "MGLTileSource_Private.h" -#import "NSURL+MGLAdditions.h" +#import "MLNGeometry_Private.h" +#import "MLNLoggingConfiguration_Private.h" +#import "MLNSource_Private.h" +#import "MLNTileSource_Private.h" +#import "NSURL+MLNAdditions.h" #if TARGET_OS_IPHONE - #import "UIImage+MGLAdditions.h" + #import "UIImage+MLNAdditions.h" #else - #import "NSImage+MGLAdditions.h" + #import "NSImage+MLNAdditions.h" #endif #include #include -@interface MGLImageSource () -- (instancetype)initWithIdentifier:(NSString *)identifier coordinateQuad:(MGLCoordinateQuad)coordinateQuad NS_DESIGNATED_INITIALIZER; +@interface MLNImageSource () +- (instancetype)initWithIdentifier:(NSString *)identifier coordinateQuad:(MLNCoordinateQuad)coordinateQuad NS_DESIGNATED_INITIALIZER; @property (nonatomic, readonly) mbgl::style::ImageSource *rawSource; @end -@implementation MGLImageSource +@implementation MLNImageSource -- (instancetype)initWithIdentifier:(NSString *)identifier coordinateQuad:(MGLCoordinateQuad)coordinateQuad { +- (instancetype)initWithIdentifier:(NSString *)identifier coordinateQuad:(MLNCoordinateQuad)coordinateQuad { - const auto coordsArray = MGLLatLngArrayFromCoordinateQuad(coordinateQuad); + const auto coordsArray = MLNLatLngArrayFromCoordinateQuad(coordinateQuad); auto source = std::make_unique(identifier.UTF8String, coordsArray); return self = [super initWithPendingSource:std::move(source)]; } -- (instancetype)initWithIdentifier:(NSString *)identifier coordinateQuad:(MGLCoordinateQuad)coordinateQuad URL:(NSURL *)url { +- (instancetype)initWithIdentifier:(NSString *)identifier coordinateQuad:(MLNCoordinateQuad)coordinateQuad URL:(NSURL *)url { self = [self initWithIdentifier:identifier coordinateQuad: coordinateQuad]; self.URL = url; return self; } -- (instancetype)initWithIdentifier:(NSString *)identifier coordinateQuad:(MGLCoordinateQuad)coordinateQuad image:(MGLImage *)image { +- (instancetype)initWithIdentifier:(NSString *)identifier coordinateQuad:(MLNCoordinateQuad)coordinateQuad image:(MLNImage *)image { self = [self initWithIdentifier:identifier coordinateQuad: coordinateQuad]; self.image = image; @@ -46,13 +46,13 @@ } - (NSURL *)URL { - MGLAssertStyleSourceIsValid(); + MLNAssertStyleSourceIsValid(); auto url = self.rawSource->getURL(); return url ? [NSURL URLWithString:@(url->c_str())] : nil; } - (void)setURL:(NSURL *)url { - MGLAssertStyleSourceIsValid(); + MLNAssertStyleSourceIsValid(); if (url) { self.rawSource->setURL(url.mgl_URLByStandardizingScheme.absoluteString.UTF8String); _image = nil; @@ -61,8 +61,8 @@ } } -- (void)setImage:(MGLImage *)image { - MGLAssertStyleSourceIsValid(); +- (void)setImage:(MLNImage *)image { + MLNAssertStyleSourceIsValid(); if (image != nullptr) { self.rawSource->setImage(image.mgl_premultipliedImage); } else { @@ -71,21 +71,21 @@ _image = image; } -- (MGLCoordinateQuad)coordinates { - MGLAssertStyleSourceIsValid(); - return MGLCoordinateQuadFromLatLngArray(self.rawSource->getCoordinates()); +- (MLNCoordinateQuad)coordinates { + MLNAssertStyleSourceIsValid(); + return MLNCoordinateQuadFromLatLngArray(self.rawSource->getCoordinates()); } -- (void)setCoordinates: (MGLCoordinateQuad)coordinateQuad { - MGLAssertStyleSourceIsValid(); - self.rawSource->setCoordinates(MGLLatLngArrayFromCoordinateQuad(coordinateQuad)); +- (void)setCoordinates: (MLNCoordinateQuad)coordinateQuad { + MLNAssertStyleSourceIsValid(); + self.rawSource->setCoordinates(MLNLatLngArrayFromCoordinateQuad(coordinateQuad)); } - (NSString *)description { if (self.rawSource) { return [NSString stringWithFormat:@"<%@: %p; identifier = %@; coordinates = %@; URL = %@; image = %@>", NSStringFromClass([self class]), (void *)self, self.identifier, - MGLStringFromCoordinateQuad(self.coordinates), + MLNStringFromCoordinateQuad(self.coordinates), self.URL, self.image]; } @@ -101,7 +101,7 @@ - (NSString *)attributionHTMLString { if (!self.rawSource) { - MGLAssert(0, @"Source with identifier `%@` was invalidated after a style change", self.identifier); + MLNAssert(0, @"Source with identifier `%@` was invalidated after a style change", self.identifier); return nil; } diff --git a/platform/ios/platform/darwin/src/MGLLight.h.ejs b/platform/ios/platform/darwin/src/MLNLight.h.ejs similarity index 80% rename from platform/ios/platform/darwin/src/MGLLight.h.ejs rename to platform/ios/platform/darwin/src/MLNLight.h.ejs index 716385f14..e7d636759 100644 --- a/platform/ios/platform/darwin/src/MGLLight.h.ejs +++ b/platform/ios/platform/darwin/src/MLNLight.h.ejs @@ -8,8 +8,8 @@ #import -#import "MGLFoundation.h" -#import "MGLStyleValue.h" +#import "MLNFoundation.h" +#import "MLNStyleValue.h" NS_ASSUME_NONNULL_BEGIN @@ -18,12 +18,12 @@ NS_ASSUME_NONNULL_BEGIN /** <%- propertyDoc(property.name, property, type, 'enum').wrap(80, 1) %> */ -typedef NS_ENUM(NSUInteger, MGLLight<%- camelize(property.name) %>) { +typedef NS_ENUM(NSUInteger, MLNLight<%- camelize(property.name) %>) { <% for (const value in property.values) { -%> /** <%- propertyDoc(property.name, property.values[value], type, 'enum').wrap(80, 4+1) %> */ - MGLLightAnchor<%- camelize(value) %>, + MLNLightAnchor<%- camelize(value) %>, <% } -%> }; <% } -%> @@ -33,28 +33,28 @@ typedef NS_ENUM(NSUInteger, MGLLight<%- camelize(property.name) %>) { A structure containing information about the position of the light source relative to lit geometries. */ -typedef struct __attribute__((objc_boxable)) MGLSphericalPosition { +typedef struct __attribute__((objc_boxable)) MLNSphericalPosition { /** Distance from the center of the base of an object to its light. */ CGFloat radial; - /** Position of the light relative to 0° (0° when `MGLLight.anchor` is set to viewport corresponds - to the top of the viewport, or 0° when `MGLLight.anchor` is set to map corresponds to due north, + /** Position of the light relative to 0° (0° when `MLNLight.anchor` is set to viewport corresponds + to the top of the viewport, or 0° when `MLNLight.anchor` is set to map corresponds to due north, and degrees proceed clockwise). */ CLLocationDirection azimuthal; /** Indicates the height of the light (from 0°, directly above, to 180°, directly below). */ CLLocationDirection polar; -} MGLSphericalPosition; +} MLNSphericalPosition; /** - Creates a new `MGLSphericalPosition` from the given radial, azimuthal, polar. + Creates a new `MLNSphericalPosition` from the given radial, azimuthal, polar. @param radial The radial coordinate. @param azimuthal The azimuthal angle. @param polar The polar angle. - @return Returns a `MGLSphericalPosition` struct containing the position attributes. + @return Returns a `MLNSphericalPosition` struct containing the position attributes. */ -NS_INLINE MGLSphericalPosition MGLSphericalPositionMake(CGFloat radial, CLLocationDirection azimuthal, CLLocationDirection polar) { - MGLSphericalPosition position; +NS_INLINE MLNSphericalPosition MLNSphericalPositionMake(CGFloat radial, CLLocationDirection azimuthal, CLLocationDirection polar) { + MLNSphericalPosition position; position.radial = radial; position.azimuthal = azimuthal; position.polar = polar; @@ -65,8 +65,8 @@ NS_INLINE MGLSphericalPosition MGLSphericalPositionMake(CGFloat radial, CLLocati /** <%- doc.wrap(80, 1) %> */ -MGL_EXPORT -@interface MGLLight : NSObject +MLN_EXPORT +@interface MLNLight : NSObject <% if (properties.length) { -%> <% for (const property of properties) { -%> @@ -90,7 +90,7 @@ MGL_EXPORT This property corresponds to the `<%- originalPropertyName(property) %>-transition` property in the style JSON file format. */ -@property (nonatomic) MGLTransition <%- camelizeWithLeadingLowercase(property.name) %>Transition; +@property (nonatomic) MLNTransition <%- camelizeWithLeadingLowercase(property.name) %>Transition; <% } -%> <% if (property.original) { -%> diff --git a/platform/ios/platform/darwin/src/MGLLight.mm.ejs b/platform/ios/platform/darwin/src/MLNLight.mm.ejs similarity index 74% rename from platform/ios/platform/darwin/src/MGLLight.mm.ejs rename to platform/ios/platform/darwin/src/MLNLight.mm.ejs index e4e455d35..cc5d5b244 100644 --- a/platform/ios/platform/darwin/src/MGLLight.mm.ejs +++ b/platform/ios/platform/darwin/src/MLNLight.mm.ejs @@ -5,23 +5,23 @@ // Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`. // test -#import "MGLLight.h" +#import "MLNLight.h" -#import "MGLTypes.h" -#import "MGLStyleValue_Private.h" -#import "NSValue+MGLAdditions.h" -#import "MGLLoggingConfiguration_Private.h" +#import "MLNTypes.h" +#import "MLNStyleValue_Private.h" +#import "NSValue+MLNAdditions.h" +#import "MLNLoggingConfiguration_Private.h" #import #import namespace mbgl { - MBGL_DEFINE_ENUM(MGLLightAnchor, { + MBGL_DEFINE_ENUM(MLNLightAnchor, { <% for (const property of properties) { -%> <% if (property.type == "enum") { -%> <% for (const value in property.values) { -%> - { MGLLightAnchor<%- camelize(value) %>, "<%- value %>" }, + { MLNLightAnchor<%- camelize(value) %>, "<%- value %>" }, <% } -%> <% } -%> <% } -%> @@ -29,16 +29,16 @@ namespace mbgl { } -@interface MGLLight() +@interface MLNLight() @end -@implementation MGLLight +@implementation MLNLight - (instancetype)initWithMBGLLight:(const mbgl::style::Light *)mbglLight { if (self = [super init]) { - MGLLogInfo(@"Initializing %@.", NSStringFromClass([self class])); + MLNLogInfo(@"Initializing %@.", NSStringFromClass([self class])); <% if (properties.length) { -%> <% for (const property of properties) { -%> <% if (property.type == "enum") { -%> @@ -46,26 +46,26 @@ namespace mbgl { NSExpression *<%- camelizeWithLeadingLowercase(property.name) -%>Expression; if (<%- camelizeWithLeadingLowercase(property.name) -%>.isUndefined()) { mbgl::style::PropertyValueType> default<%- camelize(property.name) -%> = mbglLight->getDefault<%- camelize(property.name) -%>(); - <%- camelizeWithLeadingLowercase(property.name) -%>Expression = MGLStyleValueTransformerType, MGLLight<%- camelize(property.name) -%>>().toExpression(default<%- camelize(property.name) -%>); + <%- camelizeWithLeadingLowercase(property.name) -%>Expression = MLNStyleValueTransformerType, MLNLight<%- camelize(property.name) -%>>().toExpression(default<%- camelize(property.name) -%>); } else { - <%- camelizeWithLeadingLowercase(property.name) -%>Expression = MGLStyleValueTransformerType, NSValue *, mbgl::style::Light<%- camelize(property.name) -%>Type, MGLLight<%- camelize(property.name) -%>>().toExpression(<%- camelizeWithLeadingLowercase(property.name) -%>); + <%- camelizeWithLeadingLowercase(property.name) -%>Expression = MLNStyleValueTransformerType, NSValue *, mbgl::style::Light<%- camelize(property.name) -%>Type, MLNLight<%- camelize(property.name) -%>>().toExpression(<%- camelizeWithLeadingLowercase(property.name) -%>); } _<%- camelizeWithLeadingLowercase(property.name) -%> = <%- camelizeWithLeadingLowercase(property.name) -%>Expression; <% if (property.transition) { -%> - _<%- camelizeWithLeadingLowercase(property.name) -%>Transition = MGLTransitionFromOptions(mbglLight->get<%- camelize(property.name) -%>Transition()); + _<%- camelizeWithLeadingLowercase(property.name) -%>Transition = MLNTransitionFromOptions(mbglLight->get<%- camelize(property.name) -%>Transition()); <% } -%> <% } else {-%> auto <%- camelizeWithLeadingLowercase(property.name) -%>Value = mbglLight->get<%- camelize(property.name) -%>(); if (<%- camelizeWithLeadingLowercase(property.name) -%>Value.isUndefined()) { - _<%- camelizeWithLeadingLowercase(property.name) -%> = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toExpression(mbglLight->getDefault<%- camelize(property.name) -%>()); + _<%- camelizeWithLeadingLowercase(property.name) -%> = MLNStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toExpression(mbglLight->getDefault<%- camelize(property.name) -%>()); } else { - _<%- camelizeWithLeadingLowercase(property.name) -%> = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toExpression(<%- camelizeWithLeadingLowercase(property.name) -%>Value); + _<%- camelizeWithLeadingLowercase(property.name) -%> = MLNStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toExpression(<%- camelizeWithLeadingLowercase(property.name) -%>Value); } <% if (property.transition) { -%> - _<%- camelizeWithLeadingLowercase(property.name) -%>Transition = MGLTransitionFromOptions(mbglLight->get<%- camelize(property.name) -%>Transition()); + _<%- camelizeWithLeadingLowercase(property.name) -%>Transition = MLNTransitionFromOptions(mbglLight->get<%- camelize(property.name) -%>Transition()); <% } -%> <% } -%> <% } -%> @@ -81,16 +81,16 @@ namespace mbgl { <% if (properties.length) { -%> <% for (const property of properties) { -%> <% if (property.type == "enum") { -%> - auto <%- camelizeWithLeadingLowercase(property.name) -%> = MGLStyleValueTransformerType, NSValue *, mbgl::style::Light<%- camelize(property.name) -%>Type, MGLLight<%- camelize(property.name) -%>>().toPropertyValue>>(self.<%- camelizeWithLeadingLowercase(property.name) -%>, false); + auto <%- camelizeWithLeadingLowercase(property.name) -%> = MLNStyleValueTransformerType, NSValue *, mbgl::style::Light<%- camelize(property.name) -%>Type, MLNLight<%- camelize(property.name) -%>>().toPropertyValue>>(self.<%- camelizeWithLeadingLowercase(property.name) -%>, false); mbglLight.set<%- camelize(property.name) -%>(<%- camelizeWithLeadingLowercase(property.name) -%>); <% } else {-%> - auto <%- camelizeWithLeadingLowercase(property.name) -%> = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue>>(self.<%- camelizeWithLeadingLowercase(property.name) -%>, false); + auto <%- camelizeWithLeadingLowercase(property.name) -%> = MLNStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue>>(self.<%- camelizeWithLeadingLowercase(property.name) -%>, false); mbglLight.set<%- camelize(property.name) -%>(<%- camelizeWithLeadingLowercase(property.name) -%>); <% } -%> <% if (property.transition) { -%> - mbglLight.set<%- camelize(property.name) -%>Transition(MGLOptionsFromTransition(self.<%- camelizeWithLeadingLowercase(property.name) -%>Transition)); + mbglLight.set<%- camelize(property.name) -%>Transition(MLNOptionsFromTransition(self.<%- camelizeWithLeadingLowercase(property.name) -%>Transition)); <% } -%> <% } -%> @@ -104,13 +104,13 @@ namespace mbgl { <% for (const property of properties) { -%> - (void)set<%- camelize(property.name) %>:(NSExpression *)<%- objCName(property) %> { - MGLLogDebug(@"Setting <%- objCName(property) %>: %@", <%- objCName(property) %>); + MLNLogDebug(@"Setting <%- objCName(property) %>: %@", <%- objCName(property) %>); _<%- objCName(property) %> = <%- objCName(property) %>; } <% if (property["transition"]) { -%> -- (void)set<%- camelize(property.name) %>Transition:(MGLTransition)transition { - MGLLogDebug(@"Setting <%- objCName(property) %>Transition: %@", MGLStringFromMGLTransition(transition)); +- (void)set<%- camelize(property.name) %>Transition:(MLNTransition)transition { + MLNLogDebug(@"Setting <%- objCName(property) %>Transition: %@", MLNStringFromMLNTransition(transition)); _<%- objCName(property) %>Transition = transition; } <% } -%> diff --git a/platform/ios/platform/darwin/src/MGLLight_Private.h b/platform/ios/platform/darwin/src/MLNLight_Private.h similarity index 57% rename from platform/ios/platform/darwin/src/MGLLight_Private.h rename to platform/ios/platform/darwin/src/MLNLight_Private.h index dbc29c1ef..0525dc3ef 100644 --- a/platform/ios/platform/darwin/src/MGLLight_Private.h +++ b/platform/ios/platform/darwin/src/MLNLight_Private.h @@ -1,6 +1,6 @@ #import -#import "MGLLight.h" +#import "MLNLight.h" namespace mbgl { namespace style { @@ -8,15 +8,15 @@ namespace mbgl { } } -@interface MGLLight (Private) +@interface MLNLight (Private) /** - Initializes and returns a `MGLLight` associated with a style's light. + Initializes and returns a `MLNLight` associated with a style's light. */ - (instancetype)initWithMBGLLight:(const mbgl::style::Light *)mbglLight; /** - Returns an `mbgl::style::Light` representation of the `MGLLight`. + Returns an `mbgl::style::Light` representation of the `MLNLight`. */ - (mbgl::style::Light)mbglLight; diff --git a/platform/ios/platform/darwin/src/MGLLocationManager.h b/platform/ios/platform/darwin/src/MLNLocationManager.h similarity index 80% rename from platform/ios/platform/darwin/src/MGLLocationManager.h rename to platform/ios/platform/darwin/src/MLNLocationManager.h index 8d0c058a1..2618778b7 100644 --- a/platform/ios/platform/darwin/src/MGLLocationManager.h +++ b/platform/ios/platform/darwin/src/MLNLocationManager.h @@ -3,20 +3,20 @@ NS_ASSUME_NONNULL_BEGIN -@protocol MGLLocationManagerDelegate; +@protocol MLNLocationManagerDelegate; /** - The `MGLLocationManager` protocol defines a set of methods that a class must - implement in order to serve as the location manager of an `MGLMapView`. A location + The `MLNLocationManager` protocol defines a set of methods that a class must + implement in order to serve as the location manager of an `MLNMapView`. A location manager is responsible for notifying the map view about location-related events, such as a change in the user’s location. This protocol is similar to the Core Location framework’s `CLLocationManager` class, but your implementation does not need to be based on `CLLocationManager`. - To receive location updates from an object that conforms to the `MGLLocationManager` - protocol, use the optional methods available in the `MGLLocationManagerDelegate` protocol. + To receive location updates from an object that conforms to the `MLNLocationManager` + protocol, use the optional methods available in the `MLNLocationManagerDelegate` protocol. */ -@protocol MGLLocationManager +@protocol MLNLocationManager @optional @@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN Specifies the minimum distance (measured in meters) a device must move horizontally before a location update is generated. - The default value of this property is `kCLDistanceFilterNone` when `MGLMapView` uses its + The default value of this property is `kCLDistanceFilterNone` when `MLNMapView` uses its default location manager. @see `CLLocationManager.distanceFilter` @@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN /** Specifies the accuracy of the location data. - The default value is `kCLLocationAccuracyBest` when `MGLMapView` uses its + The default value is `kCLLocationAccuracyBest` when `MLNMapView` uses its default location manager. @note Determining a location with greater accuracy requires more time and more power. @@ -63,8 +63,8 @@ NS_ASSUME_NONNULL_BEGIN Specifies the level of location accuracy the Maps SDK has permission to use. @note If the value of this property is `CLAccuracyAuthorizationFullAccuracy`, you can set the - `MGLLocationManager.desiredAccuracy` property to any value. If the value is `CLAccuracyAuthorizationReducedAccuracy`, - setting `MGLLocationManager.desiredAccuracy` to a value other than` kCLLocationAccuracyReduced` has no effect on + `MLNLocationManager.desiredAccuracy` property to any value. If the value is `CLAccuracyAuthorizationReducedAccuracy`, + setting `MLNLocationManager.desiredAccuracy` to a value other than` kCLLocationAccuracyReduced` has no effect on the location information. */ - (CLAccuracyAuthorization)accuracyAuthorization API_AVAILABLE(ios(14)); @@ -76,7 +76,7 @@ NS_ASSUME_NONNULL_BEGIN The location manager uses this property as a cue to determine when location updates may be automatically paused. - The default value is `CLActivityTypeOther` when `MGLMapView` uses its + The default value is `CLActivityTypeOther` when `MLNMapView` uses its default location manager. @see `CLLocationManager.activityType` @@ -106,10 +106,10 @@ NS_ASSUME_NONNULL_BEGIN /** The delegate to receive location updates. - Do not set the location manager’s delegate yourself. `MGLMapView` sets this property - after the location manager becomes `MGLMapView`’s location manager. + Do not set the location manager’s delegate yourself. `MLNMapView` sets this property + after the location manager becomes `MLNMapView`’s location manager. */ -@property (nonatomic, weak) id delegate; +@property (nonatomic, weak) id delegate; // MARK: Requesting Authorization for Location Services @@ -168,11 +168,11 @@ NS_ASSUME_NONNULL_BEGIN @end /** - The `MGLLocationManagerDelegate` protocol defines a set of methods that respond - to location updates from an `MGLLocationManager` object that is serving as the - location manager of an `MGLMapView`. + The `MLNLocationManagerDelegate` protocol defines a set of methods that respond + to location updates from an `MLNLocationManager` object that is serving as the + location manager of an `MLNMapView`. */ -@protocol MGLLocationManagerDelegate +@protocol MLNLocationManagerDelegate // MARK: Responding to Location Updates @@ -182,10 +182,10 @@ NS_ASSUME_NONNULL_BEGIN @param manager The location manager reporting the update. @param locations An array of `CLLocation` objects in chronological order, with the last object representing the most recent location. This array - contains multiple `CLLocation` objects when `MGLMapView` uses its + contains multiple `CLLocation` objects when `MLNMapView` uses its default location manager. */ -- (void)locationManager:(id)manager +- (void)locationManager:(id)manager didUpdateLocations:(NSArray *)locations; // MARK: Responding to Heading Updates @@ -196,7 +196,7 @@ NS_ASSUME_NONNULL_BEGIN @param manager The location manager reporting the update. @param newHeading The new heading update. */ -- (void)locationManager:(id)manager +- (void)locationManager:(id)manager didUpdateHeading:(CLHeading *)newHeading; /** @@ -204,7 +204,7 @@ NS_ASSUME_NONNULL_BEGIN @param manager The location manager reporting the calibration. */ -- (BOOL)locationManagerShouldDisplayHeadingCalibration:(id)manager; +- (BOOL)locationManagerShouldDisplayHeadingCalibration:(id)manager; // MARK: Responding to Location Updates Errors @@ -216,7 +216,7 @@ NS_ASSUME_NONNULL_BEGIN @param error An error object containing the error code that indicates why the location manager failed. */ -- (void)locationManager:(id)manager +- (void)locationManager:(id)manager didFailWithError:(nonnull NSError *)error; #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 /** @@ -224,7 +224,7 @@ NS_ASSUME_NONNULL_BEGIN @param manager The location manager reporting the change. */ -- (void)locationManagerDidChangeAuthorization:(id)manager; +- (void)locationManagerDidChangeAuthorization:(id)manager; #endif @optional diff --git a/platform/ios/platform/darwin/src/MGLLocationManager.m b/platform/ios/platform/darwin/src/MLNLocationManager.m similarity index 96% rename from platform/ios/platform/darwin/src/MGLLocationManager.m rename to platform/ios/platform/darwin/src/MLNLocationManager.m index 7027d7c58..5877c911b 100644 --- a/platform/ios/platform/darwin/src/MGLLocationManager.m +++ b/platform/ios/platform/darwin/src/MLNLocationManager.m @@ -1,12 +1,12 @@ -#import "MGLLocationManager_Private.h" +#import "MLNLocationManager_Private.h" -@interface MGLCLLocationManager() +@interface MLNCLLocationManager() @property (nonatomic) CLLocationManager *locationManager; @end -@implementation MGLCLLocationManager +@implementation MLNCLLocationManager - (instancetype)init { diff --git a/platform/ios/platform/darwin/src/MLNLocationManager_Private.h b/platform/ios/platform/darwin/src/MLNLocationManager_Private.h new file mode 100644 index 000000000..b4ee94de0 --- /dev/null +++ b/platform/ios/platform/darwin/src/MLNLocationManager_Private.h @@ -0,0 +1,5 @@ +#import "MLNLocationManager.h" + +@interface MLNCLLocationManager : NSObject + +@end diff --git a/platform/ios/platform/darwin/src/MGLLoggingConfiguration.h b/platform/ios/platform/darwin/src/MLNLoggingConfiguration.h similarity index 65% rename from platform/ios/platform/darwin/src/MGLLoggingConfiguration.h rename to platform/ios/platform/darwin/src/MLNLoggingConfiguration.h index 244507858..3bc310b32 100644 --- a/platform/ios/platform/darwin/src/MGLLoggingConfiguration.h +++ b/platform/ios/platform/darwin/src/MLNLoggingConfiguration.h @@ -1,11 +1,11 @@ #import -#import "MGLFoundation.h" +#import "MLNFoundation.h" -#ifndef MGL_LOGGING_DISABLED - #ifndef MGL_LOGGING_ENABLE_DEBUG +#ifndef MLN_LOGGING_DISABLED + #ifndef MLN_LOGGING_ENABLE_DEBUG #ifndef NDEBUG - #define MGL_LOGGING_ENABLE_DEBUG 1 + #define MLN_LOGGING_ENABLE_DEBUG 1 #endif #endif @@ -14,58 +14,58 @@ NS_ASSUME_NONNULL_BEGIN /** Constants indicating the message's logging level. */ -typedef NS_ENUM(NSInteger, MGLLoggingLevel) { +typedef NS_ENUM(NSInteger, MLNLoggingLevel) { /** None-level won't print any messages. */ - MGLLoggingLevelNone = 0, + MLNLoggingLevelNone = 0, /** Fault-level messages contain system-level error information. */ - MGLLoggingLevelFault, + MLNLoggingLevelFault, /** Error-level messages contain information that is intended to aid in process-level errors. */ - MGLLoggingLevelError, + MLNLoggingLevelError, /** Warning-level messages contain warning information for potential risks. */ - MGLLoggingLevelWarning, + MLNLoggingLevelWarning, /** Info-level messages contain information that may be helpful for flow tracing but is not essential. */ - MGLLoggingLevelInfo, + MLNLoggingLevelInfo, /** Debug-level messages contain information that may be helpful for troubleshooting specific problems. */ -#if MGL_LOGGING_ENABLE_DEBUG - MGLLoggingLevelDebug, +#if MLN_LOGGING_ENABLE_DEBUG + MLNLoggingLevelDebug, #endif /** Verbose-level will print all messages. */ - MGLLoggingLevelVerbose, + MLNLoggingLevelVerbose, }; /** - A block to be called once `loggingLevel` is set to a higher value than `MGLLoggingLevelNone`. + A block to be called once `loggingLevel` is set to a higher value than `MLNLoggingLevelNone`. @param loggingLevel The message logging level. @param filePath The description of the file and method for the calling message. @param line The line where the message is logged. @param message The logging message. */ -typedef void (^MGLLoggingBlockHandler)(MGLLoggingLevel loggingLevel, NSString *filePath, NSUInteger line, NSString *message); +typedef void (^MLNLoggingBlockHandler)(MLNLoggingLevel loggingLevel, NSString *filePath, NSUInteger line, NSString *message); /** - The `MGLLoggingConfiguration` object provides a global way to set this SDK logging levels + The `MLNLoggingConfiguration` object provides a global way to set this SDK logging levels and logging handler. */ -MGL_EXPORT -@interface MGLLoggingConfiguration : NSObject +MLN_EXPORT +@interface MLNLoggingConfiguration : NSObject /** The handler this SDK uses to log messages. @@ -75,23 +75,23 @@ MGL_EXPORT The default handler uses `os_log` and `NSLog` for iOS 10+ and iOS < 10 respectively. */ -@property (nonatomic, copy, null_resettable) MGLLoggingBlockHandler handler; +@property (nonatomic, copy, null_resettable) MLNLoggingBlockHandler handler; /** The logging level. - The default value is `MGLLoggingLevelNone`. + The default value is `MLNLoggingLevelNone`. Setting this property includes logging levels less than or equal to the setted value. */ -@property (assign, nonatomic) MGLLoggingLevel loggingLevel; +@property (assign, nonatomic) MLNLoggingLevel loggingLevel; /** Returns the shared logging object. */ -@property (class, nonatomic, readonly) MGLLoggingConfiguration *sharedConfiguration; +@property (class, nonatomic, readonly) MLNLoggingConfiguration *sharedConfiguration; -- (MGLLoggingBlockHandler)handler UNAVAILABLE_ATTRIBUTE; +- (MLNLoggingBlockHandler)handler UNAVAILABLE_ATTRIBUTE; @end diff --git a/platform/ios/platform/darwin/src/MGLLoggingConfiguration.mm b/platform/ios/platform/darwin/src/MLNLoggingConfiguration.mm similarity index 73% rename from platform/ios/platform/darwin/src/MGLLoggingConfiguration.mm rename to platform/ios/platform/darwin/src/MLNLoggingConfiguration.mm index 75d243936..e9cd41eb1 100644 --- a/platform/ios/platform/darwin/src/MGLLoggingConfiguration.mm +++ b/platform/ios/platform/darwin/src/MLNLoggingConfiguration.mm @@ -1,16 +1,16 @@ #include #include -#import "MGLLoggingConfiguration_Private.h" +#import "MLNLoggingConfiguration_Private.h" -#ifndef MGL_LOGGING_DISABLED +#ifndef MLN_LOGGING_DISABLED #if __has_builtin(__builtin_os_log_format) #import #endif namespace mbgl { -class MGLCoreLoggingObserver : public Log :: Observer { +class MLNCoreLoggingObserver : public Log :: Observer { public: //Return true not print messages at core level, and filter at platform level. bool onRecord(EventSeverity severity, Event event, int64_t code, const std::string& msg) override{ @@ -18,16 +18,16 @@ public: NSString *message = [NSString stringWithFormat:@"[event]:%s [code]:%lld [message]:%@", Enum::toString(event), code, [NSString stringWithCString:msg.c_str() encoding:NSUTF8StringEncoding]]; switch (severity) { case EventSeverity::Debug: - MGLLogDebug(message); + MLNLogDebug(message); break; case EventSeverity::Info: - MGLLogInfo(message); + MLNLogInfo(message); break; case EventSeverity::Warning: - MGLLogWarning(message); + MLNLogWarning(message); break; case EventSeverity::Error: - MGLLogError(message); + MLNLogError(message); break; } return true; @@ -35,9 +35,9 @@ public: }; } -@implementation MGLLoggingConfiguration +@implementation MLNLoggingConfiguration { - std::unique_ptr _coreLoggingObserver; + std::unique_ptr _coreLoggingObserver; } + (instancetype)sharedConfiguration { @@ -45,19 +45,19 @@ public: static id sharedConfiguration; dispatch_once(&once, ^{ sharedConfiguration = [[self alloc] init]; - ((MGLLoggingConfiguration *)sharedConfiguration).handler = nil; + ((MLNLoggingConfiguration *)sharedConfiguration).handler = nil; }); return sharedConfiguration; } - (id)init{ if(self = [super init]){ - mbgl::Log::setObserver(std::make_unique()); + mbgl::Log::setObserver(std::make_unique()); } return self; } -- (void)setHandler:(void (^)(MGLLoggingLevel, NSString *, NSUInteger, NSString *))handler { +- (void)setHandler:(void (^)(MLNLoggingLevel, NSString *, NSUInteger, NSString *))handler { if (!handler) { _handler = [self defaultBlockHandler]; @@ -66,7 +66,7 @@ public: } } -- (void)logCallingFunction:(const char *)callingFunction functionLine:(NSUInteger)functionLine messageType:(MGLLoggingLevel)type format:(id)messageFormat, ... { +- (void)logCallingFunction:(const char *)callingFunction functionLine:(NSUInteger)functionLine messageType:(MLNLoggingLevel)type format:(id)messageFormat, ... { va_list formatList; va_start(formatList, messageFormat); NSString *formattedMessage = [[NSString alloc] initWithFormat:messageFormat arguments:formatList]; @@ -76,27 +76,27 @@ public: } -- (MGLLoggingBlockHandler)defaultBlockHandler { - MGLLoggingBlockHandler mapboxHandler = ^(MGLLoggingLevel level, NSString *fileName, NSUInteger line, NSString *message) { +- (MLNLoggingBlockHandler)defaultBlockHandler { + MLNLoggingBlockHandler mapboxHandler = ^(MLNLoggingLevel level, NSString *fileName, NSUInteger line, NSString *message) { if (@available(iOS 10.0, macOS 10.12.0, *)) { static dispatch_once_t once; static os_log_t info_log; -#if MGL_LOGGING_ENABLE_DEBUG +#if MLN_LOGGING_ENABLE_DEBUG static os_log_t debug_log; #endif static os_log_t error_log; static os_log_t fault_log; static os_log_type_t log_types[] = { OS_LOG_TYPE_DEFAULT, OS_LOG_TYPE_INFO, -#if MGL_LOGGING_ENABLE_DEBUG +#if MLN_LOGGING_ENABLE_DEBUG OS_LOG_TYPE_DEBUG, #endif OS_LOG_TYPE_ERROR, OS_LOG_TYPE_FAULT }; dispatch_once(&once, ^ { info_log = os_log_create("com.mapbox.Mapbox", "INFO"); -#if MGL_LOGGING_ENABLE_DEBUG +#if MLN_LOGGING_ENABLE_DEBUG debug_log = os_log_create("com.mapbox.Mapbox", "DEBUG"); #endif error_log = os_log_create("com.mapbox.Mapbox", "ERROR"); @@ -105,22 +105,22 @@ public: os_log_t mapbox_log; switch (level) { - case MGLLoggingLevelInfo: - case MGLLoggingLevelWarning: + case MLNLoggingLevelInfo: + case MLNLoggingLevelWarning: mapbox_log = info_log; break; -#if MGL_LOGGING_ENABLE_DEBUG - case MGLLoggingLevelDebug: +#if MLN_LOGGING_ENABLE_DEBUG + case MLNLoggingLevelDebug: mapbox_log = debug_log; break; #endif - case MGLLoggingLevelError: + case MLNLoggingLevelError: mapbox_log = error_log; break; - case MGLLoggingLevelFault: + case MLNLoggingLevelFault: mapbox_log = fault_log; break; - case MGLLoggingLevelNone: + case MLNLoggingLevelNone: default: break; } @@ -130,22 +130,22 @@ public: } else { NSString *category; switch (level) { - case MGLLoggingLevelInfo: - case MGLLoggingLevelWarning: + case MLNLoggingLevelInfo: + case MLNLoggingLevelWarning: category = @"INFO"; break; -#if MGL_LOGGING_ENABLE_DEBUG - case MGLLoggingLevelDebug: +#if MLN_LOGGING_ENABLE_DEBUG + case MLNLoggingLevelDebug: category = @"DEBUG"; break; #endif - case MGLLoggingLevelError: + case MLNLoggingLevelError: category = @"ERROR"; break; - case MGLLoggingLevelFault: + case MLNLoggingLevelFault: category = @"FAULT"; break; - case MGLLoggingLevelNone: + case MLNLoggingLevelNone: default: break; } diff --git a/platform/ios/platform/darwin/src/MLNLoggingConfiguration_Private.h b/platform/ios/platform/darwin/src/MLNLoggingConfiguration_Private.h new file mode 100644 index 000000000..3b8bbce83 --- /dev/null +++ b/platform/ios/platform/darwin/src/MLNLoggingConfiguration_Private.h @@ -0,0 +1,67 @@ +#import "MLNLoggingConfiguration.h" + +NS_INLINE NSString *MLNStringFromBOOL(BOOL value) { + return value ? @"YES" : @"NO"; +} + +#if TARGET_OS_OSX +NS_INLINE NSString *MLNStringFromNSEdgeInsets(NSEdgeInsets insets) { + return [NSString stringWithFormat:@"{ top: %f, left: %f, bottom: %f, right: %f", insets.top, insets.left, insets.bottom, insets.right]; +} +#endif + +#ifdef MLN_LOGGING_DISABLED + +#define MLNLogInfo(...) +#define MLNLogDebug(...) +#define MLNLogWarning(...) +#define MLNLogError(...) +#define MLNLogFault(...) + +#else + +#if MLN_LOGGING_ENABLE_DEBUG + #define MLNLogDebug(message, ...) MLNLogWithType(MLNLoggingLevelDebug, __PRETTY_FUNCTION__, __LINE__, message, ##__VA_ARGS__) +#else + #define MLNLogDebug(...) +#endif + +#define MLNLogInfo(message, ...) MLNLogWithType(MLNLoggingLevelInfo, __PRETTY_FUNCTION__, __LINE__, message, ##__VA_ARGS__) +#define MLNLogWarning(message, ...) MLNLogWithType(MLNLoggingLevelWarning, __PRETTY_FUNCTION__, __LINE__, message, ##__VA_ARGS__) +#define MLNLogError(message, ...) MLNLogWithType(MLNLoggingLevelError, __PRETTY_FUNCTION__, __LINE__, message, ##__VA_ARGS__) +#define MLNLogFault(message, ...) MLNLogWithType(MLNLoggingLevelFault, __PRETTY_FUNCTION__, __LINE__, message, ##__VA_ARGS__) + +#endif + +#define MLNAssert(expression, message, ...) \ + __extension__({ \ + if (__builtin_expect(!(expression), 0)) { \ + MLNLogFault(message, ##__VA_ARGS__); \ + } \ + NSAssert(expression, message, ##__VA_ARGS__); \ + }) +#define MLNCAssert(expression, message, ...) \ + __extension__({ \ + if (__builtin_expect(!(expression), 0)) { \ + MLNLogFault(message, ##__VA_ARGS__); \ + } \ + NSCAssert(expression, message, ##__VA_ARGS__); \ + }) + + +#ifndef MLN_LOGGING_DISABLED + +#define MLNLogWithType(type, function, line, message, ...) \ +{ \ + if ([MLNLoggingConfiguration sharedConfiguration].loggingLevel != MLNLoggingLevelNone && type <= [MLNLoggingConfiguration sharedConfiguration].loggingLevel) \ + { \ + [[MLNLoggingConfiguration sharedConfiguration] logCallingFunction:function functionLine:line messageType:type format:(message), ##__VA_ARGS__]; \ + } \ +} + +@interface MLNLoggingConfiguration (Private) + +- (void)logCallingFunction:(const char *)callingFunction functionLine:(NSUInteger)functionLine messageType:(MLNLoggingLevel)type format:(id)messageFormat, ...; + +@end +#endif diff --git a/platform/ios/platform/darwin/src/MGLMapCamera.h b/platform/ios/platform/darwin/src/MLNMapCamera.h similarity index 95% rename from platform/ios/platform/darwin/src/MGLMapCamera.h rename to platform/ios/platform/darwin/src/MLNMapCamera.h index c0e40bc33..0f840021a 100644 --- a/platform/ios/platform/darwin/src/MGLMapCamera.h +++ b/platform/ios/platform/darwin/src/MLNMapCamera.h @@ -2,24 +2,24 @@ #import #import -#import "MGLFoundation.h" +#import "MLNFoundation.h" NS_ASSUME_NONNULL_BEGIN /** - An `MGLMapCamera` object represents a viewpoint from which the user observes - some point on an `MGLMapView`. + An `MLNMapCamera` object represents a viewpoint from which the user observes + some point on an `MLNMapView`. #### Related examples See the Camera animation example to learn how to create a camera that rotates around a central point. See the Restrict map panning to an area example to learn how to restrict map - panning using `MGLMapViewDelegate`'s + panning using `MLNMapViewDelegate`'s `-mapView:shouldChangeFromCamera:toCamera:` method. */ -MGL_EXPORT -@interface MGLMapCamera : NSObject +MLN_EXPORT +@interface MLNMapCamera : NSObject /** Coordinate at the center of the map view. */ @property (nonatomic) CLLocationCoordinate2D centerCoordinate; @@ -145,7 +145,7 @@ __attribute__((deprecated("Use -cameraLookingAtCenterCoordinate:acrossDistance:p @return A Boolean value indicating whether the two cameras are functionally equivalent. */ -- (BOOL)isEqualToMapCamera:(MGLMapCamera *)otherCamera; +- (BOOL)isEqualToMapCamera:(MLNMapCamera *)otherCamera; @end diff --git a/platform/ios/platform/darwin/src/MGLMapCamera.mm b/platform/ios/platform/darwin/src/MLNMapCamera.mm similarity index 84% rename from platform/ios/platform/darwin/src/MGLMapCamera.mm rename to platform/ios/platform/darwin/src/MLNMapCamera.mm index 0f5dd558a..a3d64b1d9 100644 --- a/platform/ios/platform/darwin/src/MGLMapCamera.mm +++ b/platform/ios/platform/darwin/src/MLNMapCamera.mm @@ -1,17 +1,17 @@ -#import "MGLMapCamera.h" -#import "MGLGeometry_Private.h" -#import "MGLLoggingConfiguration_Private.h" +#import "MLNMapCamera.h" +#import "MLNGeometry_Private.h" +#import "MLNLoggingConfiguration_Private.h" #import #include -BOOL MGLEqualFloatWithAccuracy(CGFloat left, CGFloat right, CGFloat accuracy) +BOOL MLNEqualFloatWithAccuracy(CGFloat left, CGFloat right, CGFloat accuracy) { return MAX(left, right) - MIN(left, right) <= accuracy; } -@implementation MGLMapCamera +@implementation MLNMapCamera + (BOOL)supportsSecureCoding { @@ -30,7 +30,7 @@ BOOL MGLEqualFloatWithAccuracy(CGFloat left, CGFloat right, CGFloat accuracy) CLLocationDirection heading = -1; CGFloat pitch = -1; if (CLLocationCoordinate2DIsValid(centerCoordinate) && CLLocationCoordinate2DIsValid(eyeCoordinate)) { - heading = MGLDirectionBetweenCoordinates(eyeCoordinate, centerCoordinate); + heading = MLNDirectionBetweenCoordinates(eyeCoordinate, centerCoordinate); CLLocation *centerLocation = [[CLLocation alloc] initWithLatitude:centerCoordinate.latitude longitude:centerCoordinate.longitude]; @@ -38,7 +38,7 @@ BOOL MGLEqualFloatWithAccuracy(CGFloat left, CGFloat right, CGFloat accuracy) longitude:eyeCoordinate.longitude]; CLLocationDistance groundDistance = [eyeLocation distanceFromLocation:centerLocation]; CGFloat radianPitch = atan2(eyeAltitude, groundDistance); - pitch = mbgl::util::wrap(90 - MGLDegreesFromRadians(radianPitch), 0.0, 360.0); + pitch = mbgl::util::wrap(90 - MLNDegreesFromRadians(radianPitch), 0.0, 360.0); } return [[self alloc] initWithCenterCoordinate:centerCoordinate @@ -55,7 +55,7 @@ BOOL MGLEqualFloatWithAccuracy(CGFloat left, CGFloat right, CGFloat accuracy) // Angle at the viewpoint formed by the straight lines running perpendicular // to the ground and toward the center coordinate. CLLocationDirection eyeAngle = 90 - pitch; - CLLocationDistance altitude = distance * sin(MGLRadiansFromDegrees(eyeAngle)); + CLLocationDistance altitude = distance * sin(MLNRadiansFromDegrees(eyeAngle)); return [[self alloc] initWithCenterCoordinate:centerCoordinate altitude:altitude @@ -81,7 +81,7 @@ BOOL MGLEqualFloatWithAccuracy(CGFloat left, CGFloat right, CGFloat accuracy) { // TODO: Remove this compatibility shim in favor of `-cameraLookingAtCenterCoordinate:acrossDistance:pitch:heading:. // https://github.com/mapbox/mapbox-gl-native/issues/12943 - return [MGLMapCamera cameraLookingAtCenterCoordinate:centerCoordinate + return [MLNMapCamera cameraLookingAtCenterCoordinate:centerCoordinate altitude:distance pitch:pitch heading:heading]; @@ -92,7 +92,7 @@ BOOL MGLEqualFloatWithAccuracy(CGFloat left, CGFloat right, CGFloat accuracy) pitch:(CGFloat)pitch heading:(CLLocationDirection)heading { - MGLLogDebug(@"Initializing withCenterCoordinate: %@ altitude: %.0fm pitch: %f° heading: %f°", MGLStringFromCLLocationCoordinate2D(centerCoordinate), altitude, pitch, heading); + MLNLogDebug(@"Initializing withCenterCoordinate: %@ altitude: %.0fm pitch: %f° heading: %f°", MLNStringFromCLLocationCoordinate2D(centerCoordinate), altitude, pitch, heading); if (self = [super init]) { _centerCoordinate = centerCoordinate; @@ -105,7 +105,7 @@ BOOL MGLEqualFloatWithAccuracy(CGFloat left, CGFloat right, CGFloat accuracy) - (nullable instancetype)initWithCoder:(NSCoder *)coder { - MGLLogInfo(@"Initialiazing with coder."); + MLNLogInfo(@"Initialiazing with coder."); if (self = [super init]) { _centerCoordinate = CLLocationCoordinate2DMake([coder decodeDoubleForKey:@"centerLatitude"], @@ -140,13 +140,13 @@ BOOL MGLEqualFloatWithAccuracy(CGFloat left, CGFloat right, CGFloat accuracy) - (CLLocationDistance)viewingDistance { CLLocationDirection eyeAngle = 90 - self.pitch; - return self.altitude / sin(MGLRadiansFromDegrees(eyeAngle)); + return self.altitude / sin(MLNRadiansFromDegrees(eyeAngle)); } - (void)setViewingDistance:(CLLocationDistance)distance { - MGLLogDebug(@"Setting viewingDistance: %f", distance); + MLNLogDebug(@"Setting viewingDistance: %f", distance); CLLocationDirection eyeAngle = 90 - self.pitch; - self.altitude = distance * sin(MGLRadiansFromDegrees(eyeAngle)); + self.altitude = distance * sin(MLNRadiansFromDegrees(eyeAngle)); } - (NSString *)description @@ -166,25 +166,25 @@ BOOL MGLEqualFloatWithAccuracy(CGFloat left, CGFloat right, CGFloat accuracy) return YES; } - MGLMapCamera *otherCamera = other; + MLNMapCamera *otherCamera = other; return (_centerCoordinate.latitude == otherCamera.centerCoordinate.latitude && _centerCoordinate.longitude == otherCamera.centerCoordinate.longitude && _altitude == otherCamera.altitude && _pitch == otherCamera.pitch && _heading == otherCamera.heading); } -- (BOOL)isEqualToMapCamera:(MGLMapCamera *)otherCamera +- (BOOL)isEqualToMapCamera:(MLNMapCamera *)otherCamera { if (otherCamera == self) { return YES; } - return (MGLEqualFloatWithAccuracy(_centerCoordinate.latitude, otherCamera.centerCoordinate.latitude, 1e-6) - && MGLEqualFloatWithAccuracy(_centerCoordinate.longitude, otherCamera.centerCoordinate.longitude, 1e-6) - && MGLEqualFloatWithAccuracy(_altitude, otherCamera.altitude, 1e-6) - && MGLEqualFloatWithAccuracy(_pitch, otherCamera.pitch, 1) - && MGLEqualFloatWithAccuracy(_heading, otherCamera.heading, 1)); + return (MLNEqualFloatWithAccuracy(_centerCoordinate.latitude, otherCamera.centerCoordinate.latitude, 1e-6) + && MLNEqualFloatWithAccuracy(_centerCoordinate.longitude, otherCamera.centerCoordinate.longitude, 1e-6) + && MLNEqualFloatWithAccuracy(_altitude, otherCamera.altitude, 1e-6) + && MLNEqualFloatWithAccuracy(_pitch, otherCamera.pitch, 1) + && MLNEqualFloatWithAccuracy(_heading, otherCamera.heading, 1)); } - (NSUInteger)hash diff --git a/platform/ios/platform/darwin/src/MGLMapSnapshotter.h b/platform/ios/platform/darwin/src/MLNMapSnapshotter.h similarity index 76% rename from platform/ios/platform/darwin/src/MGLMapSnapshotter.h rename to platform/ios/platform/darwin/src/MLNMapSnapshotter.h index 13c83fe99..29fb9ff25 100644 --- a/platform/ios/platform/darwin/src/MGLMapSnapshotter.h +++ b/platform/ios/platform/darwin/src/MLNMapSnapshotter.h @@ -1,20 +1,20 @@ #import -#import "MGLTypes.h" -#import "MGLGeometry.h" -#import "MGLMapCamera.h" -#import "MGLStyle.h" +#import "MLNTypes.h" +#import "MLNGeometry.h" +#import "MLNMapCamera.h" +#import "MLNStyle.h" NS_ASSUME_NONNULL_BEGIN -@protocol MGLMapSnapshotterDelegate; +@protocol MLNMapSnapshotterDelegate; /** - An overlay that is placed within a `MGLMapSnapshot`. - To access this object, use `-[MGLMapSnapshotter startWithOverlayHandler:completionHandler:]`. + An overlay that is placed within a `MLNMapSnapshot`. + To access this object, use `-[MLNMapSnapshotter startWithOverlayHandler:completionHandler:]`. */ -MGL_EXPORT -@interface MGLMapSnapshotOverlay : NSObject +MLN_EXPORT +@interface MLNMapSnapshotOverlay : NSObject /** The current `CGContext` that snapshot is drawing within. You may use this context @@ -53,15 +53,15 @@ MGL_EXPORT A block provided during the snapshot drawing process, enabling the ability to draw custom overlays rendered with Core Graphics. - @param snapshotOverlay The `MGLMapSnapshotOverlay` provided during snapshot drawing. + @param snapshotOverlay The `MLNMapSnapshotOverlay` provided during snapshot drawing. */ -typedef void (^MGLMapSnapshotOverlayHandler)(MGLMapSnapshotOverlay * snapshotOverlay); +typedef void (^MLNMapSnapshotOverlayHandler)(MLNMapSnapshotOverlay * snapshotOverlay); /** - The options to use when creating images with the `MGLMapSnapshotter`. + The options to use when creating images with the `MLNMapSnapshotter`. */ -MGL_EXPORT -@interface MGLMapSnapshotOptions : NSObject +MLN_EXPORT +@interface MLNMapSnapshotOptions : NSObject /** Creates a set of options with the minimum required information. @@ -71,7 +71,7 @@ MGL_EXPORT the application’s resource path. Specify `nil` for the default style. @param size The image size. */ -- (instancetype)initWithStyleURL:(nullable NSURL *)styleURL camera:(MGLMapCamera *)camera size:(CGSize)size; +- (instancetype)initWithStyleURL:(nullable NSURL *)styleURL camera:(MLNMapCamera *)camera size:(CGSize)size; // MARK: - Configuring the Map @@ -96,7 +96,7 @@ MGL_EXPORT non-empty coordinate bounds, the camera’s center coordinate and altitude are ignored in favor of the `coordinateBounds` property. */ -@property (nonatomic) MGLMapCamera *camera; +@property (nonatomic) MLNMapCamera *camera; /** The coordinate rectangle that encompasses the bounds to capture. @@ -104,7 +104,7 @@ MGL_EXPORT If this property is non-empty and the camera property is non-nil, the camera’s center coordinate and altitude are ignored in favor of this property’s value. */ -@property (nonatomic) MGLCoordinateBounds coordinateBounds; +@property (nonatomic) MLNCoordinateBounds coordinateBounds; // MARK: - Configuring the Image @@ -126,8 +126,8 @@ MGL_EXPORT /** An image generated by a snapshotter object. */ -MGL_EXPORT -@interface MGLMapSnapshot : NSObject +MLN_EXPORT +@interface MLNMapSnapshot : NSObject #if TARGET_OS_IPHONE /** @@ -169,17 +169,17 @@ MGL_EXPORT /** A block to processes the result or error of a snapshot request. - @param snapshot The `MGLMapSnapshot` that was generated or `nil` if an error + @param snapshot The `MLNMapSnapshot` that was generated or `nil` if an error occurred. @param error The error that occured or `nil` when successful. */ -typedef void (^MGLMapSnapshotCompletionHandler)(MGLMapSnapshot* _Nullable snapshot, NSError* _Nullable error); +typedef void (^MLNMapSnapshotCompletionHandler)(MLNMapSnapshot* _Nullable snapshot, NSError* _Nullable error); /** - An `MGLMapSnapshotter` generates static raster images of the map. Each snapshot - image depicts a portion of a map defined by an `MGLMapSnapshotOptions` object - you provide. The snapshotter generates an `MGLMapSnapshot` object - asynchronously, calling `MGLMapSnapshotterDelegate` methods if defined, then + An `MLNMapSnapshotter` generates static raster images of the map. Each snapshot + image depicts a portion of a map defined by an `MLNMapSnapshotOptions` object + you provide. The snapshotter generates an `MLNMapSnapshot` object + asynchronously, calling `MLNMapSnapshotterDelegate` methods if defined, then passing it into a completion handler once tiles and other resources needed for the snapshot are finished loading. @@ -188,9 +188,9 @@ typedef void (^MGLMapSnapshotCompletionHandler)(MGLMapSnapshot* _Nullable snapsh snapshot at a time. If you need to generate multiple snapshots concurrently, create multiple snapshotter objects. - For an interactive map, use the `MGLMapView` class. Both `MGLMapSnapshotter` - and `MGLMapView` are compatible with offline packs managed by the - `MGLOfflineStorage` class. + For an interactive map, use the `MLNMapView` class. Both `MLNMapSnapshotter` + and `MLNMapView` are compatible with offline packs managed by the + `MLNOfflineStorage` class. From a snapshot, you can obtain an image and convert geographic coordinates to the image’s coordinate space in order to superimpose markers and overlays. If @@ -201,12 +201,12 @@ typedef void (^MGLMapSnapshotCompletionHandler)(MGLMapSnapshot* _Nullable snapsh ### Example ```swift - let camera = MGLMapCamera(lookingAtCenter: CLLocationCoordinate2D(latitude: 37.7184, longitude: -122.4365), altitude: 100, pitch: 20, heading: 0) + let camera = MLNMapCamera(lookingAtCenter: CLLocationCoordinate2D(latitude: 37.7184, longitude: -122.4365), altitude: 100, pitch: 20, heading: 0) - let options = MGLMapSnapshotOptions(styleURL: MGLStyle.satelliteStreetsStyleURL, camera: camera, size: CGSize(width: 320, height: 480)) + let options = MLNMapSnapshotOptions(styleURL: MLNStyle.satelliteStreetsStyleURL, camera: camera, size: CGSize(width: 320, height: 480)) options.zoomLevel = 10 - let snapshotter = MGLMapSnapshotter(options: options) + let snapshotter = MLNMapSnapshotter(options: options) snapshotter.start { (snapshot, error) in if let error = error { fatalError(error.localizedDescription) @@ -219,11 +219,11 @@ typedef void (^MGLMapSnapshotCompletionHandler)(MGLMapSnapshot* _Nullable snapsh #### Related examples See the Create a static map snapshot example to learn how to use the - `MGLMapSnapshotter` to generate a static image based on an `MGLMapView` + `MLNMapSnapshotter` to generate a static image based on an `MLNMapView` object's style, camera, and view bounds. */ -MGL_EXPORT -@interface MGLMapSnapshotter : NSObject +MLN_EXPORT +@interface MLNMapSnapshotter : NSObject - (instancetype)init NS_UNAVAILABLE; @@ -234,7 +234,7 @@ MGL_EXPORT @param options The options to use when generating a map snapshot. @return An initialized map snapshotter. */ -- (instancetype)initWithOptions:(MGLMapSnapshotOptions *)options NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithOptions:(MLNMapSnapshotOptions *)options NS_DESIGNATED_INITIALIZER; /** Starts the snapshot creation and executes the specified block with the result. @@ -242,7 +242,7 @@ MGL_EXPORT @param completionHandler The block to call with a finished snapshot. The block is executed on the main queue. */ -- (void)startWithCompletionHandler:(MGLMapSnapshotCompletionHandler)completionHandler; +- (void)startWithCompletionHandler:(MLNMapSnapshotCompletionHandler)completionHandler; /** Starts the snapshot creation and executes the specified block with the result @@ -253,12 +253,12 @@ MGL_EXPORT @param completionHandler The block to call with a finished snapshot. The block is executed on the queue specified in the `queue` parameter. */ -- (void)startWithQueue:(dispatch_queue_t)queue completionHandler:(MGLMapSnapshotCompletionHandler)completionHandler; +- (void)startWithQueue:(dispatch_queue_t)queue completionHandler:(MLNMapSnapshotCompletionHandler)completionHandler; /** Starts the snapshot creation and executes the specified blocks with the result on the specified queue. Use this option if you want to add custom drawing on - top of the resulting `MGLMapSnapshot`. + top of the resulting `MLNMapSnapshot`. @param overlayHandler The block to call after the base map finishes drawing but before certain built-in overlays draw. The block can use Core Graphics to @@ -267,20 +267,20 @@ MGL_EXPORT @param completionHandler The block to call with a finished snapshot. The block is executed on the main queue. */ -- (void)startWithOverlayHandler:(MGLMapSnapshotOverlayHandler)overlayHandler completionHandler:(MGLMapSnapshotCompletionHandler)completionHandler; +- (void)startWithOverlayHandler:(MLNMapSnapshotOverlayHandler)overlayHandler completionHandler:(MLNMapSnapshotCompletionHandler)completionHandler; /** Cancels the snapshot creation request, if any. Once you call this method, you cannot resume the snapshot. In order to obtain - the snapshot, create a new `MGLMapSnapshotter` object. + the snapshot, create a new `MLNMapSnapshotter` object. */ - (void)cancel; /** The options to use when generating a map snapshot. */ -@property (nonatomic) MGLMapSnapshotOptions *options; +@property (nonatomic) MLNMapSnapshotOptions *options; /** Indicates whether a snapshot is currently being generated. @@ -299,36 +299,36 @@ MGL_EXPORT weak reference to its delegate, so you must keep a strong reference to it to ensure that your style customizations apply. */ -@property (nonatomic, weak) id delegate; +@property (nonatomic, weak) id delegate; /** The style displayed in the resulting snapshot. - Unlike the `MGLMapSnapshotOptions.styleURL` property, this property is set to + Unlike the `MLNMapSnapshotOptions.styleURL` property, this property is set to an object that allows you to manipulate every aspect of the style locally. This property is set to `nil` until the style finishes loading. If the style has failed to load, this property is set to `nil`. Because the style loads asynchronously, you should manipulate it in the - `-[MGLMapSnapshotterDelegate mapSnapshotter:didFinishLoadingStyle:]` method. It + `-[MLNMapSnapshotterDelegate mapSnapshotter:didFinishLoadingStyle:]` method. It is not possible to manipulate the style before it has finished loading. @note The default styles provided by Mapbox contain sources and layers with identifiers that will change over time. Applications that use APIs that manipulate a style’s sources and layers must first set the style URL to an explicitly versioned style using a convenience method like - `+[MGLStyle outdoorsStyleURLWithVersion:]` or a manually constructed + `+[MLNStyle outdoorsStyleURLWithVersion:]` or a manually constructed `NSURL`. */ -@property (nonatomic, readonly, nullable) MGLStyle *style; +@property (nonatomic, readonly, nullable) MLNStyle *style; @end /** Optional methods about significant events when creating a snapshot using an - `MGLMapSnapshotter` object. + `MLNMapSnapshotter` object. */ -@protocol MGLMapSnapshotterDelegate +@protocol MLNMapSnapshotterDelegate @optional /** @@ -342,22 +342,22 @@ MGL_EXPORT @param snapshotter The snapshotter that is unable to load the data. @param error The reason the data could not be loaded. */ -- (void)mapSnapshotterDidFail:(MGLMapSnapshotter *)snapshotter withError:(NSError *)error; +- (void)mapSnapshotterDidFail:(MLNMapSnapshotter *)snapshotter withError:(NSError *)error; /** Tells the delegate that the snapshotter has just finished loading a style. This method is called in response to - `-[MGLMapSnapshotter startWithQueue:completionHandler:]` as long as the - `MGLMapSnapshotter.delegate` property is set. Changes to sources or layers of + `-[MLNMapSnapshotter startWithQueue:completionHandler:]` as long as the + `MLNMapSnapshotter.delegate` property is set. Changes to sources or layers of the style being snapshotted do not cause this method to be called. @param snapshotter The snapshotter that has just loaded a style. @param style The style that was loaded. */ -- (void)mapSnapshotter:(MGLMapSnapshotter *)snapshotter didFinishLoadingStyle:(MGLStyle *)style; +- (void)mapSnapshotter:(MLNMapSnapshotter *)snapshotter didFinishLoadingStyle:(MLNStyle *)style; -- (void)mapSnapshotter:(MGLMapSnapshotter *)snapshotter didFailLoadingImageNamed:(NSString *)name; +- (void)mapSnapshotter:(MLNMapSnapshotter *)snapshotter didFailLoadingImageNamed:(NSString *)name; @end diff --git a/platform/ios/platform/darwin/src/MGLMapSnapshotter.mm b/platform/ios/platform/darwin/src/MLNMapSnapshotter.mm similarity index 73% rename from platform/ios/platform/darwin/src/MGLMapSnapshotter.mm rename to platform/ios/platform/darwin/src/MLNMapSnapshotter.mm index af1510b61..c2771fbc9 100644 --- a/platform/ios/platform/darwin/src/MGLMapSnapshotter.mm +++ b/platform/ios/platform/darwin/src/MLNMapSnapshotter.mm @@ -1,4 +1,4 @@ -#import "MGLMapSnapshotter.h" +#import "MLNMapSnapshotter.h" #import #import @@ -10,76 +10,76 @@ #import #import -#import "MGLOfflineStorage_Private.h" -#import "MGLGeometry_Private.h" -#import "MGLStyle_Private.h" -#import "MGLAttributionInfo_Private.h" -#import "MGLLoggingConfiguration_Private.h" -#import "MGLRendererConfiguration.h" -#import "MGLMapSnapshotter_Private.h" -#import "MGLSettings_Private.h" +#import "MLNOfflineStorage_Private.h" +#import "MLNGeometry_Private.h" +#import "MLNStyle_Private.h" +#import "MLNAttributionInfo_Private.h" +#import "MLNLoggingConfiguration_Private.h" +#import "MLNRendererConfiguration.h" +#import "MLNMapSnapshotter_Private.h" +#import "MLNSettings_Private.h" #if TARGET_OS_IPHONE -#import "UIImage+MGLAdditions.h" +#import "UIImage+MLNAdditions.h" #else -#import "NSImage+MGLAdditions.h" +#import "NSImage+MLNAdditions.h" #import #import #import #import #endif -#import "NSBundle+MGLAdditions.h" +#import "NSBundle+MLNAdditions.h" -const CGPoint MGLLogoImagePosition = CGPointMake(8, 8); -const CGFloat MGLSnapshotterMinimumPixelSize = 64; +const CGPoint MLNLogoImagePosition = CGPointMake(8, 8); +const CGFloat MLNSnapshotterMinimumPixelSize = 64; -MGLImage *MGLAttributedSnapshot(mbgl::MapSnapshotter::Attributions attributions, MGLImage *mglImage, mbgl::MapSnapshotter::PointForFn pointForFn, mbgl::MapSnapshotter::LatLngForFn latLngForFn, MGLMapSnapshotOptions *options, MGLMapSnapshotOverlayHandler overlayHandler); -MGLMapSnapshot *MGLSnapshotWithDecoratedImage(MGLImage *mglImage, MGLMapSnapshotOptions *options, mbgl::MapSnapshotter::Attributions attributions, mbgl::MapSnapshotter::PointForFn pointForFn, mbgl::MapSnapshotter::LatLngForFn latLngForFn, MGLMapSnapshotOverlayHandler overlayHandler, NSError * _Nullable *outError); -NSArray *MGLAttributionInfosFromAttributions(mbgl::MapSnapshotter::Attributions attributions); +MLNImage *MLNAttributedSnapshot(mbgl::MapSnapshotter::Attributions attributions, MLNImage *mglImage, mbgl::MapSnapshotter::PointForFn pointForFn, mbgl::MapSnapshotter::LatLngForFn latLngForFn, MLNMapSnapshotOptions *options, MLNMapSnapshotOverlayHandler overlayHandler); +MLNMapSnapshot *MLNSnapshotWithDecoratedImage(MLNImage *mglImage, MLNMapSnapshotOptions *options, mbgl::MapSnapshotter::Attributions attributions, mbgl::MapSnapshotter::PointForFn pointForFn, mbgl::MapSnapshotter::LatLngForFn latLngForFn, MLNMapSnapshotOverlayHandler overlayHandler, NSError * _Nullable *outError); +NSArray *MLNAttributionInfosFromAttributions(mbgl::MapSnapshotter::Attributions attributions); -class MGLMapSnapshotterDelegateHost: public mbgl::MapSnapshotterObserver { +class MLNMapSnapshotterDelegateHost: public mbgl::MapSnapshotterObserver { public: - MGLMapSnapshotterDelegateHost(MGLMapSnapshotter *snapshotter_) : snapshotter(snapshotter_) {} + MLNMapSnapshotterDelegateHost(MLNMapSnapshotter *snapshotter_) : snapshotter(snapshotter_) {} void onDidFailLoadingStyle(const std::string& errorMessage) { - MGLMapSnapshotter *strongSnapshotter = snapshotter; + MLNMapSnapshotter *strongSnapshotter = snapshotter; if ([strongSnapshotter.delegate respondsToSelector:@selector(mapSnapshotterDidFail:withError:)]) { NSString *description = @(errorMessage.c_str()); NSDictionary *userInfo = @{ NSLocalizedDescriptionKey: NSLocalizedStringWithDefaultValue(@"SNAPSHOT_LOAD_STYLE_FAILED_DESC", nil, nil, @"The snapshot failed because the style can’t be loaded.", @"User-friendly error description"), NSLocalizedFailureReasonErrorKey: description, }; - NSError *error = [NSError errorWithDomain:MGLErrorDomain code:MGLErrorCodeLoadStyleFailed userInfo:userInfo]; + NSError *error = [NSError errorWithDomain:MLNErrorDomain code:MLNErrorCodeLoadStyleFailed userInfo:userInfo]; [strongSnapshotter.delegate mapSnapshotterDidFail:snapshotter withError:error]; } } void onDidFinishLoadingStyle() { - MGLMapSnapshotter *strongSnapshotter = snapshotter; + MLNMapSnapshotter *strongSnapshotter = snapshotter; if ([strongSnapshotter.delegate respondsToSelector:@selector(mapSnapshotter:didFinishLoadingStyle:)]) { [strongSnapshotter.delegate mapSnapshotter:snapshotter didFinishLoadingStyle:snapshotter.style]; } } void onStyleImageMissing(const std::string& imageName) { - MGLMapSnapshotter *strongSnapshotter = snapshotter; + MLNMapSnapshotter *strongSnapshotter = snapshotter; if ([strongSnapshotter.delegate respondsToSelector:@selector(mapSnapshotter:didFailLoadingImageNamed:)]) { [strongSnapshotter.delegate mapSnapshotter:snapshotter didFailLoadingImageNamed:@(imageName.c_str())]; } } private: - __weak MGLMapSnapshotter *snapshotter; + __weak MLNMapSnapshotter *snapshotter; }; -@interface MGLMapSnapshotOverlay() +@interface MLNMapSnapshotOverlay() @property (nonatomic, assign) CGFloat scale; - (instancetype)initWithContext:(CGContextRef)context scale:(CGFloat)scale pointForFn:(mbgl::MapSnapshotter::PointForFn)pointForFn latLngForFn:(mbgl::MapSnapshotter::LatLngForFn)latLngForFn; @end -@implementation MGLMapSnapshotOverlay { +@implementation MLNMapSnapshotOverlay { mbgl::MapSnapshotter::PointForFn _pointForFn; mbgl::MapSnapshotter::LatLngForFn _latLngForFn; } @@ -100,21 +100,21 @@ private: - (CGPoint)pointForCoordinate:(CLLocationCoordinate2D)coordinate { - mbgl::ScreenCoordinate sc = _pointForFn(MGLLatLngFromLocationCoordinate2D(coordinate)); + mbgl::ScreenCoordinate sc = _pointForFn(MLNLatLngFromLocationCoordinate2D(coordinate)); return CGPointMake(sc.x, sc.y); } - (CLLocationCoordinate2D)coordinateForPoint:(CGPoint)point { mbgl::LatLng latLng = _latLngForFn(mbgl::ScreenCoordinate(point.x, point.y)); - return MGLLocationCoordinate2DFromLatLng(latLng); + return MLNLocationCoordinate2DFromLatLng(latLng); } #else - (NSPoint)pointForCoordinate:(CLLocationCoordinate2D)coordinate { - mbgl::ScreenCoordinate sc = _pointForFn(MGLLatLngFromLocationCoordinate2D(coordinate)); + mbgl::ScreenCoordinate sc = _pointForFn(MLNLatLngFromLocationCoordinate2D(coordinate)); CGFloat height = ((CGFloat)CGBitmapContextGetHeight(self.context))/self.scale; return NSMakePoint(sc.x, height - sc.y); } @@ -124,13 +124,13 @@ private: CGFloat height = ((CGFloat)CGBitmapContextGetHeight(self.context))/self.scale; auto screenCoord = mbgl::ScreenCoordinate(point.x, height - point.y); mbgl::LatLng latLng = _latLngForFn(screenCoord); - return MGLLocationCoordinate2DFromLatLng(latLng); + return MLNLocationCoordinate2DFromLatLng(latLng); } #endif @end -@interface MGLMapSnapshotOptions () +@interface MLNMapSnapshotOptions () /** :nodoc: @@ -145,17 +145,17 @@ private: @property (nonatomic, readwrite) BOOL showsLogo; @end -@implementation MGLMapSnapshotOptions +@implementation MLNMapSnapshotOptions -- (instancetype _Nonnull)initWithStyleURL:(nullable NSURL *)styleURL camera:(MGLMapCamera *)camera size:(CGSize)size +- (instancetype _Nonnull)initWithStyleURL:(nullable NSURL *)styleURL camera:(MLNMapCamera *)camera size:(CGSize)size { - MGLLogDebug(@"Initializing withStyleURL: %@ camera: %@ size: %@", styleURL, camera, MGLStringFromSize(size)); + MLNLogDebug(@"Initializing withStyleURL: %@ camera: %@ size: %@", styleURL, camera, MLNStringFromSize(size)); self = [super init]; if (self) { if ( !styleURL) { - styleURL = [MGLStyle defaultStyleURL]; + styleURL = [MLNStyle defaultStyleURL]; } _styleURL = styleURL; _size = size; @@ -181,18 +181,18 @@ private: @end -@interface MGLMapSnapshot() -- (instancetype)initWithImage:(nullable MGLImage *)image scale:(CGFloat)scale pointForFn:(mbgl::MapSnapshotter::PointForFn)pointForFn latLngForFn:(mbgl::MapSnapshotter::LatLngForFn)latLngForFn; +@interface MLNMapSnapshot() +- (instancetype)initWithImage:(nullable MLNImage *)image scale:(CGFloat)scale pointForFn:(mbgl::MapSnapshotter::PointForFn)pointForFn latLngForFn:(mbgl::MapSnapshotter::LatLngForFn)latLngForFn; @property (nonatomic) CGFloat scale; @end -@implementation MGLMapSnapshot { +@implementation MLNMapSnapshot { mbgl::MapSnapshotter::PointForFn _pointForFn; mbgl::MapSnapshotter::LatLngForFn _latLngForFn; } -- (instancetype)initWithImage:(nullable MGLImage *)image scale:(CGFloat)scale pointForFn:(mbgl::MapSnapshotter::PointForFn)pointForFn latLngForFn:(mbgl::MapSnapshotter::LatLngForFn)latLngForFn +- (instancetype)initWithImage:(nullable MLNImage *)image scale:(CGFloat)scale pointForFn:(mbgl::MapSnapshotter::PointForFn)pointForFn latLngForFn:(mbgl::MapSnapshotter::LatLngForFn)latLngForFn { self = [super init]; if (self) { @@ -208,21 +208,21 @@ private: - (CGPoint)pointForCoordinate:(CLLocationCoordinate2D)coordinate { - mbgl::ScreenCoordinate sc = _pointForFn(MGLLatLngFromLocationCoordinate2D(coordinate)); + mbgl::ScreenCoordinate sc = _pointForFn(MLNLatLngFromLocationCoordinate2D(coordinate)); return CGPointMake(sc.x, sc.y); } - (CLLocationCoordinate2D)coordinateForPoint:(CGPoint)point { mbgl::LatLng latLng = _latLngForFn(mbgl::ScreenCoordinate(point.x, point.y)); - return MGLLocationCoordinate2DFromLatLng(latLng); + return MLNLocationCoordinate2DFromLatLng(latLng); } #else - (NSPoint)pointForCoordinate:(CLLocationCoordinate2D)coordinate { - mbgl::ScreenCoordinate sc = _pointForFn(MGLLatLngFromLocationCoordinate2D(coordinate)); + mbgl::ScreenCoordinate sc = _pointForFn(MLNLatLngFromLocationCoordinate2D(coordinate)); return NSMakePoint(sc.x, self.image.size.height - sc.y); } @@ -230,21 +230,21 @@ private: { auto screenCoord = mbgl::ScreenCoordinate(point.x, self.image.size.height - point.y); mbgl::LatLng latLng = _latLngForFn(screenCoord); - return MGLLocationCoordinate2DFromLatLng(latLng); + return MLNLocationCoordinate2DFromLatLng(latLng); } #endif @end -@interface MGLMapSnapshotter() +@interface MLNMapSnapshotter() @property (nonatomic) BOOL loading; @property (nonatomic) BOOL terminated; @end -@implementation MGLMapSnapshotter { +@implementation MLNMapSnapshotter { std::unique_ptr _mbglMapSnapshotter; - std::unique_ptr _delegateHost; + std::unique_ptr _delegateHost; } - (void)dealloc { @@ -253,14 +253,14 @@ private: } - (instancetype)init { - NSAssert(NO, @"Please use -[MGLMapSnapshotter initWithOptions:]"); + NSAssert(NO, @"Please use -[MLNMapSnapshotter initWithOptions:]"); [super doesNotRecognizeSelector:_cmd]; return nil; } -- (instancetype)initWithOptions:(MGLMapSnapshotOptions *)options +- (instancetype)initWithOptions:(MLNMapSnapshotOptions *)options { - MGLLogDebug(@"Initializing withOptions: %@", options); + MLNLogDebug(@"Initializing withOptions: %@", options); self = [super init]; if (self) { self.options = options; @@ -279,33 +279,33 @@ private: self.terminated = YES; } -- (void)startWithCompletionHandler:(MGLMapSnapshotCompletionHandler)completion +- (void)startWithCompletionHandler:(MLNMapSnapshotCompletionHandler)completion { - MGLLogDebug(@"Starting withCompletionHandler: %@", completion); + MLNLogDebug(@"Starting withCompletionHandler: %@", completion); [self startWithQueue:dispatch_get_main_queue() completionHandler:completion]; } -- (void)startWithQueue:(dispatch_queue_t)queue completionHandler:(MGLMapSnapshotCompletionHandler)completionHandler { +- (void)startWithQueue:(dispatch_queue_t)queue completionHandler:(MLNMapSnapshotCompletionHandler)completionHandler { [self startWithQueue:queue overlayHandler:nil completionHandler:completionHandler]; } -- (void)startWithOverlayHandler:(MGLMapSnapshotOverlayHandler)overlayHandler completionHandler:(MGLMapSnapshotCompletionHandler)completion { +- (void)startWithOverlayHandler:(MLNMapSnapshotOverlayHandler)overlayHandler completionHandler:(MLNMapSnapshotCompletionHandler)completion { [self startWithQueue:dispatch_get_main_queue() overlayHandler:overlayHandler completionHandler:completion]; } -- (void)startWithQueue:(dispatch_queue_t)queue overlayHandler:(MGLMapSnapshotOverlayHandler)overlayHandler completionHandler:(MGLMapSnapshotCompletionHandler)completion +- (void)startWithQueue:(dispatch_queue_t)queue overlayHandler:(MLNMapSnapshotOverlayHandler)overlayHandler completionHandler:(MLNMapSnapshotCompletionHandler)completion { if (!completion) { return; } - // Ensure that offline storage has been initialized on the main thread, as MGLMapView and MGLOfflineStorage do when used directly. + // Ensure that offline storage has been initialized on the main thread, as MLNMapView and MLNOfflineStorage do when used directly. // https://github.com/mapbox/mapbox-gl-native-ios/issues/227 if ([NSThread.currentThread isMainThread]) { - (void)[MGLOfflineStorage sharedOfflineStorage]; + (void)[MLNOfflineStorage sharedOfflineStorage]; } else { [NSException raise:NSInvalidArgumentException - format:@"-[MGLMapSnapshotter startWithQueue:completionHandler:] must be called from the main thread, not %@.", NSThread.currentThread]; + format:@"-[MLNMapSnapshotter startWithQueue:completionHandler:] must be called from the main thread, not %@.", NSThread.currentThread]; } if (self.loading) { @@ -320,19 +320,19 @@ private: format:@"Starting a snapshotter after application termination is not supported."]; } - MGLMapSnapshotOptions *options = [self.options copy]; + MLNMapSnapshotOptions *options = [self.options copy]; [self configureWithOptions:options]; - MGLLogDebug(@"Starting with options: %@", self.options); + MLNLogDebug(@"Starting with options: %@", self.options); // Temporarily capture the snapshotter until the completion handler finishes executing, to keep standalone local usage of the snapshotter from becoming a no-op. // POSTCONDITION: Only refer to this variable in the final result queue. // POSTCONDITION: It is important to nil out this variable at some point in the future to avoid a leak. In cases where the completion handler gets called, the variable should be nilled out explicitly. If -cancel is called, mbgl releases the snapshot block below, causing the only remaining references to the snapshotter to go out of scope. - __block MGLMapSnapshotter *strongSelf = self; + __block MLNMapSnapshotter *strongSelf = self; _mbglMapSnapshotter->snapshot(^(std::exception_ptr mbglError, mbgl::PremultipliedImage image, mbgl::MapSnapshotter::Attributions attributions, mbgl::MapSnapshotter::PointForFn pointForFn, mbgl::MapSnapshotter::LatLngForFn latLngForFn) { if (mbglError) { NSString *description = @(mbgl::util::toString(mbglError).c_str()); NSDictionary *userInfo = @{NSLocalizedDescriptionKey: description}; - NSError *error = [NSError errorWithDomain:MGLErrorDomain code:MGLErrorCodeSnapshotFailed userInfo:userInfo]; + NSError *error = [NSError errorWithDomain:MLNErrorDomain code:MLNErrorCodeSnapshotFailed userInfo:userInfo]; // Dispatch to result queue dispatch_async(queue, ^{ @@ -342,9 +342,9 @@ private: }); } else { #if TARGET_OS_IPHONE - MGLImage *mglImage = [[MGLImage alloc] initWithMGLPremultipliedImage:std::move(image) scale:options.scale]; + MLNImage *mglImage = [[MLNImage alloc] initWithMLNPremultipliedImage:std::move(image) scale:options.scale]; #else - MGLImage *mglImage = [[MGLImage alloc] initWithMGLPremultipliedImage:std::move(image)]; + MLNImage *mglImage = [[MLNImage alloc] initWithMLNPremultipliedImage:std::move(image)]; mglImage.size = NSMakeSize(mglImage.size.width / options.scale, mglImage.size.height / options.scale); #endif @@ -354,7 +354,7 @@ private: dispatch_async(workQueue, ^{ // Call a function that cannot accidentally capture self. NSError *error; - MGLMapSnapshot *snapshot = MGLSnapshotWithDecoratedImage(mglImage, options, attributions, pointForFn, latLngForFn, overlayHandler, &error); + MLNMapSnapshot *snapshot = MLNSnapshotWithDecoratedImage(mglImage, options, attributions, pointForFn, latLngForFn, overlayHandler, &error); // Dispatch result to result queue dispatch_async(queue, ^{ @@ -367,29 +367,29 @@ private: }); } -MGLImage *MGLAttributedSnapshot(mbgl::MapSnapshotter::Attributions attributions, MGLImage *mglImage, MGLMapSnapshotOptions *options, void (^overlayHandler)()) { +MLNImage *MLNAttributedSnapshot(mbgl::MapSnapshotter::Attributions attributions, MLNImage *mglImage, MLNMapSnapshotOptions *options, void (^overlayHandler)()) { - NSArray *attributionInfo = MGLAttributionInfosFromAttributions(attributions); + NSArray *attributionInfo = MLNAttributionInfosFromAttributions(attributions); #if TARGET_OS_IPHONE - MGLAttributionInfoStyle attributionInfoStyle = MGLAttributionInfoStyleLong; - for (NSUInteger styleValue = MGLAttributionInfoStyleLong; styleValue >= MGLAttributionInfoStyleShort; styleValue--) { - attributionInfoStyle = (MGLAttributionInfoStyle)styleValue; - CGSize attributionSize = [MGLMapSnapshotter attributionSizeWithLogoStyle:attributionInfoStyle sourceAttributionStyle:attributionInfoStyle attributionInfo:attributionInfo]; + MLNAttributionInfoStyle attributionInfoStyle = MLNAttributionInfoStyleLong; + for (NSUInteger styleValue = MLNAttributionInfoStyleLong; styleValue >= MLNAttributionInfoStyleShort; styleValue--) { + attributionInfoStyle = (MLNAttributionInfoStyle)styleValue; + CGSize attributionSize = [MLNMapSnapshotter attributionSizeWithLogoStyle:attributionInfoStyle sourceAttributionStyle:attributionInfoStyle attributionInfo:attributionInfo]; if (attributionSize.width <= mglImage.size.width) { break; } } - UIImage *logoImage = [MGLMapSnapshotter logoImageWithStyle:attributionInfoStyle]; - CGSize attributionBackgroundSize = [MGLMapSnapshotter attributionTextSizeWithStyle:attributionInfoStyle attributionInfo:attributionInfo]; + UIImage *logoImage = [MLNMapSnapshotter logoImageWithStyle:attributionInfoStyle]; + CGSize attributionBackgroundSize = [MLNMapSnapshotter attributionTextSizeWithStyle:attributionInfoStyle attributionInfo:attributionInfo]; - CGRect logoImageRect = CGRectMake(MGLLogoImagePosition.x, mglImage.size.height - (MGLLogoImagePosition.y + logoImage.size.height), logoImage.size.width, logoImage.size.height); + CGRect logoImageRect = CGRectMake(MLNLogoImagePosition.x, mglImage.size.height - (MLNLogoImagePosition.y + logoImage.size.height), logoImage.size.width, logoImage.size.height); CGPoint attributionOrigin = CGPointMake(mglImage.size.width - 10 - attributionBackgroundSize.width, logoImageRect.origin.y + (logoImageRect.size.height / 2) - (attributionBackgroundSize.height / 2) + 1); if (!logoImage) { - CGSize defaultLogoSize = [MGLMapSnapshotter mapboxLongStyleLogo].size; - logoImageRect = CGRectMake(0, mglImage.size.height - (MGLLogoImagePosition.y + defaultLogoSize.height), 0, defaultLogoSize.height); + CGSize defaultLogoSize = [MLNMapSnapshotter mapboxLongStyleLogo].size; + logoImageRect = CGRectMake(0, mglImage.size.height - (MLNLogoImagePosition.y + defaultLogoSize.height), 0, defaultLogoSize.height); attributionOrigin = CGPointMake(10, logoImageRect.origin.y + (logoImageRect.size.height / 2) - (attributionBackgroundSize.height / 2) + 1); } @@ -429,11 +429,11 @@ MGLImage *MGLAttributedSnapshot(mbgl::MapSnapshotter::Attributions attributions, CIImage *ciAttributionImage = [[CIImage alloc] initWithCGImage:attributionImage.CGImage]; - UIImage *blurredAttributionBackground = [MGLMapSnapshotter blurredAttributionBackground:ciAttributionImage]; + UIImage *blurredAttributionBackground = [MLNMapSnapshotter blurredAttributionBackground:ciAttributionImage]; [blurredAttributionBackground drawInRect:attributionBackgroundFrame]; - [MGLMapSnapshotter drawAttributionTextWithStyle:attributionInfoStyle origin:attributionTextPosition attributionInfo:attributionInfo]; + [MLNMapSnapshotter drawAttributionTextWithStyle:attributionInfoStyle origin:attributionTextPosition attributionInfo:attributionInfo]; UIImage *compositedImage = UIGraphicsGetImageFromCurrentImageContext(); @@ -444,25 +444,25 @@ MGLImage *MGLAttributedSnapshot(mbgl::MapSnapshotter::Attributions attributions, #else NSRect targetFrame = { .origin = NSZeroPoint, .size = options.size }; - MGLAttributionInfoStyle attributionInfoStyle = MGLAttributionInfoStyleLong; - for (NSUInteger styleValue = MGLAttributionInfoStyleLong; styleValue >= MGLAttributionInfoStyleShort; styleValue--) { - attributionInfoStyle = (MGLAttributionInfoStyle)styleValue; - CGSize attributionSize = [MGLMapSnapshotter attributionSizeWithLogoStyle:attributionInfoStyle sourceAttributionStyle:attributionInfoStyle attributionInfo:attributionInfo]; + MLNAttributionInfoStyle attributionInfoStyle = MLNAttributionInfoStyleLong; + for (NSUInteger styleValue = MLNAttributionInfoStyleLong; styleValue >= MLNAttributionInfoStyleShort; styleValue--) { + attributionInfoStyle = (MLNAttributionInfoStyle)styleValue; + CGSize attributionSize = [MLNMapSnapshotter attributionSizeWithLogoStyle:attributionInfoStyle sourceAttributionStyle:attributionInfoStyle attributionInfo:attributionInfo]; if (attributionSize.width <= mglImage.size.width) { break; } } - NSImage *logoImage = [MGLMapSnapshotter logoImageWithStyle:attributionInfoStyle]; - CGSize attributionBackgroundSize = [MGLMapSnapshotter attributionTextSizeWithStyle:attributionInfoStyle attributionInfo:attributionInfo]; + NSImage *logoImage = [MLNMapSnapshotter logoImageWithStyle:attributionInfoStyle]; + CGSize attributionBackgroundSize = [MLNMapSnapshotter attributionTextSizeWithStyle:attributionInfoStyle attributionInfo:attributionInfo]; NSImage *sourceImage = mglImage; - CGRect logoImageRect = CGRectMake(MGLLogoImagePosition.x, MGLLogoImagePosition.y, logoImage.size.width, logoImage.size.height); + CGRect logoImageRect = CGRectMake(MLNLogoImagePosition.x, MLNLogoImagePosition.y, logoImage.size.width, logoImage.size.height); CGPoint attributionOrigin = CGPointMake(targetFrame.size.width - 10 - attributionBackgroundSize.width, - MGLLogoImagePosition.y + 1); + MLNLogoImagePosition.y + 1); if (!logoImage) { - CGSize defaultLogoSize = [MGLMapSnapshotter mapboxLongStyleLogo].size; - logoImageRect = CGRectMake(0, MGLLogoImagePosition.y, 0, defaultLogoSize.height); + CGSize defaultLogoSize = [MLNMapSnapshotter mapboxLongStyleLogo].size; + logoImageRect = CGRectMake(0, MLNLogoImagePosition.y, 0, defaultLogoSize.height); attributionOrigin = CGPointMake(10, attributionOrigin.y); } @@ -501,11 +501,11 @@ MGLImage *MGLAttributedSnapshot(mbgl::MapSnapshotter::Attributions attributions, CIImage *attributionBackgroundImage = [[CIImage alloc] initWithCGImage:[attributionBackground CGImage]]; - NSImage *blurredAttributionBackground = [MGLMapSnapshotter blurredAttributionBackground:attributionBackgroundImage]; + NSImage *blurredAttributionBackground = [MLNMapSnapshotter blurredAttributionBackground:attributionBackgroundImage]; [blurredAttributionBackground drawInRect:attributionBackgroundFrame]; - [MGLMapSnapshotter drawAttributionTextWithStyle:attributionInfoStyle origin:attributionTextPosition attributionInfo:attributionInfo]; + [MLNMapSnapshotter drawAttributionTextWithStyle:attributionInfoStyle origin:attributionTextPosition attributionInfo:attributionInfo]; [compositedImage unlockFocus]; @@ -513,8 +513,8 @@ MGLImage *MGLAttributedSnapshot(mbgl::MapSnapshotter::Attributions attributions, #endif } -MGLMapSnapshot *MGLSnapshotWithDecoratedImage(MGLImage *mglImage, MGLMapSnapshotOptions *options, mbgl::MapSnapshotter::Attributions attributions, mbgl::MapSnapshotter::PointForFn pointForFn, mbgl::MapSnapshotter::LatLngForFn latLngForFn, MGLMapSnapshotOverlayHandler overlayHandler, NSError * _Nullable *outError) { - MGLImage *compositedImage = MGLAttributedSnapshot(attributions, mglImage, options, ^{ +MLNMapSnapshot *MLNSnapshotWithDecoratedImage(MLNImage *mglImage, MLNMapSnapshotOptions *options, mbgl::MapSnapshotter::Attributions attributions, mbgl::MapSnapshotter::PointForFn pointForFn, mbgl::MapSnapshotter::LatLngForFn latLngForFn, MLNMapSnapshotOverlayHandler overlayHandler, NSError * _Nullable *outError) { + MLNImage *compositedImage = MLNAttributedSnapshot(attributions, mglImage, options, ^{ if (!overlayHandler) { return; } @@ -523,7 +523,7 @@ MGLMapSnapshot *MGLSnapshotWithDecoratedImage(MGLImage *mglImage, MGLMapSnapshot if (!context) { return; } - MGLMapSnapshotOverlay *snapshotOverlay = [[MGLMapSnapshotOverlay alloc] initWithContext:context + MLNMapSnapshotOverlay *snapshotOverlay = [[MLNMapSnapshotOverlay alloc] initWithContext:context scale:options.scale pointForFn:pointForFn latLngForFn:latLngForFn]; @@ -535,7 +535,7 @@ MGLMapSnapshot *MGLSnapshotWithDecoratedImage(MGLImage *mglImage, MGLMapSnapshot if (!context) { return; } - MGLMapSnapshotOverlay *snapshotOverlay = [[MGLMapSnapshotOverlay alloc] initWithContext:context.CGContext + MLNMapSnapshotOverlay *snapshotOverlay = [[MLNMapSnapshotOverlay alloc] initWithContext:context.CGContext scale:options.scale pointForFn:pointForFn latLngForFn:latLngForFn]; @@ -546,22 +546,22 @@ MGLMapSnapshot *MGLSnapshotWithDecoratedImage(MGLImage *mglImage, MGLMapSnapshot }); if (compositedImage) { - return [[MGLMapSnapshot alloc] initWithImage:compositedImage + return [[MLNMapSnapshot alloc] initWithImage:compositedImage scale:options.scale pointForFn:pointForFn latLngForFn:latLngForFn]; } else { if (outError) { NSDictionary *userInfo = @{NSLocalizedDescriptionKey: @"Failed to generate composited snapshot."}; - *outError = [NSError errorWithDomain:MGLErrorDomain - code:MGLErrorCodeSnapshotFailed + *outError = [NSError errorWithDomain:MLNErrorDomain + code:MLNErrorCodeSnapshotFailed userInfo:userInfo]; } return nil; } } -NSArray *MGLAttributionInfosFromAttributions(mbgl::MapSnapshotter::Attributions attributions) { +NSArray *MLNAttributionInfosFromAttributions(mbgl::MapSnapshotter::Attributions attributions) { NSMutableArray *infos = [NSMutableArray array]; #if TARGET_OS_IPHONE @@ -573,7 +573,7 @@ NSArray *MGLAttributionInfosFromAttributions(mbgl::MapSnap #endif for (auto attribution : attributions) { NSString *attributionHTMLString = @(attribution.c_str()); - NSArray *tileSetInfos = [MGLAttributionInfo attributionInfosFromHTMLString:attributionHTMLString + NSArray *tileSetInfos = [MLNAttributionInfo attributionInfosFromHTMLString:attributionHTMLString fontSize:fontSize linkColor:attributeFontColor]; [infos growArrayByAddingAttributionInfosFromArray:tileSetInfos]; @@ -581,9 +581,9 @@ NSArray *MGLAttributionInfosFromAttributions(mbgl::MapSnap return infos; } -+ (void)drawAttributionTextWithStyle:(MGLAttributionInfoStyle)attributionInfoStyle origin:(CGPoint)origin attributionInfo:(NSArray*)attributionInfo ++ (void)drawAttributionTextWithStyle:(MLNAttributionInfoStyle)attributionInfoStyle origin:(CGPoint)origin attributionInfo:(NSArray*)attributionInfo { - for (MGLAttributionInfo *info in attributionInfo) { + for (MLNAttributionInfo *info in attributionInfo) { if (info.isFeedbackLink) { continue; } @@ -594,7 +594,7 @@ NSArray *MGLAttributionInfosFromAttributions(mbgl::MapSnap } } -+ (MGLImage *)blurredAttributionBackground:(CIImage *)backgroundImage ++ (MLNImage *)blurredAttributionBackground:(CIImage *)backgroundImage { CGAffineTransform transform = CGAffineTransformIdentity; CIFilter *clamp = [CIFilter filterWithName:@"CIAffineClamp"]; @@ -613,7 +613,7 @@ NSArray *MGLAttributionInfosFromAttributions(mbgl::MapSnap CIContext *ctx = [CIContext contextWithOptions:nil]; CGImageRef cgimg = [ctx createCGImage:blurredImage fromRect:[backgroundImage extent]]; - MGLImage *image; + MLNImage *image; #if TARGET_OS_IPHONE image = [UIImage imageWithCGImage:cgimg]; @@ -625,30 +625,30 @@ NSArray *MGLAttributionInfosFromAttributions(mbgl::MapSnap return image; } -+ (MGLImage *)logoImageWithStyle:(MGLAttributionInfoStyle)style ++ (MLNImage *)logoImageWithStyle:(MLNAttributionInfoStyle)style { - MGLImage *logoImage; + MLNImage *logoImage; switch (style) { - case MGLAttributionInfoStyleLong: - logoImage = [MGLMapSnapshotter mapboxLongStyleLogo]; + case MLNAttributionInfoStyleLong: + logoImage = [MLNMapSnapshotter mapboxLongStyleLogo]; break; - case MGLAttributionInfoStyleMedium: + case MLNAttributionInfoStyleMedium: #if TARGET_OS_IPHONE logoImage = [UIImage imageNamed:@"mapbox_helmet" inBundle:[NSBundle mgl_frameworkBundle] compatibleWithTraitCollection:nil]; #else logoImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mgl_frameworkBundle] pathForResource:@"mapbox_helmet" ofType:@"pdf"]]; #endif break; - case MGLAttributionInfoStyleShort: + case MLNAttributionInfoStyleShort: logoImage = nil; break; } return logoImage; } -+ (MGLImage *)mapboxLongStyleLogo ++ (MLNImage *)mapboxLongStyleLogo { - MGLImage *logoImage; + MLNImage *logoImage; #if TARGET_OS_IPHONE logoImage =[UIImage imageNamed:@"mapbox" inBundle:[NSBundle mgl_frameworkBundle] compatibleWithTraitCollection:nil]; #else @@ -657,16 +657,16 @@ NSArray *MGLAttributionInfosFromAttributions(mbgl::MapSnap return logoImage; } -+ (CGSize)attributionSizeWithLogoStyle:(MGLAttributionInfoStyle)logoStyle sourceAttributionStyle:(MGLAttributionInfoStyle)attributionStyle attributionInfo:(NSArray*)attributionInfo ++ (CGSize)attributionSizeWithLogoStyle:(MLNAttributionInfoStyle)logoStyle sourceAttributionStyle:(MLNAttributionInfoStyle)attributionStyle attributionInfo:(NSArray*)attributionInfo { - MGLImage *logoImage = [self logoImageWithStyle:logoStyle]; + MLNImage *logoImage = [self logoImageWithStyle:logoStyle]; - CGSize attributionBackgroundSize = [MGLMapSnapshotter attributionTextSizeWithStyle:attributionStyle attributionInfo:attributionInfo]; + CGSize attributionBackgroundSize = [MLNMapSnapshotter attributionTextSizeWithStyle:attributionStyle attributionInfo:attributionInfo]; CGSize attributionSize = CGSizeZero; if (logoImage) { - attributionSize.width = MGLLogoImagePosition.x + logoImage.size.width + 10; + attributionSize.width = MLNLogoImagePosition.x + logoImage.size.width + 10; } attributionSize.width = attributionSize.width + 10 + attributionBackgroundSize.width + 10; attributionSize.height = MAX(logoImage.size.height, attributionBackgroundSize.height); @@ -674,10 +674,10 @@ NSArray *MGLAttributionInfosFromAttributions(mbgl::MapSnap return attributionSize; } -+ (CGSize)attributionTextSizeWithStyle:(MGLAttributionInfoStyle)attributionStyle attributionInfo:(NSArray*)attributionInfo ++ (CGSize)attributionTextSizeWithStyle:(MLNAttributionInfoStyle)attributionStyle attributionInfo:(NSArray*)attributionInfo { CGSize attributionBackgroundSize = CGSizeMake(10, 0); - for (MGLAttributionInfo *info in attributionInfo) { + for (MLNAttributionInfo *info in attributionInfo) { if (info.isFeedbackLink) { continue; } @@ -691,7 +691,7 @@ NSArray *MGLAttributionInfosFromAttributions(mbgl::MapSnap - (void)cancel { - MGLLogInfo(@"Cancelling snapshotter."); + MLNLogInfo(@"Cancelling snapshotter."); if (_mbglMapSnapshotter) { _mbglMapSnapshotter->cancel(); @@ -700,37 +700,37 @@ NSArray *MGLAttributionInfosFromAttributions(mbgl::MapSnap _delegateHost.reset(); } -- (void)configureWithOptions:(MGLMapSnapshotOptions *)options { - auto mbglFileSource = [[MGLOfflineStorage sharedOfflineStorage] mbglFileSource]; +- (void)configureWithOptions:(MLNMapSnapshotOptions *)options { + auto mbglFileSource = [[MLNOfflineStorage sharedOfflineStorage] mbglFileSource]; // Size; taking into account the minimum texture size for OpenGL ES - // For non retina screens the ratio is 1:1 MGLSnapshotterMinimumPixelSize + // For non retina screens the ratio is 1:1 MLNSnapshotterMinimumPixelSize mbgl::Size size = { - static_cast(MAX(options.size.width, MGLSnapshotterMinimumPixelSize)), - static_cast(MAX(options.size.height, MGLSnapshotterMinimumPixelSize)) + static_cast(MAX(options.size.width, MLNSnapshotterMinimumPixelSize)), + static_cast(MAX(options.size.height, MLNSnapshotterMinimumPixelSize)) }; float pixelRatio = MAX(options.scale, 1); // App-global configuration - MGLRendererConfiguration *config = [MGLRendererConfiguration currentConfiguration]; + MLNRendererConfiguration *config = [MLNRendererConfiguration currentConfiguration]; - auto tileServerOptions = [[MGLSettings sharedSettings] tileServerOptionsInternal]; + auto tileServerOptions = [[MLNSettings sharedSettings] tileServerOptionsInternal]; mbgl::ResourceOptions resourceOptions; resourceOptions .withTileServerOptions(*tileServerOptions) - .withCachePath(MGLOfflineStorage.sharedOfflineStorage.databasePath.UTF8String) + .withCachePath(MLNOfflineStorage.sharedOfflineStorage.databasePath.UTF8String) .withAssetPath(NSBundle.mainBundle.resourceURL.path.UTF8String); mbgl::ClientOptions clientOptions; - auto apiKey = [[MGLSettings sharedSettings] apiKey]; + auto apiKey = [[MLNSettings sharedSettings] apiKey]; if (apiKey) { resourceOptions.withApiKey([apiKey UTF8String]); } // Create the snapshotter auto localFontFamilyName = config.localFontFamilyName ? std::string(config.localFontFamilyName.UTF8String) : nullptr; - _delegateHost = std::make_unique(self); + _delegateHost = std::make_unique(self); _mbglMapSnapshotter = std::make_unique( size, pixelRatio, resourceOptions, clientOptions, *_delegateHost, localFontFamilyName); @@ -739,7 +739,7 @@ NSArray *MGLAttributionInfosFromAttributions(mbgl::MapSnap // Camera options mbgl::CameraOptions cameraOptions; if (CLLocationCoordinate2DIsValid(options.camera.centerCoordinate)) { - cameraOptions.center = MGLLatLngFromLocationCoordinate2D(options.camera.centerCoordinate); + cameraOptions.center = MLNLatLngFromLocationCoordinate2D(options.camera.centerCoordinate); } if (options.camera.heading >= 0) { cameraOptions.bearing = MAX(0, options.camera.heading); @@ -755,16 +755,16 @@ NSArray *MGLAttributionInfosFromAttributions(mbgl::MapSnap } // Region - if (!MGLCoordinateBoundsIsEmpty(options.coordinateBounds)) { - _mbglMapSnapshotter->setRegion(MGLLatLngBoundsFromCoordinateBounds(options.coordinateBounds)); + if (!MLNCoordinateBoundsIsEmpty(options.coordinateBounds)) { + _mbglMapSnapshotter->setRegion(MLNLatLngBoundsFromCoordinateBounds(options.coordinateBounds)); } } -- (MGLStyle *)style { +- (MLNStyle *)style { if (!_mbglMapSnapshotter) { return nil; } - return [[MGLStyle alloc] initWithRawStyle:&_mbglMapSnapshotter->getStyle() stylable:self]; + return [[MLNStyle alloc] initWithRawStyle:&_mbglMapSnapshotter->getStyle() stylable:self]; } @end diff --git a/platform/ios/platform/darwin/src/MGLMapSnapshotter_Private.h b/platform/ios/platform/darwin/src/MLNMapSnapshotter_Private.h similarity index 80% rename from platform/ios/platform/darwin/src/MGLMapSnapshotter_Private.h rename to platform/ios/platform/darwin/src/MLNMapSnapshotter_Private.h index 205e51a6d..7757b09dc 100644 --- a/platform/ios/platform/darwin/src/MGLMapSnapshotter_Private.h +++ b/platform/ios/platform/darwin/src/MLNMapSnapshotter_Private.h @@ -1,6 +1,6 @@ -#import "MGLMapSnapshotter.h" +#import "MLNMapSnapshotter.h" -@protocol MGLMapSnapshotProtocol +@protocol MLNMapSnapshotProtocol #if TARGET_OS_IPHONE - (CGPoint)pointForCoordinate:(CLLocationCoordinate2D)coordinate; diff --git a/platform/ios/platform/darwin/src/MGLMultiPoint.h b/platform/ios/platform/darwin/src/MLNMultiPoint.h similarity index 86% rename from platform/ios/platform/darwin/src/MGLMultiPoint.h rename to platform/ios/platform/darwin/src/MLNMultiPoint.h index ee9eb530a..76965df83 100644 --- a/platform/ios/platform/darwin/src/MGLMultiPoint.h +++ b/platform/ios/platform/darwin/src/MLNMultiPoint.h @@ -1,26 +1,26 @@ #import #import -#import "MGLFoundation.h" -#import "MGLShape.h" +#import "MLNFoundation.h" +#import "MLNShape.h" NS_ASSUME_NONNULL_BEGIN /** - The `MGLMultiPoint` class is an abstract superclass used to define shapes + The `MLNMultiPoint` class is an abstract superclass used to define shapes composed of multiple vertices. - Create instances of `MGLPolyline` or `MGLPolygon` in order to use - properties of `MGLMultiPoint`. Do not create instances of `MGLMultiPoint` + Create instances of `MLNPolyline` or `MLNPolygon` in order to use + properties of `MLNMultiPoint`. Do not create instances of `MLNMultiPoint` directly and do not create your own subclasses of this class. You can use the method and properties of this class to access information about the vertices of the line or polygon. - Do not confuse `MGLMultiPoint` with `MGLPointCollection`, which represents a + Do not confuse `MLNMultiPoint` with `MLNPointCollection`, which represents a collection of related but disconnected points. */ -MGL_EXPORT -@interface MGLMultiPoint : MGLShape +MLN_EXPORT +@interface MLNMultiPoint : MLNShape /** The array of vertices associated with the shape. @@ -62,8 +62,8 @@ MGL_EXPORT Inserts the given vertices into the shape. If the shape is currently visible on the map as an annotation, it is redrawn - immediately. If the shape is part of an `MGLShapeSource` object, you must - explicitly set the `MGLShapeSource.shape` property in order for any style + immediately. If the shape is part of an `MLNShapeSource` object, you must + explicitly set the `MLNShapeSource.shape` property in order for any style layers that use the source to be redrawn. @param coords The array of coordinates to insert into the shape. The data in @@ -78,8 +78,8 @@ MGL_EXPORT Appends the given vertices to the shape. If the shape is currently visible on the map as an annotation, it is redrawn - immediately. If the shape is part of an `MGLShapeSource` object, you must - explicitly set the `MGLShapeSource.shape` property in order for any style + immediately. If the shape is part of an `MLNShapeSource` object, you must + explicitly set the `MLNShapeSource.shape` property in order for any style layers that use the source to be redrawn. @param coords The array of coordinates to add to the shape. The data in this @@ -93,8 +93,8 @@ MGL_EXPORT vertices from a given C array. If the shape is currently visible on the map as an annotation, it is redrawn - immediately. If the shape is part of an `MGLShapeSource` object, you must - explicitly set the `MGLShapeSource.shape` property in order for any style + immediately. If the shape is part of an `MLNShapeSource` object, you must + explicitly set the `MLNShapeSource.shape` property in order for any style layers that use the source to be redrawn. The number of coordinates in `coords` must be equal to the length of `range`. @@ -119,8 +119,8 @@ MGL_EXPORT of vertices from a given C array. If the shape is currently visible on the map as an annotation, it is redrawn - immediately. If the shape is part of an `MGLShapeSource` object, you must - explicitly set the `MGLShapeSource.shape` property in order for any style + immediately. If the shape is part of an `MLNShapeSource` object, you must + explicitly set the `MLNShapeSource.shape` property in order for any style layers that use the source to be redrawn. If `count` is greater than the `length` field of `range`, some vertices will @@ -148,8 +148,8 @@ MGL_EXPORT Removes the vertices at the given range from the shape. If the shape is currently visible on the map as an annotation, it is redrawn - immediately. If the shape is part of an `MGLShapeSource` object, you must - explicitly set the `MGLShapeSource.shape` property in order for any style + immediately. If the shape is part of an `MLNShapeSource` object, you must + explicitly set the `MLNShapeSource.shape` property in order for any style layers that use the source to be redrawn. If `range` extends beyond the shape’s `coordinates` property, an diff --git a/platform/ios/platform/darwin/src/MGLMultiPoint.mm b/platform/ios/platform/darwin/src/MLNMultiPoint.mm similarity index 79% rename from platform/ios/platform/darwin/src/MGLMultiPoint.mm rename to platform/ios/platform/darwin/src/MLNMultiPoint.mm index 365c89574..523d93378 100644 --- a/platform/ios/platform/darwin/src/MGLMultiPoint.mm +++ b/platform/ios/platform/darwin/src/MLNMultiPoint.mm @@ -1,11 +1,11 @@ -#import "MGLMultiPoint_Private.h" -#import "MGLGeometry_Private.h" -#import "MGLShape_Private.h" -#import "NSCoder+MGLAdditions.h" -#import "MGLTypes.h" -#import "MGLLoggingConfiguration_Private.h" +#import "MLNMultiPoint_Private.h" +#import "MLNGeometry_Private.h" +#import "MLNShape_Private.h" +#import "NSCoder+MLNAdditions.h" +#import "MLNTypes.h" +#import "MLNLoggingConfiguration_Private.h" -@implementation MGLMultiPoint +@implementation MLNMultiPoint { std::optional _bounds; std::vector _coordinates; @@ -13,7 +13,7 @@ - (instancetype)initWithCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count { - MGLLogDebug(@"Initializing with %lu coordinates.", (unsigned long) count); + MLNLogDebug(@"Initializing with %lu coordinates.", (unsigned long) count); self = [super init]; if (self) @@ -30,7 +30,7 @@ - (instancetype)initWithCoder:(NSCoder *)decoder { - MGLLogInfo(@"Initializing with coder."); + MLNLogInfo(@"Initializing with coder."); if (self = [super initWithCoder:decoder]) { _coordinates = [decoder mgl_decodeLocationCoordinates2DForKey:@"coordinates"]; } @@ -46,9 +46,9 @@ - (BOOL)isEqual:(id)other { if (self == other) return YES; - if (![other isKindOfClass:[MGLMultiPoint class]]) return NO; + if (![other isKindOfClass:[MLNMultiPoint class]]) return NO; - MGLMultiPoint *otherMultipoint = other; + MLNMultiPoint *otherMultipoint = other; return ([super isEqual:otherMultipoint] && _coordinates == otherMultipoint->_coordinates); } @@ -64,7 +64,7 @@ - (CLLocationCoordinate2D)coordinate { - MGLAssert([self pointCount] > 0, @"A multipoint must have coordinates"); + MLNAssert([self pointCount] > 0, @"A multipoint must have coordinates"); return _coordinates.at(0); } @@ -96,7 +96,7 @@ } - (void)setCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count { - MGLLogDebug(@"Setting: %lu coordinates.", (unsigned long)count); + MLNLogDebug(@"Setting: %lu coordinates.", (unsigned long)count); if (!count) { [NSException raise:NSInvalidArgumentException format:@"A multipoint must have at least one vertex."]; @@ -109,7 +109,7 @@ } - (void)insertCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count atIndex:(NSUInteger)index { - MGLLogDebug(@"Inserting %lu coordinates at index %lu.", (unsigned long)count, (unsigned long)index); + MLNLogDebug(@"Inserting %lu coordinates at index %lu.", (unsigned long)count, (unsigned long)index); if (!count) { return; } @@ -128,18 +128,18 @@ - (void)appendCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count { - MGLLogDebug(@"Appending %lu coordinates.", (unsigned long)count); + MLNLogDebug(@"Appending %lu coordinates.", (unsigned long)count); [self insertCoordinates:coords count:count atIndex:_coordinates.size()]; } - (void)replaceCoordinatesInRange:(NSRange)range withCoordinates:(const CLLocationCoordinate2D *)coords { - MGLLogDebug(@"Replacing coordinates in range: %@", NSStringFromRange(range)); + MLNLogDebug(@"Replacing coordinates in range: %@", NSStringFromRange(range)); [self replaceCoordinatesInRange:range withCoordinates:coords count:range.length]; } - (void)replaceCoordinatesInRange:(NSRange)range withCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count { - MGLLogDebug(@"Replacing %lu coordinates in range %@.", (unsigned long)count, NSStringFromRange(range)); + MLNLogDebug(@"Replacing %lu coordinates in range %@.", (unsigned long)count, NSStringFromRange(range)); if (!count && !range.length) { return; } @@ -162,35 +162,35 @@ } - (void)removeCoordinatesInRange:(NSRange)range { - MGLLogDebug(@"Removing coordinatesInRange: %@", NSStringFromRange(range)); + MLNLogDebug(@"Removing coordinatesInRange: %@", NSStringFromRange(range)); CLLocationCoordinate2D coords; [self replaceCoordinatesInRange:range withCoordinates:&coords count:0]; } -- (MGLCoordinateBounds)overlayBounds +- (MLNCoordinateBounds)overlayBounds { if (!_bounds) { mbgl::LatLngBounds bounds = mbgl::LatLngBounds::empty(); for (auto coordinate : _coordinates) { - if (!MGLLocationCoordinate2DIsValid(coordinate)) { + if (!MLNLocationCoordinate2DIsValid(coordinate)) { bounds = mbgl::LatLngBounds::empty(); break; } - bounds.extend(MGLLatLngFromLocationCoordinate2D(coordinate)); + bounds.extend(MLNLatLngFromLocationCoordinate2D(coordinate)); } _bounds = bounds; } - return MGLCoordinateBoundsFromLatLngBounds(*_bounds); + return MLNCoordinateBoundsFromLatLngBounds(*_bounds); } -- (BOOL)intersectsOverlayBounds:(MGLCoordinateBounds)overlayBounds +- (BOOL)intersectsOverlayBounds:(MLNCoordinateBounds)overlayBounds { - return MGLCoordinateBoundsIntersectsCoordinateBounds(self.overlayBounds, overlayBounds); + return MLNCoordinateBoundsIntersectsCoordinateBounds(self.overlayBounds, overlayBounds); } -- (mbgl::Annotation)annotationObjectWithDelegate:(__unused id )delegate +- (mbgl::Annotation)annotationObjectWithDelegate:(__unused id )delegate { - MGLAssert(NO, @"Cannot add an annotation from an instance of %@", NSStringFromClass([self class])); + MLNAssert(NO, @"Cannot add an annotation from an instance of %@", NSStringFromClass([self class])); return mbgl::SymbolAnnotation(mbgl::Point()); } @@ -198,7 +198,7 @@ { return [NSString stringWithFormat:@"<%@: %p; count = %lu; bounds = %@>", NSStringFromClass([self class]), (void *)self, (unsigned long)[self pointCount], - MGLStringFromCoordinateBounds(self.overlayBounds)]; + MLNStringFromCoordinateBounds(self.overlayBounds)]; } @end diff --git a/platform/ios/platform/darwin/src/MGLMultiPoint_Private.h b/platform/ios/platform/darwin/src/MLNMultiPoint_Private.h similarity index 53% rename from platform/ios/platform/darwin/src/MGLMultiPoint_Private.h rename to platform/ios/platform/darwin/src/MLNMultiPoint_Private.h index a9b4b72ca..f27d96b63 100644 --- a/platform/ios/platform/darwin/src/MGLMultiPoint_Private.h +++ b/platform/ios/platform/darwin/src/MLNMultiPoint_Private.h @@ -1,6 +1,6 @@ -#import "MGLMultiPoint.h" +#import "MLNMultiPoint.h" -#import "MGLGeometry.h" +#import "MLNGeometry.h" #import #import @@ -11,35 +11,35 @@ NS_ASSUME_NONNULL_BEGIN -@class MGLPolygon; -@class MGLPolyline; +@class MLNPolygon; +@class MLNPolyline; -@protocol MGLMultiPointDelegate; +@protocol MLNMultiPointDelegate; -@interface MGLMultiPoint (Private) +@interface MLNMultiPoint (Private) - (instancetype)initWithCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count; -- (BOOL)intersectsOverlayBounds:(MGLCoordinateBounds)overlayBounds; +- (BOOL)intersectsOverlayBounds:(MLNCoordinateBounds)overlayBounds; /** Constructs a shape annotation object, asking the delegate for style values. */ -- (mbgl::Annotation)annotationObjectWithDelegate:(id )delegate; +- (mbgl::Annotation)annotationObjectWithDelegate:(id )delegate; @end -/** An object that tells the MGLMultiPoint instance how to style itself. */ -@protocol MGLMultiPointDelegate +/** An object that tells the MLNMultiPoint instance how to style itself. */ +@protocol MLNMultiPointDelegate /** Returns the fill alpha value for the given annotation. */ -- (double)alphaForShapeAnnotation:(MGLShape *)annotation; +- (double)alphaForShapeAnnotation:(MLNShape *)annotation; /** Returns the stroke color object for the given annotation. */ -- (mbgl::Color)strokeColorForShapeAnnotation:(MGLShape *)annotation; +- (mbgl::Color)strokeColorForShapeAnnotation:(MLNShape *)annotation; /** Returns the fill color object for the given annotation. */ -- (mbgl::Color)fillColorForPolygonAnnotation:(MGLPolygon *)annotation; +- (mbgl::Color)fillColorForPolygonAnnotation:(MLNPolygon *)annotation; /** Returns the stroke width object for the given annotation. */ -- (CGFloat)lineWidthForPolylineAnnotation:(MGLPolyline *)annotation; +- (CGFloat)lineWidthForPolylineAnnotation:(MLNPolyline *)annotation; @end diff --git a/platform/ios/platform/darwin/src/MGLNetworkConfiguration.h b/platform/ios/platform/darwin/src/MLNNetworkConfiguration.h similarity index 66% rename from platform/ios/platform/darwin/src/MGLNetworkConfiguration.h rename to platform/ios/platform/darwin/src/MLNNetworkConfiguration.h index d48513a7d..995766eb5 100644 --- a/platform/ios/platform/darwin/src/MGLNetworkConfiguration.h +++ b/platform/ios/platform/darwin/src/MLNNetworkConfiguration.h @@ -1,17 +1,17 @@ #import -#import "MGLFoundation.h" +#import "MLNFoundation.h" NS_ASSUME_NONNULL_BEGIN -@class MGLNetworkConfiguration; +@class MLNNetworkConfiguration; -@protocol MGLNetworkConfigurationDelegate +@protocol MLNNetworkConfigurationDelegate @optional /** :nodoc: - Provides an `NSURLSession` object for the specified `MGLNetworkConfiguration`. + Provides an `NSURLSession` object for the specified `MLNNetworkConfiguration`. This API should be considered experimental, likely to be removed or changed in future releases. @@ -23,27 +23,27 @@ NS_ASSUME_NONNULL_BEGIN and sessions created with a delegate that conforms to `NSURLSessionDataDelegate` are not supported at this time. */ -- (NSURLSession *)sessionForNetworkConfiguration:(MGLNetworkConfiguration *)configuration; +- (NSURLSession *)sessionForNetworkConfiguration:(MLNNetworkConfiguration *)configuration; @end /** - The `MGLNetworkConfiguration` object provides a global way to set a base + The `MLNNetworkConfiguration` object provides a global way to set a base `NSURLSessionConfiguration`, and other resources. */ -MGL_EXPORT -@interface MGLNetworkConfiguration : NSObject +MLN_EXPORT +@interface MLNNetworkConfiguration : NSObject /** :nodoc: - Delegate for the `MGLNetworkConfiguration` class. + Delegate for the `MLNNetworkConfiguration` class. */ -@property (nonatomic, weak) id delegate; +@property (nonatomic, weak) id delegate; /** - Returns the shared instance of the `MGLNetworkConfiguration` class. + Returns the shared instance of the `MLNNetworkConfiguration` class. */ -@property (class, nonatomic, readonly) MGLNetworkConfiguration *sharedManager; +@property (class, nonatomic, readonly) MLNNetworkConfiguration *sharedManager; /** The session configuration object that is used by the `NSURLSession` objects @@ -52,8 +52,8 @@ MGL_EXPORT If this property is set to nil or if no session configuration is provided this property is set to the default session configuration. - Assign this object before instantiating any `MGLMapView` object, or using - `MGLOfflineStorage` + Assign this object before instantiating any `MLNMapView` object, or using + `MLNOfflineStorage` @note `NSURLSession` objects store a copy of this configuration. Any further changes to mutable properties on this configuration object passed to a session’s initializer diff --git a/platform/ios/platform/darwin/src/MGLNetworkConfiguration.mm b/platform/ios/platform/darwin/src/MLNNetworkConfiguration.mm similarity index 82% rename from platform/ios/platform/darwin/src/MGLNetworkConfiguration.mm rename to platform/ios/platform/darwin/src/MLNNetworkConfiguration.mm index 97b0d4aa0..5091b5328 100644 --- a/platform/ios/platform/darwin/src/MGLNetworkConfiguration.mm +++ b/platform/ios/platform/darwin/src/MLNNetworkConfiguration.mm @@ -1,24 +1,24 @@ -#import "MGLNetworkConfiguration_Private.h" -#import "MGLLoggingConfiguration_Private.h" +#import "MLNNetworkConfiguration_Private.h" +#import "MLNLoggingConfiguration_Private.h" #if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR -#import "MGLSettings_Private.h" +#import "MLNSettings_Private.h" #endif -#import "MGLReachability.h" +#import "MLNReachability.h" -static NSString * const MGLStartTime = @"start_time"; -static NSString * const MGLResourceType = @"resource_type"; -NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace"; +static NSString * const MLNStartTime = @"start_time"; +static NSString * const MLNResourceType = @"resource_type"; +NSString * const kMLNDownloadPerformanceEvent = @"mobile.performance_trace"; -@interface MGLNetworkConfiguration () +@interface MLNNetworkConfiguration () @property (nonatomic, strong) NSMutableDictionary *events; -@property (nonatomic, weak) id metricsDelegate; +@property (nonatomic, weak) id metricsDelegate; @property (nonatomic) dispatch_queue_t eventsQueue; @end -@implementation MGLNetworkConfiguration +@implementation MLNNetworkConfiguration { NSURLSessionConfiguration *_sessionConfig; } @@ -35,7 +35,7 @@ NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace"; + (instancetype)sharedManager { static dispatch_once_t onceToken; - static MGLNetworkConfiguration *_sharedManager; + static MLNNetworkConfiguration *_sharedManager; dispatch_once(&onceToken, ^{ _sharedManager = [[self alloc] init]; }); @@ -50,7 +50,7 @@ NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace"; - (void)resetNativeNetworkManagerDelegate { // Tell core about our network integration. `delegate` here is not (yet) // intended to be set to nil, except for testing. - [MGLNativeNetworkManager sharedManager].delegate = self; + [MLNNativeNetworkManager sharedManager].delegate = self; } + (NSURLSessionConfiguration *)defaultSessionConfiguration { @@ -64,9 +64,9 @@ NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace"; return sessionConfiguration; } -// MARK: - MGLNativeNetworkDelegate +// MARK: - MLNNativeNetworkDelegate -- (NSURLSession *)sessionForNetworkManager:(MGLNativeNetworkManager *)networkManager { +- (NSURLSession *)sessionForNetworkManager:(MLNNativeNetworkManager *)networkManager { // Note: this method is NOT called on the main thread. NSURLSession *session; if ([self.delegate respondsToSelector:@selector(sessionForNetworkConfiguration:)]) { @@ -98,7 +98,7 @@ NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace"; - (void)setSessionConfiguration:(NSURLSessionConfiguration *)sessionConfiguration { @synchronized (self) { if (sessionConfiguration == nil) { - _sessionConfig = [MGLNetworkConfiguration defaultSessionConfiguration]; + _sessionConfig = [MLNNetworkConfiguration defaultSessionConfiguration]; } else { _sessionConfig = sessionConfiguration; } @@ -108,7 +108,7 @@ NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace"; - (void)startDownloadEvent:(NSString *)urlString type:(NSString *)resourceType { if (urlString && resourceType && ![self eventDictionaryForKey:urlString]) { NSDate *startDate = [NSDate date]; - [self setEventDictionary:@{ MGLStartTime: startDate, MGLResourceType: resourceType } + [self setEventDictionary:@{ MLNStartTime: startDate, MLNResourceType: resourceType } forKey:urlString]; } } @@ -122,11 +122,11 @@ NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace"; } - (void)debugLog:(NSString *)message { - MGLLogDebug(message); + MLNLogDebug(message); } - (void)errorLog:(NSString *)message { - MGLLogError(message); + MLNLogError(message); } // MARK: - Event management @@ -150,7 +150,7 @@ NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace"; { NSString *urlString = response.URL.relativePath; NSDictionary *parameters = [self eventDictionaryForKey:urlString]; - NSDate *startDate = [parameters objectForKey:MGLStartTime]; + NSDate *startDate = [parameters objectForKey:MLNStartTime]; NSDate *endDate = [NSDate date]; NSTimeInterval elapsedTime = [endDate timeIntervalSinceDate:startDate]; NSDateFormatter* iso8601Formatter = [[NSDateFormatter alloc] init]; @@ -159,14 +159,14 @@ NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace"; NSMutableArray *attributes = [NSMutableArray array]; [attributes addObject:@{ @"name" : @"requestUrl" , @"value" : urlString }]; - [attributes addObject:@{ @"name" : MGLResourceType , @"value" : [parameters objectForKey:MGLResourceType] }]; + [attributes addObject:@{ @"name" : MLNResourceType , @"value" : [parameters objectForKey:MLNResourceType] }]; if ([response isKindOfClass:[NSHTTPURLResponse class]]) { NSInteger responseCode = [(NSHTTPURLResponse *)response statusCode]; [attributes addObject:@{ @"name" : @"responseCode", @"value" : @(responseCode)}]; } - BOOL isWIFIOn = [[MGLReachability reachabilityWithHostName:response.URL.host] isReachableViaWiFi]; + BOOL isWIFIOn = [[MLNReachability reachabilityWithHostName:response.URL.host] isReachableViaWiFi]; [attributes addObject:@{ @"name" : @"wifiOn", @"value" : @(isWIFIOn)}]; if (action) { @@ -176,7 +176,7 @@ NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace"; double elapsedTimeInMS = elapsedTime * 1000.0; return @{ - @"event" : kMGLDownloadPerformanceEvent, + @"event" : kMLNDownloadPerformanceEvent, @"created" : createdDate, @"sessionId" : [NSUUID UUID].UUIDString, @"counters" : @[ @{ @"name" : @"elapsedMS" , @"value" : @(elapsedTimeInMS) } ], @@ -210,14 +210,14 @@ NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace"; @end -@implementation MGLNetworkConfiguration (ForTesting) +@implementation MLNNetworkConfiguration (ForTesting) + (void)testing_clearNativeNetworkManagerDelegate { - [MGLNativeNetworkManager sharedManager].delegate = nil; + [MLNNativeNetworkManager sharedManager].delegate = nil; } + (id)testing_nativeNetworkManagerDelegate { - return [MGLNativeNetworkManager sharedManager].delegate; + return [MLNNativeNetworkManager sharedManager].delegate; } @end diff --git a/platform/ios/platform/darwin/src/MGLNetworkConfiguration_Private.h b/platform/ios/platform/darwin/src/MLNNetworkConfiguration_Private.h similarity index 60% rename from platform/ios/platform/darwin/src/MGLNetworkConfiguration_Private.h rename to platform/ios/platform/darwin/src/MLNNetworkConfiguration_Private.h index 43e184a63..4d2478707 100644 --- a/platform/ios/platform/darwin/src/MGLNetworkConfiguration_Private.h +++ b/platform/ios/platform/darwin/src/MLNNetworkConfiguration_Private.h @@ -1,21 +1,21 @@ -#import "MGLNetworkConfiguration.h" +#import "MLNNetworkConfiguration.h" #include NS_ASSUME_NONNULL_BEGIN -@class MGLNetworkConfiguration; -@protocol MGLNetworkConfigurationMetricsDelegate +@class MLNNetworkConfiguration; +@protocol MLNNetworkConfigurationMetricsDelegate -- (void)networkConfiguration:(MGLNetworkConfiguration *)networkConfiguration didGenerateMetricEvent:(NSDictionary *)metricEvent; +- (void)networkConfiguration:(MLNNetworkConfiguration *)networkConfiguration didGenerateMetricEvent:(NSDictionary *)metricEvent; @end -extern NSString * const kMGLDownloadPerformanceEvent; +extern NSString * const kMLNDownloadPerformanceEvent; -@interface MGLNetworkConfiguration (Private) +@interface MLNNetworkConfiguration (Private) @property (nonatomic, strong) NSMutableDictionary *events; -@property (nonatomic, weak) id metricsDelegate; +@property (nonatomic, weak) id metricsDelegate; - (void)resetNativeNetworkManagerDelegate; - (void)startDownloadEvent:(NSString *)urlString type:(NSString *)resourceType; diff --git a/platform/ios/platform/darwin/src/MGLOfflinePack.h b/platform/ios/platform/darwin/src/MLNOfflinePack.h similarity index 76% rename from platform/ios/platform/darwin/src/MGLOfflinePack.h rename to platform/ios/platform/darwin/src/MLNOfflinePack.h index 76d8c308b..9b871ad4e 100644 --- a/platform/ios/platform/darwin/src/MGLOfflinePack.h +++ b/platform/ios/platform/darwin/src/MLNOfflinePack.h @@ -1,63 +1,63 @@ #import -#import "MGLFoundation.h" -#import "MGLTypes.h" -#import "MGLOfflineRegion.h" +#import "MLNFoundation.h" +#import "MLNTypes.h" +#import "MLNOfflineRegion.h" NS_ASSUME_NONNULL_BEGIN -FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLInvalidOfflinePackException; +FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNInvalidOfflinePackException; /** The state an offline pack is currently in. */ -typedef NS_ENUM (NSInteger, MGLOfflinePackState) { +typedef NS_ENUM (NSInteger, MLNOfflinePackState) { /** It is unknown whether the pack is inactive, active, or complete. This is the initial state of a pack. The state of a pack becomes known by - the time the shared `MGLOfflineStorage` object sends the first - `MGLOfflinePackProgressChangedNotification` about the pack. For inactive + the time the shared `MLNOfflineStorage` object sends the first + `MLNOfflinePackProgressChangedNotification` about the pack. For inactive packs, you must explicitly request a progress update using the - `-[MGLOfflinePack requestProgress]` method. + `-[MLNOfflinePack requestProgress]` method. - An invalid pack always has a state of `MGLOfflinePackStateInvalid`, never - `MGLOfflinePackStateUnknown`. + An invalid pack always has a state of `MLNOfflinePackStateInvalid`, never + `MLNOfflinePackStateUnknown`. */ - MGLOfflinePackStateUnknown = 0, + MLNOfflinePackStateUnknown = 0, /** The pack is incomplete and is not currently downloading. This is the initial state of a pack that is created using the - `-[MGLOfflineStorage addPackForRegion:withContext:completionHandler:]` - method, as well as after the `-[MGLOfflinePack suspend]` method is + `-[MLNOfflineStorage addPackForRegion:withContext:completionHandler:]` + method, as well as after the `-[MLNOfflinePack suspend]` method is called. */ - MGLOfflinePackStateInactive = 1, + MLNOfflinePackStateInactive = 1, /** The pack is incomplete and is currently downloading. - This is the state of a pack after the `-[MGLOfflinePack resume]` method is + This is the state of a pack after the `-[MLNOfflinePack resume]` method is called. */ - MGLOfflinePackStateActive = 2, + MLNOfflinePackStateActive = 2, /** The pack has downloaded to completion. */ - MGLOfflinePackStateComplete = 3, + MLNOfflinePackStateComplete = 3, /** The pack has been removed using the - `-[MGLOfflineStorage removePack:withCompletionHandler:]` method. Sending + `-[MLNOfflineStorage removePack:withCompletionHandler:]` method. Sending any message to the pack will raise an exception. */ - MGLOfflinePackStateInvalid = 4, + MLNOfflinePackStateInvalid = 4, }; /** A structure containing information about an offline pack’s current download progress. */ -typedef struct __attribute__((objc_boxable)) MGLOfflinePackProgress { +typedef struct __attribute__((objc_boxable)) MLNOfflinePackProgress { /** The number of resources, including tiles, that have been completely downloaded and are ready to use offline. @@ -94,37 +94,37 @@ typedef struct __attribute__((objc_boxable)) MGLOfflinePackProgress { upper bound. */ uint64_t maximumResourcesExpected; -} MGLOfflinePackProgress; +} MLNOfflinePackProgress; /** - An `MGLOfflinePack` represents a collection of resources necessary for viewing + An `MLNOfflinePack` represents a collection of resources necessary for viewing a region offline to a local database. - To create an instance of `MGLOfflinePack`, use the - `+[MGLOfflineStorage addPackForRegion:withContext:completionHandler:]` method. - A pack created using `-[MGLOfflinePack init]` is immediately invalid. + To create an instance of `MLNOfflinePack`, use the + `+[MLNOfflineStorage addPackForRegion:withContext:completionHandler:]` method. + A pack created using `-[MLNOfflinePack init]` is immediately invalid. ### Example ```swift - MGLOfflineStorage.shared.addPack(for: region, withContext: context) { (pack, error) in + MLNOfflineStorage.shared.addPack(for: region, withContext: context) { (pack, error) in guard let pack = pack else { // If adding the pack fails, log an error to console. print("Error:", error?.localizedDescription ?? "unknown error adding pack at \(#file)(\(#line)) in \(#function)") return } - // Start an MGLOfflinePack download + // Start an MLNOfflinePack download pack.resume() } ``` */ -MGL_EXPORT -@interface MGLOfflinePack : NSObject +MLN_EXPORT +@interface MLNOfflinePack : NSObject /** The region for which the pack manages resources. */ -@property (nonatomic, readonly) id region; +@property (nonatomic, readonly) id region; /** Arbitrary data stored alongside the downloaded resources. @@ -157,14 +157,14 @@ MGL_EXPORT The pack’s current state. The state of an inactive or completed pack is computed lazily and is set to - `MGLOfflinePackStateUnknown` by default. To request the pack’s status, use the + `MLNOfflinePackStateUnknown` by default. To request the pack’s status, use the `-requestProgress` method. To get notified when the state becomes known and when it changes, observe KVO change notifications on this pack’s `state` key path. Alternatively, you can add an observer for - `MGLOfflinePackProgressChangedNotification`s about this pack that come from the + `MLNOfflinePackProgressChangedNotification`s about this pack that come from the default notification center. */ -@property (nonatomic, readonly) MGLOfflinePackState state; +@property (nonatomic, readonly) MLNOfflinePackState state; /** The pack’s current progress. @@ -174,10 +174,10 @@ MGL_EXPORT `-requestProgress` method. To get notified when the progress becomes known and when it changes, observe KVO change notifications on this pack’s `state` key path. Alternatively, you can add an observer for - `MGLOfflinePackProgressChangedNotification`s about this pack that come from the + `MLNOfflinePackProgressChangedNotification`s about this pack that come from the default notification center. */ -@property (nonatomic, readonly) MGLOfflinePackProgress progress; +@property (nonatomic, readonly) MLNOfflinePackProgress progress; /** Resumes downloading if the pack is inactive. @@ -210,9 +210,9 @@ MGL_EXPORT The state and progress of an inactive or completed pack are computed lazily. If you need the state or progress of a pack whose `state` property is currently - set to `MGLOfflinePackStateUnknown`, observe KVO change notifications on this + set to `MLNOfflinePackStateUnknown`, observe KVO change notifications on this pack’s `state` key path, then call this method. Alternatively, you can add an - observer for `MGLOfflinePackProgressChangedNotification` about this pack that + observer for `MLNOfflinePackProgressChangedNotification` about this pack that come from the default notification center. */ - (void)requestProgress; diff --git a/platform/ios/platform/darwin/src/MGLOfflinePack.mm b/platform/ios/platform/darwin/src/MLNOfflinePack.mm similarity index 59% rename from platform/ios/platform/darwin/src/MGLOfflinePack.mm rename to platform/ios/platform/darwin/src/MLNOfflinePack.mm index e6e61d3f5..b68f831f4 100644 --- a/platform/ios/platform/darwin/src/MGLOfflinePack.mm +++ b/platform/ios/platform/darwin/src/MLNOfflinePack.mm @@ -1,72 +1,72 @@ -#import "MGLOfflinePack_Private.h" +#import "MLNOfflinePack_Private.h" -#import "MGLOfflineStorage_Private.h" -#import "MGLOfflineRegion_Private.h" -#import "MGLTilePyramidOfflineRegion.h" -#import "MGLTilePyramidOfflineRegion_Private.h" -#import "MGLShapeOfflineRegion.h" -#import "MGLShapeOfflineRegion_Private.h" -#import "MGLLoggingConfiguration_Private.h" +#import "MLNOfflineStorage_Private.h" +#import "MLNOfflineRegion_Private.h" +#import "MLNTilePyramidOfflineRegion.h" +#import "MLNTilePyramidOfflineRegion_Private.h" +#import "MLNShapeOfflineRegion.h" +#import "MLNShapeOfflineRegion_Private.h" +#import "MLNLoggingConfiguration_Private.h" -#import "NSValue+MGLAdditions.h" +#import "NSValue+MLNAdditions.h" #include #include -const MGLExceptionName MGLInvalidOfflinePackException = @"MGLInvalidOfflinePackException"; +const MLNExceptionName MLNInvalidOfflinePackException = @"MLNInvalidOfflinePackException"; /** Assert that the current offline pack is valid. This macro should be used at the beginning of any public-facing instance method - of `MGLOfflinePack`. For private methods, an assertion is more appropriate. + of `MLNOfflinePack`. For private methods, an assertion is more appropriate. */ -#define MGLAssertOfflinePackIsValid() \ +#define MLNAssertOfflinePackIsValid() \ do { \ - if (_state == MGLOfflinePackStateInvalid) { \ - [NSException raise:MGLInvalidOfflinePackException \ + if (_state == MLNOfflinePackStateInvalid) { \ + [NSException raise:MLNInvalidOfflinePackException \ format: \ - @"-[MGLOfflineStorage removePack:withCompletionHandler:] has been called " \ - @"on this instance of MGLOfflinePack, rendering it invalid. It is an " \ + @"-[MLNOfflineStorage removePack:withCompletionHandler:] has been called " \ + @"on this instance of MLNOfflinePack, rendering it invalid. It is an " \ @"error to send any message to this pack."]; \ } \ } while (NO); -@interface MGLTilePyramidOfflineRegion () +@interface MLNTilePyramidOfflineRegion () @end -@interface MGLShapeOfflineRegion () +@interface MLNShapeOfflineRegion () @end class MBGLOfflineRegionObserver : public mbgl::OfflineRegionObserver { public: - MBGLOfflineRegionObserver(MGLOfflinePack *pack_) : pack(pack_) {} + MBGLOfflineRegionObserver(MLNOfflinePack *pack_) : pack(pack_) {} void statusChanged(mbgl::OfflineRegionStatus status) override; void responseError(mbgl::Response::Error error) override; void mapboxTileCountLimitExceeded(uint64_t limit) override; private: - __weak MGLOfflinePack *pack = nullptr; + __weak MLNOfflinePack *pack = nullptr; }; -@interface MGLOfflinePack () +@interface MLNOfflinePack () @property (nonatomic, nullable, readwrite) mbgl::OfflineRegion *mbglOfflineRegion; -@property (nonatomic, readwrite) MGLOfflinePackProgress progress; +@property (nonatomic, readwrite) MLNOfflinePackProgress progress; @end -@implementation MGLOfflinePack { +@implementation MLNOfflinePack { BOOL _isSuspending; std::shared_ptr _mbglDatabaseFileSource; } - (instancetype)init { - MGLLogInfo(@"Calling this initializer is not allowed."); + MLNLogInfo(@"Calling this initializer is not allowed."); if (self = [super init]) { - _state = MGLOfflinePackStateInvalid; - NSLog(@"%s called; did you mean to call +[MGLOfflineStorage addPackForRegion:withContext:completionHandler:] instead?", __PRETTY_FUNCTION__); + _state = MLNOfflinePackStateInvalid; + NSLog(@"%s called; did you mean to call +[MLNOfflineStorage addPackForRegion:withContext:completionHandler:] instead?", __PRETTY_FUNCTION__); } return self; } @@ -74,62 +74,62 @@ private: - (instancetype)initWithMBGLRegion:(mbgl::OfflineRegion *)region { if (self = [super init]) { _mbglOfflineRegion = region; - _state = MGLOfflinePackStateUnknown; + _state = MLNOfflinePackStateUnknown; - _mbglDatabaseFileSource = [[MGLOfflineStorage sharedOfflineStorage] mbglDatabaseFileSource]; + _mbglDatabaseFileSource = [[MLNOfflineStorage sharedOfflineStorage] mbglDatabaseFileSource]; _mbglDatabaseFileSource->setOfflineRegionObserver(*_mbglOfflineRegion, std::make_unique(self)); } return self; } - (void)dealloc { - MGLAssert(_state == MGLOfflinePackStateInvalid, @"MGLOfflinePack was not invalided prior to deallocation."); + MLNAssert(_state == MLNOfflinePackStateInvalid, @"MLNOfflinePack was not invalided prior to deallocation."); } -- (id )region { - MGLAssertOfflinePackIsValid(); +- (id )region { + MLNAssertOfflinePackIsValid(); const mbgl::OfflineRegionDefinition ®ionDefinition = _mbglOfflineRegion->getDefinition(); - MGLAssert([MGLTilePyramidOfflineRegion conformsToProtocol:@protocol(MGLOfflineRegion_Private)], @"MGLTilePyramidOfflineRegion should conform to MGLOfflineRegion_Private."); - MGLAssert([MGLShapeOfflineRegion conformsToProtocol:@protocol(MGLOfflineRegion_Private)], @"MGLShapeOfflineRegion should conform to MGLOfflineRegion_Private."); + MLNAssert([MLNTilePyramidOfflineRegion conformsToProtocol:@protocol(MLNOfflineRegion_Private)], @"MLNTilePyramidOfflineRegion should conform to MLNOfflineRegion_Private."); + MLNAssert([MLNShapeOfflineRegion conformsToProtocol:@protocol(MLNOfflineRegion_Private)], @"MLNShapeOfflineRegion should conform to MLNOfflineRegion_Private."); return regionDefinition.match( [&] (const mbgl::OfflineTilePyramidRegionDefinition def){ - return (id )[[MGLTilePyramidOfflineRegion alloc] initWithOfflineRegionDefinition:def]; + return (id )[[MLNTilePyramidOfflineRegion alloc] initWithOfflineRegionDefinition:def]; }, [&] (const mbgl::OfflineGeometryRegionDefinition& def){ - return (id )[[MGLShapeOfflineRegion alloc] initWithOfflineRegionDefinition:def]; + return (id )[[MLNShapeOfflineRegion alloc] initWithOfflineRegionDefinition:def]; }); } - (NSData *)context { - MGLAssertOfflinePackIsValid(); + MLNAssertOfflinePackIsValid(); const mbgl::OfflineRegionMetadata &metadata = _mbglOfflineRegion->getMetadata(); return [NSData dataWithBytes:&metadata[0] length:metadata.size()]; } - (void)setContext:(NSData *)context completionHandler:(void (^_Nullable)(NSError * _Nullable error))completion { - MGLAssertOfflinePackIsValid(); + MLNAssertOfflinePackIsValid(); mbgl::OfflineRegionMetadata metadata(context.length); [context getBytes:&metadata[0] length:metadata.size()]; [self willChangeValueForKey:@"context"]; - __weak MGLOfflinePack *weakSelf = self; + __weak MLNOfflinePack *weakSelf = self; _mbglDatabaseFileSource->updateOfflineMetadata(_mbglOfflineRegion->getID(), metadata, [&, completion, weakSelf](mbgl::expected mbglOfflineRegionMetadata) { NSError *error; if (!mbglOfflineRegionMetadata) { NSString *errorDescription = @(mbgl::util::toString(mbglOfflineRegionMetadata.error()).c_str()); - error = [NSError errorWithDomain:MGLErrorDomain code:MGLErrorCodeModifyingOfflineStorageFailed userInfo:errorDescription ? @{ + error = [NSError errorWithDomain:MLNErrorDomain code:MLNErrorCodeModifyingOfflineStorageFailed userInfo:errorDescription ? @{ NSLocalizedDescriptionKey: errorDescription, } : nil]; } dispatch_async(dispatch_get_main_queue(), [&, completion, weakSelf, error](void) { [weakSelf reloadWithCompletionHandler:^(NSError * _Nullable reloadingError) { - MGLOfflinePack *strongSelf = weakSelf; + MLNOfflinePack *strongSelf = weakSelf; [strongSelf didChangeValueForKey:@"context"]; if (completion) { completion(error ?: reloadingError); @@ -141,11 +141,11 @@ private: - (void)reloadWithCompletionHandler:(void (^)(NSError * _Nullable error))completion { auto regionID = _mbglOfflineRegion->getID(); - MGLOfflineStorage *sharedOfflineStorage = [MGLOfflineStorage sharedOfflineStorage]; - __weak MGLOfflinePack *weakSelf = self; - [sharedOfflineStorage getPacksWithCompletionHandler:^(NSArray *packs, __unused NSError * _Nullable error) { - MGLOfflinePack *strongSelf = weakSelf; - for (MGLOfflinePack *pack in packs) { + MLNOfflineStorage *sharedOfflineStorage = [MLNOfflineStorage sharedOfflineStorage]; + __weak MLNOfflinePack *weakSelf = self; + [sharedOfflineStorage getPacksWithCompletionHandler:^(NSArray *packs, __unused NSError * _Nullable error) { + MLNOfflinePack *strongSelf = weakSelf; + for (MLNOfflinePack *pack in packs) { if (pack.mbglOfflineRegion->getID() == regionID) { strongSelf.mbglOfflineRegion = pack.mbglOfflineRegion; } @@ -156,20 +156,20 @@ private: } - (void)resume { - MGLLogInfo(@"Resuming pack download."); - MGLAssertOfflinePackIsValid(); + MLNLogInfo(@"Resuming pack download."); + MLNAssertOfflinePackIsValid(); - self.state = MGLOfflinePackStateActive; + self.state = MLNOfflinePackStateActive; _mbglDatabaseFileSource->setOfflineRegionDownloadState(*_mbglOfflineRegion, mbgl::OfflineRegionDownloadState::Active); } - (void)suspend { - MGLLogInfo(@"Suspending pack download."); - MGLAssertOfflinePackIsValid(); + MLNLogInfo(@"Suspending pack download."); + MLNAssertOfflinePackIsValid(); - if (self.state == MGLOfflinePackStateActive) { - self.state = MGLOfflinePackStateInactive; + if (self.state == MLNOfflinePackStateActive) { + self.state = MLNOfflinePackStateInactive; _isSuspending = YES; } @@ -177,12 +177,12 @@ private: } - (void)invalidate { - MGLLogInfo(@"Invalidating pack."); - MGLAssert(_state != MGLOfflinePackStateInvalid, @"Cannot invalidate an already invalid offline pack."); - MGLAssert(self.mbglOfflineRegion, @"Should have a valid region"); + MLNLogInfo(@"Invalidating pack."); + MLNAssert(_state != MLNOfflinePackStateInvalid, @"Cannot invalidate an already invalid offline pack."); + MLNAssert(self.mbglOfflineRegion, @"Should have a valid region"); @synchronized (self) { - self.state = MGLOfflinePackStateInvalid; + self.state = MLNOfflinePackStateInvalid; if (self.mbglOfflineRegion) { _mbglDatabaseFileSource->setOfflineRegionObserver(*self.mbglOfflineRegion, nullptr); } @@ -190,34 +190,34 @@ private: } } -- (void)setState:(MGLOfflinePackState)state { - MGLLogDebug(@"Setting state: %ld", (long)state); +- (void)setState:(MLNOfflinePackState)state { + MLNLogDebug(@"Setting state: %ld", (long)state); if (!self.mbglOfflineRegion) { // A progress update has arrived after the call to - // -[MGLOfflineStorage removePack:withCompletionHandler:] but before the + // -[MLNOfflineStorage removePack:withCompletionHandler:] but before the // removal is complete and the completion handler is called. - MGLAssert(_state == MGLOfflinePackStateInvalid, @"A valid MGLOfflinePack has no mbgl::OfflineRegion."); + MLNAssert(_state == MLNOfflinePackStateInvalid, @"A valid MLNOfflinePack has no mbgl::OfflineRegion."); return; } - MGLAssert(_state != MGLOfflinePackStateInvalid, @"Cannot change the state of an invalid offline pack."); + MLNAssert(_state != MLNOfflinePackStateInvalid, @"Cannot change the state of an invalid offline pack."); - if (!_isSuspending || state != MGLOfflinePackStateActive) { + if (!_isSuspending || state != MLNOfflinePackStateActive) { _isSuspending = NO; _state = state; } } - (void)requestProgress { - MGLLogInfo(@"Requesting pack progress."); - MGLAssertOfflinePackIsValid(); + MLNLogInfo(@"Requesting pack progress."); + MLNAssertOfflinePackIsValid(); - __weak MGLOfflinePack *weakSelf = self; + __weak MLNOfflinePack *weakSelf = self; _mbglDatabaseFileSource->getOfflineRegionStatus(*_mbglOfflineRegion, [&, weakSelf](mbgl::expected status) { if (status) { mbgl::OfflineRegionStatus checkedStatus = *status; dispatch_async(dispatch_get_main_queue(), ^{ - MGLOfflinePack *strongSelf = weakSelf; + MLNOfflinePack *strongSelf = weakSelf; [strongSelf offlineRegionStatusDidChange:checkedStatus]; }); } @@ -225,15 +225,15 @@ private: } - (void)offlineRegionStatusDidChange:(mbgl::OfflineRegionStatus)status { - MGLAssert(_state != MGLOfflinePackStateInvalid, @"Cannot change update progress of an invalid offline pack."); + MLNAssert(_state != MLNOfflinePackStateInvalid, @"Cannot change update progress of an invalid offline pack."); switch (status.downloadState) { case mbgl::OfflineRegionDownloadState::Inactive: - self.state = status.complete() ? MGLOfflinePackStateComplete : MGLOfflinePackStateInactive; + self.state = status.complete() ? MLNOfflinePackStateComplete : MLNOfflinePackStateInactive; break; case mbgl::OfflineRegionDownloadState::Active: - self.state = MGLOfflinePackStateActive; + self.state = MLNOfflinePackStateActive; break; } @@ -241,7 +241,7 @@ private: return; } - MGLOfflinePackProgress progress; + MLNOfflinePackProgress progress; progress.countOfResourcesCompleted = status.completedResourceCount; progress.countOfBytesCompleted = status.completedResourceSize; progress.countOfTilesCompleted = status.completedTileCount; @@ -250,54 +250,54 @@ private: progress.maximumResourcesExpected = status.requiredResourceCountIsPrecise ? status.requiredResourceCount : UINT64_MAX; self.progress = progress; - NSDictionary *userInfo = @{MGLOfflinePackUserInfoKeyState: @(self.state), - MGLOfflinePackUserInfoKeyProgress: [NSValue valueWithMGLOfflinePackProgress:progress]}; + NSDictionary *userInfo = @{MLNOfflinePackUserInfoKeyState: @(self.state), + MLNOfflinePackUserInfoKeyProgress: [NSValue valueWithMLNOfflinePackProgress:progress]}; NSNotificationCenter *noteCenter = [NSNotificationCenter defaultCenter]; - [noteCenter postNotificationName:MGLOfflinePackProgressChangedNotification + [noteCenter postNotificationName:MLNOfflinePackProgressChangedNotification object:self userInfo:userInfo]; } - (void)didReceiveError:(NSError *)error { - MGLLogError(@"Error: %@", error.localizedDescription); - MGLLogInfo(@"Notifying about pack error."); + MLNLogError(@"Error: %@", error.localizedDescription); + MLNLogInfo(@"Notifying about pack error."); - NSDictionary *userInfo = @{ MGLOfflinePackUserInfoKeyError: error }; + NSDictionary *userInfo = @{ MLNOfflinePackUserInfoKeyError: error }; NSNotificationCenter *noteCenter = [NSNotificationCenter defaultCenter]; - [noteCenter postNotificationName:MGLOfflinePackErrorNotification + [noteCenter postNotificationName:MLNOfflinePackErrorNotification object:self userInfo:userInfo]; } - (void)didReceiveMaximumAllowedMapboxTiles:(uint64_t)limit { - MGLLogInfo(@"Notifying reached maximum allowed Mapbox tiles: %lu", (unsigned long)limit); - NSDictionary *userInfo = @{ MGLOfflinePackUserInfoKeyMaximumCount: @(limit) }; + MLNLogInfo(@"Notifying reached maximum allowed Mapbox tiles: %lu", (unsigned long)limit); + NSDictionary *userInfo = @{ MLNOfflinePackUserInfoKeyMaximumCount: @(limit) }; NSNotificationCenter *noteCenter = [NSNotificationCenter defaultCenter]; - [noteCenter postNotificationName:MGLOfflinePackMaximumMapboxTilesReachedNotification + [noteCenter postNotificationName:MLNOfflinePackMaximumMapboxTilesReachedNotification object:self userInfo:userInfo]; } -NSError *MGLErrorFromResponseError(mbgl::Response::Error error) { - NSInteger errorCode = MGLErrorCodeUnknown; +NSError *MLNErrorFromResponseError(mbgl::Response::Error error) { + NSInteger errorCode = MLNErrorCodeUnknown; switch (error.reason) { case mbgl::Response::Error::Reason::NotFound: - errorCode = MGLErrorCodeNotFound; + errorCode = MLNErrorCodeNotFound; break; case mbgl::Response::Error::Reason::Server: - errorCode = MGLErrorCodeBadServerResponse; + errorCode = MLNErrorCodeBadServerResponse; break; case mbgl::Response::Error::Reason::Connection: - errorCode = MGLErrorCodeConnectionFailed; + errorCode = MLNErrorCodeConnectionFailed; break; default: break; } - return [NSError errorWithDomain:MGLErrorDomain code:errorCode userInfo:@{ + return [NSError errorWithDomain:MLNErrorDomain code:errorCode userInfo:@{ NSLocalizedFailureReasonErrorKey: @(error.message.c_str()) }]; } @@ -305,21 +305,21 @@ NSError *MGLErrorFromResponseError(mbgl::Response::Error error) { @end void MBGLOfflineRegionObserver::statusChanged(mbgl::OfflineRegionStatus status) { - __weak MGLOfflinePack *weakPack = pack; + __weak MLNOfflinePack *weakPack = pack; dispatch_async(dispatch_get_main_queue(), ^{ [weakPack offlineRegionStatusDidChange:status]; }); } void MBGLOfflineRegionObserver::responseError(mbgl::Response::Error error) { - __weak MGLOfflinePack *weakPack = pack; + __weak MLNOfflinePack *weakPack = pack; dispatch_async(dispatch_get_main_queue(), ^{ - [weakPack didReceiveError:MGLErrorFromResponseError(error)]; + [weakPack didReceiveError:MLNErrorFromResponseError(error)]; }); } void MBGLOfflineRegionObserver::mapboxTileCountLimitExceeded(uint64_t limit) { - __weak MGLOfflinePack *weakPack = pack; + __weak MLNOfflinePack *weakPack = pack; dispatch_async(dispatch_get_main_queue(), ^{ [weakPack didReceiveMaximumAllowedMapboxTiles:limit]; }); diff --git a/platform/ios/platform/darwin/src/MGLOfflinePack_Private.h b/platform/ios/platform/darwin/src/MLNOfflinePack_Private.h similarity index 76% rename from platform/ios/platform/darwin/src/MGLOfflinePack_Private.h rename to platform/ios/platform/darwin/src/MLNOfflinePack_Private.h index ea3fb2da9..6f3080fa7 100644 --- a/platform/ios/platform/darwin/src/MGLOfflinePack_Private.h +++ b/platform/ios/platform/darwin/src/MLNOfflinePack_Private.h @@ -1,14 +1,14 @@ -#import "MGLOfflinePack.h" +#import "MLNOfflinePack.h" #include NS_ASSUME_NONNULL_BEGIN -@interface MGLOfflinePack (Private) +@interface MLNOfflinePack (Private) @property (nonatomic, nullable) mbgl::OfflineRegion *mbglOfflineRegion; -@property (nonatomic, readwrite) MGLOfflinePackState state; +@property (nonatomic, readwrite) MLNOfflinePackState state; - (instancetype)initWithMBGLRegion:(mbgl::OfflineRegion *)region; diff --git a/platform/ios/platform/darwin/src/MGLOfflineRegion.h b/platform/ios/platform/darwin/src/MLNOfflineRegion.h similarity index 81% rename from platform/ios/platform/darwin/src/MGLOfflineRegion.h rename to platform/ios/platform/darwin/src/MLNOfflineRegion.h index 2f0684f24..bf0c0b009 100644 --- a/platform/ios/platform/darwin/src/MGLOfflineRegion.h +++ b/platform/ios/platform/darwin/src/MLNOfflineRegion.h @@ -3,10 +3,10 @@ NS_ASSUME_NONNULL_BEGIN /** - An object conforming to the `MGLOfflineRegion` protocol determines which - resources are required by an `MGLOfflinePack` object. + An object conforming to the `MLNOfflineRegion` protocol determines which + resources are required by an `MLNOfflinePack` object. */ -@protocol MGLOfflineRegion +@protocol MLNOfflineRegion /** URL of the style whose resources are required for offline viewing. @@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN Ideographic glyphs make up the majority of downloaded font data, but it is possible to configure the renderer to use locally installed fonts instead of relying on fonts downloaded as part of the offline pack. - See `MGLIdeographicFontFamilyName` setting. Also, for regions outside of + See `MLNIdeographicFontFamilyName` setting. Also, for regions outside of China, Japan, and Korea, these glyphs will rarely appear for non-CJK users. By default, this property is set to `NO`, so that the offline pack will diff --git a/platform/ios/platform/darwin/src/MGLOfflineRegion_Private.h b/platform/ios/platform/darwin/src/MLNOfflineRegion_Private.h similarity index 83% rename from platform/ios/platform/darwin/src/MGLOfflineRegion_Private.h rename to platform/ios/platform/darwin/src/MLNOfflineRegion_Private.h index 75a023bcb..d194b883f 100644 --- a/platform/ios/platform/darwin/src/MGLOfflineRegion_Private.h +++ b/platform/ios/platform/darwin/src/MLNOfflineRegion_Private.h @@ -1,12 +1,12 @@ #import -#import "MGLOfflineRegion.h" +#import "MLNOfflineRegion.h" #include NS_ASSUME_NONNULL_BEGIN -@protocol MGLOfflineRegion_Private +@protocol MLNOfflineRegion_Private /** Creates and returns a C++ offline region definition corresponding to the diff --git a/platform/ios/platform/darwin/src/MGLOfflineStorage.h b/platform/ios/platform/darwin/src/MLNOfflineStorage.h similarity index 82% rename from platform/ios/platform/darwin/src/MGLOfflineStorage.h rename to platform/ios/platform/darwin/src/MLNOfflineStorage.h index 503ac6f46..fbd257aec 100644 --- a/platform/ios/platform/darwin/src/MGLOfflineStorage.h +++ b/platform/ios/platform/darwin/src/MLNOfflineStorage.h @@ -1,26 +1,26 @@ #import -#import "MGLFoundation.h" -#import "MGLTypes.h" +#import "MLNFoundation.h" +#import "MLNTypes.h" NS_ASSUME_NONNULL_BEGIN -@class MGLOfflinePack; -@protocol MGLOfflineRegion; -@protocol MGLOfflineStorageDelegate; +@class MLNOfflinePack; +@protocol MLNOfflineRegion; +@protocol MLNOfflineStorageDelegate; /** - Posted by the shared `MGLOfflineStorage` object when an `MGLOfflinePack` + Posted by the shared `MLNOfflineStorage` object when an `MLNOfflinePack` object’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in the `progress` property changes. - The `object` is the `MGLOfflinePack` object whose progress changed. The + The `object` is the `MLNOfflinePack` object whose progress changed. The `userInfo` dictionary contains the pack’s current state in the - `MGLOfflinePackUserInfoKeyState` key and details about the pack’s current - progress in the `MGLOfflinePackUserInfoKeyProgress` key. You may also consult - the `MGLOfflinePack.state` and `MGLOfflinePack.progress` properties, which + `MLNOfflinePackUserInfoKeyState` key and details about the pack’s current + progress in the `MLNOfflinePackUserInfoKeyProgress` key. You may also consult + the `MLNOfflinePack.state` and `MLNOfflinePack.progress` properties, which provide the same values. If you only need to observe changes in a particular pack’s progress, you can @@ -32,76 +32,76 @@ NS_ASSUME_NONNULL_BEGIN Download an offline map example to learn how to calculate the progress of an offline download. */ -FOUNDATION_EXTERN MGL_EXPORT const NSNotificationName MGLOfflinePackProgressChangedNotification; +FOUNDATION_EXTERN MLN_EXPORT const NSNotificationName MLNOfflinePackProgressChangedNotification; /** - Posted by the shared `MGLOfflineStorage` object whenever an `MGLOfflinePack` + Posted by the shared `MLNOfflineStorage` object whenever an `MLNOfflinePack` object encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access. - The `object` is the `MGLOfflinePack` object that encountered the error. The + The `object` is the `MLNOfflinePack` object that encountered the error. The `userInfo` dictionary contains the error object in the - `MGLOfflinePackUserInfoKeyError` key. + `MLNOfflinePackUserInfoKeyError` key. */ -FOUNDATION_EXTERN MGL_EXPORT const NSNotificationName MGLOfflinePackErrorNotification; +FOUNDATION_EXTERN MLN_EXPORT const NSNotificationName MLNOfflinePackErrorNotification; /** - Posted by the shared `MGLOfflineStorage` object when the maximum number of + Posted by the shared `MLNOfflineStorage` object when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device. - The `object` is the `MGLOfflinePack` object that reached the tile limit in the + The `object` is the `MLNOfflinePack` object that reached the tile limit in the course of downloading. The `userInfo` dictionary contains the tile limit in the - `MGLOfflinePackUserInfoKeyMaximumCount` key. + `MLNOfflinePackUserInfoKeyMaximumCount` key. - Once this limit is reached, no instance of `MGLOfflinePack` can download + Once this limit is reached, no instance of `MLNOfflinePack` can download additional tiles from Mapbox APIs until already downloaded tiles are removed by - calling the `-[MGLOfflineStorage removePack:withCompletionHandler:]` method. + calling the `-[MLNOfflineStorage removePack:withCompletionHandler:]` method. */ -FOUNDATION_EXTERN MGL_EXPORT const NSNotificationName MGLOfflinePackMaximumMapboxTilesReachedNotification; +FOUNDATION_EXTERN MLN_EXPORT const NSNotificationName MLNOfflinePackMaximumMapboxTilesReachedNotification; /** - A key in the `userInfo` property of a notification posted by `MGLOfflinePack`. + A key in the `userInfo` property of a notification posted by `MLNOfflinePack`. */ -typedef NSString *MGLOfflinePackUserInfoKey NS_EXTENSIBLE_STRING_ENUM; +typedef NSString *MLNOfflinePackUserInfoKey NS_EXTENSIBLE_STRING_ENUM; /** The key for an `NSNumber` object that indicates an offline pack’s current state. This key is used in the `userInfo` dictionary of an - `MGLOfflinePackProgressChangedNotification` notification. Call `-integerValue` - on the object to receive the `MGLOfflinePackState`-typed state. + `MLNOfflinePackProgressChangedNotification` notification. Call `-integerValue` + on the object to receive the `MLNOfflinePackState`-typed state. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLOfflinePackUserInfoKey MGLOfflinePackUserInfoKeyState; +FOUNDATION_EXTERN MLN_EXPORT const MLNOfflinePackUserInfoKey MLNOfflinePackUserInfoKeyState; /** The key for an `NSValue` object that indicates an offline pack’s current progress. This key is used in the `userInfo` dictionary of an - `MGLOfflinePackProgressChangedNotification` notification. Call - `-MGLOfflinePackProgressValue` on the object to receive the - `MGLOfflinePackProgress`-typed progress. + `MLNOfflinePackProgressChangedNotification` notification. Call + `-MLNOfflinePackProgressValue` on the object to receive the + `MLNOfflinePackProgress`-typed progress. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLOfflinePackUserInfoKey MGLOfflinePackUserInfoKeyProgress; +FOUNDATION_EXTERN MLN_EXPORT const MLNOfflinePackUserInfoKey MLNOfflinePackUserInfoKeyProgress; /** The key for an `NSError` object that is encountered in the course of downloading an offline pack. This key is used in the `userInfo` dictionary of - an `MGLOfflinePackErrorNotification` notification. The error’s domain is - `MGLErrorDomain`. See `MGLErrorCode` for possible error codes. + an `MLNOfflinePackErrorNotification` notification. The error’s domain is + `MLNErrorDomain`. See `MLNErrorCode` for possible error codes. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLOfflinePackUserInfoKey MGLOfflinePackUserInfoKeyError; +FOUNDATION_EXTERN MLN_EXPORT const MLNOfflinePackUserInfoKey MLNOfflinePackUserInfoKeyError; /** The key for an `NSNumber` object that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in the `userInfo` dictionary of an - `MGLOfflinePackMaximumMapboxTilesReachedNotification` notification. Call + `MLNOfflinePackMaximumMapboxTilesReachedNotification` notification. Call `-unsignedLongLongValue` on the object to receive the `uint64_t`-typed tile limit. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLOfflinePackUserInfoKey MGLOfflinePackUserInfoKeyMaximumCount; +FOUNDATION_EXTERN MLN_EXPORT const MLNOfflinePackUserInfoKey MLNOfflinePackUserInfoKeyMaximumCount; -FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLUnsupportedRegionTypeException; +FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNUnsupportedRegionTypeException; /** A block to be called once an offline pack has been completely created and @@ -115,7 +115,7 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLUnsupportedRegionTypeExce @param error Contains a pointer to an error object (if any) indicating why the pack could not be created or added. */ -typedef void (^MGLOfflinePackAdditionCompletionHandler)(MGLOfflinePack * _Nullable pack, NSError * _Nullable error); +typedef void (^MLNOfflinePackAdditionCompletionHandler)(MLNOfflinePack * _Nullable pack, NSError * _Nullable error); /** A block to be called once an offline pack has been completely invalidated and @@ -128,7 +128,7 @@ typedef void (^MGLOfflinePackAdditionCompletionHandler)(MGLOfflinePack * _Nullab @param error Contains a pointer to an error object (if any) indicating why the pack could not be invalidated or removed. */ -typedef void (^MGLOfflinePackRemovalCompletionHandler)(NSError * _Nullable error); +typedef void (^MLNOfflinePackRemovalCompletionHandler)(NSError * _Nullable error); /** A block to be called once the contents of a file are copied into the current packs. @@ -140,7 +140,7 @@ typedef void (^MGLOfflinePackRemovalCompletionHandler)(NSError * _Nullable error @param error A pointer to an error object (if any) indicating why the pack could not be created or added. */ -typedef void (^MGLBatchedOfflinePackAdditionCompletionHandler)(NSURL *fileURL, NSArray * _Nullable packs, NSError * _Nullable error); +typedef void (^MLNBatchedOfflinePackAdditionCompletionHandler)(NSURL *fileURL, NSArray * _Nullable packs, NSError * _Nullable error); /** A block to be called once the data has been preloaded. @@ -149,36 +149,36 @@ A block to be called once the data has been preloaded. @param error Contains a pointer to an error object (if any) indicating why the data could not be pre-loaded. */ -typedef void (^MGLOfflinePreloadDataCompletionHandler)(NSURL * url, NSError * _Nullable error); +typedef void (^MLNOfflinePreloadDataCompletionHandler)(NSURL * url, NSError * _Nullable error); /** The type of resource that is requested. */ -typedef NS_ENUM(NSUInteger, MGLResourceKind) { +typedef NS_ENUM(NSUInteger, MLNResourceKind) { /** Unknown type */ - MGLResourceKindUnknown, + MLNResourceKindUnknown, /** Style sheet JSON file */ - MGLResourceKindStyle, + MLNResourceKindStyle, /** TileJSON file as specified in https://maplibre.org/maplibre-gl-js-docs/style-spec/#root-sources */ - MGLResourceKindSource, + MLNResourceKindSource, /** A vector or raster tile as described in the style sheet at https://maplibre.org/maplibre-gl-js-docs/style-spec/#sources */ - MGLResourceKindTile, + MLNResourceKindTile, /** Signed distance field glyphs for text rendering. These are the URLs specified in the style in https://maplibre.org/maplibre-gl-js-docs/style-spec/#root-glyphs */ - MGLResourceKindGlyphs, + MLNResourceKindGlyphs, /** Image part of a sprite sheet. It is constructed of the prefix in https://maplibre.org/maplibre-gl-js-docs/style-spec/#root-sprite and a PNG file extension. */ - MGLResourceKindSpriteImage, + MLNResourceKindSpriteImage, /** JSON part of a sprite sheet. It is constructed of the prefix in https://maplibre.org/maplibre-gl-js-docs/style-spec/#root-sprite and a JSON file extension. */ - MGLResourceKindSpriteJSON, + MLNResourceKindSpriteJSON, /** Image data for a georeferenced image source. **/ - MGLResourceKindImage, + MLNResourceKindImage, }; /** - MGLOfflineStorage implements a singleton (shared object) that manages offline + MLNOfflineStorage implements a singleton (shared object) that manages offline packs and ambient caching. All of this class’s instance methods are asynchronous, reflecting the fact that offline resources are stored in a database. The shared object maintains a canonical collection of offline packs in its `packs` property. @@ -193,13 +193,13 @@ typedef NS_ENUM(NSUInteger, MGLResourceKind) { Download an offline map example to learn how to create and register an offline pack for a defined region. */ -MGL_EXPORT -@interface MGLOfflineStorage : NSObject +MLN_EXPORT +@interface MLNOfflineStorage : NSObject /** Returns the shared offline storage object. */ -@property (class, nonatomic, readonly) MGLOfflineStorage *sharedOfflineStorage; +@property (class, nonatomic, readonly) MLNOfflineStorage *sharedOfflineStorage; // MARK: - Accessing the Delegate @@ -211,7 +211,7 @@ MGL_EXPORT add or remove custom parameters, or reroute certain requests to other servers or endpoints. */ -@property(nonatomic, weak, nullable) IBOutlet id delegate; +@property(nonatomic, weak, nullable) IBOutlet id delegate; // MARK: - Managing the Database of Offline Packs @@ -219,7 +219,7 @@ MGL_EXPORT The file path at which offline packs and the ambient cache are stored. To customize this path, specify the - [`MGLOfflineStorageDatabasePath`](../infoplist-keys.html#mglofflinestoragedatabasepath) + [`MLNOfflineStorageDatabasePath`](../infoplist-keys.html#mglofflinestoragedatabasepath) key in Info.plist. */ @property (nonatomic, readonly, copy) NSString *databasePath; @@ -228,7 +228,7 @@ MGL_EXPORT The file URL at which offline packs and the ambient cache are stored. To customize this path, specify the - [`MGLOfflineStorageDatabasePath`](../infoplist-keys.html#mglofflinestoragedatabasepath) + [`MLNOfflineStorageDatabasePath`](../infoplist-keys.html#mglofflinestoragedatabasepath) key in Info.plist. */ @property (nonatomic, readonly, copy) NSURL *databaseURL; @@ -248,7 +248,7 @@ MGL_EXPORT file has been added to offline storage. This handler is executed asynchronously on the main queue. */ -- (void)addContentsOfFile:(NSString *)filePath withCompletionHandler:(nullable MGLBatchedOfflinePackAdditionCompletionHandler)completion; +- (void)addContentsOfFile:(NSString *)filePath withCompletionHandler:(nullable MLNBatchedOfflinePackAdditionCompletionHandler)completion; /** Adds the offline packs located at the given URL to offline storage. @@ -265,7 +265,7 @@ MGL_EXPORT file has been added to offline storage. This handler is executed asynchronously on the main queue. */ -- (void)addContentsOfURL:(NSURL *)fileURL withCompletionHandler:(nullable MGLBatchedOfflinePackAdditionCompletionHandler)completion; +- (void)addContentsOfURL:(NSURL *)fileURL withCompletionHandler:(nullable MLNBatchedOfflinePackAdditionCompletionHandler)completion; // MARK: - Managing Offline Packs @@ -282,7 +282,7 @@ MGL_EXPORT `packs` property, observe KVO change notifications on the `packs` key path. The initial load results in an `NSKeyValueChangeSetting` change. */ -@property (nonatomic, strong, readonly, nullable) NSArray *packs; +@property (nonatomic, strong, readonly, nullable) NSArray *packs; /** Creates and registers an offline pack that downloads the resources needed to @@ -291,10 +291,10 @@ MGL_EXPORT The resulting pack is added to the shared offline storage object’s `packs` property, then the `completion` block is executed with that pack passed in. - The pack has an initial state of `MGLOfflinePackStateInactive`. To begin - downloading resources, call `-[MGLOfflinePack resume]` on the pack from within + The pack has an initial state of `MLNOfflinePackStateInactive`. To begin + downloading resources, call `-[MLNOfflinePack resume]` on the pack from within the completion handler. To monitor download progress, add an observer for - `MGLOfflinePackProgressChangedNotification`s about that pack. + `MLNOfflinePackProgressChangedNotification`s about that pack. To detect when any call to this method results in a new pack, observe KVO change notifications on the shared offline storage object’s `packs` key path. @@ -305,7 +305,7 @@ MGL_EXPORT @param completion The completion handler to call once the pack has been added. This handler is executed asynchronously on the main queue. */ -- (void)addPackForRegion:(id )region withContext:(NSData *)context completionHandler:(nullable MGLOfflinePackAdditionCompletionHandler)completion; +- (void)addPackForRegion:(id )region withContext:(NSData *)context completionHandler:(nullable MLNOfflinePackAdditionCompletionHandler)completion; /** Unregisters the given offline pack and allows resources that are no longer @@ -332,7 +332,7 @@ MGL_EXPORT @param completion The completion handler to call once the pack has been removed. This handler is executed asynchronously on the main queue. */ -- (void)removePack:(MGLOfflinePack *)pack withCompletionHandler:(nullable MGLOfflinePackRemovalCompletionHandler)completion; +- (void)removePack:(MLNOfflinePack *)pack withCompletionHandler:(nullable MLNOfflinePackRemovalCompletionHandler)completion; /** Invalidates the specified offline pack. This method checks that the tiles @@ -348,10 +348,10 @@ MGL_EXPORT removed. This handler is executed asynchronously on the main queue. */ -- (void)invalidatePack:(MGLOfflinePack *)pack withCompletionHandler:(void (^)(NSError * _Nullable))completion; +- (void)invalidatePack:(MLNOfflinePack *)pack withCompletionHandler:(void (^)(NSError * _Nullable))completion; /** Forcibly, asynchronously reloads the `packs` property. At some point after this - method is called, the pointer values of the `MGLOfflinePack` objects in the + method is called, the pointer values of the `MLNOfflinePack` objects in the `packs` property change, even if the underlying data for these packs has not changed. If this method is called while a pack is actively downloading, the behavior is undefined. @@ -369,7 +369,7 @@ MGL_EXPORT stored on the current device. Once this limit is reached, an - `MGLOfflinePackMaximumMapboxTilesReachedNotification` is posted for every + `MLNOfflinePackMaximumMapboxTilesReachedNotification` is posted for every attempt to download additional tiles until already downloaded tiles are removed by calling the `-removePack:withCompletionHandler:` method. @@ -381,7 +381,7 @@ MGL_EXPORT The cumulative size, measured in bytes, of all downloaded resources on disk. The returned value includes all resources, including tiles, whether downloaded - as part of an offline pack or due to caching during normal use of `MGLMapView`. + as part of an offline pack or due to caching during normal use of `MLNMapView`. */ @property (nonatomic, readonly) unsigned long long countOfBytesCompleted; @@ -496,16 +496,16 @@ MGL_EXPORT preloaded. This handler is executed asynchronously on the main queue. */ - (void)preloadData:(NSData *)data forURL:(NSURL *)url modificationDate:(nullable NSDate *)modified expirationDate:(nullable NSDate *)expires eTag:(nullable NSString *)eTag mustRevalidate:(BOOL)mustRevalidate - completionHandler:(nullable MGLOfflinePreloadDataCompletionHandler)completion; + completionHandler:(nullable MLNOfflinePreloadDataCompletionHandler)completion; @end /** - The `MGLOfflineStorageDelegate` protocol defines methods that a delegate of an - `MGLOfflineStorage` object can optionally implement to transform various types + The `MLNOfflineStorageDelegate` protocol defines methods that a delegate of an + `MLNOfflineStorage` object can optionally implement to transform various types of URLs before downloading them via the internet. */ -@protocol MGLOfflineStorageDelegate +@protocol MLNOfflineStorageDelegate /** Sent whenever a URL needs to be transformed. @@ -515,8 +515,8 @@ MGL_EXPORT @param url The original URL to be transformed. @return A URL that will now be downloaded. */ -- (NSURL *)offlineStorage:(MGLOfflineStorage *)storage - URLForResourceOfKind:(MGLResourceKind)kind +- (NSURL *)offlineStorage:(MLNOfflineStorage *)storage + URLForResourceOfKind:(MLNResourceKind)kind withURL:(NSURL *)url; @end diff --git a/platform/ios/platform/darwin/src/MGLOfflineStorage.mm b/platform/ios/platform/darwin/src/MLNOfflineStorage.mm similarity index 79% rename from platform/ios/platform/darwin/src/MGLOfflineStorage.mm rename to platform/ios/platform/darwin/src/MLNOfflineStorage.mm index d3eac1a95..4f3d3ead3 100644 --- a/platform/ios/platform/darwin/src/MGLOfflineStorage.mm +++ b/platform/ios/platform/darwin/src/MLNOfflineStorage.mm @@ -1,17 +1,17 @@ -#import "MGLOfflineStorage_Private.h" +#import "MLNOfflineStorage_Private.h" -#import "MGLFoundation_Private.h" -#import "MGLSettings_Private.h" -#import "MGLGeometry_Private.h" -#import "MGLOfflinePack_Private.h" -#import "MGLOfflineRegion_Private.h" -#import "MGLTilePyramidOfflineRegion.h" -#import "MGLShapeOfflineRegion.h" -#import "NSBundle+MGLAdditions.h" -#import "NSValue+MGLAdditions.h" -#import "NSDate+MGLAdditions.h" -#import "MGLLoggingConfiguration_Private.h" -#import "MGLNetworkConfiguration_Private.h" +#import "MLNFoundation_Private.h" +#import "MLNSettings_Private.h" +#import "MLNGeometry_Private.h" +#import "MLNOfflinePack_Private.h" +#import "MLNOfflineRegion_Private.h" +#import "MLNTilePyramidOfflineRegion.h" +#import "MLNShapeOfflineRegion.h" +#import "NSBundle+MLNAdditions.h" +#import "NSValue+MLNAdditions.h" +#import "NSDate+MLNAdditions.h" +#import "MLNLoggingConfiguration_Private.h" +#import "MLNNetworkConfiguration_Private.h" #include #include @@ -25,38 +25,38 @@ #include -static NSString * const MGLOfflineStorageDatabasePathInfoDictionaryKey = @"MGLOfflineStorageDatabasePath"; -static NSString * const MGLOfflineStorageFileName = @"cache.db"; -static NSString * const MGLOfflineStorageFileName3_2_0_beta_1 = @"offline.db"; +static NSString * const MLNOfflineStorageDatabasePathInfoDictionaryKey = @"MLNOfflineStorageDatabasePath"; +static NSString * const MLNOfflineStorageFileName = @"cache.db"; +static NSString * const MLNOfflineStorageFileName3_2_0_beta_1 = @"offline.db"; -const NSNotificationName MGLOfflinePackProgressChangedNotification = @"MGLOfflinePackProgressChanged"; -const NSNotificationName MGLOfflinePackErrorNotification = @"MGLOfflinePackError"; -const NSNotificationName MGLOfflinePackMaximumMapboxTilesReachedNotification = @"MGLOfflinePackMaximumMapboxTilesReached"; +const NSNotificationName MLNOfflinePackProgressChangedNotification = @"MLNOfflinePackProgressChanged"; +const NSNotificationName MLNOfflinePackErrorNotification = @"MLNOfflinePackError"; +const NSNotificationName MLNOfflinePackMaximumMapboxTilesReachedNotification = @"MLNOfflinePackMaximumMapboxTilesReached"; -const MGLOfflinePackUserInfoKey MGLOfflinePackUserInfoKeyState = @"State"; -const MGLOfflinePackUserInfoKey MGLOfflinePackUserInfoKeyProgress = @"Progress"; -const MGLOfflinePackUserInfoKey MGLOfflinePackUserInfoKeyError = @"Error"; -const MGLOfflinePackUserInfoKey MGLOfflinePackUserInfoKeyMaximumCount = @"MaximumCount"; +const MLNOfflinePackUserInfoKey MLNOfflinePackUserInfoKeyState = @"State"; +const MLNOfflinePackUserInfoKey MLNOfflinePackUserInfoKeyProgress = @"Progress"; +const MLNOfflinePackUserInfoKey MLNOfflinePackUserInfoKeyError = @"Error"; +const MLNOfflinePackUserInfoKey MLNOfflinePackUserInfoKeyMaximumCount = @"MaximumCount"; -const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegionTypeException"; +const MLNExceptionName MLNUnsupportedRegionTypeException = @"MLNUnsupportedRegionTypeException"; -@interface MGLOfflineStorage () +@interface MLNOfflineStorage () -@property (nonatomic, strong, readwrite) NSMutableArray *packs; +@property (nonatomic, strong, readwrite) NSMutableArray *packs; @property (nonatomic) std::shared_ptr mbglDatabaseFileSource; @property (nonatomic) std::shared_ptr mbglOnlineFileSource; @property (nonatomic) std::shared_ptr mbglFileSource; @property (nonatomic, getter=isPaused) BOOL paused; @end -@implementation MGLOfflineStorage { +@implementation MLNOfflineStorage { NSURL *_databaseURL; std::unique_ptr> _mbglResourceTransform; } + (instancetype)sharedOfflineStorage { static dispatch_once_t onceToken; - static MGLOfflineStorage *sharedOfflineStorage; + static MLNOfflineStorage *sharedOfflineStorage; dispatch_once(&onceToken, ^{ sharedOfflineStorage = [[self alloc] init]; #if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR @@ -66,12 +66,12 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio [sharedOfflineStorage reloadPacks]; }); - // Always ensure the MGLNativeNetworkManager delegate is setup. Calling + // Always ensure the MLNNativeNetworkManager delegate is setup. Calling // `resetNativeNetworkManagerDelegate` is not necessary here, since the shared // manager already calls it. // // TODO: Consider only calling this for testing? - [MGLNetworkConfiguration sharedManager]; + [MLNNetworkConfiguration sharedManager]; return sharedOfflineStorage; } @@ -98,8 +98,8 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio } #endif -- (void)setDelegate:(id)newValue { - MGLLogDebug(@"Setting delegate: %@", newValue); +- (void)setDelegate:(id)newValue { + MLNLogDebug(@"Setting delegate: %@", newValue); _delegate = newValue; if ([self.delegate respondsToSelector:@selector(offlineStorage:URLForResourceOfKind:withURL:)]) { _mbglResourceTransform = std::make_unique>(*mbgl::Scheduler::GetCurrent(), [offlineStorage = self](auto kind_, const std::string& url_, mbgl::ResourceTransform::FinishedCallback cb) { @@ -107,31 +107,31 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio [NSURL URLWithString:[[NSString alloc] initWithBytes:url_.data() length:url_.length() encoding:NSUTF8StringEncoding]]; - MGLResourceKind kind = MGLResourceKindUnknown; + MLNResourceKind kind = MLNResourceKindUnknown; switch (kind_) { case mbgl::Resource::Kind::Tile: - kind = MGLResourceKindTile; + kind = MLNResourceKindTile; break; case mbgl::Resource::Kind::Glyphs: - kind = MGLResourceKindGlyphs; + kind = MLNResourceKindGlyphs; break; case mbgl::Resource::Kind::Style: - kind = MGLResourceKindStyle; + kind = MLNResourceKindStyle; break; case mbgl::Resource::Kind::Source: - kind = MGLResourceKindSource; + kind = MLNResourceKindSource; break; case mbgl::Resource::Kind::SpriteImage: - kind = MGLResourceKindSpriteImage; + kind = MLNResourceKindSpriteImage; break; case mbgl::Resource::Kind::SpriteJSON: - kind = MGLResourceKindSpriteJSON; + kind = MLNResourceKindSpriteJSON; break; case mbgl::Resource::Kind::Image: - kind = MGLResourceKindImage; + kind = MLNResourceKindImage; break; case mbgl::Resource::Kind::Unknown: - kind = MGLResourceKindUnknown; + kind = MLNResourceKindUnknown; break; } @@ -154,12 +154,12 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio // Ensure network configuration & appropriate delegate prior to starting the // run loop. Calling `resetNativeNetworkManagerDelegate` is not necessary here, // since the shared manager already calls it. - [MGLNetworkConfiguration sharedManager]; + [MLNNetworkConfiguration sharedManager]; - MGLInitializeRunLoop(); + MLNInitializeRunLoop(); if (self = [super init]) { - mbgl::TileServerOptions* tileServerOptions = [[MGLSettings sharedSettings] tileServerOptionsInternal]; + mbgl::TileServerOptions* tileServerOptions = [[MLNSettings sharedSettings] tileServerOptionsInternal]; mbgl::ResourceOptions resourceOptions; resourceOptions.withCachePath(self.databasePath.UTF8String) .withAssetPath([NSBundle mainBundle].resourceURL.path.UTF8String) @@ -170,14 +170,14 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio _mbglDatabaseFileSource = std::static_pointer_cast(std::shared_ptr(mbgl::FileSourceManager::get()->getFileSource(mbgl::FileSourceType::Database, resourceOptions, clientOptions))); // Observe for changes to the tile server options (and find out the current one). - [[MGLSettings sharedSettings] addObserver:self + [[MLNSettings sharedSettings] addObserver:self forKeyPath:@"tileServerOptionsChangeToken" options:(NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew) context:NULL]; // Observe for changes to the global access token (and find out the current one). - [[MGLSettings sharedSettings] addObserver:self + [[MLNSettings sharedSettings] addObserver:self forKeyPath:@"apiKey" options:(NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew) @@ -189,23 +189,23 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [[MGLSettings sharedSettings] removeObserver:self forKeyPath:@"tileServerOptionsChangeToken"]; - [[MGLSettings sharedSettings] removeObserver:self forKeyPath:@"apiKey"]; + [[MLNSettings sharedSettings] removeObserver:self forKeyPath:@"tileServerOptionsChangeToken"]; + [[MLNSettings sharedSettings] removeObserver:self forKeyPath:@"apiKey"]; - for (MGLOfflinePack *pack in self.packs) { + for (MLNOfflinePack *pack in self.packs) { [pack invalidate]; } } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - // Synchronize the file source’s access token with the global one in MGLSettings. - if ([keyPath isEqualToString:@"apiKey"] && object == [MGLSettings sharedSettings]) { + // Synchronize the file source’s access token with the global one in MLNSettings. + if ([keyPath isEqualToString:@"apiKey"] && object == [MLNSettings sharedSettings]) { NSString *apiKey = change[NSKeyValueChangeNewKey]; if (![apiKey isKindOfClass:[NSNull class]]) { _mbglOnlineFileSource->setProperty(mbgl::API_KEY_KEY, apiKey.UTF8String); } - } else if ([keyPath isEqualToString:@"tileServerOptionsChangeToken"] && object == [MGLSettings sharedSettings]) { - auto tileServerOptions = [[MGLSettings sharedSettings] tileServerOptionsInternal]; + } else if ([keyPath isEqualToString:@"tileServerOptionsChangeToken"] && object == [MLNSettings sharedSettings]) { + auto tileServerOptions = [[MLNSettings sharedSettings] tileServerOptionsInternal]; auto apiBaseURL = tileServerOptions->baseURL(); auto resourceOptions = _mbglOnlineFileSource->getResourceOptions().clone(); _mbglOnlineFileSource->setResourceOptions(resourceOptions.withTileServerOptions(*tileServerOptions).clone()); @@ -222,7 +222,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio - (NSURL *)databaseURL { if (!_databaseURL) { - NSString *customPath = [NSBundle.mainBundle objectForInfoDictionaryKey:MGLOfflineStorageDatabasePathInfoDictionaryKey]; + NSString *customPath = [NSBundle.mainBundle objectForInfoDictionaryKey:MLNOfflineStorageDatabasePathInfoDictionaryKey]; if ([customPath isKindOfClass:[NSString class]]) { _databaseURL = [NSURL fileURLWithPath:customPath.stringByStandardizingPath isDirectory:NO relativeToURL:NSBundle.mainBundle.resourceURL]; @@ -294,7 +294,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio // unfortunately it has to live in the same file as offline resources. [databaseDirectoryURL setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:NULL]; } - return [databaseDirectoryURL URLByAppendingPathComponent:MGLOfflineStorageFileName]; + return [databaseDirectoryURL URLByAppendingPathComponent:MLNOfflineStorageFileName]; } /** @@ -305,7 +305,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio #if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR // ~/Documents/offline.db NSArray *legacyPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *legacyDatabasePath = [legacyPaths.firstObject stringByAppendingPathComponent:MGLOfflineStorageFileName3_2_0_beta_1]; + NSString *legacyDatabasePath = [legacyPaths.firstObject stringByAppendingPathComponent:MLNOfflineStorageFileName3_2_0_beta_1]; #elif TARGET_OS_MAC // ~/Library/Caches/tld.app.bundle.id/offline.db NSString *bundleIdentifier = [NSBundle mgl_applicationBundleIdentifier]; @@ -315,22 +315,22 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio create:NO error:nil]; legacyDatabaseDirectoryURL = [legacyDatabaseDirectoryURL URLByAppendingPathComponent:bundleIdentifier]; - NSURL *legacyDatabaseURL = [legacyDatabaseDirectoryURL URLByAppendingPathComponent:MGLOfflineStorageFileName3_2_0_beta_1]; + NSURL *legacyDatabaseURL = [legacyDatabaseDirectoryURL URLByAppendingPathComponent:MLNOfflineStorageFileName3_2_0_beta_1]; NSString *legacyDatabasePath = legacyDatabaseURL ? legacyDatabaseURL.path : @""; #endif return legacyDatabasePath; } -- (void)addContentsOfFile:(NSString *)filePath withCompletionHandler:(MGLBatchedOfflinePackAdditionCompletionHandler)completion { - MGLLogDebug(@"Adding contentsOfFile: %@ completionHandler: %@", filePath, completion); +- (void)addContentsOfFile:(NSString *)filePath withCompletionHandler:(MLNBatchedOfflinePackAdditionCompletionHandler)completion { + MLNLogDebug(@"Adding contentsOfFile: %@ completionHandler: %@", filePath, completion); NSURL *fileURL = [NSURL fileURLWithPath:filePath]; [self addContentsOfURL:fileURL withCompletionHandler:completion]; } -- (void)addContentsOfURL:(NSURL *)fileURL withCompletionHandler:(MGLBatchedOfflinePackAdditionCompletionHandler)completion { - MGLLogDebug(@"Adding contentsOfURL: %@ completionHandler: %@", fileURL, completion); +- (void)addContentsOfURL:(NSURL *)fileURL withCompletionHandler:(MLNBatchedOfflinePackAdditionCompletionHandler)completion { + MLNLogDebug(@"Adding contentsOfURL: %@ completionHandler: %@", fileURL, completion); NSFileManager *fileManager = [NSFileManager defaultManager]; if (!fileURL.isFileURL) { @@ -340,23 +340,23 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio [NSException raise:NSInvalidArgumentException format:@"The file path: %@ must be writable", fileURL.absoluteString]; } - __weak MGLOfflineStorage *weakSelf = self; - [self _addContentsOfFile:fileURL.path withCompletionHandler:^(NSArray * _Nullable packs, NSError * _Nullable error) { + __weak MLNOfflineStorage *weakSelf = self; + [self _addContentsOfFile:fileURL.path withCompletionHandler:^(NSArray * _Nullable packs, NSError * _Nullable error) { if (packs) { NSMutableDictionary *packsByIdentifier = [NSMutableDictionary dictionary]; - MGLOfflineStorage *strongSelf = weakSelf; - for (MGLOfflinePack *pack in packs) { + MLNOfflineStorage *strongSelf = weakSelf; + for (MLNOfflinePack *pack in packs) { [packsByIdentifier setObject:pack forKey:@(pack.mbglOfflineRegion->getID())]; } id mutablePacks = [strongSelf mutableArrayValueForKey:@"packs"]; NSMutableIndexSet *replaceIndexSet = [NSMutableIndexSet indexSet]; NSMutableArray *replacePacksArray = [NSMutableArray array]; - [strongSelf.packs enumerateObjectsUsingBlock:^(MGLOfflinePack * _Nonnull pack, NSUInteger idx, BOOL * _Nonnull stop) { - MGLOfflinePack *newPack = packsByIdentifier[@(pack.mbglOfflineRegion->getID())]; + [strongSelf.packs enumerateObjectsUsingBlock:^(MLNOfflinePack * _Nonnull pack, NSUInteger idx, BOOL * _Nonnull stop) { + MLNOfflinePack *newPack = packsByIdentifier[@(pack.mbglOfflineRegion->getID())]; if (newPack) { - MGLOfflinePack *previousPack = [mutablePacks objectAtIndex:idx]; + MLNOfflinePack *previousPack = [mutablePacks objectAtIndex:idx]; [previousPack invalidate]; [replaceIndexSet addIndex:idx]; [replacePacksArray addObject:[packsByIdentifier objectForKey:@(newPack.mbglOfflineRegion->getID())]]; @@ -377,13 +377,13 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio }]; } -- (void)_addContentsOfFile:(NSString *)filePath withCompletionHandler:(void (^)(NSArray * _Nullable packs, NSError * _Nullable error))completion { +- (void)_addContentsOfFile:(NSString *)filePath withCompletionHandler:(void (^)(NSArray * _Nullable packs, NSError * _Nullable error))completion { _mbglDatabaseFileSource->mergeOfflineRegions(std::string(static_cast([filePath UTF8String])), [&, completion, filePath](mbgl::expected result) { NSError *error; NSMutableArray *packs; if (!result) { NSString *description = [NSString stringWithFormat:NSLocalizedStringWithDefaultValue(@"ADD_FILE_CONTENTS_FAILED_DESC", @"Foundation", nil, @"Unable to add offline packs from the file at %@.", @"User-friendly error description"), filePath]; - error = [NSError errorWithDomain:MGLErrorDomain code:MGLErrorCodeModifyingOfflineStorageFailed + error = [NSError errorWithDomain:MLNErrorDomain code:MLNErrorCodeModifyingOfflineStorageFailed userInfo:@{ NSLocalizedDescriptionKey: description, NSLocalizedFailureReasonErrorKey: @(mbgl::util::toString(result.error()).c_str()) @@ -392,7 +392,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio auto& regions = result.value(); packs = [NSMutableArray arrayWithCapacity:regions.size()]; for (auto ®ion : regions) { - MGLOfflinePack *pack = [[MGLOfflinePack alloc] initWithMBGLRegion:new mbgl::OfflineRegion(std::move(region))]; + MLNOfflinePack *pack = [[MLNOfflinePack alloc] initWithMBGLRegion:new mbgl::OfflineRegion(std::move(region))]; [packs addObject:pack]; } } @@ -406,12 +406,12 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio // MARK: Pack management methods -- (void)addPackForRegion:(id )region withContext:(NSData *)context completionHandler:(MGLOfflinePackAdditionCompletionHandler)completion { - MGLLogDebug(@"Adding packForRegion: %@ contextLength: %lu completionHandler: %@", region, (unsigned long)context.length, completion); - __weak MGLOfflineStorage *weakSelf = self; - [self _addPackForRegion:region withContext:context completionHandler:^(MGLOfflinePack * _Nullable pack, NSError * _Nullable error) { - pack.state = MGLOfflinePackStateInactive; - MGLOfflineStorage *strongSelf = weakSelf; +- (void)addPackForRegion:(id )region withContext:(NSData *)context completionHandler:(MLNOfflinePackAdditionCompletionHandler)completion { + MLNLogDebug(@"Adding packForRegion: %@ contextLength: %lu completionHandler: %@", region, (unsigned long)context.length, completion); + __weak MLNOfflineStorage *weakSelf = self; + [self _addPackForRegion:region withContext:context completionHandler:^(MLNOfflinePack * _Nullable pack, NSError * _Nullable error) { + pack.state = MLNOfflinePackStateInactive; + MLNOfflineStorage *strongSelf = weakSelf; [[strongSelf mutableArrayValueForKey:@"packs"] addObject:pack]; if (completion) { completion(pack, error); @@ -419,26 +419,26 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio }]; } -- (void)_addPackForRegion:(id )region withContext:(NSData *)context completionHandler:(MGLOfflinePackAdditionCompletionHandler)completion { - if (![region conformsToProtocol:@protocol(MGLOfflineRegion_Private)]) { - [NSException raise:MGLUnsupportedRegionTypeException +- (void)_addPackForRegion:(id )region withContext:(NSData *)context completionHandler:(MLNOfflinePackAdditionCompletionHandler)completion { + if (![region conformsToProtocol:@protocol(MLNOfflineRegion_Private)]) { + [NSException raise:MLNUnsupportedRegionTypeException format:@"Regions of type %@ are unsupported.", NSStringFromClass([region class])]; return; } - const mbgl::OfflineRegionDefinition regionDefinition = [(id )region offlineRegionDefinition]; + const mbgl::OfflineRegionDefinition regionDefinition = [(id )region offlineRegionDefinition]; mbgl::OfflineRegionMetadata metadata(context.length); [context getBytes:&metadata[0] length:metadata.size()]; _mbglDatabaseFileSource->createOfflineRegion(regionDefinition, metadata, [&, completion](mbgl::expected mbglOfflineRegion) { NSError *error; if (!mbglOfflineRegion) { NSString *errorDescription = @(mbgl::util::toString(mbglOfflineRegion.error()).c_str()); - error = [NSError errorWithDomain:MGLErrorDomain code:MGLErrorCodeModifyingOfflineStorageFailed userInfo:errorDescription ? @{ + error = [NSError errorWithDomain:MLNErrorDomain code:MLNErrorCodeModifyingOfflineStorageFailed userInfo:errorDescription ? @{ NSLocalizedDescriptionKey: errorDescription, } : nil]; } if (completion) { - MGLOfflinePack *pack = mbglOfflineRegion ? [[MGLOfflinePack alloc] initWithMBGLRegion:new mbgl::OfflineRegion(std::move(mbglOfflineRegion.value()))] : nil; + MLNOfflinePack *pack = mbglOfflineRegion ? [[MLNOfflinePack alloc] initWithMBGLRegion:new mbgl::OfflineRegion(std::move(mbglOfflineRegion.value()))] : nil; dispatch_async(dispatch_get_main_queue(), [&, completion, error, pack](void) { completion(pack, error); }); @@ -446,8 +446,8 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio }); } -- (void)removePack:(MGLOfflinePack *)pack withCompletionHandler:(MGLOfflinePackRemovalCompletionHandler)completion { - MGLLogDebug(@"Removing pack: %@ completionHandler: %@", pack, completion); +- (void)removePack:(MLNOfflinePack *)pack withCompletionHandler:(MLNOfflinePackRemovalCompletionHandler)completion { + MLNLogDebug(@"Removing pack: %@ completionHandler: %@", pack, completion); [[self mutableArrayValueForKey:@"packs"] removeObject:pack]; [self _removePack:pack withCompletionHandler:^(NSError * _Nullable error) { if (completion) { @@ -456,13 +456,13 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio }]; } -- (void)_removePack:(MGLOfflinePack *)pack withCompletionHandler:(MGLOfflinePackRemovalCompletionHandler)completion { +- (void)_removePack:(MLNOfflinePack *)pack withCompletionHandler:(MLNOfflinePackRemovalCompletionHandler)completion { mbgl::OfflineRegion *mbglOfflineRegion = pack.mbglOfflineRegion; [pack invalidate]; if (!mbglOfflineRegion) { - MGLAssert(pack.state == MGLOfflinePackStateInvalid, @"State should be invalid"); + MLNAssert(pack.state == MLNOfflinePackStateInvalid, @"State should be invalid"); completion(nil); return; } @@ -470,7 +470,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio _mbglDatabaseFileSource->deleteOfflineRegion(std::move(*mbglOfflineRegion), [&, completion](std::exception_ptr exception) { NSError *error; if (exception) { - error = [NSError errorWithDomain:MGLErrorDomain code:MGLErrorCodeModifyingOfflineStorageFailed userInfo:@{ + error = [NSError errorWithDomain:MLNErrorDomain code:MLNErrorCodeModifyingOfflineStorageFailed userInfo:@{ NSLocalizedDescriptionKey: @(mbgl::util::toString(exception).c_str()), }]; } @@ -483,7 +483,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio } -- (void)invalidatePack:(MGLOfflinePack *)pack withCompletionHandler:(void (^)(NSError * _Nullable))completion { +- (void)invalidatePack:(MLNOfflinePack *)pack withCompletionHandler:(void (^)(NSError * _Nullable))completion { mbgl::OfflineRegion& region = *pack.mbglOfflineRegion; NSError *error; if (!pack.mbglOfflineRegion) { @@ -493,7 +493,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio _mbglDatabaseFileSource->invalidateOfflineRegion(region, [&](std::exception_ptr exception) { if (exception) { - error = [NSError errorWithDomain:MGLErrorDomain code:MGLErrorCodeModifyingOfflineStorageFailed userInfo:@{ + error = [NSError errorWithDomain:MLNErrorDomain code:MLNErrorCodeModifyingOfflineStorageFailed userInfo:@{ NSLocalizedDescriptionKey: @(mbgl::util::toString(exception).c_str()), }]; } @@ -506,28 +506,28 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio } - (void)reloadPacks { - MGLLogInfo(@"Reloading packs."); - [self getPacksWithCompletionHandler:^(NSArray *packs, __unused NSError * _Nullable error) { - for (MGLOfflinePack *pack in self.packs) { + MLNLogInfo(@"Reloading packs."); + [self getPacksWithCompletionHandler:^(NSArray *packs, __unused NSError * _Nullable error) { + for (MLNOfflinePack *pack in self.packs) { [pack invalidate]; } self.packs = [packs mutableCopy]; }]; } -- (void)getPacksWithCompletionHandler:(void (^)(NSArray *packs, NSError * _Nullable error))completion { +- (void)getPacksWithCompletionHandler:(void (^)(NSArray *packs, NSError * _Nullable error))completion { _mbglDatabaseFileSource->listOfflineRegions([&, completion](mbgl::expected result) { NSError *error; NSMutableArray *packs; if (!result) { - error = [NSError errorWithDomain:MGLErrorDomain code:MGLErrorCodeUnknown userInfo:@{ + error = [NSError errorWithDomain:MLNErrorDomain code:MLNErrorCodeUnknown userInfo:@{ NSLocalizedDescriptionKey: @(mbgl::util::toString(result.error()).c_str()), }]; } else { auto& regions = result.value(); packs = [NSMutableArray arrayWithCapacity:regions.size()]; for (auto ®ion : regions) { - MGLOfflinePack *pack = [[MGLOfflinePack alloc] initWithMBGLRegion:new mbgl::OfflineRegion(std::move(region))]; + MLNOfflinePack *pack = [[MLNOfflinePack alloc] initWithMBGLRegion:new mbgl::OfflineRegion(std::move(region))]; [packs addObject:pack]; } } @@ -540,7 +540,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio } - (void)setMaximumAllowedMapboxTiles:(uint64_t)maximumCount { - MGLLogDebug(@"Setting maximumAllowedMapboxTiles: %lu", (unsigned long)maximumCount); + MLNLogDebug(@"Setting maximumAllowedMapboxTiles: %lu", (unsigned long)maximumCount); _mbglDatabaseFileSource->setOfflineMapboxTileCountLimit(maximumCount); } @@ -551,7 +551,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio NSError *error; if (completion) { if (exception) { - error = [NSError errorWithDomain:MGLErrorDomain code:MGLErrorCodeModifyingOfflineStorageFailed userInfo:@{ + error = [NSError errorWithDomain:MLNErrorDomain code:MLNErrorCodeModifyingOfflineStorageFailed userInfo:@{ NSLocalizedDescriptionKey: @(mbgl::util::toString(exception).c_str()), }]; } @@ -568,7 +568,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio if (completion) { if (exception) { // Convert std::exception_ptr to an NSError. - error = [NSError errorWithDomain:MGLErrorDomain code:MGLErrorCodeModifyingOfflineStorageFailed userInfo:@{ + error = [NSError errorWithDomain:MLNErrorDomain code:MLNErrorCodeModifyingOfflineStorageFailed userInfo:@{ NSLocalizedDescriptionKey: @(mbgl::util::toString(exception).c_str()), }]; } @@ -584,7 +584,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio NSError *error; if (completion) { if (exception) { - error = [NSError errorWithDomain:MGLErrorDomain code:MGLErrorCodeModifyingOfflineStorageFailed userInfo:@{ + error = [NSError errorWithDomain:MLNErrorDomain code:MLNErrorCodeModifyingOfflineStorageFailed userInfo:@{ NSLocalizedDescriptionKey: @(mbgl::util::toString(exception).c_str()), }]; } @@ -600,7 +600,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio NSError *error; if (completion) { if (exception) { - error = [NSError errorWithDomain:MGLErrorDomain code:MGLErrorCodeUnknown userInfo:@{ + error = [NSError errorWithDomain:MLNErrorDomain code:MLNErrorCodeUnknown userInfo:@{ NSLocalizedDescriptionKey: @(mbgl::util::toString(exception).c_str()), }]; } @@ -622,7 +622,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio } - (void)preloadData:(NSData *)data forURL:(NSURL *)url modificationDate:(nullable NSDate *)modified expirationDate:(nullable NSDate *)expires eTag:(nullable NSString *)eTag mustRevalidate:(BOOL)mustRevalidate - completionHandler:(nullable MGLOfflinePreloadDataCompletionHandler)completion { + completionHandler:(nullable MLNOfflinePreloadDataCompletionHandler)completion { mbgl::Resource resource(mbgl::Resource::Kind::Unknown, url.absoluteString.UTF8String); mbgl::Response response; response.data = std::make_shared(static_cast(data.bytes), data.length); @@ -633,11 +633,11 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio } if (modified) { - response.modified = mbgl::Timestamp() + std::chrono::duration_cast(MGLDurationFromTimeInterval(modified.timeIntervalSince1970)); + response.modified = mbgl::Timestamp() + std::chrono::duration_cast(MLNDurationFromTimeInterval(modified.timeIntervalSince1970)); } if (expires) { - response.expires = mbgl::Timestamp() + std::chrono::duration_cast(MGLDurationFromTimeInterval(expires.timeIntervalSince1970)); + response.expires = mbgl::Timestamp() + std::chrono::duration_cast(MLNDurationFromTimeInterval(expires.timeIntervalSince1970)); } std::function callback; diff --git a/platform/ios/platform/darwin/src/MGLOfflineStorage_Private.h b/platform/ios/platform/darwin/src/MLNOfflineStorage_Private.h similarity index 79% rename from platform/ios/platform/darwin/src/MGLOfflineStorage_Private.h rename to platform/ios/platform/darwin/src/MLNOfflineStorage_Private.h index 9ef6514c8..757da59a5 100644 --- a/platform/ios/platform/darwin/src/MGLOfflineStorage_Private.h +++ b/platform/ios/platform/darwin/src/MLNOfflineStorage_Private.h @@ -1,17 +1,17 @@ -#import "MGLOfflineStorage.h" +#import "MLNOfflineStorage.h" -#import "MGLOfflinePack.h" +#import "MLNOfflinePack.h" #include #include -#include "MGLSettings_Private.h" +#include "MLNSettings_Private.h" #include NS_ASSUME_NONNULL_BEGIN -@interface MGLOfflineStorage (Private) +@interface MLNOfflineStorage (Private) /** The shared database file source object owned by the shared offline storage object. @@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic) std::shared_ptr mbglFileSource; -- (void)getPacksWithCompletionHandler:(void (^)(NSArray *packs, NSError * _Nullable error))completion; +- (void)getPacksWithCompletionHandler:(void (^)(NSArray *packs, NSError * _Nullable error))completion; @end diff --git a/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.h b/platform/ios/platform/darwin/src/MLNOpenGLStyleLayer.h similarity index 57% rename from platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.h rename to platform/ios/platform/darwin/src/MLNOpenGLStyleLayer.h index fd82a4a69..8231f763e 100644 --- a/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.h +++ b/platform/ios/platform/darwin/src/MLNOpenGLStyleLayer.h @@ -2,30 +2,30 @@ #import #import -#import "MGLFoundation.h" -#import "MGLStyleValue.h" -#import "MGLStyleLayer.h" -#import "MGLGeometry.h" +#import "MLNFoundation.h" +#import "MLNStyleValue.h" +#import "MLNStyleLayer.h" +#import "MLNGeometry.h" NS_ASSUME_NONNULL_BEGIN -@class MGLMapView; -@class MGLStyle; +@class MLNMapView; +@class MLNStyle; -typedef struct MGLStyleLayerDrawingContext { +typedef struct MLNStyleLayerDrawingContext { CGSize size; CLLocationCoordinate2D centerCoordinate; double zoomLevel; CLLocationDirection direction; CGFloat pitch; CGFloat fieldOfView; - MGLMatrix4 projectionMatrix; -} MGLStyleLayerDrawingContext; + MLNMatrix4 projectionMatrix; +} MLNStyleLayerDrawingContext; -MGL_EXPORT -@interface MGLOpenGLStyleLayer : MGLStyleLayer +MLN_EXPORT +@interface MLNOpenGLStyleLayer : MLNStyleLayer -@property (nonatomic, weak, readonly) MGLStyle *style; +@property (nonatomic, weak, readonly) MLNStyle *style; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -38,11 +38,11 @@ MGL_EXPORT - (instancetype)initWithIdentifier:(NSString *)identifier; -- (void)didMoveToMapView:(MGLMapView *)mapView; +- (void)didMoveToMapView:(MLNMapView *)mapView; -- (void)willMoveFromMapView:(MGLMapView *)mapView; +- (void)willMoveFromMapView:(MLNMapView *)mapView; -- (void)drawInMapView:(MGLMapView *)mapView withContext:(MGLStyleLayerDrawingContext)context; +- (void)drawInMapView:(MLNMapView *)mapView withContext:(MLNStyleLayerDrawingContext)context; - (void)setNeedsDisplay; diff --git a/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.mm b/platform/ios/platform/darwin/src/MLNOpenGLStyleLayer.mm similarity index 76% rename from platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.mm rename to platform/ios/platform/darwin/src/MLNOpenGLStyleLayer.mm index 7dd057556..5a531754e 100644 --- a/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.mm +++ b/platform/ios/platform/darwin/src/MLNOpenGLStyleLayer.mm @@ -1,18 +1,18 @@ -#import "MGLOpenGLStyleLayer.h" -#import "MGLOpenGLStyleLayer_Private.h" +#import "MLNOpenGLStyleLayer.h" +#import "MLNOpenGLStyleLayer_Private.h" -#import "MGLMapView_Private.h" -#import "MGLStyle_Private.h" -#import "MGLStyleLayer_Private.h" -#import "MGLGeometry_Private.h" +#import "MLNMapView_Private.h" +#import "MLNStyle_Private.h" +#import "MLNStyleLayer_Private.h" +#import "MLNGeometry_Private.h" #include #include -class MGLOpenGLLayerHost; +class MLNOpenGLLayerHost; /** - An `MGLOpenGLStyleLayer` is a style layer that is rendered by OpenGL code that + An `MLNOpenGLStyleLayer` is a style layer that is rendered by OpenGL code that you provide. By default, this class does nothing. You can subclass this class to provide @@ -21,19 +21,19 @@ class MGLOpenGLLayerHost; `-drawInMapView:withContext:` methods. You can access an existing OpenGL style layer using the - `-[MGLStyle layerWithIdentifier:]` method if you know its identifier; - otherwise, find it using the `MGLStyle.layers` property. You can also create a + `-[MLNStyle layerWithIdentifier:]` method if you know its identifier; + otherwise, find it using the `MLNStyle.layers` property. You can also create a new OpenGL style layer and add it to the style using a method such as - `-[MGLStyle addLayer:]`. + `-[MLNStyle addLayer:]`. @warning This API is undocumented and therefore unsupported. It may change at any time without notice. */ -@interface MGLOpenGLStyleLayer () +@interface MLNOpenGLStyleLayer () @property (nonatomic, readonly) mbgl::style::CustomLayer *rawLayer; -@property (nonatomic, readonly, nullable) MGLMapView *mapView; +@property (nonatomic, readonly, nullable) MLNMapView *mapView; /** The style currently containing the layer. @@ -41,18 +41,18 @@ class MGLOpenGLLayerHost; If the layer is not currently part of any style, this property is set to `nil`. */ -@property (nonatomic, weak, readwrite) MGLStyle *style; +@property (nonatomic, weak, readwrite) MLNStyle *style; @end -@implementation MGLOpenGLStyleLayer +@implementation MLNOpenGLStyleLayer /** Returns an OpenGL style layer object initialized with the given identifier. After initializing and configuring the style layer, add it to a map view’s - style using the `-[MGLStyle addLayer:]` or - `-[MGLStyle insertLayer:belowLayer:]` method. + style using the `-[MLNStyle addLayer:]` or + `-[MLNStyle insertLayer:belowLayer:]` method. @param identifier A string that uniquely identifies the layer in the style to which it is added. @@ -60,7 +60,7 @@ class MGLOpenGLLayerHost; */ - (instancetype)initWithIdentifier:(NSString *)identifier { auto layer = std::make_unique(identifier.UTF8String, - std::make_unique(self)); + std::make_unique(self)); return self = [super initWithPendingLayer:std::move(layer)]; } @@ -68,9 +68,9 @@ class MGLOpenGLLayerHost; return (mbgl::style::CustomLayer *)super.rawLayer; } -- (MGLMapView *)mapView { - if ([self.style.stylable isKindOfClass:[MGLMapView class]]) { - return (MGLMapView *)self.style.stylable; +- (MLNMapView *)mapView { + if ([self.style.stylable isKindOfClass:[MLNMapView class]]) { + return (MLNMapView *)self.style.stylable; } return nil; } @@ -86,13 +86,13 @@ class MGLOpenGLLayerHost; #endif // MARK: - Adding to and removing from a map view -- (void)addToStyle:(MGLStyle *)style belowLayer:(MGLStyleLayer *)otherLayer { +- (void)addToStyle:(MLNStyle *)style belowLayer:(MLNStyleLayer *)otherLayer { self.style = style; self.style.openGLLayers[self.identifier] = self; [super addToStyle:style belowLayer:otherLayer]; } -- (void)removeFromStyle:(MGLStyle *)style { +- (void)removeFromStyle:(MLNStyle *)style { [super removeFromStyle:style]; self.style.openGLLayers[self.identifier] = nil; self.style = nil; @@ -111,7 +111,7 @@ class MGLOpenGLLayerHost; @param mapView The map view to whose style the layer has been added. */ -- (void)didMoveToMapView:(MGLMapView *)mapView { +- (void)didMoveToMapView:(MLNMapView *)mapView { } @@ -127,7 +127,7 @@ class MGLOpenGLLayerHost; @param mapView The map view from whose style the layer is about to be removed. */ -- (void)willMoveFromMapView:(MGLMapView *)mapView { +- (void)willMoveFromMapView:(MLNMapView *)mapView { } @@ -150,7 +150,7 @@ class MGLOpenGLLayerHost; @param mapView The map view to which the layer draws. @param context A context structure with information defining the frame to draw. */ -- (void)drawInMapView:(MGLMapView *)mapView withContext:(MGLStyleLayerDrawingContext)context { +- (void)drawInMapView:(MLNMapView *)mapView withContext:(MLNStyleLayerDrawingContext)context { } @@ -164,9 +164,9 @@ class MGLOpenGLLayerHost; @end -class MGLOpenGLLayerHost : public mbgl::style::CustomLayerHost { +class MLNOpenGLLayerHost : public mbgl::style::CustomLayerHost { public: - MGLOpenGLLayerHost(MGLOpenGLStyleLayer *styleLayer) { + MLNOpenGLLayerHost(MLNOpenGLStyleLayer *styleLayer) { layerRef = styleLayer; layer = nil; } @@ -183,14 +183,14 @@ public: void render(const mbgl::style::CustomLayerRenderParameters ¶ms) { if(!layer) return; - MGLStyleLayerDrawingContext drawingContext = { + MLNStyleLayerDrawingContext drawingContext = { .size = CGSizeMake(params.width, params.height), .centerCoordinate = CLLocationCoordinate2DMake(params.latitude, params.longitude), .zoomLevel = params.zoom, .direction = mbgl::util::wrap(params.bearing, 0., 360.), .pitch = static_cast(params.pitch), .fieldOfView = static_cast(params.fieldOfView), - .projectionMatrix = MGLMatrix4Make(params.projectionMatrix) + .projectionMatrix = MLNMatrix4Make(params.projectionMatrix) }; if (layer.mapView) { [layer drawInMapView:layer.mapView withContext:drawingContext]; @@ -209,14 +209,14 @@ public: layer = nil; } private: - __weak MGLOpenGLStyleLayer * layerRef; - MGLOpenGLStyleLayer * layer = nil; + __weak MLNOpenGLStyleLayer * layerRef; + MLNOpenGLStyleLayer * layer = nil; }; namespace mbgl { -MGLStyleLayer* OpenGLStyleLayerPeerFactory::createPeer(style::Layer* rawLayer) { - return [[MGLOpenGLStyleLayer alloc] initWithRawLayer:rawLayer]; +MLNStyleLayer* OpenGLStyleLayerPeerFactory::createPeer(style::Layer* rawLayer) { + return [[MLNOpenGLStyleLayer alloc] initWithRawLayer:rawLayer]; } } // namespace mbgl diff --git a/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer_Private.h b/platform/ios/platform/darwin/src/MLNOpenGLStyleLayer_Private.h similarity index 76% rename from platform/ios/platform/darwin/src/MGLOpenGLStyleLayer_Private.h rename to platform/ios/platform/darwin/src/MLNOpenGLStyleLayer_Private.h index 15dd6bf81..3778ae5d2 100644 --- a/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer_Private.h +++ b/platform/ios/platform/darwin/src/MLNOpenGLStyleLayer_Private.h @@ -1,6 +1,6 @@ #pragma once -#include "MGLStyleLayer_Private.h" +#include "MLNStyleLayer_Private.h" #include @@ -9,7 +9,7 @@ namespace mbgl { class OpenGLStyleLayerPeerFactory : public LayerPeerFactory, public mbgl::CustomLayerFactory { // LayerPeerFactory overrides. LayerFactory* getCoreLayerFactory() final { return this; } - virtual MGLStyleLayer* createPeer(style::Layer*) final; + virtual MLNStyleLayer* createPeer(style::Layer*) final; }; } // namespace mbgl diff --git a/platform/ios/platform/darwin/src/MGLOverlay.h b/platform/ios/platform/darwin/src/MLNOverlay.h similarity index 87% rename from platform/ios/platform/darwin/src/MGLOverlay.h rename to platform/ios/platform/darwin/src/MLNOverlay.h index 7706b741e..20e44f50a 100644 --- a/platform/ios/platform/darwin/src/MGLOverlay.h +++ b/platform/ios/platform/darwin/src/MLNOverlay.h @@ -1,13 +1,13 @@ #import #import -#import "MGLAnnotation.h" -#import "MGLGeometry.h" +#import "MLNAnnotation.h" +#import "MLNGeometry.h" NS_ASSUME_NONNULL_BEGIN /** - The `MGLOverlay` protocol defines a specific type of annotation that represents + The `MLNOverlay` protocol defines a specific type of annotation that represents both a point and an area on a map. Overlay objects are essentially data objects that contain the geographic data needed to represent the map area. Overlays can take the form of a polyline or polygon. @@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN trace a bus route along city streets. This SDK defines several concrete classes that conform to this protocol and define standard shapes. */ -@protocol MGLOverlay +@protocol MLNOverlay /** A coordinate representing the overlay. (required) (read-only) @@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN Pacific Ocean from Tokyo to San Francisco might have a bounds extending from (35.68476, −220.24257) to (37.78428, −122.41310). */ -@property (nonatomic, readonly) MGLCoordinateBounds overlayBounds; +@property (nonatomic, readonly) MLNCoordinateBounds overlayBounds; /** Returns a Boolean indicating whether the specified rectangle intersects the @@ -50,7 +50,7 @@ NS_ASSUME_NONNULL_BEGIN @return `YES` if any part of the map rectangle intersects the receiver’s shape or `NO` if it does not. */ -- (BOOL)intersectsOverlayBounds:(MGLCoordinateBounds)overlayBounds; +- (BOOL)intersectsOverlayBounds:(MLNCoordinateBounds)overlayBounds; @end diff --git a/platform/ios/platform/darwin/src/MGLPointAnnotation.h b/platform/ios/platform/darwin/src/MLNPointAnnotation.h similarity index 57% rename from platform/ios/platform/darwin/src/MGLPointAnnotation.h rename to platform/ios/platform/darwin/src/MLNPointAnnotation.h index 27562f0df..08bfec7ee 100644 --- a/platform/ios/platform/darwin/src/MGLPointAnnotation.h +++ b/platform/ios/platform/darwin/src/MLNPointAnnotation.h @@ -1,35 +1,35 @@ #import #import -#import "MGLFoundation.h" -#import "MGLShape.h" +#import "MLNFoundation.h" +#import "MLNShape.h" NS_ASSUME_NONNULL_BEGIN /** - An `MGLPointAnnotation` object represents a one-dimensional shape located at a + An `MLNPointAnnotation` object represents a one-dimensional shape located at a single geographical coordinate. Depending on how it is used, an - `MGLPointAnnotation` object is known as a point annotation or point shape. For + `MLNPointAnnotation` object is known as a point annotation or point shape. For example, you could use a point shape to represent a city at low zoom levels, an address at high zoom levels, or the location of a long press gesture. - You can add point shapes to the map by adding them to an `MGLShapeSource` - object. Configure the appearance of an `MGLShapeSource`’s or - `MGLVectorTileSource`’s point shapes collectively using an `MGLCircleStyleLayer` or - `MGLSymbolStyleLayer` object. + You can add point shapes to the map by adding them to an `MLNShapeSource` + object. Configure the appearance of an `MLNShapeSource`’s or + `MLNVectorTileSource`’s point shapes collectively using an `MLNCircleStyleLayer` or + `MLNSymbolStyleLayer` object. For more interactivity, add a selectable point annotation to a map view using - the `-[MGLMapView addAnnotation:]` method. Alternatively, define your own model - class that conforms to the `MGLAnnotation` protocol. Configure a point + the `-[MLNMapView addAnnotation:]` method. Alternatively, define your own model + class that conforms to the `MLNAnnotation` protocol. Configure a point annotation’s appearance using - `-[MGLMapViewDelegate mapView:imageForAnnotation:]` or - `-[MGLMapViewDelegate mapView:viewForAnnotation:]` (iOS only). A point - annotation’s `MGLShape.title` and `MGLShape.subtitle` properties define the + `-[MLNMapViewDelegate mapView:imageForAnnotation:]` or + `-[MLNMapViewDelegate mapView:viewForAnnotation:]` (iOS only). A point + annotation’s `MLNShape.title` and `MLNShape.subtitle` properties define the default content of the annotation’s callout (on iOS) or popover (on macOS). To group multiple related points together in one shape, use an - `MGLPointCollection` or `MGLShapeCollection` object. To access - a point’s attributes, use an `MGLPointFeature` object. + `MLNPointCollection` or `MLNShapeCollection` object. To access + a point’s attributes, use an `MLNPointFeature` object. A point shape is known as a Point geometry @@ -39,11 +39,11 @@ NS_ASSUME_NONNULL_BEGIN See the Mark a place on the map with an annotation, Mark a place on the map with an image, and - Default callout usage examples to learn how to add `MGLPointAnnotation` + Default callout usage examples to learn how to add `MLNPointAnnotation` objects to your map. */ -MGL_EXPORT -@interface MGLPointAnnotation : MGLShape +MLN_EXPORT +@interface MLNPointAnnotation : MLNShape /** The coordinate point of the shape, specified as a latitude and longitude. diff --git a/platform/ios/platform/darwin/src/MGLPointAnnotation.mm b/platform/ios/platform/darwin/src/MLNPointAnnotation.mm similarity index 76% rename from platform/ios/platform/darwin/src/MGLPointAnnotation.mm rename to platform/ios/platform/darwin/src/MLNPointAnnotation.mm index 233bef0a0..7fc23795e 100644 --- a/platform/ios/platform/darwin/src/MGLPointAnnotation.mm +++ b/platform/ios/platform/darwin/src/MLNPointAnnotation.mm @@ -1,13 +1,13 @@ -#import "MGLPointAnnotation.h" +#import "MLNPointAnnotation.h" -#import "MGLShape_Private.h" -#import "NSCoder+MGLAdditions.h" -#import "MGLLoggingConfiguration_Private.h" +#import "MLNShape_Private.h" +#import "NSCoder+MLNAdditions.h" +#import "MLNLoggingConfiguration_Private.h" #import -@implementation MGLPointAnnotation +@implementation MLNPointAnnotation @synthesize coordinate; @@ -18,9 +18,9 @@ - (instancetype)initWithCoder:(NSCoder *)coder { - MGLLogInfo(@"Initializing with coder."); + MLNLogInfo(@"Initializing with coder."); if (self = [super initWithCoder:coder]) { - self.coordinate = [coder decodeMGLCoordinateForKey:@"coordinate"]; + self.coordinate = [coder decodeMLNCoordinateForKey:@"coordinate"]; } return self; } @@ -28,15 +28,15 @@ - (void)encodeWithCoder:(NSCoder *)coder { [super encodeWithCoder:coder]; - [coder encodeMGLCoordinate:coordinate forKey:@"coordinate"]; + [coder encodeMLNCoordinate:coordinate forKey:@"coordinate"]; } - (BOOL)isEqual:(id)other { if (other == self) return YES; - if (![other isKindOfClass:[MGLPointAnnotation class]]) return NO; + if (![other isKindOfClass:[MLNPointAnnotation class]]) return NO; - MGLPointAnnotation *otherAnnotation = other; + MLNPointAnnotation *otherAnnotation = other; return ([super isEqual:other] && self.coordinate.latitude == otherAnnotation.coordinate.latitude && self.coordinate.longitude == otherAnnotation.coordinate.longitude); diff --git a/platform/ios/platform/darwin/src/MGLPointCollection.h b/platform/ios/platform/darwin/src/MLNPointCollection.h similarity index 69% rename from platform/ios/platform/darwin/src/MGLPointCollection.h rename to platform/ios/platform/darwin/src/MLNPointCollection.h index 65ce95cb0..2d86ca301 100644 --- a/platform/ios/platform/darwin/src/MGLPointCollection.h +++ b/platform/ios/platform/darwin/src/MLNPointCollection.h @@ -1,38 +1,38 @@ #import #import -#import "MGLFoundation.h" -#import "MGLOverlay.h" -#import "MGLShape.h" +#import "MLNFoundation.h" +#import "MLNOverlay.h" +#import "MLNShape.h" /** - An `MGLPointCollection` object represents a shape consisting of one or more + An `MLNPointCollection` object represents a shape consisting of one or more disconnected vertices, specified as `CLLocationCoordinate2D` instances. The points in the collection may be related but are not connected spatially. For example, you could use a point collection to represent all the trees in an orchard. - You can add point collections to the map by adding them to an `MGLShapeSource` - object. Configure the appearance of an `MGLShapeSource`’s or - `MGLVectorTileSource`’s point collections collectively using an - `MGLCircleStyleLayer` or `MGLSymbolStyleLayer` object. To access a point - collection’s attributes, use an `MGLPointCollectionFeature` object. + You can add point collections to the map by adding them to an `MLNShapeSource` + object. Configure the appearance of an `MLNShapeSource`’s or + `MLNVectorTileSource`’s point collections collectively using an + `MLNCircleStyleLayer` or `MLNSymbolStyleLayer` object. To access a point + collection’s attributes, use an `MLNPointCollectionFeature` object. - You cannot add an `MGLPointCollection` object directly to a map view as an - annotation. However, you can create individual `MGLPointAnnotation` objects + You cannot add an `MLNPointCollection` object directly to a map view as an + annotation. However, you can create individual `MLNPointAnnotation` objects from the `coordinates` array and add those annotation objects to the map view - using the `-[MGLMapView addAnnotations:]` method. + using the `-[MLNMapView addAnnotations:]` method. A point collection is known as a MultiPoint - geometry in GeoJSON. Do not confuse `MGLPointCollection` with `MGLMultiPoint`, - the abstract superclass of `MGLPolyline` and `MGLPolygon`. + geometry in GeoJSON. Do not confuse `MLNPointCollection` with `MLNMultiPoint`, + the abstract superclass of `MLNPolyline` and `MLNPolygon`. */ -MGL_EXPORT -@interface MGLPointCollection : MGLShape +MLN_EXPORT +@interface MLNPointCollection : MLNShape /** - Creates and returns a `MGLPointCollection` object from the specified set of + Creates and returns a `MLNPointCollection` object from the specified set of coordinates. @param coords The array of coordinates defining the shape. The data in this diff --git a/platform/ios/platform/darwin/src/MGLPointCollection.mm b/platform/ios/platform/darwin/src/MLNPointCollection.mm similarity index 79% rename from platform/ios/platform/darwin/src/MGLPointCollection.mm rename to platform/ios/platform/darwin/src/MLNPointCollection.mm index 65657ef21..6ce647108 100644 --- a/platform/ios/platform/darwin/src/MGLPointCollection.mm +++ b/platform/ios/platform/darwin/src/MLNPointCollection.mm @@ -1,14 +1,14 @@ -#import "MGLPointCollection_Private.h" -#import "MGLGeometry_Private.h" -#import "NSArray+MGLAdditions.h" -#import "MGLLoggingConfiguration_Private.h" +#import "MLNPointCollection_Private.h" +#import "MLNGeometry_Private.h" +#import "NSArray+MLNAdditions.h" +#import "MLNLoggingConfiguration_Private.h" #import #import NS_ASSUME_NONNULL_BEGIN -@implementation MGLPointCollection +@implementation MLNPointCollection { std::optional _bounds; std::vector _coordinates; @@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count { - MGLLogDebug(@"Initializing with %lu coordinates.", (unsigned long)count); + MLNLogDebug(@"Initializing with %lu coordinates.", (unsigned long)count); self = [super init]; if (self) { @@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable instancetype)initWithCoder:(NSCoder *)decoder { - MGLLogInfo(@"Initializing with coder.O"); + MLNLogInfo(@"Initializing with coder.O"); if (self = [super initWithCoder:decoder]) { NSArray *coordinates = [decoder decodeObjectOfClass:[NSArray class] forKey:@"coordinates"]; _coordinates = [coordinates mgl_coordinates]; @@ -46,26 +46,26 @@ NS_ASSUME_NONNULL_BEGIN - (BOOL)isEqual:(id)other { if (self == other) return YES; - if (![other isKindOfClass:[MGLPointCollection class]]) return NO; + if (![other isKindOfClass:[MLNPointCollection class]]) return NO; - MGLPointCollection *otherCollection = (MGLPointCollection *)other; + MLNPointCollection *otherCollection = (MLNPointCollection *)other; return ([super isEqual:other] && ((![self geoJSONDictionary] && ![otherCollection geoJSONDictionary]) || [[self geoJSONDictionary] isEqualToDictionary:[otherCollection geoJSONDictionary]])); } -- (MGLCoordinateBounds)overlayBounds { +- (MLNCoordinateBounds)overlayBounds { if (!_bounds) { mbgl::LatLngBounds bounds = mbgl::LatLngBounds::empty(); for (auto coordinate : _coordinates) { - if (!MGLLocationCoordinate2DIsValid(coordinate)) { + if (!MLNLocationCoordinate2DIsValid(coordinate)) { bounds = mbgl::LatLngBounds::empty(); break; } - bounds.extend(MGLLatLngFromLocationCoordinate2D(coordinate)); + bounds.extend(MLNLatLngFromLocationCoordinate2D(coordinate)); } _bounds = bounds; } - return MGLCoordinateBoundsFromLatLngBounds(*_bounds); + return MLNCoordinateBoundsFromLatLngBounds(*_bounds); } - (NSUInteger)pointCount @@ -80,7 +80,7 @@ NS_ASSUME_NONNULL_BEGIN - (CLLocationCoordinate2D)coordinate { - MGLAssert([self pointCount] > 0, @"A multipoint must have coordinates"); + MLNAssert([self pointCount] > 0, @"A multipoint must have coordinates"); return _coordinates.at(0); } @@ -96,9 +96,9 @@ NS_ASSUME_NONNULL_BEGIN std::copy(_coordinates.begin() + range.location, _coordinates.begin() + NSMaxRange(range), coords); } -- (BOOL)intersectsOverlayBounds:(MGLCoordinateBounds)overlayBounds +- (BOOL)intersectsOverlayBounds:(MLNCoordinateBounds)overlayBounds { - return MGLCoordinateBoundsIntersectsCoordinateBounds(self.overlayBounds, overlayBounds); + return MLNCoordinateBoundsIntersectsCoordinateBounds(self.overlayBounds, overlayBounds); } - (mbgl::Geometry)geometryObject @@ -128,7 +128,7 @@ NS_ASSUME_NONNULL_BEGIN { return [NSString stringWithFormat:@"<%@: %p; count = %lu; bounds = %@>", NSStringFromClass([self class]), (void *)self, (unsigned long)[self pointCount], - MGLStringFromCoordinateBounds(self.overlayBounds)]; + MLNStringFromCoordinateBounds(self.overlayBounds)]; } @end diff --git a/platform/ios/platform/darwin/src/MGLPointCollection_Private.h b/platform/ios/platform/darwin/src/MLNPointCollection_Private.h similarity index 68% rename from platform/ios/platform/darwin/src/MGLPointCollection_Private.h rename to platform/ios/platform/darwin/src/MLNPointCollection_Private.h index fc1c33fe4..48b94760a 100644 --- a/platform/ios/platform/darwin/src/MGLPointCollection_Private.h +++ b/platform/ios/platform/darwin/src/MLNPointCollection_Private.h @@ -1,8 +1,8 @@ -#import "MGLPointCollection.h" +#import "MLNPointCollection.h" NS_ASSUME_NONNULL_BEGIN -@interface MGLPointCollection (Private) +@interface MLNPointCollection (Private) - (instancetype)initWithCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count; diff --git a/platform/ios/platform/darwin/src/MGLPolygon.h b/platform/ios/platform/darwin/src/MLNPolygon.h similarity index 66% rename from platform/ios/platform/darwin/src/MGLPolygon.h rename to platform/ios/platform/darwin/src/MLNPolygon.h index 900e43334..6725809be 100644 --- a/platform/ios/platform/darwin/src/MGLPolygon.h +++ b/platform/ios/platform/darwin/src/MLNPolygon.h @@ -1,46 +1,46 @@ #import #import -#import "MGLFoundation.h" -#import "MGLMultiPoint.h" -#import "MGLOverlay.h" +#import "MLNFoundation.h" +#import "MLNMultiPoint.h" +#import "MLNOverlay.h" -#import "MGLTypes.h" +#import "MLNTypes.h" NS_ASSUME_NONNULL_BEGIN /** - An `MGLPolygon` object represents a closed shape consisting of four or more + An `MLNPolygon` object represents a closed shape consisting of four or more vertices, specified as `CLLocationCoordinate2D` instances, and the edges that connect them. For example, you could use a polygon shape to represent a building, a lake, or an area you want to highlight. - You can add polygon shapes to the map by adding them to an `MGLShapeSource` - object. Configure the appearance of an `MGLShapeSource`’s or - `MGLVectorTileSource`’s polygons collectively using an `MGLFillStyleLayer` or - `MGLSymbolStyleLayer` object. To access a polygon’s attributes, use an - `MGLPolygonFeature` object. + You can add polygon shapes to the map by adding them to an `MLNShapeSource` + object. Configure the appearance of an `MLNShapeSource`’s or + `MLNVectorTileSource`’s polygons collectively using an `MLNFillStyleLayer` or + `MLNSymbolStyleLayer` object. To access a polygon’s attributes, use an + `MLNPolygonFeature` object. Alternatively, you can add a polygon overlay directly to a map view using the - `-[MGLMapView addAnnotation:]` or `-[MGLMapView addOverlay:]` method. Configure + `-[MLNMapView addAnnotation:]` or `-[MLNMapView addOverlay:]` method. Configure a polygon overlay’s appearance using - `-[MGLMapViewDelegate mapView:strokeColorForShapeAnnotation:]` and - `-[MGLMapViewDelegate mapView:fillColorForPolygonAnnotation:]`. + `-[MLNMapViewDelegate mapView:strokeColorForShapeAnnotation:]` and + `-[MLNMapViewDelegate mapView:fillColorForPolygonAnnotation:]`. The vertices are automatically connected in the order in which you provide them. You should close the polygon by specifying the same `CLLocationCoordinate2D` as the first and last vertices; otherwise, the polygon’s fill may not cover the area you expect it to. To avoid filling the space within the shape, give the polygon a transparent fill or use an - `MGLPolyline` object. + `MLNPolyline` object. A polygon may have one or more interior polygons, or holes, that you specify as - `MGLPolygon` objects with the `+polygonWithCoordinates:count:interiorPolygons:` + `MLNPolygon` objects with the `+polygonWithCoordinates:count:interiorPolygons:` method. For example, if a polygon represents a lake, it could exclude an island within the lake using an interior polygon. Interior polygons may not themselves have interior polygons. To represent a shape that includes a polygon within a hole or, more generally, to group multiple polygons together in one shape, use - an `MGLMultiPolygon` or `MGLShapeCollection` object. + an `MLNMultiPolygon` or `MLNShapeCollection` object. To make the polygon straddle the antimeridian, specify some longitudes less than −180 degrees or greater than 180 degrees. @@ -48,10 +48,10 @@ NS_ASSUME_NONNULL_BEGIN #### Related examples See the Add a polygon annotation example to learn how to initialize an - `MGLPolygon` object from an array of coordinates. + `MLNPolygon` object from an array of coordinates. */ -MGL_EXPORT -@interface MGLPolygon : MGLMultiPoint +MLN_EXPORT +@interface MLNPolygon : MLNMultiPoint /** The array of polygons nested inside the receiver. @@ -62,10 +62,10 @@ MGL_EXPORT If there are no interior polygons, the value of this property is `nil`. */ -@property (nonatomic, nullable, readonly) NSArray *interiorPolygons; +@property (nonatomic, nullable, readonly) NSArray *interiorPolygons; /** - Creates and returns an `MGLPolygon` object from the specified set of + Creates and returns an `MLNPolygon` object from the specified set of coordinates. @param coords The array of coordinates defining the shape. The data in this @@ -76,45 +76,45 @@ MGL_EXPORT + (instancetype)polygonWithCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count; /** - Creates and returns an `MGLPolygon` object from the specified set of + Creates and returns an `MLNPolygon` object from the specified set of coordinates and interior polygons. @param coords The array of coordinates defining the shape. The data in this array is copied to the new object. @param count The number of items in the `coords` array. - @param interiorPolygons An array of `MGLPolygon` objects that define regions + @param interiorPolygons An array of `MLNPolygon` objects that define regions excluded from the overall shape. If this array is `nil` or empty, the shape is considered to have no interior polygons. @return A new polygon object. */ -+ (instancetype)polygonWithCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count interiorPolygons:(nullable NSArray *)interiorPolygons; ++ (instancetype)polygonWithCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count interiorPolygons:(nullable NSArray *)interiorPolygons; @end /** - An `MGLMultiPolygon` object represents a shape consisting of one or more + An `MLNMultiPolygon` object represents a shape consisting of one or more polygons that do not overlap. For example, you could use a multipolygon shape to represent the body of land that consists of an island surrounded by an - atoll: the inner island would be one `MGLPolygon` object, while the surrounding + atoll: the inner island would be one `MLNPolygon` object, while the surrounding atoll would be another. You could also use a multipolygon shape to represent a group of disconnected but related buildings. You can add multipolygon shapes to the map by adding them to an - `MGLShapeSource` object. Configure the appearance of an `MGLShapeSource`’s or - `MGLVectorTileSource`’s multipolygons collectively using an `MGLFillStyleLayer` - or `MGLSymbolStyleLayer` object. + `MLNShapeSource` object. Configure the appearance of an `MLNShapeSource`’s or + `MLNVectorTileSource`’s multipolygons collectively using an `MLNFillStyleLayer` + or `MLNSymbolStyleLayer` object. - You cannot add an `MGLMultiPolygon` object directly to a map view using - `-[MGLMapView addAnnotation:]` or `-[MGLMapView addOverlay:]`. However, you can + You cannot add an `MLNMultiPolygon` object directly to a map view using + `-[MLNMapView addAnnotation:]` or `-[MLNMapView addOverlay:]`. However, you can add the `polygons` array’s items as overlays individually. */ -MGL_EXPORT -@interface MGLMultiPolygon : MGLShape +MLN_EXPORT +@interface MLNMultiPolygon : MLNShape /** An array of polygons forming the multipolygon. */ -@property (nonatomic, copy, readonly) NSArray *polygons; +@property (nonatomic, copy, readonly) NSArray *polygons; /** Creates and returns a multipolygon object consisting of the given polygons. @@ -122,7 +122,7 @@ MGL_EXPORT @param polygons The array of polygons defining the shape. @return A new multipolygon object. */ -+ (instancetype)multiPolygonWithPolygons:(NSArray *)polygons; ++ (instancetype)multiPolygonWithPolygons:(NSArray *)polygons; @end diff --git a/platform/ios/platform/darwin/src/MGLPolygon.mm b/platform/ios/platform/darwin/src/MLNPolygon.mm similarity index 75% rename from platform/ios/platform/darwin/src/MGLPolygon.mm rename to platform/ios/platform/darwin/src/MLNPolygon.mm index 52bff01b2..868083e9e 100644 --- a/platform/ios/platform/darwin/src/MGLPolygon.mm +++ b/platform/ios/platform/darwin/src/MLNPolygon.mm @@ -1,15 +1,15 @@ -#import "MGLPolygon_Private.h" +#import "MLNPolygon_Private.h" -#import "MGLMultiPoint_Private.h" -#import "MGLGeometry_Private.h" -#import "MGLLoggingConfiguration_Private.h" +#import "MLNMultiPoint_Private.h" +#import "MLNGeometry_Private.h" +#import "MLNLoggingConfiguration_Private.h" -#import "MGLFeature.h" +#import "MLNFeature.h" #import #import -@implementation MGLPolygon +@implementation MLNPolygon @dynamic overlayBounds; @@ -17,12 +17,12 @@ return [self polygonWithCoordinates:coords count:count interiorPolygons:nil]; } -+ (instancetype)polygonWithCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count interiorPolygons:(NSArray *)interiorPolygons { ++ (instancetype)polygonWithCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count interiorPolygons:(NSArray *)interiorPolygons { return [[self alloc] initWithCoordinates:coords count:count interiorPolygons:interiorPolygons]; } -- (instancetype)initWithCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count interiorPolygons:(NSArray *)interiorPolygons { - MGLLogDebug(@"Initializing with %lu coordinates and %lu interiorPolygons.", (unsigned long)count, (unsigned long)interiorPolygons); +- (instancetype)initWithCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count interiorPolygons:(NSArray *)interiorPolygons { + MLNLogDebug(@"Initializing with %lu coordinates and %lu interiorPolygons.", (unsigned long)count, (unsigned long)interiorPolygons); if (self = [super initWithCoordinates:coords count:count]) { if (interiorPolygons.count) { _interiorPolygons = interiorPolygons; @@ -32,7 +32,7 @@ } - (instancetype)initWithCoder:(NSCoder *)decoder { - MGLLogInfo(@"Initializng with coder."); + MLNLogInfo(@"Initializng with coder."); self = [super initWithCoder:decoder]; if (self) { _interiorPolygons = [decoder decodeObjectOfClass:[NSArray class] forKey:@"interiorPolygons"]; @@ -47,9 +47,9 @@ - (BOOL)isEqual:(id)other { if (self == other) return YES; - if (![other isKindOfClass:[MGLPolygon class]]) return NO; + if (![other isKindOfClass:[MLNPolygon class]]) return NO; - MGLPolygon *otherPolygon = (MGLPolygon *)other; + MLNPolygon *otherPolygon = (MLNPolygon *)other; return ([super isEqual:otherPolygon] && [[self geoJSONDictionary] isEqualToDictionary:[otherPolygon geoJSONDictionary]]); } @@ -62,7 +62,7 @@ // pole of inaccessibility auto poi = mapbox::polylabel([self polygon]); - return MGLLocationCoordinate2DFromPoint(poi); + return MLNLocationCoordinate2DFromPoint(poi); } - (mbgl::LinearRing)ring { @@ -80,7 +80,7 @@ - (mbgl::Polygon)polygon { mbgl::Polygon geometry; geometry.push_back(self.ring); - for (MGLPolygon *polygon in self.interiorPolygons) { + for (MLNPolygon *polygon in self.interiorPolygons) { geometry.push_back(polygon.ring); } return geometry; @@ -90,7 +90,7 @@ return [self polygon]; } -- (mbgl::Annotation)annotationObjectWithDelegate:(id )delegate { +- (mbgl::Annotation)annotationObjectWithDelegate:(id )delegate { mbgl::FillAnnotation annotation { [self polygon] }; annotation.opacity = { static_cast([delegate alphaForShapeAnnotation:self]) }; @@ -115,7 +115,7 @@ } [coordinates addObject:exteriorRing]; - for (MGLPolygon *interiorPolygon in self.interiorPolygons) { + for (MLNPolygon *interiorPolygon in self.interiorPolygons) { NSMutableArray *interiorRing = [NSMutableArray array]; for (NSUInteger index = 0; index < interiorPolygon.pointCount; index++) { CLLocationCoordinate2D coordinate = interiorPolygon.coordinates[index]; @@ -129,39 +129,39 @@ @end -@interface MGLMultiPolygon () +@interface MLNMultiPolygon () -@property (nonatomic, copy, readwrite) NSArray *polygons; +@property (nonatomic, copy, readwrite) NSArray *polygons; @end -@implementation MGLMultiPolygon { - MGLCoordinateBounds _overlayBounds; +@implementation MLNMultiPolygon { + MLNCoordinateBounds _overlayBounds; } @synthesize overlayBounds = _overlayBounds; -+ (instancetype)multiPolygonWithPolygons:(NSArray *)polygons { ++ (instancetype)multiPolygonWithPolygons:(NSArray *)polygons { return [[self alloc] initWithPolygons:polygons]; } -- (instancetype)initWithPolygons:(NSArray *)polygons { - MGLLogDebug(@"Initializing with %lu polygons.", (unsigned long)polygons.count); +- (instancetype)initWithPolygons:(NSArray *)polygons { + MLNLogDebug(@"Initializing with %lu polygons.", (unsigned long)polygons.count); if (self = [super init]) { _polygons = polygons; mbgl::LatLngBounds bounds = mbgl::LatLngBounds::empty(); - for (MGLPolygon *polygon in _polygons) { - bounds.extend(MGLLatLngBoundsFromCoordinateBounds(polygon.overlayBounds)); + for (MLNPolygon *polygon in _polygons) { + bounds.extend(MLNLatLngBoundsFromCoordinateBounds(polygon.overlayBounds)); } - _overlayBounds = MGLCoordinateBoundsFromLatLngBounds(bounds); + _overlayBounds = MLNCoordinateBoundsFromLatLngBounds(bounds); } return self; } - (instancetype)initWithCoder:(NSCoder *)decoder { - MGLLogInfo(@"Initializing with coder."); + MLNLogInfo(@"Initializing with coder."); if (self = [super initWithCoder:decoder]) { _polygons = [decoder decodeObjectOfClass:[NSArray class] forKey:@"polygons"]; } @@ -175,38 +175,38 @@ - (BOOL)isEqual:(id)other { if (self == other) return YES; - if (![other isKindOfClass:[MGLMultiPolygon class]]) return NO; + if (![other isKindOfClass:[MLNMultiPolygon class]]) return NO; - MGLMultiPolygon *otherMultiPolygon = other; + MLNMultiPolygon *otherMultiPolygon = other; return [super isEqual:other] && [self.polygons isEqualToArray:otherMultiPolygon.polygons]; } - (NSUInteger)hash { NSUInteger hash = [super hash]; - for (MGLPolygon *polygon in self.polygons) { + for (MLNPolygon *polygon in self.polygons) { hash += [polygon hash]; } return hash; } - (CLLocationCoordinate2D)coordinate { - MGLPolygon *firstPolygon = self.polygons.firstObject; + MLNPolygon *firstPolygon = self.polygons.firstObject; return firstPolygon.coordinate; } -- (BOOL)intersectsOverlayBounds:(MGLCoordinateBounds)overlayBounds { - return MGLCoordinateBoundsIntersectsCoordinateBounds(_overlayBounds, overlayBounds); +- (BOOL)intersectsOverlayBounds:(MLNCoordinateBounds)overlayBounds { + return MLNCoordinateBoundsIntersectsCoordinateBounds(_overlayBounds, overlayBounds); } - (mbgl::MultiPolygon)multiPolygon { mbgl::MultiPolygon multiPolygon; multiPolygon.reserve(self.polygons.count); - for (MGLPolygon *polygon in self.polygons) { + for (MLNPolygon *polygon in self.polygons) { mbgl::Polygon geometry; geometry.push_back(polygon.ring); - for (MGLPolygon *interiorPolygon in polygon.interiorPolygons) { + for (MLNPolygon *interiorPolygon in polygon.interiorPolygons) { geometry.push_back(interiorPolygon.ring); } multiPolygon.push_back(geometry); @@ -220,7 +220,7 @@ - (NSDictionary *)geoJSONDictionary { NSMutableArray *coordinates = [[NSMutableArray alloc] initWithCapacity:self.polygons.count]; - for (MGLPolygonFeature *feature in self.polygons) { + for (MLNPolygonFeature *feature in self.polygons) { [coordinates addObject: feature.mgl_coordinates]; } return @{@"type": @"MultiPolygon", @@ -234,7 +234,7 @@ self.title ? [NSString stringWithFormat:@"\"%@\"", self.title] : self.title, self.subtitle ? [NSString stringWithFormat:@"\"%@\"", self.subtitle] : self.subtitle, (unsigned long)self.polygons.count, - MGLStringFromCoordinateBounds(self.overlayBounds)]; + MLNStringFromCoordinateBounds(self.overlayBounds)]; } @end diff --git a/platform/ios/platform/darwin/src/MGLPolygon_Private.h b/platform/ios/platform/darwin/src/MLNPolygon_Private.h similarity index 62% rename from platform/ios/platform/darwin/src/MGLPolygon_Private.h rename to platform/ios/platform/darwin/src/MLNPolygon_Private.h index b006f2d77..4dc19e04e 100644 --- a/platform/ios/platform/darwin/src/MGLPolygon_Private.h +++ b/platform/ios/platform/darwin/src/MLNPolygon_Private.h @@ -1,8 +1,8 @@ -#import "MGLPolygon.h" +#import "MLNPolygon.h" NS_ASSUME_NONNULL_BEGIN -@interface MGLPolygon (Private) +@interface MLNPolygon (Private) - (NSArray *)mgl_coordinates; diff --git a/platform/ios/platform/darwin/src/MGLPolyline.h b/platform/ios/platform/darwin/src/MLNPolyline.h similarity index 62% rename from platform/ios/platform/darwin/src/MGLPolyline.h rename to platform/ios/platform/darwin/src/MLNPolyline.h index 9efaea24f..f899acbd8 100644 --- a/platform/ios/platform/darwin/src/MGLPolyline.h +++ b/platform/ios/platform/darwin/src/MLNPolyline.h @@ -1,38 +1,38 @@ #import #import -#import "MGLFoundation.h" -#import "MGLMultiPoint.h" -#import "MGLOverlay.h" +#import "MLNFoundation.h" +#import "MLNMultiPoint.h" +#import "MLNOverlay.h" -#import "MGLTypes.h" +#import "MLNTypes.h" NS_ASSUME_NONNULL_BEGIN /** - An `MGLPolyline` object represents a shape consisting of two or more vertices, + An `MLNPolyline` object represents a shape consisting of two or more vertices, specified as `CLLocationCoordinate2D` instances, and the line segments that connect them. For example, you could use an polyline to represent a road or the path along which something moves. - You can add polyline shapes to the map by adding them to an `MGLShapeSource` - object. Configure the appearance of an `MGLShapeSource`’s or - `MGLVectorTileSource`’s polylines collectively using an `MGLLineStyleLayer` or - `MGLSymbolStyleLayer` object. To access a polyline’s attributes, use an - `MGLPolylineFeature` object. + You can add polyline shapes to the map by adding them to an `MLNShapeSource` + object. Configure the appearance of an `MLNShapeSource`’s or + `MLNVectorTileSource`’s polylines collectively using an `MLNLineStyleLayer` or + `MLNSymbolStyleLayer` object. To access a polyline’s attributes, use an + `MLNPolylineFeature` object. Alternatively, you can add a polyline overlay directly to a map view using the - `-[MGLMapView addAnnotation:]` or `-[MGLMapView addOverlay:]` method. Configure + `-[MLNMapView addAnnotation:]` or `-[MLNMapView addOverlay:]` method. Configure a polyline overlay’s appearance using - `-[MGLMapViewDelegate mapView:strokeColorForShapeAnnotation:]` and - `-[MGLMapViewDelegate mapView:lineWidthForPolylineAnnotation:]`. + `-[MLNMapViewDelegate mapView:strokeColorForShapeAnnotation:]` and + `-[MLNMapViewDelegate mapView:lineWidthForPolylineAnnotation:]`. The vertices are automatically connected in the order in which you provide them. The first and last vertices are not connected to each other, but you can specify the same `CLLocationCoordinate2D` as the first and last vertices in order to close the polyline. To fill the space within the shape, use an - `MGLPolygon` object. To group multiple polylines together in one shape, use an - `MGLMultiPolyline` or `MGLShapeCollection` object. + `MLNPolygon` object. To group multiple polylines together in one shape, use an + `MLNMultiPolyline` or `MLNShapeCollection` object. To make the polyline go across the antimeridian or international date line, specify some longitudes less than −180 degrees or greater than 180 degrees. @@ -44,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN CLLocationCoordinate2D(latitude: 35.68476, longitude: -220.24257), CLLocationCoordinate2D(latitude: 37.78428, longitude: -122.41310) ] - let polyline = MGLPolyline(coordinates: coordinates, count: UInt(coordinates.count)) + let polyline = MLNPolyline(coordinates: coordinates, count: UInt(coordinates.count)) ``` A polyline is known as a @@ -53,14 +53,14 @@ NS_ASSUME_NONNULL_BEGIN #### Related examples See the - Annotation models example to learn how to add an `MGLPolyine` object to + Annotation models example to learn how to add an `MLNPolyine` object to your map. */ -MGL_EXPORT -@interface MGLPolyline : MGLMultiPoint +MLN_EXPORT +@interface MLNPolyline : MLNMultiPoint /** - Creates and returns an `MGLPolyline` object from the specified set of + Creates and returns an `MLNPolyline` object from the specified set of coordinates. @param coords The array of coordinates defining the shape. The data in this @@ -73,31 +73,31 @@ MGL_EXPORT @end /** - An `MGLMultiPolyline` object represents a shape consisting of one or more + An `MLNMultiPolyline` object represents a shape consisting of one or more polylines. For example, you could use a multipolyline shape to represent both sides of a divided highway (dual carriageway), excluding the median (central - reservation): each carriageway would be a distinct `MGLPolyline` object. + reservation): each carriageway would be a distinct `MLNPolyline` object. You can add multipolyline shapes to the map by adding them to an - `MGLShapeSource` object. Configure the appearance of an `MGLShapeSource`’s or - `MGLVectorTileSource`’s multipolylines collectively using an - `MGLLineStyleLayer` or `MGLSymbolStyleLayer` object. + `MLNShapeSource` object. Configure the appearance of an `MLNShapeSource`’s or + `MLNVectorTileSource`’s multipolylines collectively using an + `MLNLineStyleLayer` or `MLNSymbolStyleLayer` object. - You cannot add an `MGLMultiPolyline` object directly to a map view using - `-[MGLMapView addAnnotation:]` or `-[MGLMapView addOverlay:]`. However, you can + You cannot add an `MLNMultiPolyline` object directly to a map view using + `-[MLNMapView addAnnotation:]` or `-[MLNMapView addOverlay:]`. However, you can add the `polylines` array’s items as overlays individually. A multipolyline is known as a MultiLineString geometry in GeoJSON. */ -MGL_EXPORT -@interface MGLMultiPolyline : MGLShape +MLN_EXPORT +@interface MLNMultiPolyline : MLNShape /** An array of polygons forming the multipolyline. */ -@property (nonatomic, copy, readonly) NSArray *polylines; +@property (nonatomic, copy, readonly) NSArray *polylines; /** Creates and returns a multipolyline object consisting of the given polylines. @@ -105,7 +105,7 @@ MGL_EXPORT @param polylines The array of polylines defining the shape. @return A new multipolyline object. */ -+ (instancetype)multiPolylineWithPolylines:(NSArray *)polylines; ++ (instancetype)multiPolylineWithPolylines:(NSArray *)polylines; @end diff --git a/platform/ios/platform/darwin/src/MGLPolyline.mm b/platform/ios/platform/darwin/src/MLNPolyline.mm similarity index 70% rename from platform/ios/platform/darwin/src/MGLPolyline.mm rename to platform/ios/platform/darwin/src/MLNPolyline.mm index 25c540b52..ead8e0c9e 100644 --- a/platform/ios/platform/darwin/src/MGLPolyline.mm +++ b/platform/ios/platform/darwin/src/MLNPolyline.mm @@ -1,15 +1,15 @@ -#import "MGLPolyline_Private.h" +#import "MLNPolyline_Private.h" -#import "MGLMultiPoint_Private.h" -#import "MGLGeometry_Private.h" +#import "MLNMultiPoint_Private.h" +#import "MLNGeometry_Private.h" -#import "MGLFeature.h" -#import "MGLLoggingConfiguration_Private.h" +#import "MLNFeature.h" +#import "MLNLoggingConfiguration_Private.h" #import #import -@implementation MGLPolyline +@implementation MLNPolyline @dynamic overlayBounds; @@ -32,7 +32,7 @@ return geometry; } -- (mbgl::Annotation)annotationObjectWithDelegate:(id )delegate { +- (mbgl::Annotation)annotationObjectWithDelegate:(id )delegate { mbgl::LineAnnotation annotation { [self lineString] }; annotation.opacity = { static_cast([delegate alphaForShapeAnnotation:self]) }; annotation.color = { [delegate strokeColorForShapeAnnotation:self] }; @@ -60,12 +60,12 @@ } - (BOOL)isEqual:(id)other { - return self == other || ([other isKindOfClass:[MGLPolyline class]] && [super isEqual:other]); + return self == other || ([other isKindOfClass:[MLNPolyline class]] && [super isEqual:other]); } - (CLLocationCoordinate2D)coordinate { NSUInteger count = self.pointCount; - MGLAssert(count > 0, @"Polyline must have coordinates"); + MLNAssert(count > 0, @"Polyline must have coordinates"); CLLocationCoordinate2D *coordinates = self.coordinates; CLLocationDistance middle = [self length] / 2.0; @@ -77,24 +77,24 @@ // Avoid a heap buffer overflow when there are only two coordinates. NSUInteger nextIndex = (i + 1 == count) ? 0 : 1; - MGLRadianCoordinate2D from = MGLRadianCoordinateFromLocationCoordinate(coordinates[i]); - MGLRadianCoordinate2D to = MGLRadianCoordinateFromLocationCoordinate(coordinates[i + nextIndex]); + MLNRadianCoordinate2D from = MLNRadianCoordinateFromLocationCoordinate(coordinates[i]); + MLNRadianCoordinate2D to = MLNRadianCoordinateFromLocationCoordinate(coordinates[i + nextIndex]); if (traveled >= middle) { double overshoot = middle - traveled; if (overshoot == 0) { return coordinates[i]; } - to = MGLRadianCoordinateFromLocationCoordinate(coordinates[i - 1]); + to = MLNRadianCoordinateFromLocationCoordinate(coordinates[i - 1]); CLLocationDirection direction = [self direction:from to:to] - 180; - MGLRadianCoordinate2D otherCoordinate = MGLRadianCoordinateAtDistanceFacingDirection(from, + MLNRadianCoordinate2D otherCoordinate = MLNRadianCoordinateAtDistanceFacingDirection(from, overshoot/mbgl::util::EARTH_RADIUS_M, - MGLRadiansFromDegrees(direction)); - return CLLocationCoordinate2DMake(MGLDegreesFromRadians(otherCoordinate.latitude), - MGLDegreesFromRadians(otherCoordinate.longitude)); + MLNRadiansFromDegrees(direction)); + return CLLocationCoordinate2DMake(MLNDegreesFromRadians(otherCoordinate.latitude), + MLNDegreesFromRadians(otherCoordinate.longitude)); } - traveled += (MGLDistanceBetweenRadianCoordinates(from, to) * mbgl::util::EARTH_RADIUS_M); + traveled += (MLNDistanceBetweenRadianCoordinates(from, to) * mbgl::util::EARTH_RADIUS_M); } } @@ -109,52 +109,52 @@ CLLocationCoordinate2D *coordinates = self.coordinates; for (NSUInteger i = 0; i < count - 1; i++) { - length += (MGLDistanceBetweenRadianCoordinates(MGLRadianCoordinateFromLocationCoordinate(coordinates[i]), MGLRadianCoordinateFromLocationCoordinate(coordinates[i + 1])) * mbgl::util::EARTH_RADIUS_M); + length += (MLNDistanceBetweenRadianCoordinates(MLNRadianCoordinateFromLocationCoordinate(coordinates[i]), MLNRadianCoordinateFromLocationCoordinate(coordinates[i + 1])) * mbgl::util::EARTH_RADIUS_M); } return length; } -- (CLLocationDirection)direction:(MGLRadianCoordinate2D)from to:(MGLRadianCoordinate2D)to +- (CLLocationDirection)direction:(MLNRadianCoordinate2D)from to:(MLNRadianCoordinate2D)to { - return MGLDegreesFromRadians(MGLRadianCoordinatesDirection(from, to)); + return MLNDegreesFromRadians(MLNRadianCoordinatesDirection(from, to)); } @end -@interface MGLMultiPolyline () +@interface MLNMultiPolyline () -@property (nonatomic, copy, readwrite) NSArray *polylines; +@property (nonatomic, copy, readwrite) NSArray *polylines; @end -@implementation MGLMultiPolyline { - MGLCoordinateBounds _overlayBounds; +@implementation MLNMultiPolyline { + MLNCoordinateBounds _overlayBounds; } @synthesize overlayBounds = _overlayBounds; -+ (instancetype)multiPolylineWithPolylines:(NSArray *)polylines { ++ (instancetype)multiPolylineWithPolylines:(NSArray *)polylines { return [[self alloc] initWithPolylines:polylines]; } -- (instancetype)initWithPolylines:(NSArray *)polylines { - MGLLogDebug(@"Initializing with %lu polylines.", (unsigned long)polylines.count); +- (instancetype)initWithPolylines:(NSArray *)polylines { + MLNLogDebug(@"Initializing with %lu polylines.", (unsigned long)polylines.count); if (self = [super init]) { _polylines = polylines; mbgl::LatLngBounds bounds = mbgl::LatLngBounds::empty(); - for (MGLPolyline *polyline in _polylines) { - bounds.extend(MGLLatLngBoundsFromCoordinateBounds(polyline.overlayBounds)); + for (MLNPolyline *polyline in _polylines) { + bounds.extend(MLNLatLngBoundsFromCoordinateBounds(polyline.overlayBounds)); } - _overlayBounds = MGLCoordinateBoundsFromLatLngBounds(bounds); + _overlayBounds = MLNCoordinateBoundsFromLatLngBounds(bounds); } return self; } - (instancetype)initWithCoder:(NSCoder *)decoder { - MGLLogInfo(@"Initializing with coder."); + MLNLogInfo(@"Initializing with coder."); if (self = [super initWithCoder:decoder]) { _polylines = [decoder decodeObjectOfClass:[NSArray class] forKey:@"polylines"]; } @@ -169,38 +169,38 @@ - (BOOL)isEqual:(id)other { if (self == other) return YES; - if (![other isKindOfClass:[MGLMultiPolyline class]]) return NO; + if (![other isKindOfClass:[MLNMultiPolyline class]]) return NO; - MGLMultiPolyline *otherMultipoline = other; + MLNMultiPolyline *otherMultipoline = other; return ([super isEqual:otherMultipoline] && [self.polylines isEqualToArray:otherMultipoline.polylines]); } - (NSUInteger)hash { NSUInteger hash = [super hash]; - for (MGLPolyline *polyline in self.polylines) { + for (MLNPolyline *polyline in self.polylines) { hash += [polyline hash]; } return hash; } - (CLLocationCoordinate2D)coordinate { - MGLPolyline *polyline = self.polylines.firstObject; + MLNPolyline *polyline = self.polylines.firstObject; CLLocationCoordinate2D *coordinates = polyline.coordinates; - MGLAssert([polyline pointCount] > 0, @"Polyline must have coordinates"); + MLNAssert([polyline pointCount] > 0, @"Polyline must have coordinates"); CLLocationCoordinate2D firstCoordinate = coordinates[0]; return firstCoordinate; } -- (BOOL)intersectsOverlayBounds:(MGLCoordinateBounds)overlayBounds { - return MGLCoordinateBoundsIntersectsCoordinateBounds(_overlayBounds, overlayBounds); +- (BOOL)intersectsOverlayBounds:(MLNCoordinateBounds)overlayBounds { + return MLNCoordinateBoundsIntersectsCoordinateBounds(_overlayBounds, overlayBounds); } - (mbgl::Geometry)geometryObject { mbgl::MultiLineString multiLineString; multiLineString.reserve(self.polylines.count); - for (MGLPolyline *polyline in self.polylines) { + for (MLNPolyline *polyline in self.polylines) { multiLineString.push_back([polyline lineString]); } return multiLineString; @@ -208,7 +208,7 @@ - (NSDictionary *)geoJSONDictionary { NSMutableArray *coordinates = [NSMutableArray array]; - for (MGLPolylineFeature *feature in self.polylines) { + for (MLNPolylineFeature *feature in self.polylines) { [coordinates addObject: feature.mgl_coordinates]; } return @{@"type": @"MultiLineString", @@ -222,7 +222,7 @@ self.title ? [NSString stringWithFormat:@"\"%@\"", self.title] : self.title, self.subtitle ? [NSString stringWithFormat:@"\"%@\"", self.subtitle] : self.subtitle, (unsigned long)self.polylines.count, - MGLStringFromCoordinateBounds(self.overlayBounds)]; + MLNStringFromCoordinateBounds(self.overlayBounds)]; } @end diff --git a/platform/ios/platform/darwin/src/MGLPolyline_Private.h b/platform/ios/platform/darwin/src/MLNPolyline_Private.h similarity index 61% rename from platform/ios/platform/darwin/src/MGLPolyline_Private.h rename to platform/ios/platform/darwin/src/MLNPolyline_Private.h index ff4fabaa7..b31f082bb 100644 --- a/platform/ios/platform/darwin/src/MGLPolyline_Private.h +++ b/platform/ios/platform/darwin/src/MLNPolyline_Private.h @@ -1,8 +1,8 @@ -#import "MGLPolyline.h" +#import "MLNPolyline.h" NS_ASSUME_NONNULL_BEGIN -@interface MGLPolyline (Private) +@interface MLNPolyline (Private) - (NSArray *)mgl_coordinates; diff --git a/platform/ios/platform/darwin/src/MGLRasterDEMSource.h b/platform/ios/platform/darwin/src/MLNRasterDEMSource.h similarity index 62% rename from platform/ios/platform/darwin/src/MGLRasterDEMSource.h rename to platform/ios/platform/darwin/src/MLNRasterDEMSource.h index dc2430530..7150d00e1 100644 --- a/platform/ios/platform/darwin/src/MGLRasterDEMSource.h +++ b/platform/ios/platform/darwin/src/MLNRasterDEMSource.h @@ -1,37 +1,37 @@ -#import "MGLFoundation.h" +#import "MLNFoundation.h" -#import "MGLRasterTileSource.h" +#import "MLNRasterTileSource.h" /** An `NSNumber` object containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of - the constants described in `MGLDEMEncoding`. + the constants described in `MLNDEMEncoding`. - The default value for this option is `MGLDEMEncodingMapbox`. + The default value for this option is `MLNDEMEncodingMapbox`. This option cannot be represented in a TileJSON or style JSON file. It is used - with the `MGLRasterDEMSource` class and is ignored when creating an - `MGLRasterTileSource` or `MGLVectorTileSource` object. + with the `MLNRasterDEMSource` class and is ignored when creating an + `MLNRasterTileSource` or `MLNVectorTileSource` object. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionDEMEncoding; +FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionDEMEncoding; /** - `MGLRasterDEMSource` is a map content source that supplies rasterized + `MLNRasterDEMSource` is a map content source that supplies rasterized digital elevation model (DEM) tiles to be shown on the map. The location of and metadata about the tiles are defined either by an option dictionary or by an external file that conforms to the TileJSON specification. - A raster DEM source is added to an `MGLStyle` object along with one or more - `MGLHillshadeStyleLayer` objects. Use a hillshade style layer to control the + A raster DEM source is added to an `MLNStyle` object along with one or more + `MLNHillshadeStyleLayer` objects. Use a hillshade style layer to control the appearance of content supplied by the raster DEM source. Each raster-dem source defined by the style JSON file is represented at runtime by an - `MGLRasterDEMSource` object that you can use to initialize new style layers. + `MLNRasterDEMSource` object that you can use to initialize new style layers. You can also add and remove sources dynamically using methods such as - `-[MGLStyle addSource:]` and `-[MGLStyle sourceWithIdentifier:]`. + `-[MLNStyle addSource:]` and `-[MLNStyle sourceWithIdentifier:]`. Currently, raster DEM sources only support the format used by Mapbox Terrain-RGB. @@ -40,11 +40,11 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionDEMEnc ```swift let terrainRGBURL = URL(string: "maptiler://sources/terrain-rgb")! - let source = MGLRasterDEMSource(identifier: "hills", configurationURL: terrainRGBURL) + let source = MLNRasterDEMSource(identifier: "hills", configurationURL: terrainRGBURL) mapView.style?.addSource(source) ``` */ -MGL_EXPORT -@interface MGLRasterDEMSource : MGLRasterTileSource +MLN_EXPORT +@interface MLNRasterDEMSource : MLNRasterTileSource @end diff --git a/platform/ios/platform/darwin/src/MGLRasterDEMSource.mm b/platform/ios/platform/darwin/src/MLNRasterDEMSource.mm similarity index 79% rename from platform/ios/platform/darwin/src/MGLRasterDEMSource.mm rename to platform/ios/platform/darwin/src/MLNRasterDEMSource.mm index 753499ff9..13ad81602 100644 --- a/platform/ios/platform/darwin/src/MGLRasterDEMSource.mm +++ b/platform/ios/platform/darwin/src/MLNRasterDEMSource.mm @@ -1,11 +1,11 @@ -#import "MGLRasterDEMSource.h" +#import "MLNRasterDEMSource.h" -#import "MGLRasterTileSource_Private.h" -#import "NSURL+MGLAdditions.h" +#import "MLNRasterTileSource_Private.h" +#import "NSURL+MLNAdditions.h" #import -@implementation MGLRasterDEMSource +@implementation MLNRasterDEMSource - (std::unique_ptr)pendingSourceWithIdentifier:(NSString *)identifier urlOrTileset:(mbgl::variant)urlOrTileset tileSize:(uint16_t)tileSize { auto source = std::make_unique(identifier.UTF8String, diff --git a/platform/ios/platform/darwin/src/MGLRasterTileSource.h b/platform/ios/platform/darwin/src/MLNRasterTileSource.h similarity index 79% rename from platform/ios/platform/darwin/src/MGLRasterTileSource.h rename to platform/ios/platform/darwin/src/MLNRasterTileSource.h index eb8eed0a8..de84c2a13 100644 --- a/platform/ios/platform/darwin/src/MGLRasterTileSource.h +++ b/platform/ios/platform/darwin/src/MLNRasterTileSource.h @@ -1,7 +1,7 @@ #import -#import "MGLFoundation.h" -#import "MGLTileSource.h" +#import "MLNFoundation.h" +#import "MLNTileSource.h" NS_ASSUME_NONNULL_BEGIN @@ -17,37 +17,37 @@ NS_ASSUME_NONNULL_BEGIN requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value. - This option is only applicable to `MGLRasterTileSource` objects; it is ignored - when initializing `MGLVectorTileSource` objects. + This option is only applicable to `MLNRasterTileSource` objects; it is ignored + when initializing `MLNVectorTileSource` objects. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionTileSize; +FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionTileSize; /** - `MGLRasterTileSource` is a map content source that supplies raster image tiles + `MLNRasterTileSource` is a map content source that supplies raster image tiles to be shown on the map. The location of and metadata about the tiles are defined either by an option dictionary or by an external file that conforms to the TileJSON specification. - A raster tile source is added to an `MGLStyle` object along with one or more - `MGLRasterStyleLayer` objects. Use a raster style layer to control the + A raster tile source is added to an `MLNStyle` object along with one or more + `MLNRasterStyleLayer` objects. Use a raster style layer to control the appearance of content supplied by the raster tile source. Each raster source defined by the style JSON file is represented at runtime by an - `MGLRasterTileSource` object that you can use to initialize new style layers. You + `MLNRasterTileSource` object that you can use to initialize new style layers. You can also add and remove sources dynamically using methods such as - `-[MGLStyle addSource:]` and `-[MGLStyle sourceWithIdentifier:]`. + `-[MLNStyle addSource:]` and `-[MLNStyle sourceWithIdentifier:]`. ### Example ```swift - let source = MGLRasterTileSource(identifier: "clouds", tileURLTemplates: ["https://example.com/raster-tiles/{z}/{x}/{y}.png"], options: [ + let source = MLNRasterTileSource(identifier: "clouds", tileURLTemplates: ["https://example.com/raster-tiles/{z}/{x}/{y}.png"], options: [ .minimumZoomLevel: 9, .maximumZoomLevel: 16, .tileSize: 512, .attributionInfos: [ - MGLAttributionInfo(title: NSAttributedString(string: "© Mapbox"), url: URL(string: "https://mapbox.com")) + MLNAttributionInfo(title: NSAttributedString(string: "© Mapbox"), url: URL(string: "https://mapbox.com")) ] ]) mapView.style?.addSource(source) @@ -55,11 +55,11 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionTileSi #### Related examples See the - Add raster imagery example to learn how to add a `MGLRasterStyleLayer` - to your map using an `MGLRasterTileSource`. + Add raster imagery example to learn how to add a `MLNRasterStyleLayer` + to your map using an `MLNRasterTileSource`. */ -MGL_EXPORT -@interface MGLRasterTileSource : MGLTileSource +MLN_EXPORT +@interface MLNRasterTileSource : MLNTileSource // MARK: Initializing a Source @@ -68,7 +68,7 @@ MGL_EXPORT URL. After initializing and configuring the source, add it to a map view’s style - using the `-[MGLStyle addSource:]` method. + using the `-[MLNStyle addSource:]` method. The URL may be a full HTTP or HTTPS URL or canonical URL. The URL should point to a JSON file that conforms to the @@ -76,7 +76,7 @@ MGL_EXPORT If a Mapbox URL is specified, this source uses a tile size of 256. For all other tilesets, the default value is 512. (See the - `MGLTileSourceOptionTileSize` documentation for more information about tile + `MLNTileSourceOptionTileSize` documentation for more information about tile sizes.) If you need to use a tile size other than the default, use the `-initWithIdentifier:configurationURL:tileSize:` method. @@ -93,7 +93,7 @@ MGL_EXPORT and tile size. After initializing and configuring the source, add it to a map view’s style - using the `-[MGLStyle addSource:]` method. + using the `-[MLNStyle addSource:]` method. The URL may be a full HTTP or HTTPS URL or, canonical URL. The URL should point to a JSON file that conforms to the @@ -104,7 +104,7 @@ MGL_EXPORT @param configurationURL A URL to a TileJSON configuration file describing the source’s contents and other metadata. @param tileSize The width and height (measured in points) of each tiled image - in the raster tile source. See the `MGLTileSourceOptionTileSize` + in the raster tile source. See the `MLNTileSourceOptionTileSize` documentation for details. @return An initialized raster tile source. */ @@ -119,18 +119,18 @@ MGL_EXPORT guide for information about the format of a tile URL template. After initializing and configuring the source, add it to a map view’s style - using the `-[MGLStyle addSource:]` method. + using the `-[MLNStyle addSource:]` method. @param identifier A string that uniquely identifies the source in the style to which it is added. @param tileURLTemplates An array of tile URL template strings. Only the first string is used; any additional strings are ignored. @param options A dictionary containing configuration options. See - `MGLTileSourceOption` for available keys and values. Pass in `nil` to use + `MLNTileSourceOption` for available keys and values. Pass in `nil` to use the default values. @return An initialized tile source. */ -- (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NSArray *)tileURLTemplates options:(nullable NSDictionary *)options NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NSArray *)tileURLTemplates options:(nullable NSDictionary *)options NS_DESIGNATED_INITIALIZER; @end diff --git a/platform/ios/platform/darwin/src/MGLRasterTileSource.mm b/platform/ios/platform/darwin/src/MLNRasterTileSource.mm similarity index 74% rename from platform/ios/platform/darwin/src/MGLRasterTileSource.mm rename to platform/ios/platform/darwin/src/MLNRasterTileSource.mm index 80b21cc7d..358130b72 100644 --- a/platform/ios/platform/darwin/src/MGLRasterTileSource.mm +++ b/platform/ios/platform/darwin/src/MLNRasterTileSource.mm @@ -1,26 +1,26 @@ -#import "MGLRasterTileSource_Private.h" +#import "MLNRasterTileSource_Private.h" -#import "MGLLoggingConfiguration_Private.h" -#import "MGLMapView_Private.h" -#import "MGLSource_Private.h" -#import "MGLTileSource_Private.h" -#import "NSURL+MGLAdditions.h" +#import "MLNLoggingConfiguration_Private.h" +#import "MLNMapView_Private.h" +#import "MLNSource_Private.h" +#import "MLNTileSource_Private.h" +#import "NSURL+MLNAdditions.h" #include #include -const MGLTileSourceOption MGLTileSourceOptionTileSize = @"MGLTileSourceOptionTileSize"; +const MLNTileSourceOption MLNTileSourceOptionTileSize = @"MLNTileSourceOptionTileSize"; -static const CGFloat MGLRasterTileSourceClassicTileSize = 256; -static const CGFloat MGLRasterTileSourceRetinaTileSize = 512; +static const CGFloat MLNRasterTileSourceClassicTileSize = 256; +static const CGFloat MLNRasterTileSourceRetinaTileSize = 512; -@interface MGLRasterTileSource () +@interface MLNRasterTileSource () @property (nonatomic, readonly) mbgl::style::RasterSource *rawSource; @end -@implementation MGLRasterTileSource +@implementation MLNRasterTileSource - (instancetype)initWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL { // The style specification default is 512, but 256 is the expected value for @@ -29,7 +29,7 @@ static const CGFloat MGLRasterTileSourceRetinaTileSize = 512; BOOL isMapboxURL = ([configurationURL.scheme isEqualToString:@"mapbox"] && [configurationURL.host containsString:@"."] && (!configurationURL.path.length || [configurationURL.path isEqualToString:@"/"])); - CGFloat tileSize = isMapboxURL ? MGLRasterTileSourceClassicTileSize : MGLRasterTileSourceRetinaTileSize; + CGFloat tileSize = isMapboxURL ? MLNRasterTileSourceClassicTileSize : MLNRasterTileSourceRetinaTileSize; return [self initWithIdentifier:identifier configurationURL:configurationURL tileSize:tileSize]; } @@ -46,14 +46,14 @@ static const CGFloat MGLRasterTileSourceRetinaTileSize = 512; return source; } -- (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NSArray *)tileURLTemplates options:(nullable NSDictionary *)options { - mbgl::Tileset tileSet = MGLTileSetFromTileURLTemplates(tileURLTemplates, options); +- (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NSArray *)tileURLTemplates options:(nullable NSDictionary *)options { + mbgl::Tileset tileSet = MLNTileSetFromTileURLTemplates(tileURLTemplates, options); - uint16_t tileSize = MGLRasterTileSourceRetinaTileSize; - if (NSNumber *tileSizeNumber = options[MGLTileSourceOptionTileSize]) { + uint16_t tileSize = MLNRasterTileSourceRetinaTileSize; + if (NSNumber *tileSizeNumber = options[MLNTileSourceOptionTileSize]) { if (![tileSizeNumber isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLTileSourceOptionTileSize must be set to an NSNumber."]; + format:@"MLNTileSourceOptionTileSize must be set to an NSNumber."]; } tileSize = static_cast(round(tileSizeNumber.doubleValue)); } @@ -67,14 +67,14 @@ static const CGFloat MGLRasterTileSourceRetinaTileSize = 512; } - (NSURL *)configurationURL { - MGLAssertStyleSourceIsValid(); + MLNAssertStyleSourceIsValid(); auto url = self.rawSource->getURL(); return url ? [NSURL URLWithString:@(url->c_str())] : nil; } - (NSString *)attributionHTMLString { if (!self.rawSource) { - MGLAssert(0, @"Source with identifier `%@` was invalidated after a style change", self.identifier); + MLNAssert(0, @"Source with identifier `%@` was invalidated after a style change", self.identifier); return nil; } diff --git a/platform/ios/platform/darwin/src/MGLRasterTileSource_Private.h b/platform/ios/platform/darwin/src/MLNRasterTileSource_Private.h similarity index 86% rename from platform/ios/platform/darwin/src/MGLRasterTileSource_Private.h rename to platform/ios/platform/darwin/src/MLNRasterTileSource_Private.h index 55f342c7f..d95bc73ee 100644 --- a/platform/ios/platform/darwin/src/MGLRasterTileSource_Private.h +++ b/platform/ios/platform/darwin/src/MLNRasterTileSource_Private.h @@ -1,4 +1,4 @@ -#import "MGLRasterTileSource.h" +#import "MLNRasterTileSource.h" #include #include @@ -12,7 +12,7 @@ namespace mbgl { NS_ASSUME_NONNULL_BEGIN -@interface MGLRasterTileSource (Private) +@interface MLNRasterTileSource (Private) @property (nonatomic, readonly, nullable) mbgl::style::RasterSource *rawSource; diff --git a/platform/ios/platform/darwin/src/MGLReachability.h b/platform/ios/platform/darwin/src/MLNReachability.h similarity index 92% rename from platform/ios/platform/darwin/src/MGLReachability.h rename to platform/ios/platform/darwin/src/MLNReachability.h index e7a00008b..bfcf78059 100644 --- a/platform/ios/platform/darwin/src/MGLReachability.h +++ b/platform/ios/platform/darwin/src/MLNReachability.h @@ -38,7 +38,7 @@ #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type #endif -extern NSString *const kMGLReachabilityChangedNotification; +extern NSString *const kMLNReachabilityChangedNotification; typedef NS_ENUM(NSInteger, NetworkStatus) { // Apple NetworkStatus Compatible Names. @@ -47,13 +47,13 @@ typedef NS_ENUM(NSInteger, NetworkStatus) { ReachableViaWWAN = 1 }; -@class MGLReachability; +@class MLNReachability; -typedef void (^NetworkReachable)(MGLReachability * reachability); -typedef void (^NetworkUnreachable)(MGLReachability * reachability); +typedef void (^NetworkReachable)(MLNReachability * reachability); +typedef void (^NetworkUnreachable)(MLNReachability * reachability); -@interface MGLReachability : NSObject +@interface MLNReachability : NSObject @property (nonatomic, copy) NetworkReachable reachableBlock; @property (nonatomic, copy) NetworkUnreachable unreachableBlock; diff --git a/platform/ios/platform/darwin/src/MGLReachability.m b/platform/ios/platform/darwin/src/MLNReachability.m similarity index 97% rename from platform/ios/platform/darwin/src/MGLReachability.m rename to platform/ios/platform/darwin/src/MLNReachability.m index 72396a2b0..e0a3e0fad 100644 --- a/platform/ios/platform/darwin/src/MGLReachability.m +++ b/platform/ios/platform/darwin/src/MLNReachability.m @@ -25,7 +25,7 @@ POSSIBILITY OF SUCH DAMAGE. */ -#import "MGLReachability.h" +#import "MLNReachability.h" #import #import @@ -35,10 +35,10 @@ #import -NSString *const kMGLReachabilityChangedNotification = @"kMGLReachabilityChangedNotification"; +NSString *const kMLNReachabilityChangedNotification = @"kMLNReachabilityChangedNotification"; -@interface MGLReachability () +@interface MLNReachability () @property (nonatomic, assign) SCNetworkReachabilityRef reachabilityRef; @property (nonatomic, strong) dispatch_queue_t reachabilitySerialQueue; @@ -73,7 +73,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea { #pragma unused (target) - MGLReachability *reachability = ((__bridge MGLReachability*)info); + MLNReachability *reachability = ((__bridge MLNReachability*)info); // We probably don't need an autoreleasepool here, as GCD docs state each queue has its own autorelease pool, // but what the heck eh? @@ -84,13 +84,13 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea } -@implementation MGLReachability +@implementation MLNReachability // MARK: - Class Constructor Methods +(instancetype)reachabilityWithHostName:(NSString*)hostname { - return [MGLReachability reachabilityWithHostname:hostname]; + return [MLNReachability reachabilityWithHostname:hostname]; } +(instancetype)reachabilityWithHostname:(NSString*)hostname @@ -456,7 +456,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea // this makes sure the change notification happens on the MAIN THREAD dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:kMGLReachabilityChangedNotification + [[NSNotificationCenter defaultCenter] postNotificationName:kMLNReachabilityChangedNotification object:self]; }); } diff --git a/platform/ios/platform/darwin/src/MGLRendererConfiguration.h b/platform/ios/platform/darwin/src/MLNRendererConfiguration.h similarity index 82% rename from platform/ios/platform/darwin/src/MGLRendererConfiguration.h rename to platform/ios/platform/darwin/src/MLNRendererConfiguration.h index f3a917c7e..5dd78a5aa 100644 --- a/platform/ios/platform/darwin/src/MGLRendererConfiguration.h +++ b/platform/ios/platform/darwin/src/MLNRendererConfiguration.h @@ -1,17 +1,17 @@ -#import "MGLFoundation.h" +#import "MLNFoundation.h" #import NS_ASSUME_NONNULL_BEGIN /** - The MGLRendererConfiguration object represents configuration values for the + The MLNRendererConfiguration object represents configuration values for the renderer. */ -MGL_EXPORT -@interface MGLRendererConfiguration : NSObject +MLN_EXPORT +@interface MLNRendererConfiguration : NSObject /** Returns an instance of the current renderer configuration. */ -@property (class, nonatomic, readonly) MGLRendererConfiguration *currentConfiguration; +@property (class, nonatomic, readonly) MLNRendererConfiguration *currentConfiguration; /** The scale factor to use. @@ -20,7 +20,7 @@ MGL_EXPORT /** The name of the font family to use for client-side text rendering of CJK ideographs. - Set MGLIdeographicFontFamilyName in your containing application's Info.plist to + Set MLNIdeographicFontFamilyName in your containing application's Info.plist to font family name(s) that will be available at run time, such as “PingFang TC” or “Marker Felt”. This plist key accepts: @@ -40,8 +40,8 @@ MGL_EXPORT A Boolean value indicating whether symbol layers may enable per-source symbol collision detection. - Set `MGLCollisionBehaviorPre4_0` in your containing app's Info.plist or by using - `[[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:@"MGLCollisionBehaviorPre4_0"]`. + Set `MLNCollisionBehaviorPre4_0` in your containing app's Info.plist or by using + `[[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:@"MLNCollisionBehaviorPre4_0"]`. If both are set, the value from `NSUserDefaults` takes priority. Setting this property to `YES` in the plist results in symbol layers only running diff --git a/platform/ios/platform/darwin/src/MGLRendererConfiguration.m b/platform/ios/platform/darwin/src/MLNRendererConfiguration.m similarity index 85% rename from platform/ios/platform/darwin/src/MGLRendererConfiguration.m rename to platform/ios/platform/darwin/src/MLNRendererConfiguration.m index 1cc47e322..4541c617e 100644 --- a/platform/ios/platform/darwin/src/MGLRendererConfiguration.m +++ b/platform/ios/platform/darwin/src/MLNRendererConfiguration.m @@ -1,4 +1,4 @@ -#import "MGLRendererConfiguration.h" +#import "MLNRendererConfiguration.h" #if TARGET_OS_IPHONE #import @@ -6,10 +6,10 @@ #import #endif -static NSString * const MGLCollisionBehaviorPre4_0Key = @"MGLCollisionBehaviorPre4_0"; -static NSString * const MGLIdeographicFontFamilyNameKey = @"MGLIdeographicFontFamilyName"; +static NSString * const MLNCollisionBehaviorPre4_0Key = @"MLNCollisionBehaviorPre4_0"; +static NSString * const MLNIdeographicFontFamilyNameKey = @"MLNIdeographicFontFamilyName"; -@implementation MGLRendererConfiguration +@implementation MLNRendererConfiguration + (instancetype)currentConfiguration { return [[self alloc] init]; @@ -24,7 +24,7 @@ static NSString * const MGLIdeographicFontFamilyNameKey = @"MGLIdeographicFontFa } - (nullable NSString *)localFontFamilyName { - id infoDictionaryObject = [NSBundle.mainBundle objectForInfoDictionaryKey:MGLIdeographicFontFamilyNameKey]; + id infoDictionaryObject = [NSBundle.mainBundle objectForInfoDictionaryKey:MLNIdeographicFontFamilyNameKey]; return [self localFontFamilyNameWithInfoDictionaryObject:infoDictionaryObject]; } @@ -47,15 +47,15 @@ static NSString * const MGLIdeographicFontFamilyNameKey = @"MGLIdeographicFontFa } - (BOOL)perSourceCollisions { - id infoDictionaryObject = [NSBundle.mainBundle objectForInfoDictionaryKey:MGLCollisionBehaviorPre4_0Key]; + id infoDictionaryObject = [NSBundle.mainBundle objectForInfoDictionaryKey:MLNCollisionBehaviorPre4_0Key]; return [self perSourceCollisionsWithInfoDictionaryObject:infoDictionaryObject]; } - (BOOL)perSourceCollisionsWithInfoDictionaryObject:(nullable id)infoDictionaryObject { // Set the collision behaviour. A value set in `NSUserDefaults.standardUserDefaults` // should override anything in the application's info.plist - if ([NSUserDefaults.standardUserDefaults objectForKey:MGLCollisionBehaviorPre4_0Key]) { - return [NSUserDefaults.standardUserDefaults boolForKey:MGLCollisionBehaviorPre4_0Key]; + if ([NSUserDefaults.standardUserDefaults objectForKey:MLNCollisionBehaviorPre4_0Key]) { + return [NSUserDefaults.standardUserDefaults boolForKey:MLNCollisionBehaviorPre4_0Key]; } else if ([infoDictionaryObject isKindOfClass:[NSNumber class]] || [infoDictionaryObject isKindOfClass:[NSString class]]) { // Also support NSString to correspond with the behavior of `-[NSUserDefaults boolForKey:]` return [infoDictionaryObject boolValue]; diff --git a/platform/ios/platform/darwin/src/MGLRendererFrontend.h b/platform/ios/platform/darwin/src/MLNRendererFrontend.h similarity index 87% rename from platform/ios/platform/darwin/src/MGLRendererFrontend.h rename to platform/ios/platform/darwin/src/MLNRendererFrontend.h index 492714eaf..001c7aff8 100644 --- a/platform/ios/platform/darwin/src/MGLRendererFrontend.h +++ b/platform/ios/platform/darwin/src/MLNRendererFrontend.h @@ -8,10 +8,10 @@ The RenderFrontend is passed to the Map to facilitate rendering in a platform dependent way. */ -class MGLRenderFrontend : public mbgl::RendererFrontend +class MLNRenderFrontend : public mbgl::RendererFrontend { public: - MGLRenderFrontend(std::unique_ptr renderer_, MGLMapView* nativeView_, mbgl::gfx::RendererBackend& mbglBackend_, bool async = false) + MLNRenderFrontend(std::unique_ptr renderer_, MLNMapView* nativeView_, mbgl::gfx::RendererBackend& mbglBackend_, bool async = false) : renderer(std::move(renderer_)) , nativeView(nativeView_) , mbglBackend(mbglBackend_) { @@ -48,7 +48,7 @@ public: mbgl::gfx::BackendScope guard { mbglBackend, mbgl::gfx::BackendScope::ScopeType::Implicit }; // onStyleImageMissing might be called during a render. The user implemented method - // could trigger a call to MGLRenderFrontend#update which overwrites `updateParameters`. + // could trigger a call to MLNRenderFrontend#update which overwrites `updateParameters`. // Copy the shared pointer here so that the parameters aren't destroyed while `render(...)` is // still using them. auto updateParameters_ = updateParameters; @@ -66,7 +66,7 @@ public: private: std::unique_ptr renderer; - __weak MGLMapView *nativeView = nullptr; + __weak MLNMapView *nativeView = nullptr; mbgl::gfx::RendererBackend& mbglBackend; std::shared_ptr updateParameters; std::optional asyncInvalidate; diff --git a/platform/ios/platform/darwin/src/MGLSettings.h b/platform/ios/platform/darwin/src/MLNSettings.h similarity index 60% rename from platform/ios/platform/darwin/src/MGLSettings.h rename to platform/ios/platform/darwin/src/MLNSettings.h index c2408ad40..dc11e9719 100644 --- a/platform/ios/platform/darwin/src/MGLSettings.h +++ b/platform/ios/platform/darwin/src/MLNSettings.h @@ -1,52 +1,52 @@ #import -#import "MGLFoundation.h" -#import "MGLTileServerOptions.h" +#import "MLNFoundation.h" +#import "MLNTileServerOptions.h" NS_ASSUME_NONNULL_BEGIN /** Well-known tile servers */ -typedef NS_ENUM(NSUInteger, MGLWellKnownTileServer) { +typedef NS_ENUM(NSUInteger, MLNWellKnownTileServer) { /** Maptiler */ - MGLMapTiler, + MLNMapTiler, /** MapLibre */ - MGLMapLibre, + MLNMapLibre, /** Mapbox */ - MGLMapbox + MLNMapbox }; /** - The `MGLSettings` object provides a global way to set SDK properties such + The `MLNSettings` object provides a global way to set SDK properties such as apiKey, backend URL, etc. */ -MGL_EXPORT -@interface MGLSettings : NSObject +MLN_EXPORT +@interface MLNSettings : NSObject // MARK: Tile Server Configuration /** Tile server options */ -@property (class, copy, nullable) MGLTileServerOptions* tileServerOptions; +@property (class, copy, nullable) MLNTileServerOptions* tileServerOptions; // MARK: Authorizing Access /** - The API Key used by all instances of `MGLMapView` in the current application. + The API Key used by all instances of `MLNMapView` in the current application. Setting this property to a value of `nil` has no effect. @note You must set the API key before attempting to load any style which requires the token. Therefore, you should generally set it before creating an instance of - `MGLMapView`. The recommended way to set an api key is to add an entry - to your application’s Info.plist file with the key `MGLApiKey` + `MLNMapView`. The recommended way to set an api key is to add an entry + to your application’s Info.plist file with the key `MLNApiKey` and the type `String`. Alternatively, you may call this method from your application delegate’s `-applicationDidFinishLaunching:` method. */ @@ -55,7 +55,7 @@ MGL_EXPORT /** Instructs the SDk to use the give tile server */ -+ (void)useWellKnownTileServer:(MGLWellKnownTileServer)tileServer; ++ (void)useWellKnownTileServer:(MLNWellKnownTileServer)tileServer; @end diff --git a/platform/ios/platform/darwin/src/MGLSettings.mm b/platform/ios/platform/darwin/src/MLNSettings.mm similarity index 83% rename from platform/ios/platform/darwin/src/MGLSettings.mm rename to platform/ios/platform/darwin/src/MLNSettings.mm index c13717066..decb8e7df 100644 --- a/platform/ios/platform/darwin/src/MGLSettings.mm +++ b/platform/ios/platform/darwin/src/MLNSettings.mm @@ -1,11 +1,11 @@ -#import "MGLSettings_Private.h" -#import "NSBundle+MGLAdditions.h" +#import "MLNSettings_Private.h" +#import "NSBundle+MLNAdditions.h" #if TARGET_OS_OSX -#import "NSProcessInfo+MGLAdditions.h" +#import "NSProcessInfo+MLNAdditions.h" #endif -@interface MGLSettings () +@interface MLNSettings () @property (atomic) NSString *apiKey; @property (atomic) mbgl::TileServerOptions *tileServerOptionsInternal; @@ -13,7 +13,7 @@ @end -@implementation MGLSettings +@implementation MLNSettings // MARK: - Internal @@ -26,12 +26,12 @@ + (void)load { // Read the initial configuration from Info.plist. - NSString *apiKey = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MGLApiKey"]; + NSString *apiKey = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MLNApiKey"]; if (apiKey.length) { self.apiKey = apiKey; } - NSString *apiBaseURL = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MGLTileServerBaseURL"]; + NSString *apiBaseURL = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MLNTileServerBaseURL"]; // If apiBaseURL is not a valid URL, [NSURL URLWithString:] will be `nil`. if (apiBaseURL.length && [NSURL URLWithString:apiBaseURL]) { @@ -48,7 +48,7 @@ #endif static dispatch_once_t onceToken; - static MGLSettings *_sharedSettings; + static MLNSettings *_sharedSettings; void (^setupBlock)(void) = ^{ dispatch_once(&onceToken, ^{ _sharedSettings = [[self alloc] init]; @@ -71,60 +71,60 @@ return; } - [MGLSettings sharedSettings].apiKey = apiKey; + [MLNSettings sharedSettings].apiKey = apiKey; } + (NSString *)apiKey { - return [MGLSettings sharedSettings].apiKey; + return [MLNSettings sharedSettings].apiKey; } + (void)setAPIBaseURL:(NSURL *)apiBaseURL { - auto tileServerOptions = [MGLSettings sharedSettings].tileServerOptionsInternal; + auto tileServerOptions = [MLNSettings sharedSettings].tileServerOptionsInternal; NSString *baseUrlNSStr = apiBaseURL.absoluteString; auto baseUrl = std::string([baseUrlNSStr UTF8String]); - [MGLSettings sharedSettings].tileServerOptionsInternal = &tileServerOptions->withBaseURL(baseUrl); + [MLNSettings sharedSettings].tileServerOptionsInternal = &tileServerOptions->withBaseURL(baseUrl); } + (NSURL *)apiBaseURL { - auto baseUrl = [MGLSettings sharedSettings].tileServerOptionsInternal->baseURL(); + auto baseUrl = [MLNSettings sharedSettings].tileServerOptionsInternal->baseURL(); NSString* baseUrlNSStr = [NSString stringWithUTF8String:baseUrl.c_str()]; NSURL *url = [NSURL URLWithString:baseUrlNSStr]; return url; } + (void)setTileServerOptionsInternal:(mbgl::TileServerOptions)options { - [MGLSettings sharedSettings].tileServerOptionsInternal = new mbgl::TileServerOptions(); - *[MGLSettings sharedSettings].tileServerOptionsInternal = options.clone(); + [MLNSettings sharedSettings].tileServerOptionsInternal = new mbgl::TileServerOptions(); + *[MLNSettings sharedSettings].tileServerOptionsInternal = options.clone(); [self tileServerOptionsChanged]; } + (mbgl::TileServerOptions)tileServerOptionsInternal { - auto options = [MGLSettings sharedSettings]; + auto options = [MLNSettings sharedSettings]; return options.tileServerOptionsInternal->clone(); } + (void)tileServerOptionsChanged { - [MGLSettings sharedSettings].tileServerOptionsChangeToken = [[NSUUID UUID] UUIDString]; + [MLNSettings sharedSettings].tileServerOptionsChangeToken = [[NSUUID UUID] UUIDString]; } -+ (void)useWellKnownTileServer:(MGLWellKnownTileServer)tileServer { ++ (void)useWellKnownTileServer:(MLNWellKnownTileServer)tileServer { switch(tileServer){ - case MGLMapTiler: - [MGLSettings setTileServerOptionsInternal:mbgl::TileServerOptions::MapTilerConfiguration()]; + case MLNMapTiler: + [MLNSettings setTileServerOptionsInternal:mbgl::TileServerOptions::MapTilerConfiguration()]; break; - case MGLMapLibre: - [MGLSettings setTileServerOptionsInternal:mbgl::TileServerOptions::MapLibreConfiguration()]; + case MLNMapLibre: + [MLNSettings setTileServerOptionsInternal:mbgl::TileServerOptions::MapLibreConfiguration()]; break; - case MGLMapbox: - [MGLSettings setTileServerOptionsInternal:mbgl::TileServerOptions::MapboxConfiguration()]; + case MLNMapbox: + [MLNSettings setTileServerOptionsInternal:mbgl::TileServerOptions::MapboxConfiguration()]; break; default: - [MGLSettings setTileServerOptionsInternal:mbgl::TileServerOptions::DefaultConfiguration()]; + [MLNSettings setTileServerOptionsInternal:mbgl::TileServerOptions::DefaultConfiguration()]; } } -+ (void)setTileServerOptions:(MGLTileServerOptions*)options { ++ (void)setTileServerOptions:(MLNTileServerOptions*)options { auto opts = mbgl::TileServerOptions() .withBaseURL(std::string([options.baseURL UTF8String])) @@ -158,7 +158,7 @@ std::vector defaultStyles; if (options.defaultStyles) { - for (MGLDefaultStyle* objCStyle in options.defaultStyles) { + for (MLNDefaultStyle* objCStyle in options.defaultStyles) { mbgl::util::DefaultStyle cppStyle( std::string([objCStyle.url.absoluteString UTF8String]), std::string([objCStyle.name UTF8String]), @@ -173,11 +173,11 @@ self.tileServerOptionsInternal = opts; } -+ (MGLTileServerOptions*)tileServerOptions { - auto cppOpts = [MGLSettings sharedSettings].tileServerOptionsInternal; ++ (MLNTileServerOptions*)tileServerOptions { + auto cppOpts = [MLNSettings sharedSettings].tileServerOptionsInternal; if (cppOpts) { - MGLTileServerOptions* retVal = [[MGLTileServerOptions alloc] init]; + MLNTileServerOptions* retVal = [[MLNTileServerOptions alloc] init]; retVal.baseURL = [NSString stringWithUTF8String:cppOpts->baseURL().c_str()]; retVal.uriSchemeAlias = [NSString stringWithUTF8String:cppOpts->uriSchemeAlias().c_str()]; retVal.apiKeyParameterName = [NSString stringWithUTF8String:cppOpts->apiKeyParameterName().c_str()]; @@ -205,11 +205,11 @@ std::vector cppDefaultStyles = cppOpts->defaultStyles(); - NSMutableArray* mglStyles = [[NSMutableArray alloc] init]; + NSMutableArray* mglStyles = [[NSMutableArray alloc] init]; for (auto it = begin(cppDefaultStyles); it != end(cppDefaultStyles); ++it) { NSString* url = [NSString stringWithUTF8String:it->getUrl().c_str()]; - auto* mglDefaultStyle = [[MGLDefaultStyle alloc] init]; + auto* mglDefaultStyle = [[MLNDefaultStyle alloc] init]; mglDefaultStyle.url = [NSURL URLWithString:url]; mglDefaultStyle.name = [NSString stringWithUTF8String:it->getName().c_str()]; mglDefaultStyle.version = it->getCurrentVersion(); diff --git a/platform/ios/platform/darwin/src/MGLSettings_Private.h b/platform/ios/platform/darwin/src/MLNSettings_Private.h similarity index 78% rename from platform/ios/platform/darwin/src/MGLSettings_Private.h rename to platform/ios/platform/darwin/src/MLNSettings_Private.h index f4c08e8d1..501a4607b 100644 --- a/platform/ios/platform/darwin/src/MGLSettings_Private.h +++ b/platform/ios/platform/darwin/src/MLNSettings_Private.h @@ -1,13 +1,13 @@ -#import "MGLSettings.h" +#import "MLNSettings.h" #import #import NS_ASSUME_NONNULL_BEGIN -@interface MGLSettings (Private) +@interface MLNSettings (Private) -/// Returns the shared instance of the `MGLSettings` class. -@property (class, nonatomic, readonly) MGLSettings *sharedSettings; +/// Returns the shared instance of the `MLNSettings` class. +@property (class, nonatomic, readonly) MLNSettings *sharedSettings; /// The current global access token. @property (atomic, nullable) NSString *apiKey; diff --git a/platform/ios/platform/darwin/src/MGLShape.h b/platform/ios/platform/darwin/src/MLNShape.h similarity index 61% rename from platform/ios/platform/darwin/src/MGLShape.h rename to platform/ios/platform/darwin/src/MLNShape.h index 46f0d1897..afc122f80 100644 --- a/platform/ios/platform/darwin/src/MGLShape.h +++ b/platform/ios/platform/darwin/src/MLNShape.h @@ -1,18 +1,18 @@ #import -#import "MGLFoundation.h" -#import "MGLAnnotation.h" +#import "MLNFoundation.h" +#import "MLNAnnotation.h" NS_ASSUME_NONNULL_BEGIN /** - `MGLShape` is an abstract class that represents a shape or annotation. Shapes + `MLNShape` is an abstract class that represents a shape or annotation. Shapes constitute the content of a map — not only the overlays atop the map, but also the content that forms the base map. - Create instances of `MGLPointAnnotation`, `MGLPointCollection`, `MGLPolyline`, - `MGLMultiPolyline`, `MGLPolygon`, `MGLMultiPolygon`, or `MGLShapeCollection` in - order to use `MGLShape`'s methods. Do not create instances of `MGLShape` + Create instances of `MLNPointAnnotation`, `MLNPointCollection`, `MLNPolyline`, + `MLNMultiPolyline`, `MLNPolygon`, `MLNMultiPolygon`, or `MLNShapeCollection` in + order to use `MLNShape`'s methods. Do not create instances of `MLNShape` directly, and do not create your own subclasses of this class. The shape classes correspond to the Geometry object @@ -20,54 +20,54 @@ NS_ASSUME_NONNULL_BEGIN compatibility. Although you do not create instances of this class directly, you can use its - `+[MGLShape shapeWithData:encoding:error:]` factory method to create one of the - concrete subclasses of `MGLShape` noted above from GeoJSON data. To access a - shape’s attributes, use the corresponding `MGLFeature` class instead. + `+[MLNShape shapeWithData:encoding:error:]` factory method to create one of the + concrete subclasses of `MLNShape` noted above from GeoJSON data. To access a + shape’s attributes, use the corresponding `MLNFeature` class instead. - You can add shapes to the map by adding them to an `MGLShapeSource` object. - Configure the appearance of an `MGLShapeSource`’s or `MGLVectorTileSource`’s - shapes collectively using a concrete instance of `MGLVectorStyleLayer`. + You can add shapes to the map by adding them to an `MLNShapeSource` object. + Configure the appearance of an `MLNShapeSource`’s or `MLNVectorTileSource`’s + shapes collectively using a concrete instance of `MLNVectorStyleLayer`. Alternatively, you can add some kinds of shapes directly to a map view as annotations or overlays. - You can filter the features in a `MGLVectorStyleLayer` or vary their layout or - paint attributes based on the features’ geographies. Pass an `MGLShape` into an + You can filter the features in a `MLNVectorStyleLayer` or vary their layout or + paint attributes based on the features’ geographies. Pass an `MLNShape` into an `NSPredicate` with the format `SELF IN %@` or `%@ CONTAINS SELF` and set the - `MGLVectorStyleLayer.predicate` property to that predicate, or set a layout or + `MLNVectorStyleLayer.predicate` property to that predicate, or set a layout or paint attribute to a similarly formatted `NSExpression`. */ -MGL_EXPORT -@interface MGLShape : NSObject +MLN_EXPORT +@interface MLNShape : NSObject // MARK: Creating a Shape /** - Returns an `MGLShape` object initialized with the given data interpreted as a + Returns an `MLNShape` object initialized with the given data interpreted as a string containing a GeoJSON object. If the GeoJSON object is a geometry, the returned value is a kind of - `MGLShape`. If it is a feature object, the returned value is a kind of - `MGLShape` that conforms to the `MGLFeature` protocol. If it is a feature + `MLNShape`. If it is a feature object, the returned value is a kind of + `MLNShape` that conforms to the `MLNFeature` protocol. If it is a feature collection object, the returned value is an instance of - `MGLShapeCollectionFeature`. + `MLNShapeCollectionFeature`. ### Example ```swift let url = mainBundle.url(forResource: "amsterdam", withExtension: "geojson")! let data = try! Data(contentsOf: url) - let feature = try! MGLShape(data: data, encoding: String.Encoding.utf8.rawValue) as! MGLShapeCollectionFeature + let feature = try! MLNShape(data: data, encoding: String.Encoding.utf8.rawValue) as! MLNShapeCollectionFeature ``` @param data String data containing GeoJSON source code. @param encoding The encoding used by `data`. @param outError Upon return, if an error has occurred, a pointer to an `NSError` object describing the error. Pass in `NULL` to ignore any error. - @return An `MGLShape` object representation of `data`, or `nil` if `data` could + @return An `MLNShape` object representation of `data`, or `nil` if `data` could not be parsed as valid GeoJSON source code. If `nil`, `outError` contains an `NSError` object describing the problem. */ -+ (nullable MGLShape *)shapeWithData:(NSData *)data encoding:(NSStringEncoding)encoding error:(NSError * _Nullable *)outError; ++ (nullable MLNShape *)shapeWithData:(NSData *)data encoding:(NSStringEncoding)encoding error:(NSError * _Nullable *)outError; // MARK: Accessing the Shape Attributes @@ -76,9 +76,9 @@ MGL_EXPORT The default value of this property is `nil`. - This property is ignored when the shape is used in an `MGLShapeSource`. To name - a shape used in a shape source, create an `MGLFeature` and add an attribute to - the `MGLFeature.attributes` property. + This property is ignored when the shape is used in an `MLNShapeSource`. To name + a shape used in a shape source, create an `MLNFeature` and add an attribute to + the `MLNFeature.attributes` property. */ @property (nonatomic, copy, nullable) NSString *title; @@ -86,9 +86,9 @@ MGL_EXPORT The subtitle of the shape annotation. The default value of this property is `nil`. - This property is ignored when the shape is used in an `MGLShapeSource`. To + This property is ignored when the shape is used in an `MLNShapeSource`. To provide additional information about a shape used in a shape source, create an - `MGLFeature` and add an attribute to the `MGLFeature.attributes` property. + `MLNFeature` and add an attribute to the `MLNFeature.attributes` property. */ @property (nonatomic, copy, nullable) NSString *subtitle; @@ -99,7 +99,7 @@ MGL_EXPORT The default value of this property is `nil`. - This property is ignored when the shape is used in an `MGLShapeSource`. + This property is ignored when the shape is used in an `MLNShapeSource`. */ @property (nonatomic, copy, nullable) NSString *toolTip; diff --git a/platform/ios/platform/darwin/src/MGLShape.mm b/platform/ios/platform/darwin/src/MLNShape.mm similarity index 78% rename from platform/ios/platform/darwin/src/MGLShape.mm rename to platform/ios/platform/darwin/src/MLNShape.mm index 59643dcb6..e12a91ff9 100644 --- a/platform/ios/platform/darwin/src/MGLShape.mm +++ b/platform/ios/platform/darwin/src/MLNShape.mm @@ -1,9 +1,9 @@ -#import "MGLShape_Private.h" +#import "MLNShape_Private.h" -#import "MGLFeature_Private.h" +#import "MLNFeature_Private.h" -#import "NSString+MGLAdditions.h" -#import "MGLTypes.h" +#import "NSString+MLNAdditions.h" +#import "MLNTypes.h" #import @@ -11,23 +11,23 @@ bool operator==(const CLLocationCoordinate2D lhs, const CLLocationCoordinate2D r return lhs.latitude == rhs.latitude && lhs.longitude == rhs.longitude; } -@implementation MGLShape +@implementation MLNShape -+ (nullable MGLShape *)shapeWithData:(NSData *)data encoding:(NSStringEncoding)encoding error:(NSError * _Nullable *)outError { ++ (nullable MLNShape *)shapeWithData:(NSData *)data encoding:(NSStringEncoding)encoding error:(NSError * _Nullable *)outError { NSString *string = [[NSString alloc] initWithData:data encoding:encoding]; if (!string) { if (outError) { - *outError = [NSError errorWithDomain:MGLErrorDomain code:MGLErrorCodeUnknown userInfo:nil]; + *outError = [NSError errorWithDomain:MLNErrorDomain code:MLNErrorCodeUnknown userInfo:nil]; } return nil; } try { const auto geojson = mapbox::geojson::parse(string.UTF8String); - return MGLShapeFromGeoJSON(geojson); + return MLNShapeFromGeoJSON(geojson); } catch (std::runtime_error &err) { if (outError) { - *outError = [NSError errorWithDomain:MGLErrorDomain code:MGLErrorCodeUnknown userInfo:@{ + *outError = [NSError errorWithDomain:MLNErrorDomain code:MLNErrorCodeUnknown userInfo:@{ NSLocalizedFailureReasonErrorKey: @(err.what()), }]; } @@ -40,8 +40,8 @@ bool operator==(const CLLocationCoordinate2D lhs, const CLLocationCoordinate2D r } - (mbgl::Geometry)geometryObject { - [NSException raise:MGLAbstractClassException - format:@"MGLShape is an abstract class"]; + [NSException raise:MLNAbstractClassException + format:@"MLNShape is an abstract class"]; return mbgl::Point(); } @@ -80,7 +80,7 @@ bool operator==(const CLLocationCoordinate2D lhs, const CLLocationCoordinate2D r - (BOOL)isEqual:(id)other { if (other == self) { return YES; } - id annotation = other; + id annotation = other; #if TARGET_OS_IPHONE return ((!_title && ![annotation title]) || [_title isEqualToString:[annotation title]]) @@ -103,8 +103,8 @@ bool operator==(const CLLocationCoordinate2D lhs, const CLLocationCoordinate2D r - (CLLocationCoordinate2D)coordinate { - [NSException raise:MGLAbstractClassException - format:@"MGLShape is an abstract class"]; + [NSException raise:MLNAbstractClassException + format:@"MLNShape is an abstract class"]; return kCLLocationCoordinate2DInvalid; } diff --git a/platform/ios/platform/darwin/src/MLNShapeCollection.h b/platform/ios/platform/darwin/src/MLNShapeCollection.h new file mode 100644 index 000000000..b0e3b8eee --- /dev/null +++ b/platform/ios/platform/darwin/src/MLNShapeCollection.h @@ -0,0 +1,56 @@ +#import + +#import "MLNFoundation.h" +#import "MLNShape.h" + +#import "MLNTypes.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + An `MLNShapeCollection` object represents a shape consisting of zero or more + distinct but related shapes that are instances of `MLNShape`. The constituent + shapes can be a mixture of different kinds of shapes. + + `MLNShapeCollection` is most commonly used to add multiple shapes to a single + `MLNShapeSource`. Configure the appearance of an `MLNShapeSource`’s or + `MLNVectorTileSource`’s shape collection collectively using an + `MLNSymbolStyleLayer` object, or use multiple instances of + `MLNCircleStyleLayer`, `MLNFillStyleLayer`, and `MLNLineStyleLayer` to + configure the appearance of each kind of shape inside the collection. + + You cannot add an `MLNShapeCollection` object directly to a map view as an + annotation. However, you can create individual `MLNPointAnnotation`, + `MLNPolyline`, and `MLNPolygon` objects from the `shapes` array and add those + annotation objects to the map view using the `-[MLNMapView addAnnotations:]` + method. + + To represent a collection of point, polyline, or polygon shapes, it may be more + convenient to use an `MLNPointCollection`, `MLNMultiPolyline`, or + `MLNMultiPolygon` object, respectively. To access a shape collection’s + attributes, use the corresponding `MLNFeature` object. + + A shape collection is known as a + GeometryCollection + geometry in GeoJSON. + */ +MLN_EXPORT +@interface MLNShapeCollection : MLNShape + +/** + An array of shapes forming the shape collection. + */ +@property (nonatomic, copy, readonly) NSArray *shapes; + +/** + Creates and returns a shape collection consisting of the given shapes. + + @param shapes The array of shapes defining the shape collection. The data in + this array is copied to the new object. + @return A new shape collection object. + */ ++ (instancetype)shapeCollectionWithShapes:(NSArray *)shapes; + +@end + +NS_ASSUME_NONNULL_END diff --git a/platform/ios/platform/darwin/src/MGLShapeCollection.mm b/platform/ios/platform/darwin/src/MLNShapeCollection.mm similarity index 72% rename from platform/ios/platform/darwin/src/MGLShapeCollection.mm rename to platform/ios/platform/darwin/src/MLNShapeCollection.mm index 5a0ef0334..1e7133832 100644 --- a/platform/ios/platform/darwin/src/MGLShapeCollection.mm +++ b/platform/ios/platform/darwin/src/MLNShapeCollection.mm @@ -1,19 +1,19 @@ -#import "MGLShapeCollection.h" +#import "MLNShapeCollection.h" -#import "MGLShape_Private.h" -#import "MGLFeature.h" -#import "MGLLoggingConfiguration_Private.h" +#import "MLNShape_Private.h" +#import "MLNFeature.h" +#import "MLNLoggingConfiguration_Private.h" #import -@implementation MGLShapeCollection +@implementation MLNShapeCollection -+ (instancetype)shapeCollectionWithShapes:(NSArray *)shapes { ++ (instancetype)shapeCollectionWithShapes:(NSArray *)shapes { return [[self alloc] initWithShapes:shapes]; } -- (instancetype)initWithShapes:(NSArray *)shapes { - MGLLogDebug(@"Initializing with %lu shapes.", (unsigned long)shapes.count); +- (instancetype)initWithShapes:(NSArray *)shapes { + MLNLogDebug(@"Initializing with %lu shapes.", (unsigned long)shapes.count); if (self = [super init]) { _shapes = shapes.copy; } @@ -21,7 +21,7 @@ } - (instancetype)initWithCoder:(NSCoder *)decoder { - MGLLogInfo(@"Initializing with coder."); + MLNLogInfo(@"Initializing with coder."); if (self = [super initWithCoder:decoder]) { _shapes = [decoder decodeObjectOfClass:[NSArray class] forKey:@"shapes"]; } @@ -35,16 +35,16 @@ - (BOOL)isEqual:(id)other { if (self == other) return YES; - if (![other isKindOfClass:[MGLShapeCollection class]]) return NO; + if (![other isKindOfClass:[MLNShapeCollection class]]) return NO; - MGLShapeCollection *otherShapeCollection = other; + MLNShapeCollection *otherShapeCollection = other; return [super isEqual:otherShapeCollection] && [_shapes isEqualToArray:otherShapeCollection.shapes]; } - (NSUInteger)hash { NSUInteger hash = [super hash]; - for (MGLShape *shape in _shapes) { + for (MLNShape *shape in _shapes) { hash += [shape hash]; } return hash; @@ -71,7 +71,7 @@ - (mbgl::Geometry)geometryObject { mapbox::geojson::geometry_collection collection; collection.reserve(self.shapes.count); - for (MGLShape *shape in self.shapes) { + for (MLNShape *shape in self.shapes) { collection.push_back([shape geometryObject]); } return collection; diff --git a/platform/ios/platform/darwin/src/MGLShapeOfflineRegion.h b/platform/ios/platform/darwin/src/MLNShapeOfflineRegion.h similarity index 78% rename from platform/ios/platform/darwin/src/MGLShapeOfflineRegion.h rename to platform/ios/platform/darwin/src/MLNShapeOfflineRegion.h index 8f895877d..d2f789157 100644 --- a/platform/ios/platform/darwin/src/MGLShapeOfflineRegion.h +++ b/platform/ios/platform/darwin/src/MLNShapeOfflineRegion.h @@ -1,8 +1,8 @@ #import -#import "MGLFoundation.h" -#import "MGLOfflineRegion.h" -#import "MGLShape.h" +#import "MLNFoundation.h" +#import "MLNOfflineRegion.h" +#import "MLNShape.h" NS_ASSUME_NONNULL_BEGIN @@ -18,35 +18,35 @@ NS_ASSUME_NONNULL_BEGIN CLLocationCoordinate2D(latitude: 45.530883, longitude: -122.678833) ] - let triangle = MGLPolygon(coordinates: &coordinates, count: UInt(coordinates.count)) - let region = MGLShapeOfflineRegion(styleURL: MGLStyle.lightStyleURL, shape: triangle, fromZoomLevel: 11, toZoomLevel: 14) + let triangle = MLNPolygon(coordinates: &coordinates, count: UInt(coordinates.count)) + let region = MLNShapeOfflineRegion(styleURL: MLNStyle.lightStyleURL, shape: triangle, fromZoomLevel: 11, toZoomLevel: 14) let context = "Triangle Region".data(using: .utf8) - MGLOfflineStorage.shared.addPack(for: region, withContext: context!) + MLNOfflineStorage.shared.addPack(for: region, withContext: context!) ``` - This class requires fewer resources than MGLTilePyramidOfflineRegion + This class requires fewer resources than MLNTilePyramidOfflineRegion for irregularly shaped regions. */ -MGL_EXPORT -@interface MGLShapeOfflineRegion : NSObject +MLN_EXPORT +@interface MLNShapeOfflineRegion : NSObject /** The shape for the geographic region covered by the downloaded tiles. */ -@property (nonatomic, readonly) MGLShape *shape; +@property (nonatomic, readonly) MLNShape *shape; /** The minimum zoom level for which to download tiles and other resources. - For more information about zoom levels, `-[MGLMapView zoomLevel]`. + For more information about zoom levels, `-[MLNMapView zoomLevel]`. */ @property (nonatomic, readonly) double minimumZoomLevel; /** The maximum zoom level for which to download tiles and other resources. - For more information about zoom levels, `-[MGLMapView zoomLevel]`. + For more information about zoom levels, `-[MLNMapView zoomLevel]`. */ @property (nonatomic, readonly) double maximumZoomLevel; @@ -56,7 +56,7 @@ MGL_EXPORT Initializes a newly created offline region with the given style URL, geometry, and range of zoom levels. - This is the designated initializer for `MGLShapeOfflineRegion`. + This is the designated initializer for `MLNShapeOfflineRegion`. @param styleURL URL of the map style for which to download resources. The URL may be a full HTTP or HTTPS URL or a canonical URL. @@ -79,7 +79,7 @@ MGL_EXPORT level, the download covers zoom levels up to the tile source’s maximum zoom level. */ -- (instancetype)initWithStyleURL:(nullable NSURL *)styleURL shape:(MGLShape *)shape fromZoomLevel:(double)minimumZoomLevel toZoomLevel:(double)maximumZoomLevel NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithStyleURL:(nullable NSURL *)styleURL shape:(MLNShape *)shape fromZoomLevel:(double)minimumZoomLevel toZoomLevel:(double)maximumZoomLevel NS_DESIGNATED_INITIALIZER; @end diff --git a/platform/ios/platform/darwin/src/MGLShapeOfflineRegion.mm b/platform/ios/platform/darwin/src/MLNShapeOfflineRegion.mm similarity index 80% rename from platform/ios/platform/darwin/src/MGLShapeOfflineRegion.mm rename to platform/ios/platform/darwin/src/MLNShapeOfflineRegion.mm index 841d06ae5..8e2492080 100644 --- a/platform/ios/platform/darwin/src/MGLShapeOfflineRegion.mm +++ b/platform/ios/platform/darwin/src/MLNShapeOfflineRegion.mm @@ -1,4 +1,4 @@ -#import "MGLShapeOfflineRegion.h" +#import "MLNShapeOfflineRegion.h" #if !TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR #import @@ -6,18 +6,18 @@ #import #endif -#import "MGLOfflineRegion_Private.h" -#import "MGLShapeOfflineRegion_Private.h" -#import "MGLFeature_Private.h" -#import "MGLShape_Private.h" -#import "MGLStyle.h" -#import "MGLLoggingConfiguration_Private.h" +#import "MLNOfflineRegion_Private.h" +#import "MLNShapeOfflineRegion_Private.h" +#import "MLNFeature_Private.h" +#import "MLNShape_Private.h" +#import "MLNStyle.h" +#import "MLNLoggingConfiguration_Private.h" -@interface MGLShapeOfflineRegion () +@interface MLNShapeOfflineRegion () @end -@implementation MGLShapeOfflineRegion { +@implementation MLNShapeOfflineRegion { NSURL *_styleURL; } @@ -33,19 +33,19 @@ } - (instancetype)init { - MGLLogInfo(@"Calling this initializer is not allowed."); + MLNLogInfo(@"Calling this initializer is not allowed."); [NSException raise:@"Method unavailable" format: - @"-[MGLShapeOfflineRegion init] is unavailable. " + @"-[MLNShapeOfflineRegion init] is unavailable. " @"Use -initWithStyleURL:shape:fromZoomLevel:toZoomLevel: instead."]; return nil; } -- (instancetype)initWithStyleURL:(NSURL *)styleURL shape:(MGLShape *)shape fromZoomLevel:(double)minimumZoomLevel toZoomLevel:(double)maximumZoomLevel { - MGLLogDebug(@"Initializing styleURL: %@ shape: %@ fromZoomLevel: %f toZoomLevel: %f", styleURL, shape, minimumZoomLevel, maximumZoomLevel); +- (instancetype)initWithStyleURL:(NSURL *)styleURL shape:(MLNShape *)shape fromZoomLevel:(double)minimumZoomLevel toZoomLevel:(double)maximumZoomLevel { + MLNLogDebug(@"Initializing styleURL: %@ shape: %@ fromZoomLevel: %f toZoomLevel: %f", styleURL, shape, minimumZoomLevel, maximumZoomLevel); if (self = [super init]) { if (!styleURL) { - styleURL = [MGLStyle defaultStyleURL]; + styleURL = [MLNStyle defaultStyleURL]; } if (!styleURL.scheme) { @@ -68,8 +68,8 @@ - (instancetype)initWithOfflineRegionDefinition:(const mbgl::OfflineGeometryRegionDefinition &)definition { NSURL *styleURL = [NSURL URLWithString:@(definition.styleURL.c_str())]; - MGLShape *shape = MGLShapeFromGeoJSON(definition.geometry); - MGLShapeOfflineRegion* result = [self initWithStyleURL:styleURL shape:shape fromZoomLevel:definition.minZoom toZoomLevel:definition.maxZoom]; + MLNShape *shape = MLNShapeFromGeoJSON(definition.geometry); + MLNShapeOfflineRegion* result = [self initWithStyleURL:styleURL shape:shape fromZoomLevel:definition.minZoom toZoomLevel:definition.maxZoom]; result.includesIdeographicGlyphs = definition.includeIdeographs; return result; } @@ -87,13 +87,13 @@ } - (nullable instancetype)initWithCoder:(NSCoder *)coder { - MGLLogInfo(@"Initializing with coder."); + MLNLogInfo(@"Initializing with coder."); NSURL *styleURL = [coder decodeObjectForKey:@"styleURL"]; - MGLShape * shape = [coder decodeObjectForKey:@"shape"]; + MLNShape * shape = [coder decodeObjectForKey:@"shape"]; double minimumZoomLevel = [coder decodeDoubleForKey:@"minimumZoomLevel"]; double maximumZoomLevel = [coder decodeDoubleForKey:@"maximumZoomLevel"]; - MGLShapeOfflineRegion* result = [self initWithStyleURL:styleURL shape:shape fromZoomLevel:minimumZoomLevel toZoomLevel:maximumZoomLevel]; + MLNShapeOfflineRegion* result = [self initWithStyleURL:styleURL shape:shape fromZoomLevel:minimumZoomLevel toZoomLevel:maximumZoomLevel]; result.includesIdeographicGlyphs = [coder decodeBoolForKey:@"includesIdeographicGlyphs"]; return result; } @@ -108,7 +108,7 @@ } - (id)copyWithZone:(nullable NSZone *)zone { - MGLShapeOfflineRegion* result = [[[self class] allocWithZone:zone] initWithStyleURL:_styleURL shape:_shape fromZoomLevel:_minimumZoomLevel toZoomLevel:_maximumZoomLevel]; + MLNShapeOfflineRegion* result = [[[self class] allocWithZone:zone] initWithStyleURL:_styleURL shape:_shape fromZoomLevel:_minimumZoomLevel toZoomLevel:_maximumZoomLevel]; result.includesIdeographicGlyphs = _includesIdeographicGlyphs; return result; } @@ -121,7 +121,7 @@ return NO; } - MGLShapeOfflineRegion *otherRegion = other; + MLNShapeOfflineRegion *otherRegion = other; return (_minimumZoomLevel == otherRegion->_minimumZoomLevel && _maximumZoomLevel == otherRegion->_maximumZoomLevel && _shape.geometryObject == otherRegion->_shape.geometryObject diff --git a/platform/ios/platform/darwin/src/MGLShapeOfflineRegion_Private.h b/platform/ios/platform/darwin/src/MLNShapeOfflineRegion_Private.h similarity index 83% rename from platform/ios/platform/darwin/src/MGLShapeOfflineRegion_Private.h rename to platform/ios/platform/darwin/src/MLNShapeOfflineRegion_Private.h index 2ab44ad40..9ccf94234 100644 --- a/platform/ios/platform/darwin/src/MGLShapeOfflineRegion_Private.h +++ b/platform/ios/platform/darwin/src/MLNShapeOfflineRegion_Private.h @@ -1,12 +1,12 @@ #import -#import "MGLOfflineRegion.h" +#import "MLNOfflineRegion.h" #include NS_ASSUME_NONNULL_BEGIN -@protocol MGLShapeOfflineRegion_Private +@protocol MLNShapeOfflineRegion_Private /** Initializes and returns an offline region backed by the given C++ region diff --git a/platform/ios/platform/darwin/src/MGLShapeSource.h b/platform/ios/platform/darwin/src/MLNShapeSource.h similarity index 68% rename from platform/ios/platform/darwin/src/MGLShapeSource.h rename to platform/ios/platform/darwin/src/MLNShapeSource.h index 439340d4e..c8798c6d9 100644 --- a/platform/ios/platform/darwin/src/MGLShapeSource.h +++ b/platform/ios/platform/darwin/src/MLNShapeSource.h @@ -1,18 +1,18 @@ -#import "MGLFoundation.h" -#import "MGLTypes.h" -#import "MGLSource.h" +#import "MLNFoundation.h" +#import "MLNTypes.h" +#import "MLNSource.h" NS_ASSUME_NONNULL_BEGIN -@protocol MGLFeature; -@class MGLPointFeature; -@class MGLPointFeatureCluster; -@class MGLShape; +@protocol MLNFeature; +@class MLNPointFeature; +@class MLNPointFeatureCluster; +@class MLNShape; /** - Options for `MGLShapeSource` objects. + Options for `MLNShapeSource` objects. */ -typedef NSString *MGLShapeSourceOption NS_STRING_ENUM; +typedef NSString *MLNShapeSourceOption NS_STRING_ENUM; /** An `NSNumber` object containing a Boolean enabling or disabling clustering. @@ -23,23 +23,23 @@ typedef NSString *MGLShapeSourceOption NS_STRING_ENUM; cluster source property in the Mapbox Style Specification. - This option only affects point features within an `MGLShapeSource` object; it - is ignored when creating an `MGLComputedShapeSource` object. + This option only affects point features within an `MLNShapeSource` object; it + is ignored when creating an `MLNComputedShapeSource` object. #### Related examples - See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this `MGLShapeSourceOption`. + See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this `MLNShapeSourceOption`. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionClustered; +FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionClustered; /** An `NSNumber` object containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50. - This option only affects point features within an `MGLShapeSource` object; it - is ignored when creating an `MGLComputedShapeSource` object. + This option only affects point features within an `MLNShapeSource` object; it + is ignored when creating an `MLNComputedShapeSource` object. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionClusterRadius; +FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionClusterRadius; /** An `NSDictionary` object where the key is an `NSString`. The dictionary key will @@ -61,7 +61,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionClus let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] - let options : [MGLShapeSourceOption : Any] = [.clustered : true, + let options : [MLNShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary] ``` @@ -69,24 +69,24 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionClus clusterProperties source property in the Mapbox Style Specification. - This option only affects point features within an `MGLShapeSource` object; it - is ignored when creating an `MGLComputedShapeSource` object. + This option only affects point features within an `MLNShapeSource` object; it + is ignored when creating an `MLNComputedShapeSource` object. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionClusterProperties; +FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionClusterProperties; /** An `NSNumber` object containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level - less than the value of `MGLShapeSourceOptionMaximumZoomLevel` so that, at the + less than the value of `MLNShapeSourceOptionMaximumZoomLevel` so that, at the maximum zoom level, the shapes are not clustered. This option corresponds to the clusterMaxZoom source property in the Mapbox Style Specification. - This option only affects point features within an `MGLShapeSource` object; it - is ignored when creating an `MGLComputedShapeSource` object. + This option only affects point features within an `MLNShapeSource` object; it + is ignored when creating an `MLNComputedShapeSource` object. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionMaximumZoomLevelForClustering; +FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionMaximumZoomLevelForClustering; /** An `NSNumber` object containing an integer; specifies the minimum zoom level at @@ -96,7 +96,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionMaxi minzoom source property in the Mapbox Style Specification. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionMinimumZoomLevel; +FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionMinimumZoomLevel; /** An `NSNumber` object containing an integer; specifies the maximum zoom level at @@ -107,7 +107,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionMini maxzoom source property in the Mapbox Style Specification. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionMaximumZoomLevel; +FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionMaximumZoomLevel; /** An `NSNumber` object containing an integer; specifies the size of the tile @@ -119,7 +119,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionMaxi buffer source property in the Mapbox Style Specification. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionBuffer; +FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionBuffer; /** An `NSNumber` object containing a double; specifies the Douglas-Peucker @@ -130,40 +130,40 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionBuff tolerance source property in the Mapbox Style Specification. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionSimplificationTolerance; +FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionSimplificationTolerance; /** An `NSNumber` object containing a Boolean enabling or disabling calculating line distance metrics. - Set this property to `YES` in order for the `MGLLineStyleLayer.lineGradient` property to have its intended effect. + Set this property to `YES` in order for the `MLNLineStyleLayer.lineGradient` property to have its intended effect. The default value is `NO`. This option corresponds to the lineMetrics source property in the Mapbox Style Specification. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionLineDistanceMetrics; +FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionLineDistanceMetrics; /** - `MGLShapeSource` is a map content source that supplies vector shapes to be - shown on the map. The shapes may be instances of `MGLShape` or `MGLFeature`, + `MLNShapeSource` is a map content source that supplies vector shapes to be + shown on the map. The shapes may be instances of `MLNShape` or `MLNFeature`, or they may be defined by local or external GeoJSON code. A shape source is added to an - `MGLStyle` object along with an `MGLVectorStyleLayer` object. The vector style + `MLNStyle` object along with an `MLNVectorStyleLayer` object. The vector style layer defines the appearance of any content supplied by the shape source. You can update a shape source by setting its `shape` or `URL` property. - `MGLShapeSource` is optimized for data sets that change dynamically and fit + `MLNShapeSource` is optimized for data sets that change dynamically and fit completely in memory. For large data sets that do not fit completely in memory, - use the `MGLComputedShapeSource` or `MGLVectorTileSource` class. + use the `MLNComputedShapeSource` or `MLNVectorTileSource` class. Each geojson source defined by the style JSON file is represented at runtime by an - `MGLShapeSource` object that you can use to refine the map’s content and + `MLNShapeSource` object that you can use to refine the map’s content and initialize new style layers. You can also add and remove sources dynamically - using methods such as `-[MGLStyle addSource:]` and - `-[MGLStyle sourceWithIdentifier:]`. + using methods such as `-[MLNStyle addSource:]` and + `-[MLNStyle sourceWithIdentifier:]`. Any vector style layer initialized with a shape source should have a `nil` value in its `sourceLayerIdentifier` property. @@ -175,16 +175,16 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionLine CLLocationCoordinate2D(latitude: 37.77, longitude: -122.42), CLLocationCoordinate2D(latitude: 38.91, longitude: -77.04), ] - let polyline = MGLPolylineFeature(coordinates: &coordinates, count: UInt(coordinates.count)) - let source = MGLShapeSource(identifier: "lines", features: [polyline], options: nil) + let polyline = MLNPolylineFeature(coordinates: &coordinates, count: UInt(coordinates.count)) + let source = MLNShapeSource(identifier: "lines", features: [polyline], options: nil) mapView.style?.addSource(source) ``` #### Related examples - See the Cluster point data, Use images to cluster point data, and Add live data examples to learn how to add data to your map using this `MGLSource` object. + See the Cluster point data, Use images to cluster point data, and Add live data examples to learn how to add data to your map using this `MLNSource` object. */ -MGL_EXPORT -@interface MGLShapeSource : MGLSource +MLN_EXPORT +@interface MLNShapeSource : MLNSource // MARK: Initializing a Source @@ -192,12 +192,12 @@ MGL_EXPORT Returns a shape source with an identifier, URL, and dictionary of options for the source. - This class supports the following options: `MGLShapeSourceOptionClustered`, - `MGLShapeSourceOptionClusterRadius`, - `MGLShapeSourceOptionMaximumZoomLevelForClustering`, - `MGLShapeSourceOptionMinimumZoomLevel`, `MGLShapeSourceOptionMaximumZoomLevel`, - `MGLShapeSourceOptionBuffer`, and - `MGLShapeSourceOptionSimplificationTolerance`. Shapes provided by a shape + This class supports the following options: `MLNShapeSourceOptionClustered`, + `MLNShapeSourceOptionClusterRadius`, + `MLNShapeSourceOptionMaximumZoomLevelForClustering`, + `MLNShapeSourceOptionMinimumZoomLevel`, `MLNShapeSourceOptionMaximumZoomLevel`, + `MLNShapeSourceOptionBuffer`, and + `MLNShapeSourceOptionSimplificationTolerance`. Shapes provided by a shape source are not clipped or wrapped automatically. @param identifier A string that uniquely identifies the source. @@ -209,98 +209,98 @@ MGL_EXPORT #### Related examples See the Add live data example to learn how to add live data to your map by - updating the an `MGLShapeSource` object's `URL` property. + updating the an `MLNShapeSource` object's `URL` property. */ -- (instancetype)initWithIdentifier:(NSString *)identifier URL:(NSURL *)url options:(nullable NSDictionary *)options NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithIdentifier:(NSString *)identifier URL:(NSURL *)url options:(nullable NSDictionary *)options NS_DESIGNATED_INITIALIZER; /** Returns a shape source with an identifier, a shape, and dictionary of options for the source. - This class supports the following options: `MGLShapeSourceOptionClustered`, - `MGLShapeSourceOptionClusterRadius`, - `MGLShapeSourceOptionMaximumZoomLevelForClustering`, - `MGLShapeSourceOptionMinimumZoomLevel`, `MGLShapeSourceOptionMaximumZoomLevel`, - `MGLShapeSourceOptionBuffer`, and - `MGLShapeSourceOptionSimplificationTolerance`. Shapes provided by a shape + This class supports the following options: `MLNShapeSourceOptionClustered`, + `MLNShapeSourceOptionClusterRadius`, + `MLNShapeSourceOptionMaximumZoomLevelForClustering`, + `MLNShapeSourceOptionMinimumZoomLevel`, `MLNShapeSourceOptionMaximumZoomLevel`, + `MLNShapeSourceOptionBuffer`, and + `MLNShapeSourceOptionSimplificationTolerance`. Shapes provided by a shape source are not clipped or wrapped automatically. - To specify attributes about the shape, use an instance of an `MGLShape` - subclass that conforms to the `MGLFeature` protocol, such as `MGLPointFeature`. - To include multiple shapes in the source, use an `MGLShapeCollection` or - `MGLShapeCollectionFeature` object, or use the + To specify attributes about the shape, use an instance of an `MLNShape` + subclass that conforms to the `MLNFeature` protocol, such as `MLNPointFeature`. + To include multiple shapes in the source, use an `MLNShapeCollection` or + `MLNShapeCollectionFeature` object, or use the `-initWithIdentifier:features:options:` or `-initWithIdentifier:shapes:options:` methods. To create a shape from GeoJSON source code, use the - `+[MGLShape shapeWithData:encoding:error:]` method. + `+[MLNShape shapeWithData:encoding:error:]` method. @param identifier A string that uniquely identifies the source. - @param shape A concrete subclass of `MGLShape` + @param shape A concrete subclass of `MLNShape` @param options An `NSDictionary` of options for this source. @return An initialized shape source. #### Related examples See the Animate a line example to learn how to animate line data by continously - updating an `MGLShapeSource`'s `shape` attribute. + updating an `MLNShapeSource`'s `shape` attribute. */ -- (instancetype)initWithIdentifier:(NSString *)identifier shape:(nullable MGLShape *)shape options:(nullable NSDictionary *)options NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithIdentifier:(NSString *)identifier shape:(nullable MLNShape *)shape options:(nullable NSDictionary *)options NS_DESIGNATED_INITIALIZER; /** Returns a shape source with an identifier, an array of features, and a dictionary of options for the source. - This class supports the following options: `MGLShapeSourceOptionClustered`, - `MGLShapeSourceOptionClusterRadius`, - `MGLShapeSourceOptionMaximumZoomLevelForClustering`, - `MGLShapeSourceOptionMinimumZoomLevel`, `MGLShapeSourceOptionMaximumZoomLevel`, - `MGLShapeSourceOptionBuffer`, and - `MGLShapeSourceOptionSimplificationTolerance`. Shapes provided by a shape + This class supports the following options: `MLNShapeSourceOptionClustered`, + `MLNShapeSourceOptionClusterRadius`, + `MLNShapeSourceOptionMaximumZoomLevelForClustering`, + `MLNShapeSourceOptionMinimumZoomLevel`, `MLNShapeSourceOptionMaximumZoomLevel`, + `MLNShapeSourceOptionBuffer`, and + `MLNShapeSourceOptionSimplificationTolerance`. Shapes provided by a shape source are not clipped or wrapped automatically. - Unlike `-initWithIdentifier:shapes:options:`, this method accepts `MGLFeature` - instances, such as `MGLPointFeature` objects, whose attributes you can use when - applying a predicate to `MGLVectorStyleLayer` or configuring a style layer’s + Unlike `-initWithIdentifier:shapes:options:`, this method accepts `MLNFeature` + instances, such as `MLNPointFeature` objects, whose attributes you can use when + applying a predicate to `MLNVectorStyleLayer` or configuring a style layer’s appearance. To create a shape from GeoJSON source code, use the - `+[MGLShape shapeWithData:encoding:error:]` method. + `+[MLNShape shapeWithData:encoding:error:]` method. @param identifier A string that uniquely identifies the source. - @param features An array of objects that conform to the MGLFeature protocol. + @param features An array of objects that conform to the MLNFeature protocol. @param options An `NSDictionary` of options for this source. @return An initialized shape source. */ -- (instancetype)initWithIdentifier:(NSString *)identifier features:(NSArray *> *)features options:(nullable NSDictionary *)options; +- (instancetype)initWithIdentifier:(NSString *)identifier features:(NSArray *> *)features options:(nullable NSDictionary *)options; /** Returns a shape source with an identifier, an array of shapes, and a dictionary of options for the source. - This class supports the following options: `MGLShapeSourceOptionClustered`, - `MGLShapeSourceOptionClusterRadius`, - `MGLShapeSourceOptionMaximumZoomLevelForClustering`, - `MGLShapeSourceOptionMinimumZoomLevel`, `MGLShapeSourceOptionMaximumZoomLevel`, - `MGLShapeSourceOptionBuffer`, and - `MGLShapeSourceOptionSimplificationTolerance`. Shapes provided by a shape + This class supports the following options: `MLNShapeSourceOptionClustered`, + `MLNShapeSourceOptionClusterRadius`, + `MLNShapeSourceOptionMaximumZoomLevelForClustering`, + `MLNShapeSourceOptionMinimumZoomLevel`, `MLNShapeSourceOptionMaximumZoomLevel`, + `MLNShapeSourceOptionBuffer`, and + `MLNShapeSourceOptionSimplificationTolerance`. Shapes provided by a shape source are not clipped or wrapped automatically. - Any `MGLFeature` instance passed into this initializer is treated as an ordinary - shape, causing any attributes to be inaccessible to an `MGLVectorStyleLayer` when + Any `MLNFeature` instance passed into this initializer is treated as an ordinary + shape, causing any attributes to be inaccessible to an `MLNVectorStyleLayer` when evaluating a predicate or configuring certain layout or paint attributes. To preserve the attributes associated with each feature, use the `-initWithIdentifier:features:options:` method instead. To create a shape from GeoJSON source code, use the - `+[MGLShape shapeWithData:encoding:error:]` method. + `+[MLNShape shapeWithData:encoding:error:]` method. @param identifier A string that uniquely identifies the source. - @param shapes An array of shapes; each shape is a member of a concrete subclass of MGLShape. + @param shapes An array of shapes; each shape is a member of a concrete subclass of MLNShape. @param options An `NSDictionary` of options for this source. @return An initialized shape source. */ -- (instancetype)initWithIdentifier:(NSString *)identifier shapes:(NSArray *)shapes options:(nullable NSDictionary *)options; +- (instancetype)initWithIdentifier:(NSString *)identifier shapes:(NSArray *)shapes options:(nullable NSDictionary *)options; // MARK: Accessing a Source’s Content @@ -310,12 +310,12 @@ MGL_EXPORT If the receiver was initialized using `-initWithIdentifier:URL:options:`, this property is set to `nil`. This property is unavailable until the receiver is - passed into `-[MGLStyle addSource:]`. + passed into `-[MLNStyle addSource:]`. You can get/set the shapes within a collection via this property. Actions must be performed on the application's main thread. */ -@property (nonatomic, copy, nullable) MGLShape *shape; +@property (nonatomic, copy, nullable) MLNShape *shape; /** The URL to the GeoJSON document that specifies the contents of the source. @@ -343,17 +343,17 @@ MGL_EXPORT Returned features may not necessarily be visible to the user at the time they are loaded: the style may lack a layer that draws the features in question. To obtain only _visible_ features, use the - `-[MGLMapView visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:predicate:]` + `-[MLNMapView visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:predicate:]` or - `-[MGLMapView visibleFeaturesInRect:inStyleLayersWithIdentifiers:predicate:]` + `-[MLNMapView visibleFeaturesInRect:inStyleLayersWithIdentifiers:predicate:]` method. @param predicate A predicate to filter the returned features. Use `nil` to include all features in the source. - @return An array of objects conforming to the `MGLFeature` protocol that + @return An array of objects conforming to the `MLNFeature` protocol that represent features in the source that match the predicate. */ -- (NSArray> *)featuresMatchingPredicate:(nullable NSPredicate *)predicate; +- (NSArray> *)featuresMatchingPredicate:(nullable NSPredicate *)predicate; /** Returns an array of map features that are the leaves of the specified cluster. @@ -362,38 +362,38 @@ MGL_EXPORT This method supports pagination; you supply an offset (number of features to skip) and a maximum number of features to return. - @param cluster An object of type `MGLPointFeatureCluster` (that conforms to the `MGLCluster` protocol). + @param cluster An object of type `MLNPointFeatureCluster` (that conforms to the `MLNCluster` protocol). @param offset Number of features to skip. @param limit The maximum number of features to return - @return An array of objects that conform to the `MGLFeature` protocol. + @return An array of objects that conform to the `MLNFeature` protocol. */ -- (NSArray> *)leavesOfCluster:(MGLPointFeatureCluster *)cluster offset:(NSUInteger)offset limit:(NSUInteger)limit; +- (NSArray> *)leavesOfCluster:(MLNPointFeatureCluster *)cluster offset:(NSUInteger)offset limit:(NSUInteger)limit; /** Returns an array of map features that are the immediate children of the specified cluster *on the next zoom level*. The may include features that also conform to - the `MGLCluster` protocol (currently only objects of type `MGLPointFeatureCluster`). + the `MLNCluster` protocol (currently only objects of type `MLNPointFeatureCluster`). - @param cluster An object of type `MGLPointFeatureCluster` (that conforms to the `MGLCluster` protocol). + @param cluster An object of type `MLNPointFeatureCluster` (that conforms to the `MLNCluster` protocol). - @return An array of objects that conform to the `MGLFeature` protocol. + @return An array of objects that conform to the `MLNFeature` protocol. @note The returned array may contain the `cluster` that was passed in, if the next zoom level doesn't match the zoom level for expanding that cluster. See - `-[MGLShapeSource zoomLevelForExpandingCluster:]`. + `-[MLNShapeSource zoomLevelForExpandingCluster:]`. */ -- (NSArray> *)childrenOfCluster:(MGLPointFeatureCluster *)cluster; +- (NSArray> *)childrenOfCluster:(MLNPointFeatureCluster *)cluster; /** Returns the zoom level at which the given cluster expands. - @param cluster An object of type `MGLPointFeatureCluster` (that conforms to the `MGLCluster` protocol). + @param cluster An object of type `MLNPointFeatureCluster` (that conforms to the `MLNCluster` protocol). @return Zoom level. This should be >= 0; any negative return value should be considered an error. */ -- (double)zoomLevelForExpandingCluster:(MGLPointFeatureCluster *)cluster; +- (double)zoomLevelForExpandingCluster:(MLNPointFeatureCluster *)cluster; @end diff --git a/platform/ios/platform/darwin/src/MGLShapeSource.mm b/platform/ios/platform/darwin/src/MLNShapeSource.mm similarity index 66% rename from platform/ios/platform/darwin/src/MGLShapeSource.mm rename to platform/ios/platform/darwin/src/MLNShapeSource.mm index 9ae0f6535..dc15f035a 100644 --- a/platform/ios/platform/darwin/src/MGLShapeSource.mm +++ b/platform/ios/platform/darwin/src/MLNShapeSource.mm @@ -1,95 +1,95 @@ -#import "MGLFoundation_Private.h" -#import "MGLShapeSource_Private.h" +#import "MLNFoundation_Private.h" +#import "MLNShapeSource_Private.h" -#import "MGLLoggingConfiguration_Private.h" -#import "MGLStyle_Private.h" -#import "MGLStyleValue_Private.h" -#import "MGLMapView_Private.h" -#import "MGLSource_Private.h" -#import "MGLFeature_Private.h" -#import "MGLShape_Private.h" -#import "MGLCluster.h" +#import "MLNLoggingConfiguration_Private.h" +#import "MLNStyle_Private.h" +#import "MLNStyleValue_Private.h" +#import "MLNMapView_Private.h" +#import "MLNSource_Private.h" +#import "MLNFeature_Private.h" +#import "MLNShape_Private.h" +#import "MLNCluster.h" -#import "NSPredicate+MGLPrivateAdditions.h" -#import "NSURL+MGLAdditions.h" +#import "NSPredicate+MLNPrivateAdditions.h" +#import "NSURL+MLNAdditions.h" #include #include #include -const MGLShapeSourceOption MGLShapeSourceOptionBuffer = @"MGLShapeSourceOptionBuffer"; -const MGLShapeSourceOption MGLShapeSourceOptionClusterRadius = @"MGLShapeSourceOptionClusterRadius"; -const MGLShapeSourceOption MGLShapeSourceOptionClustered = @"MGLShapeSourceOptionClustered"; -const MGLShapeSourceOption MGLShapeSourceOptionClusterProperties = @"MGLShapeSourceOptionClusterProperties"; -const MGLShapeSourceOption MGLShapeSourceOptionMaximumZoomLevel = @"MGLShapeSourceOptionMaximumZoomLevel"; -const MGLShapeSourceOption MGLShapeSourceOptionMaximumZoomLevelForClustering = @"MGLShapeSourceOptionMaximumZoomLevelForClustering"; -const MGLShapeSourceOption MGLShapeSourceOptionMinimumZoomLevel = @"MGLShapeSourceOptionMinimumZoomLevel"; -const MGLShapeSourceOption MGLShapeSourceOptionSimplificationTolerance = @"MGLShapeSourceOptionSimplificationTolerance"; -const MGLShapeSourceOption MGLShapeSourceOptionLineDistanceMetrics = @"MGLShapeSourceOptionLineDistanceMetrics"; +const MLNShapeSourceOption MLNShapeSourceOptionBuffer = @"MLNShapeSourceOptionBuffer"; +const MLNShapeSourceOption MLNShapeSourceOptionClusterRadius = @"MLNShapeSourceOptionClusterRadius"; +const MLNShapeSourceOption MLNShapeSourceOptionClustered = @"MLNShapeSourceOptionClustered"; +const MLNShapeSourceOption MLNShapeSourceOptionClusterProperties = @"MLNShapeSourceOptionClusterProperties"; +const MLNShapeSourceOption MLNShapeSourceOptionMaximumZoomLevel = @"MLNShapeSourceOptionMaximumZoomLevel"; +const MLNShapeSourceOption MLNShapeSourceOptionMaximumZoomLevelForClustering = @"MLNShapeSourceOptionMaximumZoomLevelForClustering"; +const MLNShapeSourceOption MLNShapeSourceOptionMinimumZoomLevel = @"MLNShapeSourceOptionMinimumZoomLevel"; +const MLNShapeSourceOption MLNShapeSourceOptionSimplificationTolerance = @"MLNShapeSourceOptionSimplificationTolerance"; +const MLNShapeSourceOption MLNShapeSourceOptionLineDistanceMetrics = @"MLNShapeSourceOptionLineDistanceMetrics"; -mbgl::Immutable MGLGeoJSONOptionsFromDictionary(NSDictionary *options) { +mbgl::Immutable MLNGeoJSONOptionsFromDictionary(NSDictionary *options) { auto geoJSONOptions = mbgl::makeMutable(); - if (NSNumber *value = options[MGLShapeSourceOptionMinimumZoomLevel]) { + if (NSNumber *value = options[MLNShapeSourceOptionMinimumZoomLevel]) { if (![value isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionMaximumZoomLevel must be an NSNumber."]; + format:@"MLNShapeSourceOptionMaximumZoomLevel must be an NSNumber."]; } geoJSONOptions->minzoom = value.integerValue; } - if (NSNumber *value = options[MGLShapeSourceOptionMaximumZoomLevel]) { + if (NSNumber *value = options[MLNShapeSourceOptionMaximumZoomLevel]) { if (![value isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionMaximumZoomLevel must be an NSNumber."]; + format:@"MLNShapeSourceOptionMaximumZoomLevel must be an NSNumber."]; } geoJSONOptions->maxzoom = value.integerValue; } - if (NSNumber *value = options[MGLShapeSourceOptionBuffer]) { + if (NSNumber *value = options[MLNShapeSourceOptionBuffer]) { if (![value isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionBuffer must be an NSNumber."]; + format:@"MLNShapeSourceOptionBuffer must be an NSNumber."]; } geoJSONOptions->buffer = value.integerValue; } - if (NSNumber *value = options[MGLShapeSourceOptionSimplificationTolerance]) { + if (NSNumber *value = options[MLNShapeSourceOptionSimplificationTolerance]) { if (![value isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionSimplificationTolerance must be an NSNumber."]; + format:@"MLNShapeSourceOptionSimplificationTolerance must be an NSNumber."]; } geoJSONOptions->tolerance = value.doubleValue; } - if (NSNumber *value = options[MGLShapeSourceOptionClusterRadius]) { + if (NSNumber *value = options[MLNShapeSourceOptionClusterRadius]) { if (![value isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionClusterRadius must be an NSNumber."]; + format:@"MLNShapeSourceOptionClusterRadius must be an NSNumber."]; } geoJSONOptions->clusterRadius = value.integerValue; } - if (NSNumber *value = options[MGLShapeSourceOptionMaximumZoomLevelForClustering]) { + if (NSNumber *value = options[MLNShapeSourceOptionMaximumZoomLevelForClustering]) { if (![value isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionMaximumZoomLevelForClustering must be an NSNumber."]; + format:@"MLNShapeSourceOptionMaximumZoomLevelForClustering must be an NSNumber."]; } geoJSONOptions->clusterMaxZoom = value.integerValue; } - if (NSNumber *value = options[MGLShapeSourceOptionClustered]) { + if (NSNumber *value = options[MLNShapeSourceOptionClustered]) { if (![value isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionClustered must be an NSNumber."]; + format:@"MLNShapeSourceOptionClustered must be an NSNumber."]; } geoJSONOptions->cluster = value.boolValue; } - if (NSDictionary *value = options[MGLShapeSourceOptionClusterProperties]) { + if (NSDictionary *value = options[MLNShapeSourceOptionClusterProperties]) { if (![value isKindOfClass:[NSDictionary class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionClusterProperties must be an NSDictionary with an NSString as a key and an array containing two NSExpression objects as a value."]; + format:@"MLNShapeSourceOptionClusterProperties must be an NSDictionary with an NSString as a key and an array containing two NSExpression objects as a value."]; } NSEnumerator *stringEnumerator = [value keyEnumerator]; @@ -99,36 +99,36 @@ mbgl::Immutable MGLGeoJSONOptionsFromDictionary(NSD NSArray *expressionsArray = value[key]; if (![expressionsArray isKindOfClass:[NSArray class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionClusterProperties dictionary member value must be an array containing two objects."]; + format:@"MLNShapeSourceOptionClusterProperties dictionary member value must be an array containing two objects."]; } // Check that the array has 2 values. One should be a the reduce expression and one should be the map expression. if ([expressionsArray count] != 2) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionClusterProperties member value requires array of two objects."]; + format:@"MLNShapeSourceOptionClusterProperties member value requires array of two objects."]; } // reduceExpression should be a valid NSExpression NSExpression *reduceExpression = expressionsArray[0]; if (![reduceExpression isKindOfClass:[NSExpression class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionClusterProperties array value requires two expression objects."]; + format:@"MLNShapeSourceOptionClusterProperties array value requires two expression objects."]; } - auto reduce = MGLClusterPropertyFromNSExpression(reduceExpression); + auto reduce = MLNClusterPropertyFromNSExpression(reduceExpression); if (!reduce) { [NSException raise:NSInvalidArgumentException - format:@"Failed to convert MGLShapeSourceOptionClusterProperties reduce expression."]; + format:@"Failed to convert MLNShapeSourceOptionClusterProperties reduce expression."]; } // mapExpression should be a valid NSExpression NSExpression *mapExpression = expressionsArray[1]; if (![mapExpression isKindOfClass:[NSExpression class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionClusterProperties member value must contain a valid NSExpression."]; + format:@"MLNShapeSourceOptionClusterProperties member value must contain a valid NSExpression."]; } - auto map = MGLClusterPropertyFromNSExpression(mapExpression); + auto map = MLNClusterPropertyFromNSExpression(mapExpression); if (!map) { [NSException raise:NSInvalidArgumentException - format:@"Failed to convert MGLShapeSourceOptionClusterProperties map expression."]; + format:@"Failed to convert MLNShapeSourceOptionClusterProperties map expression."]; } std::string keyString = std::string([key UTF8String]); @@ -137,10 +137,10 @@ mbgl::Immutable MGLGeoJSONOptionsFromDictionary(NSD } } - if (NSNumber *value = options[MGLShapeSourceOptionLineDistanceMetrics]) { + if (NSNumber *value = options[MLNShapeSourceOptionLineDistanceMetrics]) { if (![value isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLShapeSourceOptionLineDistanceMetrics must be an NSNumber."]; + format:@"MLNShapeSourceOptionLineDistanceMetrics must be an NSNumber."]; } geoJSONOptions->lineMetrics = value.boolValue; } @@ -148,17 +148,17 @@ mbgl::Immutable MGLGeoJSONOptionsFromDictionary(NSD return geoJSONOptions; } -@interface MGLShapeSource () +@interface MLNShapeSource () @property (nonatomic, readwrite) NSDictionary *options; @property (nonatomic, readonly) mbgl::style::GeoJSONSource *rawSource; @end -@implementation MGLShapeSource +@implementation MLNShapeSource - (instancetype)initWithIdentifier:(NSString *)identifier URL:(NSURL *)url options:(NSDictionary *)options { - auto geoJSONOptions = MGLGeoJSONOptionsFromDictionary(options); + auto geoJSONOptions = MLNGeoJSONOptionsFromDictionary(options); auto source = std::make_unique(identifier.UTF8String, std::move(geoJSONOptions)); if (self = [super initWithPendingSource:std::move(source)]) { self.URL = url; @@ -166,15 +166,15 @@ mbgl::Immutable MGLGeoJSONOptionsFromDictionary(NSD return self; } -- (instancetype)initWithIdentifier:(NSString *)identifier shape:(nullable MGLShape *)shape options:(NSDictionary *)options { - auto geoJSONOptions = MGLGeoJSONOptionsFromDictionary(options); +- (instancetype)initWithIdentifier:(NSString *)identifier shape:(nullable MLNShape *)shape options:(NSDictionary *)options { + auto geoJSONOptions = MLNGeoJSONOptionsFromDictionary(options); auto source = std::make_unique(identifier.UTF8String, std::move(geoJSONOptions)); if (self = [super initWithPendingSource:std::move(source)]) { - if ([shape isMemberOfClass:[MGLShapeCollection class]]) { + if ([shape isMemberOfClass:[MLNShapeCollection class]]) { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - NSLog(@"MGLShapeCollection initialized with MGLFeatures will not retain attributes." - @"Use MGLShapeCollectionFeature to retain attributes instead." + NSLog(@"MLNShapeCollection initialized with MLNFeatures will not retain attributes." + @"Use MLNShapeCollectionFeature to retain attributes instead." @"This will be logged only once."); }); } @@ -183,18 +183,18 @@ mbgl::Immutable MGLGeoJSONOptionsFromDictionary(NSD return self; } -- (instancetype)initWithIdentifier:(NSString *)identifier features:(NSArray *> *)features options:(nullable NSDictionary *)options { - for (id feature in features) { - if (![feature conformsToProtocol:@protocol(MGLFeature)]) { - [NSException raise:NSInvalidArgumentException format:@"The object %@ included in the features argument does not conform to the MGLFeature protocol.", feature]; +- (instancetype)initWithIdentifier:(NSString *)identifier features:(NSArray *> *)features options:(nullable NSDictionary *)options { + for (id feature in features) { + if (![feature conformsToProtocol:@protocol(MLNFeature)]) { + [NSException raise:NSInvalidArgumentException format:@"The object %@ included in the features argument does not conform to the MLNFeature protocol.", feature]; } } - MGLShapeCollectionFeature *shapeCollectionFeature = [MGLShapeCollectionFeature shapeCollectionWithShapes:features]; + MLNShapeCollectionFeature *shapeCollectionFeature = [MLNShapeCollectionFeature shapeCollectionWithShapes:features]; return [self initWithIdentifier:identifier shape:shapeCollectionFeature options:options]; } -- (instancetype)initWithIdentifier:(NSString *)identifier shapes:(NSArray *)shapes options:(nullable NSDictionary *)options { - MGLShapeCollection *shapeCollection = [MGLShapeCollection shapeCollectionWithShapes:shapes]; +- (instancetype)initWithIdentifier:(NSString *)identifier shapes:(NSArray *)shapes options:(nullable NSDictionary *)options { + MLNShapeCollection *shapeCollection = [MLNShapeCollection shapeCollectionWithShapes:shapes]; return [self initWithIdentifier:identifier shape:shapeCollection options:options]; } @@ -203,13 +203,13 @@ mbgl::Immutable MGLGeoJSONOptionsFromDictionary(NSD } - (NSURL *)URL { - MGLAssertStyleSourceIsValid(); + MLNAssertStyleSourceIsValid(); auto url = self.rawSource->getURL(); return url ? [NSURL URLWithString:@(url->c_str())] : nil; } - (void)setURL:(NSURL *)url { - MGLAssertStyleSourceIsValid(); + MLNAssertStyleSourceIsValid(); if (url) { self.rawSource->setURL(url.mgl_URLByStandardizingScheme.absoluteString.UTF8String); _shape = nil; @@ -218,8 +218,8 @@ mbgl::Immutable MGLGeoJSONOptionsFromDictionary(NSD } } -- (void)setShape:(MGLShape *)shape { - MGLAssertStyleSourceIsValid(); +- (void)setShape:(MLNShape *)shape { + MLNAssertStyleSourceIsValid(); self.rawSource->setGeoJSON({ shape.geoJSONObject }); _shape = shape; } @@ -235,25 +235,25 @@ mbgl::Immutable MGLGeoJSONOptionsFromDictionary(NSD } } -- (NSArray> *)featuresMatchingPredicate:(nullable NSPredicate *)predicate { - MGLAssertStyleSourceIsValid(); +- (NSArray> *)featuresMatchingPredicate:(nullable NSPredicate *)predicate { + MLNAssertStyleSourceIsValid(); std::optional optionalFilter; if (predicate) { optionalFilter = predicate.mgl_filter; } std::vector features; - if ([self.stylable isKindOfClass:[MGLMapView class]]) { - MGLMapView *mapView = (MGLMapView *)self.stylable; + if ([self.stylable isKindOfClass:[MLNMapView class]]) { + MLNMapView *mapView = (MLNMapView *)self.stylable; features = mapView.renderer->querySourceFeatures(self.rawSource->getID(), { {}, optionalFilter }); } - return MGLFeaturesFromMBGLFeatures(features); + return MLNFeaturesFromMBGLFeatures(features); } -// MARK: - MGLCluster management +// MARK: - MLNCluster management -- (std::optional)featureExtensionValueOfCluster:(MGLShape *)cluster extension:(std::string)extension options:(const std::map)options { - MGLAssertStyleSourceIsValid(); +- (std::optional)featureExtensionValueOfCluster:(MLNShape *)cluster extension:(std::string)extension options:(const std::map)options { + MLNAssertStyleSourceIsValid(); std::optional extensionValue; // Check parameters @@ -264,14 +264,14 @@ mbgl::Immutable MGLGeoJSONOptionsFromDictionary(NSD auto geoJSON = [cluster geoJSONObject]; if (!geoJSON.is()) { - MGLAssert(0, @"cluster geoJSON object is not a feature."); + MLNAssert(0, @"cluster geoJSON object is not a feature."); return extensionValue; } auto clusterFeature = geoJSON.get(); - if ([self.stylable isKindOfClass:[MGLMapView class]]) { - MGLMapView *mapView = (MGLMapView *)self.stylable; + if ([self.stylable isKindOfClass:[MLNMapView class]]) { + MLNMapView *mapView = (MLNMapView *)self.stylable; extensionValue = mapView.renderer->queryFeatureExtensions(self.rawSource->getID(), clusterFeature, "supercluster", @@ -281,7 +281,7 @@ mbgl::Immutable MGLGeoJSONOptionsFromDictionary(NSD return extensionValue; } -- (NSArray> *)leavesOfCluster:(MGLPointFeatureCluster *)cluster offset:(NSUInteger)offset limit:(NSUInteger)limit { +- (NSArray> *)leavesOfCluster:(MLNPointFeatureCluster *)cluster offset:(NSUInteger)offset limit:(NSUInteger)limit { const std::map options = { { "limit", static_cast(limit) }, { "offset", static_cast(offset) } @@ -298,10 +298,10 @@ mbgl::Immutable MGLGeoJSONOptionsFromDictionary(NSD } std::vector leaves = featureExtension->get(); - return MGLFeaturesFromMBGLFeatures(leaves); + return MLNFeaturesFromMBGLFeatures(leaves); } -- (NSArray> *)childrenOfCluster:(MGLPointFeatureCluster *)cluster { +- (NSArray> *)childrenOfCluster:(MLNPointFeatureCluster *)cluster { auto featureExtension = [self featureExtensionValueOfCluster:cluster extension:"children" options:{}]; if (!featureExtension) { @@ -313,10 +313,10 @@ mbgl::Immutable MGLGeoJSONOptionsFromDictionary(NSD } std::vector leaves = featureExtension->get(); - return MGLFeaturesFromMBGLFeatures(leaves); + return MLNFeaturesFromMBGLFeatures(leaves); } -- (double)zoomLevelForExpandingCluster:(MGLPointFeatureCluster *)cluster { +- (double)zoomLevelForExpandingCluster:(MLNPointFeatureCluster *)cluster { auto featureExtension = [self featureExtensionValueOfCluster:cluster extension:"expansion-zoom" options:{}]; if (!featureExtension) { @@ -336,7 +336,7 @@ mbgl::Immutable MGLGeoJSONOptionsFromDictionary(NSD return -1.0; } -- (void)debugRecursiveLogForFeature:(id )feature indent:(NSUInteger)indent { +- (void)debugRecursiveLogForFeature:(id )feature indent:(NSUInteger)indent { NSString *description = feature.description; // Want our recursive log on a single line @@ -347,10 +347,10 @@ mbgl::Immutable MGLGeoJSONOptionsFromDictionary(NSD printf("%*s%s\n", (int)indent, "", log.UTF8String); - MGLPointFeatureCluster *cluster = MGL_OBJC_DYNAMIC_CAST(feature, MGLPointFeatureCluster); + MLNPointFeatureCluster *cluster = MLN_OBJC_DYNAMIC_CAST(feature, MLNPointFeatureCluster); if (cluster) { - for (id child in [self childrenOfCluster:cluster]) { + for (id child in [self childrenOfCluster:cluster]) { [self debugRecursiveLogForFeature:child indent:indent + 4]; } } diff --git a/platform/ios/platform/darwin/src/MLNShapeSource_Private.h b/platform/ios/platform/darwin/src/MLNShapeSource_Private.h new file mode 100644 index 000000000..c1c998013 --- /dev/null +++ b/platform/ios/platform/darwin/src/MLNShapeSource_Private.h @@ -0,0 +1,32 @@ +#import "MLNFoundation.h" +#import "MLNShapeSource.h" +#include + +NS_ASSUME_NONNULL_BEGIN + +namespace mbgl { + namespace style { + struct GeoJSONOptions; + } +} + +MLN_EXPORT +mbgl::Immutable MLNGeoJSONOptionsFromDictionary(NSDictionary *options); + +@interface MLNShapeSource (Private) + +/** + :nodoc: + Debug log showing structure of an `MLNFeature`. This method recurses in the case + that the feature conforms to `MLNCluster`. This method is used for testing and + should be considered experimental, likely to be removed or changed in future + releases. + + @param feature An object that conforms to the `MLNFeature` protocol. + @param indent Used during recursion. Specify 0. + */ + +- (void)debugRecursiveLogForFeature:(id)feature indent:(NSUInteger)indent; +@end + +NS_ASSUME_NONNULL_END diff --git a/platform/ios/platform/darwin/src/MGLShape_Private.h b/platform/ios/platform/darwin/src/MLNShape_Private.h similarity index 69% rename from platform/ios/platform/darwin/src/MGLShape_Private.h rename to platform/ios/platform/darwin/src/MLNShape_Private.h index 9821d4917..5036f3492 100644 --- a/platform/ios/platform/darwin/src/MGLShape_Private.h +++ b/platform/ios/platform/darwin/src/MLNShape_Private.h @@ -1,4 +1,4 @@ -#import "MGLShape.h" +#import "MLNShape.h" #import #import @@ -6,15 +6,15 @@ bool operator==(const CLLocationCoordinate2D lhs, const CLLocationCoordinate2D rhs); -@interface MGLShape (Private) +@interface MLNShape (Private) /** - Returns an `mbgl::GeoJSON` representation of the `MGLShape`. + Returns an `mbgl::GeoJSON` representation of the `MLNShape`. */ - (mbgl::GeoJSON)geoJSONObject; /** - Returns an `mbgl::Geometry` representation of the `MGLShape`. + Returns an `mbgl::Geometry` representation of the `MLNShape`. */ - (mbgl::Geometry)geometryObject; diff --git a/platform/ios/platform/darwin/src/MGLSource.h b/platform/ios/platform/darwin/src/MLNSource.h similarity index 61% rename from platform/ios/platform/darwin/src/MGLSource.h rename to platform/ios/platform/darwin/src/MLNSource.h index 485ac9f06..e2acbefa5 100644 --- a/platform/ios/platform/darwin/src/MGLSource.h +++ b/platform/ios/platform/darwin/src/MLNSource.h @@ -1,32 +1,32 @@ #import -#import "MGLFoundation.h" -#import "MGLTypes.h" +#import "MLNFoundation.h" +#import "MLNTypes.h" NS_ASSUME_NONNULL_BEGIN -FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLInvalidStyleSourceException; +FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNInvalidStyleSourceException; /** - `MGLSource` is an abstract base class for map content sources. A map content + `MLNSource` is an abstract base class for map content sources. A map content source supplies content to be shown on the map. A source is added to an - `MGLStyle` object along with an `MGLForegroundStyleLayer` object. The + `MLNStyle` object along with an `MLNForegroundStyleLayer` object. The foreground style layer defines the appearance of any content supplied by the source. Each source defined by the style JSON file is represented at runtime by an - `MGLSource` object that you can use to refine the map’s content. You can also + `MLNSource` object that you can use to refine the map’s content. You can also add and remove sources dynamically using methods such as - `-[MGLStyle addSource:]` and `-[MGLStyle sourceWithIdentifier:]`. + `-[MLNStyle addSource:]` and `-[MLNStyle sourceWithIdentifier:]`. - Create instances of `MGLShapeSource`, `MGLComputedShapeSource`, - `MGLImageSource`, and the concrete subclasses of `MGLTileSource` - (`MGLVectorTileSource` and `MGLRasterTileSource`) in order to use `MGLSource`’s - properties and methods. Do not create instances of `MGLSource` directly, and do + Create instances of `MLNShapeSource`, `MLNComputedShapeSource`, + `MLNImageSource`, and the concrete subclasses of `MLNTileSource` + (`MLNVectorTileSource` and `MLNRasterTileSource`) in order to use `MLNSource`’s + properties and methods. Do not create instances of `MLNSource` directly, and do not create your own subclasses of this class. */ -MGL_EXPORT -@interface MGLSource : NSObject +MLN_EXPORT +@interface MLNSource : NSObject // MARK: Initializing a Source @@ -36,7 +36,7 @@ MGL_EXPORT Returns a source initialized with an identifier. After initializing and configuring the source, add it to a map view’s style - using the `-[MGLStyle addSource:]` method. + using the `-[MLNStyle addSource:]` method. @param identifier A string that uniquely identifies the source in the style to which it is added. diff --git a/platform/ios/platform/darwin/src/MGLSource.mm b/platform/ios/platform/darwin/src/MLNSource.mm similarity index 79% rename from platform/ios/platform/darwin/src/MGLSource.mm rename to platform/ios/platform/darwin/src/MLNSource.mm index 49d5b533b..12e2d112a 100644 --- a/platform/ios/platform/darwin/src/MGLSource.mm +++ b/platform/ios/platform/darwin/src/MLNSource.mm @@ -1,25 +1,25 @@ -#import "MGLSource_Private.h" -#import "MGLStyle_Private.h" -#import "MGLMapView_Private.h" -#import "NSBundle+MGLAdditions.h" +#import "MLNSource_Private.h" +#import "MLNStyle_Private.h" +#import "MLNMapView_Private.h" +#import "NSBundle+MLNAdditions.h" #include #include #include -const MGLExceptionName MGLInvalidStyleSourceException = @"MGLInvalidStyleSourceException"; +const MLNExceptionName MLNInvalidStyleSourceException = @"MLNInvalidStyleSourceException"; -@interface MGLSource () +@interface MLNSource () -// Even though this class is abstract, MGLStyle uses it to represent some +// Even though this class is abstract, MLNStyle uses it to represent some // special internal source types like mbgl::AnnotationSource. @property (nonatomic, readonly) mbgl::style::Source *rawSource; -@property (nonatomic, readonly, weak) id stylable; +@property (nonatomic, readonly, weak) id stylable; @end -@implementation MGLSource { +@implementation MLNSource { std::unique_ptr _pendingSource; mapbox::base::WeakPtr _weakSource; } @@ -33,7 +33,7 @@ const MGLExceptionName MGLInvalidStyleSourceException = @"MGLInvalidStyleSourceE return self; } -- (instancetype)initWithRawSource:(mbgl::style::Source *)rawSource stylable:(id )stylable { +- (instancetype)initWithRawSource:(mbgl::style::Source *)rawSource stylable:(id )stylable { NSString *identifier = @(rawSource->getID().c_str()); if (self = [self initWithIdentifier:identifier]) { _weakSource = rawSource->makeWeakPtr(); @@ -55,9 +55,9 @@ const MGLExceptionName MGLInvalidStyleSourceException = @"MGLInvalidStyleSourceE return self; } -- (void)addToStylable:(id )stylable { +- (void)addToStylable:(id )stylable { if (_pendingSource == nullptr) { - [NSException raise:MGLRedundantSourceException + [NSException raise:MLNRedundantSourceException format:@"This instance %@ was already added to %@. Adding the same source instance " \ "to the style more than once is invalid.", self, stylable.style]; } @@ -66,8 +66,8 @@ const MGLExceptionName MGLInvalidStyleSourceException = @"MGLInvalidStyleSourceE _stylable.style.rawStyle->addSource(std::move(_pendingSource)); } -- (BOOL)removeFromStylable:(id )mapView error:(NSError * __nullable * __nullable)outError { - MGLAssertStyleSourceIsValid(); +- (BOOL)removeFromStylable:(id )mapView error:(NSError * __nullable * __nullable)outError { + MLNAssertStyleSourceIsValid(); BOOL removed = NO; if (self.rawSource == mapView.style.rawStyle->getSource(self.identifier.UTF8String)) { @@ -83,8 +83,8 @@ const MGLExceptionName MGLInvalidStyleSourceException = @"MGLInvalidStyleSourceE NSLocalizedStringWithDefaultValue(@"REMOVE_SRC_FAIL_IN_USE_FMT", @"Foundation", nil, @"The source “%@” can’t be removed while it is in use.", @"User-friendly error description; first placeholder is the source’s identifier"), self.identifier]; - *outError = [NSError errorWithDomain:MGLErrorDomain - code:MGLErrorCodeSourceIsInUseCannotRemove + *outError = [NSError errorWithDomain:MLNErrorDomain + code:MLNErrorCodeSourceIsInUseCannotRemove userInfo:@{ NSLocalizedDescriptionKey : localizedDescription }]; } } else if (outError) { @@ -93,8 +93,8 @@ const MGLExceptionName MGLInvalidStyleSourceException = @"MGLInvalidStyleSourceE NSLocalizedStringWithDefaultValue(@"REMOVE_SRC_FAIL_MISMATCH_FMT", @"Foundation", nil, @"The source can’t be removed because its identifier, “%@”, belongs to a different source in this style.", @"User-friendly error description"), self.identifier]; - *outError = [NSError errorWithDomain:MGLErrorDomain - code:MGLErrorCodeSourceIdentifierMismatch + *outError = [NSError errorWithDomain:MLNErrorDomain + code:MLNErrorCodeSourceIdentifierMismatch userInfo:@{ NSLocalizedDescriptionKey : localizedDescription }]; } diff --git a/platform/ios/platform/darwin/src/MGLSource_Private.h b/platform/ios/platform/darwin/src/MLNSource_Private.h similarity index 74% rename from platform/ios/platform/darwin/src/MGLSource_Private.h rename to platform/ios/platform/darwin/src/MLNSource_Private.h index 345f25970..33b78250c 100644 --- a/platform/ios/platform/darwin/src/MGLSource_Private.h +++ b/platform/ios/platform/darwin/src/MLNSource_Private.h @@ -1,11 +1,11 @@ -#import "MGLSource.h" +#import "MLNSource.h" #include NS_ASSUME_NONNULL_BEGIN -@protocol MGLStylable; +@protocol MLNStylable; namespace mbgl { namespace style { @@ -14,36 +14,36 @@ namespace mbgl { } // A struct to be stored in the `peer` member of mbgl::style::Source, in order to implement -// object identity. We don't store a MGLSource pointer directly because that doesn't +// object identity. We don't store a MLNSource pointer directly because that doesn't // interoperate with ARC. The inner pointer is weak in order to avoid a reference cycle for -// "pending" MGLSources, which have a strong owning pointer to the mbgl::style::Source. +// "pending" MLNSources, which have a strong owning pointer to the mbgl::style::Source. struct SourceWrapper { - __weak MGLSource *source; + __weak MLNSource *source; }; /** Assert that the style source is valid. This macro should be used at the beginning of any public-facing instance method - of `MGLSource` and its subclasses. For private methods, an assertion is more appropriate. + of `MLNSource` and its subclasses. For private methods, an assertion is more appropriate. */ -#define MGLAssertStyleSourceIsValid() \ +#define MLNAssertStyleSourceIsValid() \ do { \ if (!self.rawSource) { \ - [NSException raise:MGLInvalidStyleSourceException \ + [NSException raise:MLNInvalidStyleSourceException \ format:@"This source got invalidated after the style change"]; \ } \ } while (NO); -@class MGLMapView; +@class MLNMapView; -@interface MGLSource (Private) +@interface MLNSource (Private) /** Initializes and returns a source with a raw pointer to the backing store, associated with a style. */ -- (instancetype)initWithRawSource:(mbgl::style::Source *)rawSource stylable:(nullable id )stylable; +- (instancetype)initWithRawSource:(mbgl::style::Source *)rawSource stylable:(nullable id )stylable; /** Initializes and returns a source with an owning pointer to the backing store, @@ -66,26 +66,26 @@ do { \ If the source is not currently part of any stylable object’s style, this property is set to `nil`. */ -@property (nonatomic, readonly, weak) id stylable; +@property (nonatomic, readonly, weak) id stylable; /** Adds the mbgl source that this object represents to the mbgl map. Once a mbgl source is added, ownership of the object is transferred to the `mbgl::Map` and this object no longer has an active unique_ptr reference to the `mbgl::Source`. If this object's mbgl source is in that state, the mbgl source - can still be changed but the changes will not be visible until the `MGLSource` - is added back to the map via `-[MGLStyle addSource:]` and styled with a - `MGLLayer`. + can still be changed but the changes will not be visible until the `MLNSource` + is added back to the map via `-[MLNStyle addSource:]` and styled with a + `MLNLayer`. */ -- (void)addToStylable:(id )mapView; +- (void)addToStylable:(id )mapView; /** Removes the mbgl source that this object represents from the mbgl map. When a mbgl source is removed, ownership of the object is transferred back - to the `MGLSource` instance and the unique_ptr reference is valid again. It is + to the `MLNSource` instance and the unique_ptr reference is valid again. It is safe to add the source back to the style after it is removed. */ -- (BOOL)removeFromStylable:(id )mapView error:(NSError * __nullable * __nullable)outError; +- (BOOL)removeFromStylable:(id )mapView error:(NSError * __nullable * __nullable)outError; @end diff --git a/platform/ios/platform/darwin/src/MGLStyle.h b/platform/ios/platform/darwin/src/MLNStyle.h similarity index 73% rename from platform/ios/platform/darwin/src/MGLStyle.h rename to platform/ios/platform/darwin/src/MLNStyle.h index ebe48ea4f..7d0284604 100644 --- a/platform/ios/platform/darwin/src/MGLStyle.h +++ b/platform/ios/platform/darwin/src/MLNStyle.h @@ -1,60 +1,60 @@ #import -#import "MGLFoundation.h" -#import "MGLStyleLayer.h" +#import "MLNFoundation.h" +#import "MLNStyleLayer.h" -#import "MGLTypes.h" +#import "MLNTypes.h" -#import "MGLSettings.h" -#import "MGLTileServerOptions.h" -#import "MGLDefaultStyle.h" +#import "MLNSettings.h" +#import "MLNTileServerOptions.h" +#import "MLNDefaultStyle.h" -@class MGLSource; -@class MGLLight; +@class MLNSource; +@class MLNLight; NS_ASSUME_NONNULL_BEGIN -FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLInvalidStyleURLException; -FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLRedundantLayerException; -FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLRedundantLayerIdentifierException; -FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLRedundantSourceException; -FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLRedundantSourceIdentifierException; +FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNInvalidStyleURLException; +FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNRedundantLayerException; +FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNRedundantLayerIdentifierException; +FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNRedundantSourceException; +FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNRedundantSourceIdentifierException; /** The proxy object for the current map style. - MGLStyle provides a set of convenience methods for changing Mapbox - default styles using `MGLMapView.styleURL`. + MLNStyle provides a set of convenience methods for changing Mapbox + default styles using `MLNMapView.styleURL`. Learn more about Mapbox default styles. It is also possible to directly manipulate the current map style - via `MGLMapView.style` by updating the style's data sources or layers. + via `MLNMapView.style` by updating the style's data sources or layers. @note Wait until the map style has finished loading before modifying a map's - style via any of the `MGLStyle` instance methods below. You can use the - `-[MGLMapViewDelegate mapView:didFinishLoadingStyle:]` or - `-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]` methods as indicators + style via any of the `MLNStyle` instance methods below. You can use the + `-[MLNMapViewDelegate mapView:didFinishLoadingStyle:]` or + `-[MLNMapViewDelegate mapViewDidFinishLoadingMap:]` methods as indicators that it's safe to modify the map's style. #### Related examples See the - Default styles example to learn how to initialize an `MGLMapView` object - with a Mapbox default style using `MGLStyle`'s class methods. + Default styles example to learn how to initialize an `MLNMapView` object + with a Mapbox default style using `MLNStyle`'s class methods. */ -MGL_EXPORT -@interface MGLStyle : NSObject +MLN_EXPORT +@interface MLNStyle : NSObject // MARK: Accessing Default Styles /** Returns list of predefined styles */ -+ (NSArray*) predefinedStyles; ++ (NSArray*) predefinedStyles; /** Returns default style */ -+ (MGLDefaultStyle*) defaultStyle; ++ (MLNDefaultStyle*) defaultStyle; /** Returns default style as NSURL @@ -65,7 +65,7 @@ MGL_EXPORT @param withStyleName style name. */ -+ (MGLDefaultStyle*) predefinedStyle:(NSString*)withStyleName; ++ (MLNDefaultStyle*) predefinedStyle:(NSString*)withStyleName; // MARK: Accessing Metadata About the Style @@ -81,13 +81,13 @@ MGL_EXPORT /** A set containing the style’s sources. */ -@property (nonatomic, strong) NSSet<__kindof MGLSource *> *sources; +@property (nonatomic, strong) NSSet<__kindof MLNSource *> *sources; /** Values describing animated transitions to changes on a style's individual paint properties. */ -@property (nonatomic) MGLTransition transition; +@property (nonatomic) MLNTransition transition; /** A boolean value indicating whether label placement transitions are enabled. @@ -102,32 +102,32 @@ MGL_EXPORT @note Source identifiers are not guaranteed to exist across styles or different versions of the same style. Applications that use this API must first set the style URL to an explicitly versioned style using a convenience method like - `+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL” + `+[MLNStyle outdoorsStyleURLWithVersion:]`, `MLNMapView`’s “Style URL” inspectable in Interface Builder, or a manually constructed `NSURL`. This approach also avoids source identifer name changes that will occur in the default style’s sources over time. - @return An instance of a concrete subclass of `MGLSource` associated with the + @return An instance of a concrete subclass of `MLNSource` associated with the given identifier, or `nil` if the current style contains no such source. */ -- (nullable MGLSource *)sourceWithIdentifier:(NSString *)identifier; +- (nullable MLNSource *)sourceWithIdentifier:(NSString *)identifier; /** Adds a new source to the current style. @note Adding the same source instance more than once will result in a - `MGLRedundantSourceException`. Reusing the same source identifier, even with + `MLNRedundantSourceException`. Reusing the same source identifier, even with different source instances, will result in a - `MGLRedundantSourceIdentifierException`. + `MLNRedundantSourceIdentifierException`. @note Sources should be added in - `-[MGLMapViewDelegate mapView:didFinishLoadingStyle:]` or - `-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map + `-[MLNMapViewDelegate mapView:didFinishLoadingStyle:]` or + `-[MLNMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map has loaded the style and is ready to accept a new source. @param source The source to add to the current style. */ -- (void)addSource:(MGLSource *)source; +- (void)addSource:(MLNSource *)source; /** Removes a source from the current style. @@ -135,14 +135,14 @@ MGL_EXPORT @note Source identifiers are not guaranteed to exist across styles or different versions of the same style. Applications that use this API must first set the style URL to an explicitly versioned style using a convenience method like - `+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL” + `+[MLNStyle outdoorsStyleURLWithVersion:]`, `MLNMapView`’s “Style URL” inspectable in Interface Builder, or a manually constructed `NSURL`. This approach also avoids source identifer name changes that will occur in the default style’s sources over time. @param source The source to remove from the current style. */ -- (void)removeSource:(MGLSource *)source; +- (void)removeSource:(MLNSource *)source; /** Removes a source from the current style. @@ -150,7 +150,7 @@ MGL_EXPORT @note Source identifiers are not guaranteed to exist across styles or different versions of the same style. Applications that use this API must first set the style URL to an explicitly versioned style using a convenience method like - `+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL” + `+[MLNStyle outdoorsStyleURLWithVersion:]`, `MLNMapView`’s “Style URL” inspectable in Interface Builder, or a manually constructed `NSURL`. This approach also avoids source identifer name changes that will occur in the default style’s sources over time. @@ -162,7 +162,7 @@ MGL_EXPORT @return `YES` if `source` was removed successfully. If `NO`, `outError` contains an `NSError` object describing the problem. */ -- (BOOL)removeSource:(MGLSource *)source error:(NSError * __nullable * __nullable)outError; +- (BOOL)removeSource:(MLNSource *)source error:(NSError * __nullable * __nullable)outError; // MARK: Managing Style Layers @@ -171,7 +171,7 @@ MGL_EXPORT The layers included in the style, arranged according to their back-to-front ordering on the screen. */ -@property (nonatomic, strong) NSArray<__kindof MGLStyleLayer *> *layers; +@property (nonatomic, strong) NSArray<__kindof MLNStyleLayer *> *layers; /** Returns a style layer with the given identifier in the current style. @@ -179,44 +179,44 @@ MGL_EXPORT @note Layer identifiers are not guaranteed to exist across styles or different versions of the same style. Applications that use this API must first set the style URL to an explicitly versioned style using a convenience method like - `+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL” + `+[MLNStyle outdoorsStyleURLWithVersion:]`, `MLNMapView`’s “Style URL” inspectable in Interface Builder, or a manually constructed `NSURL`. This approach also avoids layer identifer name changes that will occur in the default style’s layers over time. - @return An instance of a concrete subclass of `MGLStyleLayer` associated with + @return An instance of a concrete subclass of `MLNStyleLayer` associated with the given identifier, or `nil` if the current style contains no such style layer. */ -- (nullable MGLStyleLayer *)layerWithIdentifier:(NSString *)identifier; +- (nullable MLNStyleLayer *)layerWithIdentifier:(NSString *)identifier; /** Adds a new layer on top of existing layers. @note Adding the same layer instance more than once will result in a - `MGLRedundantLayerException`. Reusing the same layer identifer, even with + `MLNRedundantLayerException`. Reusing the same layer identifer, even with different layer instances, will also result in an exception. @note Layers should be added in - `-[MGLMapViewDelegate mapView:didFinishLoadingStyle:]` or - `-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map + `-[MLNMapViewDelegate mapView:didFinishLoadingStyle:]` or + `-[MLNMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map has loaded the style and is ready to accept a new layer. @param layer The layer object to add to the map view. This object must be an - instance of a concrete subclass of `MGLStyleLayer`. + instance of a concrete subclass of `MLNStyleLayer`. */ -- (void)addLayer:(MGLStyleLayer *)layer; +- (void)addLayer:(MLNStyleLayer *)layer; /** Inserts a new layer into the style at the given index. @note Adding the same layer instance more than once will result in a - `MGLRedundantLayerException`. Reusing the same layer identifer, even with + `MLNRedundantLayerException`. Reusing the same layer identifer, even with different layer instances, will also result in an exception. @note Layers should be added in - `-[MGLMapViewDelegate mapView:didFinishLoadingStyle:]` or - `-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map + `-[MLNMapViewDelegate mapView:didFinishLoadingStyle:]` or + `-[MLNMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map has loaded the style and is ready to accept a new layer. @param layer The layer to insert. @@ -224,7 +224,7 @@ MGL_EXPORT the layer to the back; an index equal to the number of objects in the `layers` property would bring the layer to the front. */ -- (void)insertLayer:(MGLStyleLayer *)layer atIndex:(NSUInteger)index; +- (void)insertLayer:(MLNStyleLayer *)layer atIndex:(NSUInteger)index; /** Inserts a new layer below another layer. @@ -232,13 +232,13 @@ MGL_EXPORT @note Layer identifiers are not guaranteed to exist across styles or different versions of the same style. Applications that use this API must first set the style URL to an explicitly versioned style using a convenience method like - `+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL” + `+[MLNStyle outdoorsStyleURLWithVersion:]`, `MLNMapView`’s “Style URL” inspectable in Interface Builder, or a manually constructed `NSURL`. This approach also avoids layer identifer name changes that will occur in the default style’s layers over time. Inserting the same layer instance more than once will result in a - `MGLRedundantLayerException`. Reusing the same layer identifer, even with + `MLNRedundantLayerException`. Reusing the same layer identifer, even with different layer instances, will also result in an exception. @param layer The layer to insert. @@ -249,7 +249,7 @@ MGL_EXPORT Add multiple shapes from a single shape source example to learn how to add a layer to your map below an existing layer. */ -- (void)insertLayer:(MGLStyleLayer *)layer belowLayer:(MGLStyleLayer *)sibling; +- (void)insertLayer:(MLNStyleLayer *)layer belowLayer:(MLNStyleLayer *)sibling; /** Inserts a new layer above another layer. @@ -257,13 +257,13 @@ MGL_EXPORT @note Layer identifiers are not guaranteed to exist across styles or different versions of the same style. Applications that use this API must first set the style URL to an explicitly versioned style using a convenience method like - `+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL” + `+[MLNStyle outdoorsStyleURLWithVersion:]`, `MLNMapView`’s “Style URL” inspectable in Interface Builder, or a manually constructed `NSURL`. This approach also avoids layer identifer name changes that will occur in the default style’s layers over time. Inserting the same layer instance more than once will result in a - `MGLRedundantLayerException`. Reusing the same layer identifer, even with + `MLNRedundantLayerException`. Reusing the same layer identifer, even with different layer instances, will also result in an exception. @param layer The layer to insert. @@ -274,7 +274,7 @@ MGL_EXPORT Add an image example to learn how to add a layer to your map above an existing layer. */ -- (void)insertLayer:(MGLStyleLayer *)layer aboveLayer:(MGLStyleLayer *)sibling; +- (void)insertLayer:(MLNStyleLayer *)layer aboveLayer:(MLNStyleLayer *)sibling; /** Removes a layer from the map view. @@ -282,15 +282,15 @@ MGL_EXPORT @note Layer identifiers are not guaranteed to exist across styles or different versions of the same style. Applications that use this API must first set the style URL to an explicitly versioned style using a convenience method like - `+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL” + `+[MLNStyle outdoorsStyleURLWithVersion:]`, `MLNMapView`’s “Style URL” inspectable in Interface Builder, or a manually constructed `NSURL`. This approach also avoids layer identifer name changes that will occur in the default style’s layers over time. @param layer The layer object to remove from the map view. This object - must conform to the `MGLStyleLayer` protocol. + must conform to the `MLNStyleLayer` protocol. */ -- (void)removeLayer:(MGLStyleLayer *)layer; +- (void)removeLayer:(MLNStyleLayer *)layer; // MARK: Managing a Style’s Images @@ -300,8 +300,8 @@ MGL_EXPORT @note Names and their associated images are not guaranteed to exist across styles or different versions of the same style. Applications that use this API must first set the style URL to an explicitly versioned style using a - convenience method like `+[MGLStyle outdoorsStyleURLWithVersion:]`, - `MGLMapView`’s “Style URL” inspectable in Interface Builder, or a manually + convenience method like `+[MLNStyle outdoorsStyleURLWithVersion:]`, + `MLNMapView`’s “Style URL” inspectable in Interface Builder, or a manually constructed `NSURL`. This approach also avoids image name changes that will occur in the default style over time. @@ -309,13 +309,13 @@ MGL_EXPORT @return The image associated with the given name, or `nil` if no image is associated with that name. */ -- (nullable MGLImage *)imageForName:(NSString *)name; +- (nullable MLNImage *)imageForName:(NSString *)name; /** Adds or overrides an image used by the style’s layers. To use an image in a style layer, give it a unique name using this method, then - set the `iconImageName` property of an `MGLSymbolStyleLayer` object to that + set the `iconImageName` property of an `MLNSymbolStyleLayer` object to that name. @param image The image for the name. @@ -325,9 +325,9 @@ MGL_EXPORT See the Use images to cluster point data and Cluster point data examples to learn how to add images to your map using - an `MGLStyle` object. + an `MLNStyle` object. */ -- (void)setImage:(MGLImage *)image forName:(NSString *)name; +- (void)setImage:(MLNImage *)image forName:(NSString *)name; /** Removes a name and its associated image from the style. @@ -335,8 +335,8 @@ MGL_EXPORT @note Names and their associated images are not guaranteed to exist across styles or different versions of the same style. Applications that use this API must first set the style URL to an explicitly versioned style using a - convenience method like `+[MGLStyle outdoorsStyleURLWithVersion:]`, - `MGLMapView`’s “Style URL” inspectable in Interface Builder, or a manually + convenience method like `+[MLNStyle outdoorsStyleURLWithVersion:]`, + `MLNMapView`’s “Style URL” inspectable in Interface Builder, or a manually constructed `NSURL`. This approach also avoids image name changes that will occur in the default style over time. @@ -350,7 +350,7 @@ MGL_EXPORT /** Provides global light source for the style. */ -@property (nonatomic, strong) MGLLight *light; +@property (nonatomic, strong) MLNLight *light; // MARK: Localizing Map Content @@ -373,10 +373,10 @@ MGL_EXPORT @end /** - An object whose contents are represented by an `MGLStyle` object that you + An object whose contents are represented by an `MLNStyle` object that you configure. */ -@protocol MGLStylable +@protocol MLNStylable /** The style currently displayed in the receiver. @@ -385,10 +385,10 @@ MGL_EXPORT identifiers that will change over time. Applications that use APIs that manipulate a style’s sources and layers must first set the style URL to an explicitly versioned style using a convenience method like - `+[MGLStyle outdoorsStyleURLWithVersion:]` or a manually constructed + `+[MLNStyle outdoorsStyleURLWithVersion:]` or a manually constructed `NSURL`. */ -@property (nonatomic, readonly, nullable) MGLStyle *style; +@property (nonatomic, readonly, nullable) MLNStyle *style; @end diff --git a/platform/ios/platform/darwin/src/MGLStyle.mm b/platform/ios/platform/darwin/src/MLNStyle.mm similarity index 66% rename from platform/ios/platform/darwin/src/MGLStyle.mm rename to platform/ios/platform/darwin/src/MLNStyle.mm index f946bb1d4..7f9d19a62 100644 --- a/platform/ios/platform/darwin/src/MGLStyle.mm +++ b/platform/ios/platform/darwin/src/MLNStyle.mm @@ -1,32 +1,32 @@ -#import "MGLStyle_Private.h" +#import "MLNStyle_Private.h" -#import "MGLMapView_Private.h" -#import "MGLStyleLayer.h" -#import "MGLStyleLayer_Private.h" -#import "MGLFillStyleLayer.h" -#import "MGLFillExtrusionStyleLayer.h" -#import "MGLLineStyleLayer.h" -#import "MGLCircleStyleLayer.h" -#import "MGLSymbolStyleLayer.h" -#import "MGLHeatmapStyleLayer.h" -#import "MGLHillshadeStyleLayer.h" -#import "MGLRasterStyleLayer.h" -#import "MGLBackgroundStyleLayer.h" -#import "MGLOpenGLStyleLayer.h" -#import "MGLStyleLayerManager.h" +#import "MLNMapView_Private.h" +#import "MLNStyleLayer.h" +#import "MLNStyleLayer_Private.h" +#import "MLNFillStyleLayer.h" +#import "MLNFillExtrusionStyleLayer.h" +#import "MLNLineStyleLayer.h" +#import "MLNCircleStyleLayer.h" +#import "MLNSymbolStyleLayer.h" +#import "MLNHeatmapStyleLayer.h" +#import "MLNHillshadeStyleLayer.h" +#import "MLNRasterStyleLayer.h" +#import "MLNBackgroundStyleLayer.h" +#import "MLNOpenGLStyleLayer.h" +#import "MLNStyleLayerManager.h" -#import "MGLSource.h" -#import "MGLSource_Private.h" -#import "MGLLight_Private.h" -#import "MGLTileSource_Private.h" -#import "MGLVectorTileSource_Private.h" -#import "MGLRasterTileSource.h" -#import "MGLRasterDEMSource.h" -#import "MGLShapeSource.h" -#import "MGLImageSource.h" +#import "MLNSource.h" +#import "MLNSource_Private.h" +#import "MLNLight_Private.h" +#import "MLNTileSource_Private.h" +#import "MLNVectorTileSource_Private.h" +#import "MLNRasterTileSource.h" +#import "MLNRasterDEMSource.h" +#import "MLNShapeSource.h" +#import "MLNImageSource.h" -#import "MGLAttributionInfo_Private.h" -#import "MGLLoggingConfiguration_Private.h" +#import "MLNAttributionInfo_Private.h" +#import "MLNLoggingConfiguration_Private.h" #include #include @@ -38,24 +38,24 @@ #include #include -#import "NSDate+MGLAdditions.h" +#import "NSDate+MLNAdditions.h" #if TARGET_OS_IPHONE - #import "UIImage+MGLAdditions.h" + #import "UIImage+MLNAdditions.h" #else - #import "NSImage+MGLAdditions.h" + #import "NSImage+MLNAdditions.h" #endif -const MGLExceptionName MGLInvalidStyleURLException = @"MGLInvalidStyleURLException"; -const MGLExceptionName MGLRedundantLayerException = @"MGLRedundantLayerException"; -const MGLExceptionName MGLRedundantLayerIdentifierException = @"MGLRedundantLayerIdentifierException"; -const MGLExceptionName MGLRedundantSourceException = @"MGLRedundantSourceException"; -const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSourceIdentifierException"; +const MLNExceptionName MLNInvalidStyleURLException = @"MLNInvalidStyleURLException"; +const MLNExceptionName MLNRedundantLayerException = @"MLNRedundantLayerException"; +const MLNExceptionName MLNRedundantLayerIdentifierException = @"MLNRedundantLayerIdentifierException"; +const MLNExceptionName MLNRedundantSourceException = @"MLNRedundantSourceException"; +const MLNExceptionName MLNRedundantSourceIdentifierException = @"MLNRedundantSourceIdentifierException"; /** Model class for localization changes. */ -@interface MGLTextLanguage: NSObject +@interface MLNTextLanguage: NSObject @property (strong, nonatomic) NSString *originalTextField; @property (strong, nonatomic) NSString *updatedTextField; @@ -63,7 +63,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou @end -@implementation MGLTextLanguage +@implementation MLNTextLanguage - (instancetype)initWithTextLanguage:(NSString *)originalTextField updatedTextField:(NSString *)updatedTextField { if (self = [super init]) { @@ -74,31 +74,31 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou } @end -@interface MGLStyle() +@interface MLNStyle() -@property (nonatomic, readonly, weak) id stylable; +@property (nonatomic, readonly, weak) id stylable; @property (nonatomic, readonly) mbgl::style::Style *rawStyle; @property (readonly, copy, nullable) NSURL *URL; -@property (nonatomic, readwrite, strong) NSMutableDictionary *openGLLayers; -@property (nonatomic) NSMutableDictionary *> *localizedLayersByIdentifier; +@property (nonatomic, readwrite, strong) NSMutableDictionary *openGLLayers; +@property (nonatomic) NSMutableDictionary *> *localizedLayersByIdentifier; @end -@implementation MGLStyle +@implementation MLNStyle // MARK: Predefined style URLs -+ (NSArray*) predefinedStyles { - return MGLSettings.tileServerOptions.defaultStyles; ++ (NSArray*) predefinedStyles { + return MLNSettings.tileServerOptions.defaultStyles; } -+ (MGLDefaultStyle*) defaultStyle { - MGLTileServerOptions* opts = MGLSettings.tileServerOptions; ++ (MLNDefaultStyle*) defaultStyle { + MLNTileServerOptions* opts = MLNSettings.tileServerOptions; return opts.defaultStyle; } + (NSURL*) defaultStyleURL { - MGLDefaultStyle* styleDefinition = [MGLStyle defaultStyle]; + MLNDefaultStyle* styleDefinition = [MLNStyle defaultStyle]; if (styleDefinition != nil){ return styleDefinition.url; } @@ -106,8 +106,8 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou return nil; } -+ (MGLDefaultStyle*) predefinedStyle:(NSString*)withStyleName { - for (MGLDefaultStyle* style in MGLSettings.tileServerOptions.defaultStyles) { ++ (MLNDefaultStyle*) predefinedStyle:(NSString*)withStyleName { + for (MLNDefaultStyle* style in MLNSettings.tileServerOptions.defaultStyles) { if ([style.name isEqualToString:withStyleName]) { return style; } @@ -117,14 +117,14 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou // MARK: - -- (instancetype)initWithRawStyle:(mbgl::style::Style *)rawStyle stylable:(id )stylable { - MGLLogInfo(@"Initializing %@ with stylable: %@", NSStringFromClass([self class]), stylable); +- (instancetype)initWithRawStyle:(mbgl::style::Style *)rawStyle stylable:(id )stylable { + MLNLogInfo(@"Initializing %@ with stylable: %@", NSStringFromClass([self class]), stylable); if (self = [super init]) { _stylable = stylable; _rawStyle = rawStyle; _openGLLayers = [NSMutableDictionary dictionary]; _localizedLayersByIdentifier = [NSMutableDictionary dictionary]; - MGLLogDebug(@"Initializing with style name: %@ stylable: %@", self.name, stylable); + MLNLogDebug(@"Initializing with style name: %@ stylable: %@", self.name, stylable); } return self; } @@ -140,22 +140,22 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou // MARK: Sources -- (NSSet<__kindof MGLSource *> *)sources { +- (NSSet<__kindof MLNSource *> *)sources { auto rawSources = self.rawStyle->getSources(); - NSMutableSet<__kindof MGLSource *> *sources = [NSMutableSet setWithCapacity:rawSources.size()]; + NSMutableSet<__kindof MLNSource *> *sources = [NSMutableSet setWithCapacity:rawSources.size()]; for (auto rawSource = rawSources.begin(); rawSource != rawSources.end(); ++rawSource) { - MGLSource *source = [self sourceFromMBGLSource:*rawSource]; + MLNSource *source = [self sourceFromMBGLSource:*rawSource]; [sources addObject:source]; } return sources; } -- (void)setSources:(NSSet<__kindof MGLSource *> *)sources { - MGLLogDebug(@"Setting: %lu sources", sources.count); - for (MGLSource *source in self.sources) { +- (void)setSources:(NSSet<__kindof MLNSource *> *)sources { + MLNLogDebug(@"Setting: %lu sources", sources.count); + for (MLNSource *source in self.sources) { [self removeSource:source]; } - for (MGLSource *source in sources) { + for (MLNSource *source in sources) { [self addSource:source]; } } @@ -164,75 +164,75 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou return self.rawStyle->getSources().size(); } -- (MGLSource *)memberOfSources:(MGLSource *)object { +- (MLNSource *)memberOfSources:(MLNSource *)object { return [self sourceWithIdentifier:object.identifier]; } -- (MGLSource *)sourceWithIdentifier:(NSString *)identifier +- (MLNSource *)sourceWithIdentifier:(NSString *)identifier { - MGLLogDebug(@"Querying source with identifier: %@", identifier); + MLNLogDebug(@"Querying source with identifier: %@", identifier); auto rawSource = self.rawStyle->getSource(identifier.UTF8String); return rawSource ? [self sourceFromMBGLSource:rawSource] : nil; } -- (MGLSource *)sourceFromMBGLSource:(mbgl::style::Source *)rawSource { - if (MGLSource *source = rawSource->peer.has_value() ? rawSource->peer.get().source : nil) { +- (MLNSource *)sourceFromMBGLSource:(mbgl::style::Source *)rawSource { + if (MLNSource *source = rawSource->peer.has_value() ? rawSource->peer.get().source : nil) { return source; } // TODO: Fill in options specific to the respective source classes // https://github.com/mapbox/mapbox-gl-native/issues/6584 if (auto vectorSource = rawSource->as()) { - return [[MGLVectorTileSource alloc] initWithRawSource:vectorSource stylable:self.stylable]; + return [[MLNVectorTileSource alloc] initWithRawSource:vectorSource stylable:self.stylable]; } else if (auto geoJSONSource = rawSource->as()) { - return [[MGLShapeSource alloc] initWithRawSource:geoJSONSource stylable:self.stylable]; + return [[MLNShapeSource alloc] initWithRawSource:geoJSONSource stylable:self.stylable]; } else if (auto rasterSource = rawSource->as()) { - return [[MGLRasterTileSource alloc] initWithRawSource:rasterSource stylable:self.stylable]; + return [[MLNRasterTileSource alloc] initWithRawSource:rasterSource stylable:self.stylable]; } else if (auto rasterDEMSource = rawSource->as()) { - return [[MGLRasterDEMSource alloc] initWithRawSource:rasterDEMSource stylable:self.stylable]; + return [[MLNRasterDEMSource alloc] initWithRawSource:rasterDEMSource stylable:self.stylable]; } else if (auto imageSource = rawSource->as()) { - return [[MGLImageSource alloc] initWithRawSource:imageSource stylable:self.stylable]; + return [[MLNImageSource alloc] initWithRawSource:imageSource stylable:self.stylable]; } else { - return [[MGLSource alloc] initWithRawSource:rawSource stylable:self.stylable]; + return [[MLNSource alloc] initWithRawSource:rawSource stylable:self.stylable]; } } -- (void)addSource:(MGLSource *)source +- (void)addSource:(MLNSource *)source { - MGLLogDebug(@"Adding source: %@", source); + MLNLogDebug(@"Adding source: %@", source); if (!source.rawSource) { [NSException raise:NSInvalidArgumentException format: @"The source %@ cannot be added to the style. " - @"Make sure the source was created as a member of a concrete subclass of MGLSource.", + @"Make sure the source was created as a member of a concrete subclass of MLNSource.", source]; } try { [source addToStylable:self.stylable]; } catch (std::runtime_error & err) { - [NSException raise:MGLRedundantSourceIdentifierException format:@"%s", err.what()]; + [NSException raise:MLNRedundantSourceIdentifierException format:@"%s", err.what()]; } } -- (void)removeSource:(MGLSource *)source +- (void)removeSource:(MLNSource *)source { [self removeSource:source error:nil]; } -- (BOOL)removeSource:(MGLSource *)source error:(NSError * __nullable * __nullable)outError { - MGLLogDebug(@"Removing source: %@", source); +- (BOOL)removeSource:(MLNSource *)source error:(NSError * __nullable * __nullable)outError { + MLNLogDebug(@"Removing source: %@", source); if (!source.rawSource) { NSString *errorMessage = [NSString stringWithFormat: @"The source %@ cannot be removed from the style. " - @"Make sure the source was created as a member of a concrete subclass of MGLSource." + @"Make sure the source was created as a member of a concrete subclass of MLNSource." @"Automatic re-addition of sources after style changes is not currently supported.", source]; if (outError) { - *outError = [NSError errorWithDomain:MGLErrorDomain - code:MGLErrorCodeSourceCannotBeRemovedFromStyle + *outError = [NSError errorWithDomain:MLNErrorDomain + code:MLNErrorCodeSourceCannotBeRemovedFromStyle userInfo:@{ NSLocalizedDescriptionKey : errorMessage }]; return NO; } @@ -245,15 +245,15 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou } -- (nullable NSArray *)attributionInfosWithFontSize:(CGFloat)fontSize linkColor:(nullable MGLColor *)linkColor { +- (nullable NSArray *)attributionInfosWithFontSize:(CGFloat)fontSize linkColor:(nullable MLNColor *)linkColor { // It’d be incredibly convenient to use -sources here, but this operation // depends on the sources being sorted in ascending order by creation, as // with the std::vector used in mbgl. auto rawSources = self.rawStyle->getSources(); NSMutableArray *infos = [NSMutableArray arrayWithCapacity:rawSources.size()]; for (auto rawSource = rawSources.begin(); rawSource != rawSources.end(); ++rawSource) { - MGLTileSource *source = (MGLTileSource *)[self sourceFromMBGLSource:*rawSource]; - if (![source isKindOfClass:[MGLTileSource class]]) { + MLNTileSource *source = (MLNTileSource *)[self sourceFromMBGLSource:*rawSource]; + if (![source isKindOfClass:[MLNTileSource class]]) { continue; } @@ -265,23 +265,23 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou // MARK: Style layers -- (NSArray<__kindof MGLStyleLayer *> *)layers +- (NSArray<__kindof MLNStyleLayer *> *)layers { auto layers = self.rawStyle->getLayers(); - NSMutableArray<__kindof MGLStyleLayer *> *styleLayers = [NSMutableArray arrayWithCapacity:layers.size()]; + NSMutableArray<__kindof MLNStyleLayer *> *styleLayers = [NSMutableArray arrayWithCapacity:layers.size()]; for (auto layer : layers) { - MGLStyleLayer *styleLayer = [self layerFromMBGLLayer:layer]; + MLNStyleLayer *styleLayer = [self layerFromMBGLLayer:layer]; [styleLayers addObject:styleLayer]; } return styleLayers; } -- (void)setLayers:(NSArray<__kindof MGLStyleLayer *> *)layers { - MGLLogDebug(@"Setting: %lu layers", layers.count); - for (MGLStyleLayer *layer in self.layers) { +- (void)setLayers:(NSArray<__kindof MLNStyleLayer *> *)layers { + MLNLogDebug(@"Setting: %lu layers", layers.count); + for (MLNStyleLayer *layer in self.layers) { [self removeLayer:layer]; } - for (MGLStyleLayer *layer in layers) { + for (MLNStyleLayer *layer in layers) { [self addLayer:layer]; } } @@ -291,7 +291,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou return self.rawStyle->getLayers().size(); } -- (MGLStyleLayer *)objectInLayersAtIndex:(NSUInteger)index +- (MLNStyleLayer *)objectInLayersAtIndex:(NSUInteger)index { auto layers = self.rawStyle->getLayers(); if (index >= layers.size()) { @@ -303,7 +303,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou return [self layerFromMBGLLayer:layer]; } -- (void)getLayers:(MGLStyleLayer **)buffer range:(NSRange)inRange +- (void)getLayers:(MLNStyleLayer **)buffer range:(NSRange)inRange { auto layers = self.rawStyle->getLayers(); if (NSMaxRange(inRange) > layers.size()) { @@ -312,17 +312,17 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou } NSUInteger i = 0; for (auto layer = *(layers.rbegin() + inRange.location); i < inRange.length; ++layer, ++i) { - MGLStyleLayer *styleLayer = [self layerFromMBGLLayer:layer]; + MLNStyleLayer *styleLayer = [self layerFromMBGLLayer:layer]; buffer[i] = styleLayer; } } -- (void)insertObject:(MGLStyleLayer *)styleLayer inLayersAtIndex:(NSUInteger)index +- (void)insertObject:(MLNStyleLayer *)styleLayer inLayersAtIndex:(NSUInteger)index { if (!styleLayer.rawLayer) { [NSException raise:NSInvalidArgumentException format: @"The style layer %@ cannot be inserted into the style. " - @"Make sure the style layer was created as a member of a concrete subclass of MGLStyleLayer.", + @"Make sure the style layer was created as a member of a concrete subclass of MLNStyleLayer.", styleLayer]; } auto layers = self.rawStyle->getLayers(); @@ -331,17 +331,17 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou format:@"Cannot insert style layer at out-of-bounds index %lu.", (unsigned long)index]; } else if (index == 0) { try { - MGLStyleLayer *sibling = layers.size() ? [self layerFromMBGLLayer:layers.at(0)] : nil; + MLNStyleLayer *sibling = layers.size() ? [self layerFromMBGLLayer:layers.at(0)] : nil; [styleLayer addToStyle:self belowLayer:sibling]; } catch (const std::runtime_error & err) { - [NSException raise:MGLRedundantLayerIdentifierException format:@"%s", err.what()]; + [NSException raise:MLNRedundantLayerIdentifierException format:@"%s", err.what()]; } } else { try { - MGLStyleLayer *sibling = [self layerFromMBGLLayer:layers.at(index)]; + MLNStyleLayer *sibling = [self layerFromMBGLLayer:layers.at(index)]; [styleLayer addToStyle:self belowLayer:sibling]; } catch (std::runtime_error & err) { - [NSException raise:MGLRedundantLayerIdentifierException format:@"%s", err.what()]; + [NSException raise:MLNRedundantLayerIdentifierException format:@"%s", err.what()]; } } } @@ -354,35 +354,35 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou format:@"Cannot remove style layer at out-of-bounds index %lu.", (unsigned long)index]; } auto layer = layers.at(index); - MGLStyleLayer *styleLayer = [self layerFromMBGLLayer:layer]; + MLNStyleLayer *styleLayer = [self layerFromMBGLLayer:layer]; [styleLayer removeFromStyle:self]; } -- (MGLStyleLayer *)layerFromMBGLLayer:(mbgl::style::Layer *)rawLayer +- (MLNStyleLayer *)layerFromMBGLLayer:(mbgl::style::Layer *)rawLayer { NSParameterAssert(rawLayer); - if (MGLStyleLayer *layer = rawLayer->peer.has_value() ? rawLayer->peer.get().layer : nil) { + if (MLNStyleLayer *layer = rawLayer->peer.has_value() ? rawLayer->peer.get().layer : nil) { return layer; } return mbgl::LayerManagerDarwin::get()->createPeer(rawLayer); } -- (MGLStyleLayer *)layerWithIdentifier:(NSString *)identifier +- (MLNStyleLayer *)layerWithIdentifier:(NSString *)identifier { - MGLLogDebug(@"Querying layerWithIdentifier: %@", identifier); + MLNLogDebug(@"Querying layerWithIdentifier: %@", identifier); auto mbglLayer = self.rawStyle->getLayer(identifier.UTF8String); return mbglLayer ? [self layerFromMBGLLayer:mbglLayer] : nil; } -- (void)removeLayer:(MGLStyleLayer *)layer +- (void)removeLayer:(MLNStyleLayer *)layer { - MGLLogDebug(@"Removing layer: %@", layer); + MLNLogDebug(@"Removing layer: %@", layer); if (!layer.rawLayer) { [NSException raise:NSInvalidArgumentException format: @"The style layer %@ cannot be removed from the style. " - @"Make sure the style layer was created as a member of a concrete subclass of MGLStyleLayer.", + @"Make sure the style layer was created as a member of a concrete subclass of MLNStyleLayer.", layer]; } [self willChangeValueForKey:@"layers"]; @@ -390,68 +390,68 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou [self didChangeValueForKey:@"layers"]; } -- (void)addLayer:(MGLStyleLayer *)layer +- (void)addLayer:(MLNStyleLayer *)layer { - MGLLogDebug(@"Adding layer: %@", layer); + MLNLogDebug(@"Adding layer: %@", layer); if (!layer.rawLayer) { [NSException raise:NSInvalidArgumentException format: @"The style layer %@ cannot be added to the style. " - @"Make sure the style layer was created as a member of a concrete subclass of MGLStyleLayer.", + @"Make sure the style layer was created as a member of a concrete subclass of MLNStyleLayer.", layer]; } [self willChangeValueForKey:@"layers"]; try { [layer addToStyle:self belowLayer:nil]; } catch (std::runtime_error & err) { - [NSException raise:MGLRedundantLayerIdentifierException format:@"%s", err.what()]; + [NSException raise:MLNRedundantLayerIdentifierException format:@"%s", err.what()]; } [self didChangeValueForKey:@"layers"]; } -- (void)insertLayer:(MGLStyleLayer *)layer atIndex:(NSUInteger)index { +- (void)insertLayer:(MLNStyleLayer *)layer atIndex:(NSUInteger)index { [self insertObject:layer inLayersAtIndex:index]; } -- (void)insertLayer:(MGLStyleLayer *)layer belowLayer:(MGLStyleLayer *)sibling +- (void)insertLayer:(MLNStyleLayer *)layer belowLayer:(MLNStyleLayer *)sibling { - MGLLogDebug(@"Inseting layer: %@ belowLayer: %@", layer, sibling); + MLNLogDebug(@"Inseting layer: %@ belowLayer: %@", layer, sibling); if (!layer.rawLayer) { [NSException raise:NSInvalidArgumentException format: @"The style layer %@ cannot be added to the style. " - @"Make sure the style layer was created as a member of a concrete subclass of MGLStyleLayer.", + @"Make sure the style layer was created as a member of a concrete subclass of MLNStyleLayer.", layer]; } if (!sibling.rawLayer) { [NSException raise:NSInvalidArgumentException format: @"A style layer cannot be placed below %@ in the style. " - @"Make sure sibling was obtained using -[MGLStyle layerWithIdentifier:].", + @"Make sure sibling was obtained using -[MLNStyle layerWithIdentifier:].", sibling]; } [self willChangeValueForKey:@"layers"]; try { [layer addToStyle:self belowLayer:sibling]; } catch (std::runtime_error & err) { - [NSException raise:MGLRedundantLayerIdentifierException format:@"%s", err.what()]; + [NSException raise:MLNRedundantLayerIdentifierException format:@"%s", err.what()]; } [self didChangeValueForKey:@"layers"]; } -- (void)insertLayer:(MGLStyleLayer *)layer aboveLayer:(MGLStyleLayer *)sibling { - MGLLogDebug(@"Inseting layer: %@ aboveLayer: %@", layer, sibling); +- (void)insertLayer:(MLNStyleLayer *)layer aboveLayer:(MLNStyleLayer *)sibling { + MLNLogDebug(@"Inseting layer: %@ aboveLayer: %@", layer, sibling); if (!layer.rawLayer) { [NSException raise:NSInvalidArgumentException format: @"The style layer %@ cannot be added to the style. " - @"Make sure the style layer was created as a member of a concrete subclass of MGLStyleLayer.", + @"Make sure the style layer was created as a member of a concrete subclass of MLNStyleLayer.", layer]; } if (!sibling.rawLayer) { [NSException raise:NSInvalidArgumentException format: @"A style layer cannot be placed above %@ in the style. " - @"Make sure sibling was obtained using -[MGLStyle layerWithIdentifier:].", + @"Make sure sibling was obtained using -[MLNStyle layerWithIdentifier:].", sibling]; } @@ -470,20 +470,20 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou [NSException raise:NSInvalidArgumentException format: @"A style layer cannot be placed above %@ in the style. " - @"Make sure sibling was obtained using -[MGLStyle layerWithIdentifier:].", + @"Make sure sibling was obtained using -[MLNStyle layerWithIdentifier:].", sibling]; } else if (index + 1 == layers.size()) { try { [layer addToStyle:self belowLayer:nil]; } catch (std::runtime_error & err) { - [NSException raise:MGLRedundantLayerIdentifierException format:@"%s", err.what()]; + [NSException raise:MLNRedundantLayerIdentifierException format:@"%s", err.what()]; } } else { - MGLStyleLayer *nextSibling = [self layerFromMBGLLayer:layers.at(index + 1)]; + MLNStyleLayer *nextSibling = [self layerFromMBGLLayer:layers.at(index + 1)]; try { [layer addToStyle:self belowLayer:nextSibling]; } catch (std::runtime_error & err) { - [NSException raise:MGLRedundantLayerIdentifierException format:@"%s", err.what()]; + [NSException raise:MLNRedundantLayerIdentifierException format:@"%s", err.what()]; } } [self didChangeValueForKey:@"layers"]; @@ -491,9 +491,9 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou // MARK: Style images -- (void)setImage:(MGLImage *)image forName:(NSString *)name +- (void)setImage:(MLNImage *)image forName:(NSString *)name { - MGLLogDebug(@"Setting image: %@ forName: %@", image, name); + MLNLogDebug(@"Setting image: %@ forName: %@", image, name); if (!image) { [NSException raise:NSInvalidArgumentException format:@"Cannot assign nil image to “%@”.", name]; @@ -508,7 +508,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou - (void)removeImageForName:(NSString *)name { - MGLLogDebug(@"Removing imageForName: %@", name); + MLNLogDebug(@"Removing imageForName: %@", name); if (!name) { [NSException raise:NSInvalidArgumentException format:@"Cannot remove image with nil name."]; @@ -517,30 +517,30 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou self.rawStyle->removeImage([name UTF8String]); } -- (MGLImage *)imageForName:(NSString *)name +- (MLNImage *)imageForName:(NSString *)name { - MGLLogDebug(@"Querying imageForName: %@", name); + MLNLogDebug(@"Querying imageForName: %@", name); if (!name) { [NSException raise:NSInvalidArgumentException format:@"Cannot get image with nil name."]; } auto styleImage = self.rawStyle->getImage([name UTF8String]); - return styleImage ? [[MGLImage alloc] initWithMGLStyleImage:*styleImage] : nil; + return styleImage ? [[MLNImage alloc] initWithMLNStyleImage:*styleImage] : nil; } // MARK: Style transitions -- (void)setTransition:(MGLTransition)transition +- (void)setTransition:(MLNTransition)transition { - self.rawStyle->setTransitionOptions(MGLOptionsFromTransition(transition)); + self.rawStyle->setTransitionOptions(MLNOptionsFromTransition(transition)); } -- (MGLTransition)transition +- (MLNTransition)transition { const mbgl::style::TransitionOptions transitionOptions = self.rawStyle->getTransitionOptions(); - return MGLTransitionFromOptions(transitionOptions); + return MLNTransitionFromOptions(transitionOptions); } - (void)setPerformsPlacementTransitions:(BOOL)performsPlacementTransitions @@ -558,16 +558,16 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou // MARK: Style light -- (void)setLight:(MGLLight *)light +- (void)setLight:(MLNLight *)light { std::unique_ptr mbglLight = std::make_unique([light mbglLight]); self.rawStyle->setLight(std::move(mbglLight)); } -- (MGLLight *)light +- (MLNLight *)light { auto mbglLight = self.rawStyle->getLight(); - MGLLight *light = [[MGLLight alloc] initWithMBGLLight:mbglLight]; + MLNLight *light = [[MLNLight alloc] initWithMBGLLight:mbglLight]; return light; } @@ -582,15 +582,15 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou // MARK: Mapbox Streets source introspection - (void)localizeLabelsIntoLocale:(nullable NSLocale *)locale { - NSSet *streetsSources = + NSSet *streetsSources = [self.sources filteredSetUsingPredicate: - [NSPredicate predicateWithBlock:^BOOL(MGLVectorTileSource * _Nullable source, NSDictionary * _Nullable bindings) { - return [source isKindOfClass:[MGLVectorTileSource class]] && [source isMapboxStreets]; + [NSPredicate predicateWithBlock:^BOOL(MLNVectorTileSource * _Nullable source, NSDictionary * _Nullable bindings) { + return [source isKindOfClass:[MLNVectorTileSource class]] && [source isMapboxStreets]; }]]; NSSet *streetsSourceIdentifiers = [streetsSources valueForKey:@"identifier"]; - for (MGLSymbolStyleLayer *layer in self.layers) { - if (![layer isKindOfClass:[MGLSymbolStyleLayer class]]) { + for (MLNSymbolStyleLayer *layer in self.layers) { + if (![layer isKindOfClass:[MLNSymbolStyleLayer class]]) { continue; } if (![streetsSourceIdentifiers containsObject:layer.sourceIdentifier]) { @@ -605,28 +605,28 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou } } -- (NSSet *)mapboxStreetsSources { - return [self.sources objectsPassingTest:^BOOL (__kindof MGLVectorTileSource * _Nonnull source, BOOL * _Nonnull stop) { - return [source isKindOfClass:[MGLVectorTileSource class]] && source.mapboxStreets; +- (NSSet *)mapboxStreetsSources { + return [self.sources objectsPassingTest:^BOOL (__kindof MLNVectorTileSource * _Nonnull source, BOOL * _Nonnull stop) { + return [source isKindOfClass:[MLNVectorTileSource class]] && source.mapboxStreets; }]; } -- (NSArray *)placeStyleLayers { +- (NSArray *)placeStyleLayers { NSSet *streetsSourceIdentifiers = [self.mapboxStreetsSources valueForKey:@"identifier"]; NSSet *placeSourceLayerIdentifiers = [NSSet setWithObjects:@"marine_label", @"country_label", @"state_label", @"place_label", @"water_label", @"poi_label", @"rail_station_label", @"mountain_peak_label", @"natural_label", @"transit_stop_label", nil]; - NSPredicate *isPlacePredicate = [NSPredicate predicateWithBlock:^BOOL (MGLVectorStyleLayer * _Nullable layer, NSDictionary * _Nullable bindings) { - return [layer isKindOfClass:[MGLVectorStyleLayer class]] && [streetsSourceIdentifiers containsObject:layer.sourceIdentifier] && [placeSourceLayerIdentifiers containsObject:layer.sourceLayerIdentifier]; + NSPredicate *isPlacePredicate = [NSPredicate predicateWithBlock:^BOOL (MLNVectorStyleLayer * _Nullable layer, NSDictionary * _Nullable bindings) { + return [layer isKindOfClass:[MLNVectorStyleLayer class]] && [streetsSourceIdentifiers containsObject:layer.sourceIdentifier] && [placeSourceLayerIdentifiers containsObject:layer.sourceLayerIdentifier]; }]; return [self.layers filteredArrayUsingPredicate:isPlacePredicate]; } -- (NSArray *)roadStyleLayers { +- (NSArray *)roadStyleLayers { NSSet *streetsSourceIdentifiers = [self.mapboxStreetsSources valueForKey:@"identifier"]; NSSet *roadStyleLayerIdentifiers = [NSSet setWithObjects:@"road_label", @"road", nil]; - NSPredicate *isPlacePredicate = [NSPredicate predicateWithBlock:^BOOL (MGLVectorStyleLayer * _Nullable layer, NSDictionary * _Nullable bindings) { - return [layer isKindOfClass:[MGLVectorStyleLayer class]] && [streetsSourceIdentifiers containsObject:layer.sourceIdentifier] && [roadStyleLayerIdentifiers containsObject:layer.sourceLayerIdentifier]; + NSPredicate *isPlacePredicate = [NSPredicate predicateWithBlock:^BOOL (MLNVectorStyleLayer * _Nullable layer, NSDictionary * _Nullable bindings) { + return [layer isKindOfClass:[MLNVectorStyleLayer class]] && [streetsSourceIdentifiers containsObject:layer.sourceIdentifier] && [roadStyleLayerIdentifiers containsObject:layer.sourceLayerIdentifier]; }]; return [self.layers filteredArrayUsingPredicate:isPlacePredicate]; } diff --git a/platform/ios/platform/darwin/src/MGLStyleLayer.h b/platform/ios/platform/darwin/src/MLNStyleLayer.h similarity index 67% rename from platform/ios/platform/darwin/src/MGLStyleLayer.h rename to platform/ios/platform/darwin/src/MLNStyleLayer.h index c11380910..53d882b93 100644 --- a/platform/ios/platform/darwin/src/MGLStyleLayer.h +++ b/platform/ios/platform/darwin/src/MLNStyleLayer.h @@ -1,31 +1,31 @@ #import -#import "MGLFoundation.h" -#import "MGLTypes.h" +#import "MLNFoundation.h" +#import "MLNTypes.h" NS_ASSUME_NONNULL_BEGIN -FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLInvalidStyleLayerException; +FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNInvalidStyleLayerException; /** - `MGLStyleLayer` is an abstract base class for style layers. A style layer + `MLNStyleLayer` is an abstract base class for style layers. A style layer manages the layout and appearance of content at a specific z-index in a style. - An `MGLStyle` object consists of one or more `MGLStyleLayer` objects. + An `MLNStyle` object consists of one or more `MLNStyleLayer` objects. Each style layer defined by the style JSON file is represented at runtime by an - `MGLStyleLayer` object, which you can use to refine the map’s appearance. You + `MLNStyleLayer` object, which you can use to refine the map’s appearance. You can also add and remove style layers dynamically. - Create instances of `MGLBackgroundStyleLayer` and the concrete subclasses of - `MGLForegroundStyleLayer` in order to use `MGLStyleLayer`'s properties and methods. - You do not create instances of `MGLStyleLayer` directly, and do not + Create instances of `MLNBackgroundStyleLayer` and the concrete subclasses of + `MLNForegroundStyleLayer` in order to use `MLNStyleLayer`'s properties and methods. + You do not create instances of `MLNStyleLayer` directly, and do not create your own subclasses of this class. - Do not add `MGLStyleLayer` objects to the `style` property of a `MGLMapView` before + Do not add `MLNStyleLayer` objects to the `style` property of a `MLNMapView` before `-mapView:didFinishLoadingStyle:` is called. */ -MGL_EXPORT -@interface MGLStyleLayer : NSObject +MLN_EXPORT +@interface MLNStyleLayer : NSObject // MARK: Initializing a Style Layer @@ -46,7 +46,7 @@ MGL_EXPORT #### Related examples See the - Show and hide a layer example to learn how to toggle an `MGLStyleLayer` + Show and hide a layer example to learn how to toggle an `MLNStyleLayer` object's visibility. */ @property (nonatomic, assign, getter=isVisible) BOOL visible; diff --git a/platform/ios/platform/darwin/src/MGLStyleLayer.h.ejs b/platform/ios/platform/darwin/src/MLNStyleLayer.h.ejs similarity index 79% rename from platform/ios/platform/darwin/src/MGLStyleLayer.h.ejs rename to platform/ios/platform/darwin/src/MLNStyleLayer.h.ejs index e23f614b7..0ee234376 100644 --- a/platform/ios/platform/darwin/src/MGLStyleLayer.h.ejs +++ b/platform/ios/platform/darwin/src/MLNStyleLayer.h.ejs @@ -9,8 +9,8 @@ // This file is generated. // Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`. -#import "MGLFoundation.h" -#import "MGL<%- +#import "MLNFoundation.h" +#import "MLN<%- (type === 'background' ? '' : (type === 'raster' || type === 'hillshade' ? 'Foreground' : 'Vector')) @@ -23,15 +23,15 @@ NS_ASSUME_NONNULL_BEGIN /** <%- propertyDoc(enumName(property), property, type, 'enum').wrap(80, 1) %> - Values of this type are used in the `MGL<%- camelize(type) %>StyleLayer.<%- camelizeWithLeadingLowercase(property.name) %>` + Values of this type are used in the `MLN<%- camelize(type) %>StyleLayer.<%- camelizeWithLeadingLowercase(property.name) %>` property. */ -typedef NS_ENUM(NSUInteger, MGL<%- camelize(enumName(property)) %>) { +typedef NS_ENUM(NSUInteger, MLN<%- camelize(enumName(property)) %>) { <% for (const value in property.values) { -%> /** <%- propertyDoc(enumName(property), property.values[value], type, 'enum').wrap(80, 4+1) %> */ - MGL<%- camelize(enumName(property)) %><%- camelize(value) %>, + MLN<%- camelize(enumName(property)) %><%- camelize(value) %>, <% } -%> }; @@ -42,15 +42,15 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(enumName(property)) %>) { /** <%- propertyDoc(enumName(property), property, type, 'enum').wrap(80, 1) %> - Values of this type are used in the `MGL<%- camelize(type) %>StyleLayer.<%- camelizeWithLeadingLowercase(enumName(property)) %>` + Values of this type are used in the `MLN<%- camelize(type) %>StyleLayer.<%- camelizeWithLeadingLowercase(enumName(property)) %>` property. */ -typedef NS_ENUM(NSUInteger, MGL<%- camelize(enumName(property)) %>) { +typedef NS_ENUM(NSUInteger, MLN<%- camelize(enumName(property)) %>) { <% for (const value in property.values) { -%> /** <%- propertyDoc(enumName(property), property.values[value], type, 'enum').wrap(80, 4+1) %> */ - MGL<%- camelize(enumName(property)) %><%- camelize(value) %>, + MLN<%- camelize(enumName(property)) %><%- camelize(value) %>, <% } -%> }; @@ -65,10 +65,10 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(enumName(property)) %>) { <%- doc.wrap(80, 1) %> You can access an existing <%- type %> style layer using the - `-[MGLStyle layerWithIdentifier:]` method if you know its identifier; - otherwise, find it using the `MGLStyle.layers` property. You can also create a + `-[MLNStyle layerWithIdentifier:]` method if you know its identifier; + otherwise, find it using the `MLNStyle.layers` property. You can also create a new <%- type %> style layer and add it to the style using a method such as - `-[MGLStyle addLayer:]`. + `-[MLNStyle addLayer:]`. <% if (examples) { -%> #### Related examples @@ -81,8 +81,8 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(enumName(property)) %>) { ``` */ <% } -%> -MGL_EXPORT -@interface MGL<%- camelize(type) %>StyleLayer : MGL<%- +MLN_EXPORT +@interface MLN<%- camelize(type) %>StyleLayer : MLN<%- (type === 'background' ? '' : (type === 'raster' || type === 'hillshade' ? 'Foreground' : 'Vector')) @@ -93,8 +93,8 @@ MGL_EXPORT Returns a <%- type %> style layer initialized with an identifier. After initializing and configuring the style layer, add it to a map view’s -style using the `-[MGLStyle addLayer:]` or -`-[MGLStyle insertLayer:belowLayer:]` method. +style using the `-[MLNStyle addLayer:]` or +`-[MLNStyle insertLayer:belowLayer:]` method. @param identifier A string that uniquely identifies the source in the style to which it is added. @@ -106,8 +106,8 @@ which it is added. Returns a <%- type %> style layer initialized with an identifier and source. After initializing and configuring the style layer, add it to a map view’s - style using the `-[MGLStyle addLayer:]` or - `-[MGLStyle insertLayer:belowLayer:]` method. + style using the `-[MLNStyle addLayer:]` or + `-[MLNStyle insertLayer:belowLayer:]` method. @param identifier A string that uniquely identifies the source in the style to which it is added. @@ -115,7 +115,7 @@ which it is added. has not yet been added to the current style, the behavior is undefined. @return An initialized foreground style layer. */ -- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source; +- (instancetype)initWithIdentifier:(NSString *)identifier source:(MLNSource *)source; <% } -%> <% if (layoutProperties.length) { -%> @@ -158,7 +158,7 @@ which it is added. This property corresponds to the `<%- originalPropertyName(property) %>-transition` property in the style JSON file format. */ -@property (nonatomic) MGLTransition <%- camelizeWithLeadingLowercase(property.name) %>Transition; +@property (nonatomic) MLNTransition <%- camelizeWithLeadingLowercase(property.name) %>Transition; <% } -%> <% if (property.original) { -%> @@ -172,25 +172,25 @@ which it is added. <% if (enumProperties) { -%> /** Methods for wrapping an enumeration value for a style layer attribute in an - `MGL<%- camelize(type) %>StyleLayer` object and unwrapping its raw value. + `MLN<%- camelize(type) %>StyleLayer` object and unwrapping its raw value. */ -@interface NSValue (MGL<%- camelize(type) %>StyleLayerAdditions) +@interface NSValue (MLN<%- camelize(type) %>StyleLayerAdditions) // MARK: Working with <%- camelize(unhyphenate(type)) %> Style Layer Attribute Values <% for (let property of enumProperties) { -%> /** - Creates a new value object containing the given `MGL<%- camelize(enumName(property)) %>` enumeration. + Creates a new value object containing the given `MLN<%- camelize(enumName(property)) %>` enumeration. @param <%- objCName(property) %> The value for the new object. @return A new value object that contains the enumeration value. */ -+ (instancetype)valueWithMGL<%- camelize(enumName(property)) %>:(MGL<%- camelize(enumName(property)) %>)<%- objCName(property) %>; ++ (instancetype)valueWithMLN<%- camelize(enumName(property)) %>:(MLN<%- camelize(enumName(property)) %>)<%- objCName(property) %>; /** - The `MGL<%- camelize(enumName(property)) %>` enumeration representation of the value. + The `MLN<%- camelize(enumName(property)) %>` enumeration representation of the value. */ -@property (readonly) MGL<%- camelize(enumName(property)) %> MGL<%- camelize(enumName(property)) %>Value; +@property (readonly) MLN<%- camelize(enumName(property)) %> MLN<%- camelize(enumName(property)) %>Value; <% } -%> @end diff --git a/platform/ios/platform/darwin/src/MGLStyleLayer.mm b/platform/ios/platform/darwin/src/MLNStyleLayer.mm similarity index 82% rename from platform/ios/platform/darwin/src/MGLStyleLayer.mm rename to platform/ios/platform/darwin/src/MLNStyleLayer.mm index fe650164b..7b410345b 100644 --- a/platform/ios/platform/darwin/src/MGLStyleLayer.mm +++ b/platform/ios/platform/darwin/src/MLNStyleLayer.mm @@ -1,18 +1,18 @@ -#import "MGLStyleLayer_Private.h" -#import "MGLStyle_Private.h" +#import "MLNStyleLayer_Private.h" +#import "MLNStyle_Private.h" #include #include -const MGLExceptionName MGLInvalidStyleLayerException = @"MGLInvalidStyleLayerException"; +const MLNExceptionName MLNInvalidStyleLayerException = @"MLNInvalidStyleLayerException"; -@interface MGLStyleLayer () +@interface MLNStyleLayer () @property (nonatomic, readonly) mbgl::style::Layer *rawLayer; @end -@implementation MGLStyleLayer { +@implementation MLNStyleLayer { std::unique_ptr _pendingLayer; mapbox::base::WeakPtr _weakLayer; } @@ -38,10 +38,10 @@ const MGLExceptionName MGLInvalidStyleLayerException = @"MGLInvalidStyleLayerExc return _weakLayer.get(); } -- (void)addToStyle:(MGLStyle *)style belowLayer:(MGLStyleLayer *)otherLayer +- (void)addToStyle:(MLNStyle *)style belowLayer:(MLNStyleLayer *)otherLayer { if (_pendingLayer == nullptr) { - [NSException raise:MGLRedundantLayerException + [NSException raise:MLNRedundantLayerException format:@"This instance %@ was already added to %@. Adding the same layer instance " \ "to the style more than once is invalid.", self, style]; } @@ -54,7 +54,7 @@ const MGLExceptionName MGLInvalidStyleLayerException = @"MGLInvalidStyleLayerExc } } -- (void)removeFromStyle:(MGLStyle *)style +- (void)removeFromStyle:(MLNStyle *)style { if (self.rawLayer == style.rawStyle->getLayer(self.identifier.UTF8String)) { _pendingLayer = style.rawStyle->removeLayer(self.identifier.UTF8String); @@ -63,7 +63,7 @@ const MGLExceptionName MGLInvalidStyleLayerException = @"MGLInvalidStyleLayerExc - (void)setVisible:(BOOL)visible { - MGLAssertStyleLayerIsValid(); + MLNAssertStyleLayerIsValid(); mbgl::style::VisibilityType v = visible ? mbgl::style::VisibilityType::Visible @@ -73,7 +73,7 @@ const MGLExceptionName MGLInvalidStyleLayerException = @"MGLInvalidStyleLayerExc - (BOOL)isVisible { - MGLAssertStyleLayerIsValid(); + MLNAssertStyleLayerIsValid(); mbgl::style::VisibilityType v = self.rawLayer->getVisibility(); return (v == mbgl::style::VisibilityType::Visible); @@ -81,28 +81,28 @@ const MGLExceptionName MGLInvalidStyleLayerException = @"MGLInvalidStyleLayerExc - (void)setMaximumZoomLevel:(float)maximumZoomLevel { - MGLAssertStyleLayerIsValid(); + MLNAssertStyleLayerIsValid(); self.rawLayer->setMaxZoom(maximumZoomLevel); } - (float)maximumZoomLevel { - MGLAssertStyleLayerIsValid(); + MLNAssertStyleLayerIsValid(); return self.rawLayer->getMaxZoom(); } - (void)setMinimumZoomLevel:(float)minimumZoomLevel { - MGLAssertStyleLayerIsValid(); + MLNAssertStyleLayerIsValid(); self.rawLayer->setMinZoom(minimumZoomLevel); } - (float)minimumZoomLevel { - MGLAssertStyleLayerIsValid(); + MLNAssertStyleLayerIsValid(); return self.rawLayer->getMinZoom(); } diff --git a/platform/ios/platform/darwin/src/MGLStyleLayer.mm.ejs b/platform/ios/platform/darwin/src/MLNStyleLayer.mm.ejs similarity index 73% rename from platform/ios/platform/darwin/src/MGLStyleLayer.mm.ejs rename to platform/ios/platform/darwin/src/MLNStyleLayer.mm.ejs index 8c3e1839c..c706aa02e 100644 --- a/platform/ios/platform/darwin/src/MGLStyleLayer.mm.ejs +++ b/platform/ios/platform/darwin/src/MLNStyleLayer.mm.ejs @@ -7,14 +7,14 @@ // This file is generated. // Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`. -#import "MGLSource.h" -#import "NSPredicate+MGLPrivateAdditions.h" -#import "NSDate+MGLAdditions.h" -#import "MGLStyleLayer_Private.h" -#import "MGLStyleValue_Private.h" -#import "MGL<%- camelize(type) %>StyleLayer.h" -#import "MGLLoggingConfiguration_Private.h" -#import "MGL<%- camelize(type) %>StyleLayer_Private.h" +#import "MLNSource.h" +#import "NSPredicate+MLNPrivateAdditions.h" +#import "NSDate+MLNAdditions.h" +#import "MLNStyleLayer_Private.h" +#import "MLNStyleValue_Private.h" +#import "MLN<%- camelize(type) %>StyleLayer.h" +#import "MLNLoggingConfiguration_Private.h" +#import "MLN<%- camelize(type) %>StyleLayer_Private.h" #include _layer.hpp> #include @@ -26,9 +26,9 @@ namespace mbgl { <% if (layoutProperties.length) { -%> <% for (const property of layoutProperties) { -%> <% if (definesEnum(property, layoutProperties)) { -%> - MBGL_DEFINE_ENUM(MGL<%- camelize(enumName(property)) %>, { + MBGL_DEFINE_ENUM(MLN<%- camelize(enumName(property)) %>, { <% for (const value in property.values) { -%> - { MGL<%- camelize(enumName(property)) %><%- camelize(value) %>, "<%-value%>" }, + { MLN<%- camelize(enumName(property)) %><%- camelize(value) %>, "<%-value%>" }, <% } -%> }); @@ -38,9 +38,9 @@ namespace mbgl { <% if (paintProperties.length) { -%> <% for (const property of paintProperties) { -%> <% if (definesEnum(property, paintProperties)) { -%> - MBGL_DEFINE_ENUM(MGL<%- camelize(enumName(property)) %>, { + MBGL_DEFINE_ENUM(MLN<%- camelize(enumName(property)) %>, { <% for (const value in property.values) { -%> - { MGL<%- camelize(enumName(property)) %><%- camelize(value) %>, "<%-value%>" }, + { MLN<%- camelize(enumName(property)) %><%- camelize(value) %>, "<%-value%>" }, <% } -%> }); @@ -50,26 +50,26 @@ namespace mbgl { } <% } -%> -@interface MGL<%- camelize(type) %>StyleLayer () +@interface MLN<%- camelize(type) %>StyleLayer () @property (nonatomic, readonly) mbgl::style::<%- camelize(type) %>Layer *rawLayer; @end -@implementation MGL<%- camelize(type) %>StyleLayer +@implementation MLN<%- camelize(type) %>StyleLayer <% if (type == 'background') { -%> - (instancetype)initWithIdentifier:(NSString *)identifier { - MGLLogDebug(@"Initializing %@ with identifier: %@", NSStringFromClass([self class]), identifier); + MLNLogDebug(@"Initializing %@ with identifier: %@", NSStringFromClass([self class]), identifier); auto layer = std::make_uniqueLayer>(identifier.UTF8String); return self = [super initWithPendingLayer:std::move(layer)]; } <% } else { -%> -- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source +- (instancetype)initWithIdentifier:(NSString *)identifier source:(MLNSource *)source { - MGLLogDebug(@"Initializing %@ with identifier: %@ source: %@", NSStringFromClass([self class]), identifier, source); + MLNLogDebug(@"Initializing %@ with identifier: %@ source: %@", NSStringFromClass([self class]), identifier, source); auto layer = std::make_uniqueLayer>(identifier.UTF8String, source.identifier.UTF8String); return self = [super initWithPendingLayer:std::move(layer)]; } @@ -83,7 +83,7 @@ namespace mbgl { <% if (type !== 'background') { -%> - (NSString *)sourceIdentifier { - MGLAssertStyleLayerIsValid(); + MLNAssertStyleLayerIsValid(); return @(self.rawLayer->getSourceID().c_str()); } @@ -91,7 +91,7 @@ namespace mbgl { <% if (type !== 'raster' && type !== 'hillshade') { -%> - (NSString *)sourceLayerIdentifier { - MGLAssertStyleLayerIsValid(); + MLNAssertStyleLayerIsValid(); auto layerID = self.rawLayer->getSourceLayer(); return layerID.empty() ? nil : @(layerID.c_str()); @@ -99,23 +99,23 @@ namespace mbgl { - (void)setSourceLayerIdentifier:(NSString *)sourceLayerIdentifier { - MGLAssertStyleLayerIsValid(); - MGLLogDebug(@"Setting sourceLayerIdentifier: %@", sourceLayerIdentifier); + MLNAssertStyleLayerIsValid(); + MLNLogDebug(@"Setting sourceLayerIdentifier: %@", sourceLayerIdentifier); self.rawLayer->setSourceLayer(sourceLayerIdentifier.UTF8String ?: ""); } - (void)setPredicate:(NSPredicate *)predicate { - MGLAssertStyleLayerIsValid(); - MGLLogDebug(@"Setting predicate: %@", predicate); + MLNAssertStyleLayerIsValid(); + MLNLogDebug(@"Setting predicate: %@", predicate); self.rawLayer->setFilter(predicate ? predicate.mgl_filter : mbgl::style::Filter()); } - (NSPredicate *)predicate { - MGLAssertStyleLayerIsValid(); + MLNAssertStyleLayerIsValid(); return [NSPredicate mgl_predicateWithFilter:self.rawLayer->getFilter()]; } @@ -126,8 +126,8 @@ namespace mbgl { <% for (const property of layoutProperties) { -%> - (void)set<%- camelize(property.name) %>:(NSExpression *)<%- objCName(property) %> { - MGLAssertStyleLayerIsValid(); - MGLLogDebug(@"Setting <%- objCName(property) %>: %@", <%- objCName(property) %>); + MLNAssertStyleLayerIsValid(); + MLNLogDebug(@"Setting <%- objCName(property) %>: %@", <%- objCName(property) %>); <% if (property.tokens) { -%> if (<%- objCName(property) %> && <%- objCName(property) %>.expressionType == NSConstantValueExpressionType) { @@ -148,21 +148,21 @@ namespace mbgl { } <% } -%> <% if (isDataDriven(property)) { -%> - auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue>>(<%- objCName(property) %>, true); + auto mbglValue = MLNStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue>>(<%- objCName(property) %>, true); <% } else { -%> - auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue>>(<%- objCName(property) %>, false); + auto mbglValue = MLNStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue>>(<%- objCName(property) %>, false); <% } -%> self.rawLayer->set<%- camelize(originalPropertyName(property)) %>(mbglValue); } - (NSExpression *)<%- objCGetter(property) %> { - MGLAssertStyleLayerIsValid(); + MLNAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->get<%- camelize(originalPropertyName(property)) %>(); if (propertyValue.isUndefined()) { propertyValue = self.rawLayer->getDefault<%- camelize(originalPropertyName(property)) %>(); } - return MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toExpression(propertyValue); + return MLNStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toExpression(propertyValue); } <% if (property.original) { -%> @@ -181,47 +181,47 @@ namespace mbgl { <% for (const property of paintProperties) { -%> - (void)set<%- camelize(property.name) %>:(NSExpression *)<%- objCName(property) %> { - MGLAssertStyleLayerIsValid(); - MGLLogDebug(@"Setting <%- objCName(property) %>: %@", <%- objCName(property) %>); + MLNAssertStyleLayerIsValid(); + MLNLogDebug(@"Setting <%- objCName(property) %>: %@", <%- objCName(property) %>); <% switch (property['property-type']) { case 'color-ramp': -%> - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(<%- objCName(property) %>); + auto mbglValue = MLNStyleValueTransformer().toPropertyValue(<%- objCName(property) %>); <% break case 'data-driven': case 'cross-faded-data-driven': -%> - auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue>>(<%- objCName(property) %>, true); + auto mbglValue = MLNStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue>>(<%- objCName(property) %>, true); <% break default: -%> - auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue>>(<%- objCName(property) %>, false); + auto mbglValue = MLNStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue>>(<%- objCName(property) %>, false); <% } -%> self.rawLayer->set<%- camelize(originalPropertyName(property)) %>(mbglValue); } - (NSExpression *)<%- objCGetter(property) %> { - MGLAssertStyleLayerIsValid(); + MLNAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->get<%- camelize(originalPropertyName(property)) %>(); if (propertyValue.isUndefined()) { propertyValue = self.rawLayer->getDefault<%- camelize(originalPropertyName(property)) %>(); } - return MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toExpression(propertyValue); + return MLNStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toExpression(propertyValue); } <% if (property["transition"]) { -%> -- (void)set<%- camelize(property.name) %>Transition:(MGLTransition )transition { - MGLAssertStyleLayerIsValid(); - MGLLogDebug(@"Setting <%- objCName(property) %>Transition: %@", MGLStringFromMGLTransition(transition)); +- (void)set<%- camelize(property.name) %>Transition:(MLNTransition )transition { + MLNAssertStyleLayerIsValid(); + MLNLogDebug(@"Setting <%- objCName(property) %>Transition: %@", MLNStringFromMLNTransition(transition)); - self.rawLayer->set<%- camelize(originalPropertyName(property)) %>Transition(MGLOptionsFromTransition(transition)); + self.rawLayer->set<%- camelize(originalPropertyName(property)) %>Transition(MLNOptionsFromTransition(transition)); } -- (MGLTransition)<%- objCGetter(property) %>Transition { - MGLAssertStyleLayerIsValid(); +- (MLNTransition)<%- objCGetter(property) %>Transition { + MLNAssertStyleLayerIsValid(); mbgl::style::TransitionOptions transitionOptions = self.rawLayer->get<%- camelize(originalPropertyName(property)) %>Transition(); - return MGLTransitionFromOptions(transitionOptions); + return MLNTransitionFromOptions(transitionOptions); } <% } -%> <% if (property.original) { -%> @@ -239,15 +239,15 @@ namespace mbgl { @end <% if (enumProperties) { -%> -@implementation NSValue (MGL<%- camelize(type) %>StyleLayerAdditions) +@implementation NSValue (MLN<%- camelize(type) %>StyleLayerAdditions) <% for (let property of enumProperties) { -%> -+ (NSValue *)valueWithMGL<%- camelize(enumName(property)) %>:(MGL<%- camelize(enumName(property)) %>)<%- objCName(property) %> { - return [NSValue value:&<%- objCName(property) %> withObjCType:@encode(MGL<%- camelize(enumName(property)) %>)]; ++ (NSValue *)valueWithMLN<%- camelize(enumName(property)) %>:(MLN<%- camelize(enumName(property)) %>)<%- objCName(property) %> { + return [NSValue value:&<%- objCName(property) %> withObjCType:@encode(MLN<%- camelize(enumName(property)) %>)]; } -- (MGL<%- camelize(enumName(property)) %>)MGL<%- camelize(enumName(property)) %>Value { - MGL<%- camelize(enumName(property)) %> <%- objCName(property) %>; +- (MLN<%- camelize(enumName(property)) %>)MLN<%- camelize(enumName(property)) %>Value { + MLN<%- camelize(enumName(property)) %> <%- objCName(property) %>; [self getValue:&<%- objCName(property) %>]; return <%- objCName(property) %>; } @@ -258,8 +258,8 @@ namespace mbgl { namespace mbgl { -MGLStyleLayer* <%- camelize(type) %>StyleLayerPeerFactory::createPeer(style::Layer* rawLayer) { - return [[MGL<%- camelize(type) %>StyleLayer alloc] initWithRawLayer:rawLayer]; +MLNStyleLayer* <%- camelize(type) %>StyleLayerPeerFactory::createPeer(style::Layer* rawLayer) { + return [[MLN<%- camelize(type) %>StyleLayer alloc] initWithRawLayer:rawLayer]; } } // namespace mbgl diff --git a/platform/ios/platform/darwin/src/MGLStyleLayerManager.h b/platform/ios/platform/darwin/src/MLNStyleLayerManager.h similarity index 94% rename from platform/ios/platform/darwin/src/MGLStyleLayerManager.h rename to platform/ios/platform/darwin/src/MLNStyleLayerManager.h index 95fecd025..a11f0b0e1 100644 --- a/platform/ios/platform/darwin/src/MGLStyleLayerManager.h +++ b/platform/ios/platform/darwin/src/MLNStyleLayerManager.h @@ -1,6 +1,6 @@ #pragma once -#import "MGLStyleLayer_Private.h" +#import "MLNStyleLayer_Private.h" #include #include @@ -16,7 +16,7 @@ public: static LayerManagerDarwin* get() noexcept; ~LayerManagerDarwin(); - MGLStyleLayer* createPeer(style::Layer*); + MLNStyleLayer* createPeer(style::Layer*); private: LayerManagerDarwin(); diff --git a/platform/ios/platform/darwin/src/MGLStyleLayerManager.mm b/platform/ios/platform/darwin/src/MLNStyleLayerManager.mm similarity index 90% rename from platform/ios/platform/darwin/src/MGLStyleLayerManager.mm rename to platform/ios/platform/darwin/src/MLNStyleLayerManager.mm index 72673d4c2..79e08be6b 100644 --- a/platform/ios/platform/darwin/src/MGLStyleLayerManager.mm +++ b/platform/ios/platform/darwin/src/MLNStyleLayerManager.mm @@ -1,15 +1,15 @@ -#import "MGLStyleLayerManager.h" +#import "MLNStyleLayerManager.h" -#import "MGLBackgroundStyleLayer_Private.h" -#import "MGLCircleStyleLayer_Private.h" -#import "MGLFillExtrusionStyleLayer_Private.h" -#import "MGLFillStyleLayer_Private.h" -#import "MGLHeatmapStyleLayer_Private.h" -#import "MGLHillshadeStyleLayer_Private.h" -#import "MGLLineStyleLayer_Private.h" -#import "MGLRasterStyleLayer_Private.h" -#import "MGLSymbolStyleLayer_Private.h" -#import "MGLOpenGLStyleLayer_Private.h" +#import "MLNBackgroundStyleLayer_Private.h" +#import "MLNCircleStyleLayer_Private.h" +#import "MLNFillExtrusionStyleLayer_Private.h" +#import "MLNFillStyleLayer_Private.h" +#import "MLNHeatmapStyleLayer_Private.h" +#import "MLNHillshadeStyleLayer_Private.h" +#import "MLNLineStyleLayer_Private.h" +#import "MLNRasterStyleLayer_Private.h" +#import "MLNSymbolStyleLayer_Private.h" +#import "MLNOpenGLStyleLayer_Private.h" #include @@ -70,7 +70,7 @@ LayerManagerDarwin::LayerManagerDarwin() { LayerManagerDarwin::~LayerManagerDarwin() = default; -MGLStyleLayer* LayerManagerDarwin::createPeer(style::Layer* layer) { +MLNStyleLayer* LayerManagerDarwin::createPeer(style::Layer* layer) { if (auto* factory = getPeerFactory(layer->getTypeInfo())) { return factory->createPeer(layer); } diff --git a/platform/ios/platform/darwin/src/MGLStyleLayer_Private.h b/platform/ios/platform/darwin/src/MLNStyleLayer_Private.h similarity index 78% rename from platform/ios/platform/darwin/src/MGLStyleLayer_Private.h rename to platform/ios/platform/darwin/src/MLNStyleLayer_Private.h index 52254f78c..4c6068e96 100644 --- a/platform/ios/platform/darwin/src/MGLStyleLayer_Private.h +++ b/platform/ios/platform/darwin/src/MLNStyleLayer_Private.h @@ -1,7 +1,7 @@ #import -#import "MGLStyleLayer.h" -#import "MGLStyleValue_Private.h" +#import "MLNStyleLayer.h" +#import "MLNStyleValue_Private.h" #include #include @@ -9,26 +9,26 @@ NS_ASSUME_NONNULL_BEGIN // A struct to be stored in the `peer` member of mbgl::style::Layer, in order to implement -// object identity. We don't store a MGLStyleLayer pointer directly because that doesn't +// object identity. We don't store a MLNStyleLayer pointer directly because that doesn't // interoperate with ARC. The inner pointer is weak in order to avoid a reference cycle for -// "pending" MGLStyleLayers, which have a strong owning pointer to the mbgl::style::Layer. +// "pending" MLNStyleLayers, which have a strong owning pointer to the mbgl::style::Layer. struct LayerWrapper { - __weak MGLStyleLayer *layer; + __weak MLNStyleLayer *layer; }; /** Assert that the style layer is valid. This macro should be used at the beginning of any public-facing instance method - of `MGLStyleLayer` and its subclasses. For private methods, an assertion is more appropriate. + of `MLNStyleLayer` and its subclasses. For private methods, an assertion is more appropriate. */ -#define MGLAssertStyleLayerIsValid() \ +#define MLNAssertStyleLayerIsValid() \ do { \ if (!self.rawLayer) { \ - [NSException raise:MGLInvalidStyleLayerException \ + [NSException raise:MLNInvalidStyleLayerException \ format: \ @"Either this layer got invalidated after the style change or " \ - @"-[MGLStyle removeLayer:] has been called " \ + @"-[MLNStyle removeLayer:] has been called " \ @"with this instance but another style layer instance was added with the same identifer. It is an " \ @"error to send any message to this layer since it cannot be recovered after removal due to the " \ @"identifier collision. Use unique identifiers for all layer instances including layers of " \ @@ -36,9 +36,9 @@ struct LayerWrapper { } \ } while (NO); -@class MGLStyle; +@class MLNStyle; -@interface MGLStyleLayer (Private) +@interface MLNStyleLayer (Private) /** Initializes and returns a layer with a raw pointer to the backing store, @@ -71,16 +71,16 @@ struct LayerWrapper { `mbgl::Map` and this object no longer has an active unique_ptr reference to the `mbgl::style::Layer`. */ -- (void)addToStyle:(MGLStyle *)style belowLayer:(nullable MGLStyleLayer *)otherLayer; +- (void)addToStyle:(MLNStyle *)style belowLayer:(nullable MLNStyleLayer *)otherLayer; /** Removes the mbgl style layer that this object represents from the mbgl map. When a mbgl style layer is removed, ownership of the object is transferred back - to the `MGLStyleLayer` instance and the unique_ptr reference is valid again. It + to the `MLNStyleLayer` instance and the unique_ptr reference is valid again. It is safe to add the layer back to the style after it is removed. */ -- (void)removeFromStyle:(MGLStyle *)style; +- (void)removeFromStyle:(MLNStyle *)style; @end @@ -94,9 +94,9 @@ public: */ virtual LayerFactory* getCoreLayerFactory() = 0; /** - Creates an MGLStyleLayer instance with a raw pointer to the backing store. + Creates an MLNStyleLayer instance with a raw pointer to the backing store. */ - virtual MGLStyleLayer* createPeer(style::Layer*) = 0; + virtual MLNStyleLayer* createPeer(style::Layer*) = 0; }; } // namespace mbgl diff --git a/platform/ios/platform/darwin/src/MGLStyleLayer_Private.h.ejs b/platform/ios/platform/darwin/src/MLNStyleLayer_Private.h.ejs similarity index 87% rename from platform/ios/platform/darwin/src/MGLStyleLayer_Private.h.ejs rename to platform/ios/platform/darwin/src/MLNStyleLayer_Private.h.ejs index a6e6b9cd8..69bc30fc8 100644 --- a/platform/ios/platform/darwin/src/MGLStyleLayer_Private.h.ejs +++ b/platform/ios/platform/darwin/src/MLNStyleLayer_Private.h.ejs @@ -9,7 +9,7 @@ // Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`. #pragma once -#include "MGLStyleLayer_Private.h" +#include "MLNStyleLayer_Private.h" #include _layer_factory.hpp> @@ -18,7 +18,7 @@ namespace mbgl { class <%- camelize(type) %>StyleLayerPeerFactory : public LayerPeerFactory, public mbgl::<%- camelize(type) %>LayerFactory { // LayerPeerFactory overrides. LayerFactory* getCoreLayerFactory() final { return this; } - virtual MGLStyleLayer* createPeer(style::Layer*) final; + virtual MLNStyleLayer* createPeer(style::Layer*) final; }; } // namespace mbgl diff --git a/platform/ios/platform/darwin/src/MGLStyleValue.h b/platform/ios/platform/darwin/src/MLNStyleValue.h similarity index 51% rename from platform/ios/platform/darwin/src/MGLStyleValue.h rename to platform/ios/platform/darwin/src/MLNStyleValue.h index 2a90472b0..60376c143 100644 --- a/platform/ios/platform/darwin/src/MGLStyleValue.h +++ b/platform/ios/platform/darwin/src/MLNStyleValue.h @@ -1,48 +1,48 @@ #import #import -#import "MGLFoundation.h" -#import "MGLTypes.h" +#import "MLNFoundation.h" +#import "MLNTypes.h" NS_ASSUME_NONNULL_BEGIN -typedef NSString *MGLStyleFunctionOption NS_STRING_ENUM NS_UNAVAILABLE; +typedef NSString *MLNStyleFunctionOption NS_STRING_ENUM NS_UNAVAILABLE; -FOUNDATION_EXTERN MGL_EXPORT const MGLStyleFunctionOption MGLStyleFunctionOptionInterpolationBase __attribute__((unavailable("Use NSExpression instead, applying the mgl_interpolate:withCurveType:parameters:stops: function with a curve type of “exponential” and a non-nil parameter."))); +FOUNDATION_EXTERN MLN_EXPORT const MLNStyleFunctionOption MLNStyleFunctionOptionInterpolationBase __attribute__((unavailable("Use NSExpression instead, applying the mgl_interpolate:withCurveType:parameters:stops: function with a curve type of “exponential” and a non-nil parameter."))); -FOUNDATION_EXTERN MGL_EXPORT const MGLStyleFunctionOption MGLStyleFunctionOptionDefaultValue __attribute__((unavailable("Use +[NSExpression expressionForConditional:trueExpression:falseExpression:] instead."))); +FOUNDATION_EXTERN MLN_EXPORT const MLNStyleFunctionOption MLNStyleFunctionOptionDefaultValue __attribute__((unavailable("Use +[NSExpression expressionForConditional:trueExpression:falseExpression:] instead."))); -typedef NS_ENUM(NSUInteger, MGLInterpolationMode) { - MGLInterpolationModeExponential __attribute__((unavailable("Use NSExpression instead, applying the mgl_interpolate:withCurveType:parameters:stops: function with a curve type of “exponential”."))) = 0, - MGLInterpolationModeInterval __attribute__((unavailable("Use NSExpression instead, calling the mgl_step:from:stops: function."))), - MGLInterpolationModeCategorical __attribute__((unavailable("Use NSExpression instead."))), - MGLInterpolationModeIdentity __attribute__((unavailable("Use +[NSExpression expressionForKeyPath:] instead."))) +typedef NS_ENUM(NSUInteger, MLNInterpolationMode) { + MLNInterpolationModeExponential __attribute__((unavailable("Use NSExpression instead, applying the mgl_interpolate:withCurveType:parameters:stops: function with a curve type of “exponential”."))) = 0, + MLNInterpolationModeInterval __attribute__((unavailable("Use NSExpression instead, calling the mgl_step:from:stops: function."))), + MLNInterpolationModeCategorical __attribute__((unavailable("Use NSExpression instead."))), + MLNInterpolationModeIdentity __attribute__((unavailable("Use +[NSExpression expressionForKeyPath:] instead."))) } __attribute__((unavailable("Use NSExpression instead."))); -MGL_EXPORT __attribute__((unavailable("Use NSExpression instead."))) -@interface MGLStyleValue : NSObject +MLN_EXPORT __attribute__((unavailable("Use NSExpression instead."))) +@interface MLNStyleValue : NSObject @end -MGL_EXPORT __attribute__((unavailable("Use +[NSExpression expressionForConstantValue:] instead."))) -@interface MGLConstantStyleValue : MGLStyleValue +MLN_EXPORT __attribute__((unavailable("Use +[NSExpression expressionForConstantValue:] instead."))) +@interface MLNConstantStyleValue : MLNStyleValue @end -@compatibility_alias MGLStyleConstantValue MGLConstantStyleValue; +@compatibility_alias MLNStyleConstantValue MLNConstantStyleValue; -MGL_EXPORT __attribute__((unavailable("Use NSExpression instead, calling the mgl_step:from:stops: or mgl_interpolate:withCurveType:parameters:stops: function."))) -@interface MGLStyleFunction : MGLStyleValue +MLN_EXPORT __attribute__((unavailable("Use NSExpression instead, calling the mgl_step:from:stops: or mgl_interpolate:withCurveType:parameters:stops: function."))) +@interface MLNStyleFunction : MLNStyleValue @end -MGL_EXPORT __attribute__((unavailable("Use NSExpression instead, applying the mgl_step:from:stops: or mgl_interpolate:withCurveType:parameters:stops: function to the $zoomLevel variable."))) -@interface MGLCameraStyleFunction : MGLStyleFunction +MLN_EXPORT __attribute__((unavailable("Use NSExpression instead, applying the mgl_step:from:stops: or mgl_interpolate:withCurveType:parameters:stops: function to the $zoomLevel variable."))) +@interface MLNCameraStyleFunction : MLNStyleFunction @end -MGL_EXPORT __attribute__((unavailable("Use NSExpression instead, applying the mgl_step:from:stops: or mgl_interpolate:withCurveType:parameters:stops: function to a key path expression."))) -@interface MGLSourceStyleFunction : MGLStyleFunction +MLN_EXPORT __attribute__((unavailable("Use NSExpression instead, applying the mgl_step:from:stops: or mgl_interpolate:withCurveType:parameters:stops: function to a key path expression."))) +@interface MLNSourceStyleFunction : MLNStyleFunction @end -MGL_EXPORT __attribute__((unavailable("Use a NSExpression instead with nested mgl_step:from:stops: or mgl_interpolate:withCurveType:parameters:stops: function calls."))) -@interface MGLCompositeStyleFunction : MGLStyleFunction +MLN_EXPORT __attribute__((unavailable("Use a NSExpression instead with nested mgl_step:from:stops: or mgl_interpolate:withCurveType:parameters:stops: function calls."))) +@interface MLNCompositeStyleFunction : MLNStyleFunction @end NS_ASSUME_NONNULL_END diff --git a/platform/ios/platform/darwin/src/MGLStyleValue.mm b/platform/ios/platform/darwin/src/MLNStyleValue.mm similarity index 66% rename from platform/ios/platform/darwin/src/MGLStyleValue.mm rename to platform/ios/platform/darwin/src/MLNStyleValue.mm index f379e71b8..8dcf6b0fc 100644 --- a/platform/ios/platform/darwin/src/MGLStyleValue.mm +++ b/platform/ios/platform/darwin/src/MLNStyleValue.mm @@ -1,11 +1,11 @@ -#import "MGLStyleValue_Private.h" +#import "MLNStyleValue_Private.h" #include -const MGLStyleFunctionOption MGLStyleFunctionOptionInterpolationBase = @"MGLStyleFunctionOptionInterpolationBase"; -const MGLStyleFunctionOption MGLStyleFunctionOptionDefaultValue = @"MGLStyleFunctionOptionDefaultValue"; +const MLNStyleFunctionOption MLNStyleFunctionOptionInterpolationBase = @"MLNStyleFunctionOptionInterpolationBase"; +const MLNStyleFunctionOption MLNStyleFunctionOptionDefaultValue = @"MLNStyleFunctionOptionDefaultValue"; -id MGLJSONObjectFromMBGLValue(const mbgl::Value &value) { +id MLNJSONObjectFromMBGLValue(const mbgl::Value &value) { return value.match([](const mbgl::NullValue) -> id { return [NSNull null]; }, [](const bool value) { @@ -21,21 +21,21 @@ id MGLJSONObjectFromMBGLValue(const mbgl::Value &value) { }, [](const std::string &value) { return @(value.c_str()); }, [](const mbgl::Color &value) { - return [MGLColor mgl_colorWithColor:value]; + return [MLNColor mgl_colorWithColor:value]; }, [](const mbgl::style::Position &value) { std::array spherical = value.getSpherical(); - MGLSphericalPosition position = MGLSphericalPositionMake(spherical[0], spherical[1], spherical[2]); - return [NSValue valueWithMGLSphericalPosition:position]; + MLNSphericalPosition position = MLNSphericalPositionMake(spherical[0], spherical[1], spherical[2]); + return [NSValue valueWithMLNSphericalPosition:position]; }, [&](const std::vector &vector) { NSMutableArray *array = [NSMutableArray arrayWithCapacity:vector.size()]; for (auto value : vector) { - [array addObject:MGLJSONObjectFromMBGLValue(value)]; + [array addObject:MLNJSONObjectFromMBGLValue(value)]; } return array; }, [&](const std::unordered_map &map) { NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithCapacity:map.size()]; for (auto &item : map) { - dictionary[@(item.first.c_str())] = MGLJSONObjectFromMBGLValue(item.second); + dictionary[@(item.first.c_str())] = MLNJSONObjectFromMBGLValue(item.second); } return dictionary; }, [](const auto &) -> id { @@ -43,12 +43,12 @@ id MGLJSONObjectFromMBGLValue(const mbgl::Value &value) { }); } -id MGLJSONObjectFromMBGLExpression(const mbgl::style::expression::Expression &mbglExpression) { - return MGLJSONObjectFromMBGLValue(mbglExpression.serialize()); +id MLNJSONObjectFromMBGLExpression(const mbgl::style::expression::Expression &mbglExpression) { + return MLNJSONObjectFromMBGLValue(mbglExpression.serialize()); } -std::unique_ptr MGLClusterPropertyFromNSExpression(NSExpression *expression) { +std::unique_ptr MLNClusterPropertyFromNSExpression(NSExpression *expression) { if (!expression) { return nullptr; } diff --git a/platform/ios/platform/darwin/src/MGLStyleValue_Private.h b/platform/ios/platform/darwin/src/MLNStyleValue_Private.h similarity index 76% rename from platform/ios/platform/darwin/src/MGLStyleValue_Private.h rename to platform/ios/platform/darwin/src/MLNStyleValue_Private.h index cec6e1aae..f389eaa35 100644 --- a/platform/ios/platform/darwin/src/MGLStyleValue_Private.h +++ b/platform/ios/platform/darwin/src/MLNStyleValue_Private.h @@ -1,14 +1,14 @@ #import -#import "MGLStyleValue.h" +#import "MLNStyleValue.h" -#import "NSValue+MGLStyleAttributeAdditions.h" -#import "NSValue+MGLAdditions.h" -#import "NSExpression+MGLPrivateAdditions.h" -#import "NSDate+MGLAdditions.h" -#import "MGLTypes.h" +#import "NSValue+MLNStyleAttributeAdditions.h" +#import "NSValue+MLNAdditions.h" +#import "NSExpression+MLNPrivateAdditions.h" +#import "NSDate+MLNAdditions.h" +#import "MLNTypes.h" -#import "MGLConversion.h" +#import "MLNConversion.h" #include #include #include @@ -22,9 +22,9 @@ #include #if TARGET_OS_IPHONE - #import "UIColor+MGLAdditions.h" + #import "UIColor+MLNAdditions.h" #else - #import "NSColor+MGLAdditions.h" + #import "NSColor+MLNAdditions.h" #endif namespace mbgl { @@ -35,27 +35,27 @@ namespace mbgl { } } -id MGLJSONObjectFromMBGLValue(const mbgl::Value &value); +id MLNJSONObjectFromMBGLValue(const mbgl::Value &value); -NS_INLINE MGLTransition MGLTransitionFromOptions(const mbgl::style::TransitionOptions& options) { - MGLTransition transition; - transition.duration = MGLTimeIntervalFromDuration(options.duration.value_or(mbgl::Duration::zero())); - transition.delay = MGLTimeIntervalFromDuration(options.delay.value_or(mbgl::Duration::zero())); +NS_INLINE MLNTransition MLNTransitionFromOptions(const mbgl::style::TransitionOptions& options) { + MLNTransition transition; + transition.duration = MLNTimeIntervalFromDuration(options.duration.value_or(mbgl::Duration::zero())); + transition.delay = MLNTimeIntervalFromDuration(options.delay.value_or(mbgl::Duration::zero())); return transition; } -NS_INLINE mbgl::style::TransitionOptions MGLOptionsFromTransition(MGLTransition transition) { - mbgl::style::TransitionOptions options { { MGLDurationFromTimeInterval(transition.duration) }, { MGLDurationFromTimeInterval(transition.delay) } }; +NS_INLINE mbgl::style::TransitionOptions MLNOptionsFromTransition(MLNTransition transition) { + mbgl::style::TransitionOptions options { { MLNDurationFromTimeInterval(transition.duration) }, { MLNDurationFromTimeInterval(transition.delay) } }; return options; } -std::unique_ptr MGLClusterPropertyFromNSExpression(NSExpression *expression); +std::unique_ptr MLNClusterPropertyFromNSExpression(NSExpression *expression); -id MGLJSONObjectFromMBGLExpression(const mbgl::style::expression::Expression &mbglExpression); +id MLNJSONObjectFromMBGLExpression(const mbgl::style::expression::Expression &mbglExpression); template -class MGLStyleValueTransformer { +class MLNStyleValueTransformer { public: /// Convert an mbgl property value into an mgl style value @@ -69,7 +69,7 @@ public: if (mbglValue.isUndefined()) { return nil; } - return [NSExpression expressionWithMGLJSONObject:MGLJSONObjectFromMBGLExpression(mbglValue.getExpression())]; + return [NSExpression expressionWithMLNJSONObject:MLNJSONObjectFromMBGLExpression(mbglValue.getExpression())]; } /** @@ -140,11 +140,11 @@ private: // Private utilities for converting from mgl to mbgl values */ template ::value>::type, - typename MGLEnum = ObjCEnum, - class = typename std::enable_if::value>::type> - NSObject* toRawStyleSpecValue(NSObject *rawMGLValue, MBGLEnum &) { - if ([rawMGLValue isKindOfClass:[NSValue class]]) { - const auto rawNSValue = (NSValue *)rawMGLValue; + typename MLNEnum = ObjCEnum, + class = typename std::enable_if::value>::type> + NSObject* toRawStyleSpecValue(NSObject *rawMLNValue, MBGLEnum &) { + if ([rawMLNValue isKindOfClass:[NSValue class]]) { + const auto rawNSValue = (NSValue *)rawMLNValue; if (strcmp([rawNSValue objCType], @encode(CGVector)) == 0) { // offset [x, y] std::array mglValue = rawNSValue.mgl_offsetArrayValue; @@ -152,20 +152,20 @@ private: // Private utilities for converting from mgl to mbgl values } } // noop pass-through plain NSObject-based items - return rawMGLValue; + return rawMLNValue; } template ::value>::type, - typename MGLEnum = ObjCEnum, - class = typename std::enable_if::value>::type> + typename MLNEnum = ObjCEnum, + class = typename std::enable_if::value>::type> NSString* toRawStyleSpecValue(ObjCType rawValue, MBGLEnum &) { - MGLEnum mglEnum; + MLNEnum mglEnum; [rawValue getValue:&mglEnum]; - return @(mbgl::Enum::toString(mglEnum)); + return @(mbgl::Enum::toString(mglEnum)); } - NSObject* toRawStyleSpecValue(MGLColor *color, MBGLType &) { + NSObject* toRawStyleSpecValue(MLNColor *color, MBGLType &) { return @(color.mgl_color.stringify().c_str()); } @@ -215,7 +215,7 @@ private: // Private utilities for converting from mgl to mbgl values } // Color - void getMBGLValue(MGLColor *rawValue, mbgl::Color &mbglValue) { + void getMBGLValue(MLNColor *rawValue, mbgl::Color &mbglValue) { mbglValue = rawValue.mgl_color; } @@ -247,15 +247,15 @@ private: // Private utilities for converting from mgl to mbgl values // Enumerations template ::value>::type, - typename MGLEnum = ObjCEnum, - class = typename std::enable_if::value>::type> + typename MLNEnum = ObjCEnum, + class = typename std::enable_if::value>::type> void getMBGLValue(id rawValue, MBGLEnum &mbglValue) { if ([rawValue isKindOfClass:[NSString class]]) { mbglValue = *mbgl::Enum::toEnum([(NSString *)rawValue UTF8String]); } else { - MGLEnum mglEnum; + MLNEnum mglEnum; [(NSValue *)rawValue getValue:&mglEnum]; - auto str = mbgl::Enum::toString(mglEnum); + auto str = mbgl::Enum::toString(mglEnum); mbglValue = *mbgl::Enum::toEnum(str); } } @@ -263,68 +263,68 @@ private: // Private utilities for converting from mgl to mbgl values private: // Private utilities for converting from mbgl to mgl values // Bool - static NSNumber *toMGLRawStyleValue(const bool mbglStopValue) { + static NSNumber *toMLNRawStyleValue(const bool mbglStopValue) { return @(mbglStopValue); } // Float - static NSNumber *toMGLRawStyleValue(const float mbglStopValue) { + static NSNumber *toMLNRawStyleValue(const float mbglStopValue) { return @(mbglStopValue); } // Integer - static NSNumber *toMGLRawStyleValue(const int64_t mbglStopValue) { + static NSNumber *toMLNRawStyleValue(const int64_t mbglStopValue) { return @(mbglStopValue); } // String - static NSString *toMGLRawStyleValue(const std::string &mbglStopValue) { + static NSString *toMLNRawStyleValue(const std::string &mbglStopValue) { return @(mbglStopValue.c_str()); } // Formatted - static NSString *toMGLRawStyleValue(const mbgl::style::expression::Formatted &mbglStopValue) { + static NSString *toMLNRawStyleValue(const mbgl::style::expression::Formatted &mbglStopValue) { return @(mbglStopValue.toString().c_str()); } // Offsets - static NSValue *toMGLRawStyleValue(const std::array &mbglStopValue) { + static NSValue *toMLNRawStyleValue(const std::array &mbglStopValue) { return [NSValue mgl_valueWithOffsetArray:mbglStopValue]; } // Padding - static NSValue *toMGLRawStyleValue(const std::array &mbglStopValue) { + static NSValue *toMLNRawStyleValue(const std::array &mbglStopValue) { return [NSValue mgl_valueWithPaddingArray:mbglStopValue]; } // Color - static MGLColor *toMGLRawStyleValue(const mbgl::Color mbglStopValue) { - return [MGLColor mgl_colorWithColor:mbglStopValue]; + static MLNColor *toMLNRawStyleValue(const mbgl::Color mbglStopValue) { + return [MLNColor mgl_colorWithColor:mbglStopValue]; } // Image - static NSString *toMGLRawStyleValue(const mbgl::style::expression::Image &mbglImageValue) { + static NSString *toMLNRawStyleValue(const mbgl::style::expression::Image &mbglImageValue) { return @(mbglImageValue.id().c_str()); } // Array - static NSArray *toMGLRawStyleValue(const std::vector &mbglStopValue) { + static NSArray *toMLNRawStyleValue(const std::vector &mbglStopValue) { NSMutableArray *array = [NSMutableArray arrayWithCapacity:mbglStopValue.size()]; for (const auto &mbglElement: mbglStopValue) { - [array addObject:[NSExpression expressionForConstantValue:toMGLRawStyleValue(mbglElement)]]; + [array addObject:[NSExpression expressionForConstantValue:toMLNRawStyleValue(mbglElement)]]; } return array; } - static NSValue *toMGLRawStyleValue(const mbgl::style::Position &mbglStopValue) { + static NSValue *toMLNRawStyleValue(const mbgl::style::Position &mbglStopValue) { std::array spherical = mbglStopValue.getSpherical(); - MGLSphericalPosition position = MGLSphericalPositionMake(spherical[0], spherical[1], spherical[2]); - return [NSValue valueWithMGLSphericalPosition:position]; + MLNSphericalPosition position = MLNSphericalPositionMake(spherical[0], spherical[1], spherical[2]); + return [NSValue valueWithMLNSphericalPosition:position]; } // Enumerations - template - static NSString *toMGLRawStyleValue(const MBGLEnum &value) { + template + static NSString *toMLNRawStyleValue(const MBGLEnum &value) { return @(mbgl::Enum::toString(value)); } @@ -336,7 +336,7 @@ private: // Private utilities for converting from mbgl to mgl values } NSExpression *operator()(const MBGLType &value) const { - id constantValue = toMGLRawStyleValue(value); + id constantValue = toMLNRawStyleValue(value); if ([constantValue isKindOfClass:[NSArray class]]) { return [NSExpression expressionForAggregate:constantValue]; } @@ -344,7 +344,7 @@ private: // Private utilities for converting from mbgl to mgl values } NSExpression *operator()(const mbgl::style::PropertyExpression &mbglValue) const { - return [NSExpression expressionWithMGLJSONObject:MGLJSONObjectFromMBGLExpression(mbglValue.getExpression())]; + return [NSExpression expressionWithMLNJSONObject:MLNJSONObjectFromMBGLExpression(mbglValue.getExpression())]; } }; }; diff --git a/platform/ios/platform/darwin/src/MLNStyle_Private.h b/platform/ios/platform/darwin/src/MLNStyle_Private.h new file mode 100644 index 000000000..def44f5c3 --- /dev/null +++ b/platform/ios/platform/darwin/src/MLNStyle_Private.h @@ -0,0 +1,40 @@ +#import "MLNStyle.h" + +#import "MLNStyleLayer.h" +#import "MLNFillStyleLayer.h" + +NS_ASSUME_NONNULL_BEGIN + +namespace mbgl { + namespace style { + class Style; + } +} + +@class MLNAttributionInfo; +@class MLNMapView; +@class MLNOpenGLStyleLayer; +@class MLNVectorTileSource; +@class MLNVectorStyleLayer; + +@interface MLNStyle (Private) + +- (instancetype)initWithRawStyle:(mbgl::style::Style *)rawStyle stylable:(id )stylable; + +@property (nonatomic, readonly, weak) id stylable; +@property (nonatomic, readonly) mbgl::style::Style *rawStyle; + +- (nullable NSArray *)attributionInfosWithFontSize:(CGFloat)fontSize linkColor:(nullable MLNColor *)linkColor; +@property (nonatomic, readonly, strong) NSMutableDictionary *openGLLayers; +- (void)setStyleClasses:(NSArray *)appliedClasses transitionDuration:(NSTimeInterval)transitionDuration; + +@end + +@interface MLNStyle (MLNStreetsAdditions) + +@property (nonatomic, readonly, copy) NSArray *placeStyleLayers; +@property (nonatomic, readonly, copy) NSArray *roadStyleLayers; + +@end + +NS_ASSUME_NONNULL_END diff --git a/platform/ios/platform/darwin/src/MGLTilePyramidOfflineRegion.h b/platform/ios/platform/darwin/src/MLNTilePyramidOfflineRegion.h similarity index 79% rename from platform/ios/platform/darwin/src/MGLTilePyramidOfflineRegion.h rename to platform/ios/platform/darwin/src/MLNTilePyramidOfflineRegion.h index 09fe65b8a..ff2e13860 100644 --- a/platform/ios/platform/darwin/src/MGLTilePyramidOfflineRegion.h +++ b/platform/ios/platform/darwin/src/MLNTilePyramidOfflineRegion.h @@ -1,8 +1,8 @@ #import -#import "MGLFoundation.h" -#import "MGLOfflineRegion.h" -#import "MGLGeometry.h" +#import "MLNFoundation.h" +#import "MLNOfflineRegion.h" +#import "MLNGeometry.h" NS_ASSUME_NONNULL_BEGIN @@ -11,17 +11,17 @@ NS_ASSUME_NONNULL_BEGIN range of zoom levels. To minimize the resources required by an irregularly shaped offline region, - use the MGLShapeOfflineRegion class instead. + use the MLNShapeOfflineRegion class instead. ### Example ```swift let northeast = CLLocationCoordinate2D(latitude: 40.989329, longitude: -102.062592) let southwest = CLLocationCoordinate2D(latitude: 36.986207, longitude: -109.049896) - let bbox = MGLCoordinateBounds(sw: southwest, ne: northeast) + let bbox = MLNCoordinateBounds(sw: southwest, ne: northeast) - let region = MGLTilePyramidOfflineRegion(styleURL: MGLStyle.lightStyleURL, bounds: bbox, fromZoomLevel: 11, toZoomLevel: 14) + let region = MLNTilePyramidOfflineRegion(styleURL: MLNStyle.lightStyleURL, bounds: bbox, fromZoomLevel: 11, toZoomLevel: 14) let context = "Tile Pyramid Region".data(using: .utf8) - MGLOfflineStorage.shared.addPack(for: region, withContext: context!) + MLNOfflineStorage.shared.addPack(for: region, withContext: context!) ``` #### Related examples @@ -29,26 +29,26 @@ NS_ASSUME_NONNULL_BEGIN Download an offline map example to learn how to define an offline region to be downloaded to a user's device. */ -MGL_EXPORT -@interface MGLTilePyramidOfflineRegion : NSObject +MLN_EXPORT +@interface MLNTilePyramidOfflineRegion : NSObject /** The coordinate bounds for the geographic region covered by the downloaded tiles. */ -@property (nonatomic, readonly) MGLCoordinateBounds bounds; +@property (nonatomic, readonly) MLNCoordinateBounds bounds; /** The minimum zoom level for which to download tiles and other resources. - For more information about zoom levels, `-[MGLMapView zoomLevel]`. + For more information about zoom levels, `-[MLNMapView zoomLevel]`. */ @property (nonatomic, readonly) double minimumZoomLevel; /** The maximum zoom level for which to download tiles and other resources. - For more information about zoom levels, `-[MGLMapView zoomLevel]`. + For more information about zoom levels, `-[MLNMapView zoomLevel]`. */ @property (nonatomic, readonly) double maximumZoomLevel; @@ -58,7 +58,7 @@ MGL_EXPORT Initializes a newly created offline region with the given style URL, geographic coordinate bounds, and range of zoom levels. - This is the designated initializer for `MGLTilePyramidOfflineRegion`. + This is the designated initializer for `MLNTilePyramidOfflineRegion`. @param styleURL URL of the map style for which to download resources. The URL may be a full HTTP or HTTPS URL or a canonical style URL. @@ -81,7 +81,7 @@ MGL_EXPORT level, the download covers zoom levels up to the tile source’s maximum zoom level. */ -- (instancetype)initWithStyleURL:(nullable NSURL *)styleURL bounds:(MGLCoordinateBounds)bounds fromZoomLevel:(double)minimumZoomLevel toZoomLevel:(double)maximumZoomLevel NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithStyleURL:(nullable NSURL *)styleURL bounds:(MLNCoordinateBounds)bounds fromZoomLevel:(double)minimumZoomLevel toZoomLevel:(double)maximumZoomLevel NS_DESIGNATED_INITIALIZER; @end diff --git a/platform/ios/platform/darwin/src/MGLTilePyramidOfflineRegion.mm b/platform/ios/platform/darwin/src/MLNTilePyramidOfflineRegion.mm similarity index 78% rename from platform/ios/platform/darwin/src/MGLTilePyramidOfflineRegion.mm rename to platform/ios/platform/darwin/src/MLNTilePyramidOfflineRegion.mm index 4bd459332..e83d9d595 100644 --- a/platform/ios/platform/darwin/src/MGLTilePyramidOfflineRegion.mm +++ b/platform/ios/platform/darwin/src/MLNTilePyramidOfflineRegion.mm @@ -1,20 +1,20 @@ -#import "MGLTilePyramidOfflineRegion.h" +#import "MLNTilePyramidOfflineRegion.h" #if !TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR #import #endif -#import "MGLOfflineRegion_Private.h" -#import "MGLTilePyramidOfflineRegion_Private.h" -#import "MGLGeometry_Private.h" -#import "MGLStyle.h" -#import "MGLLoggingConfiguration_Private.h" +#import "MLNOfflineRegion_Private.h" +#import "MLNTilePyramidOfflineRegion_Private.h" +#import "MLNGeometry_Private.h" +#import "MLNStyle.h" +#import "MLNLoggingConfiguration_Private.h" -@interface MGLTilePyramidOfflineRegion () +@interface MLNTilePyramidOfflineRegion () @end -@implementation MGLTilePyramidOfflineRegion { +@implementation MLNTilePyramidOfflineRegion { NSURL *_styleURL; } @@ -30,22 +30,22 @@ } - (instancetype)init { - MGLLogInfo(@"Calling this initializer is not allowed."); + MLNLogInfo(@"Calling this initializer is not allowed."); [NSException raise:NSGenericException format: - @"-[MGLTilePyramidOfflineRegion init] is unavailable. " + @"-[MLNTilePyramidOfflineRegion init] is unavailable. " @"Use -initWithStyleURL:bounds:fromZoomLevel:toZoomLevel: instead."]; return nil; } -- (instancetype)initWithStyleURL:(NSURL *)styleURL bounds:(MGLCoordinateBounds)bounds fromZoomLevel:(double)minimumZoomLevel toZoomLevel:(double)maximumZoomLevel { - MGLLogDebug(@"Initializing styleURL: %@ bounds: %@ fromZoomLevel: %f toZoomLevel: %f", styleURL, MGLStringFromCoordinateBounds(bounds), minimumZoomLevel, maximumZoomLevel); +- (instancetype)initWithStyleURL:(NSURL *)styleURL bounds:(MLNCoordinateBounds)bounds fromZoomLevel:(double)minimumZoomLevel toZoomLevel:(double)maximumZoomLevel { + MLNLogDebug(@"Initializing styleURL: %@ bounds: %@ fromZoomLevel: %f toZoomLevel: %f", styleURL, MLNStringFromCoordinateBounds(bounds), minimumZoomLevel, maximumZoomLevel); if (self = [super init]) { if (!styleURL) { - styleURL = [MGLStyle defaultStyleURL]; + styleURL = [MLNStyle defaultStyleURL]; } if (!styleURL.scheme) { - [NSException raise:MGLInvalidStyleURLException format: + [NSException raise:MLNInvalidStyleURLException format: @"%@ does not support setting a relative file URL as the style URL. " @"To download the online resources required by this style, " @"specify a URL to an online copy of this style. " @@ -64,8 +64,8 @@ - (instancetype)initWithOfflineRegionDefinition:(const mbgl::OfflineTilePyramidRegionDefinition &)definition { NSURL *styleURL = [NSURL URLWithString:@(definition.styleURL.c_str())]; - MGLCoordinateBounds bounds = MGLCoordinateBoundsFromLatLngBounds(definition.bounds); - MGLTilePyramidOfflineRegion* result = [self initWithStyleURL:styleURL bounds:bounds fromZoomLevel:definition.minZoom toZoomLevel:definition.maxZoom]; + MLNCoordinateBounds bounds = MLNCoordinateBoundsFromLatLngBounds(definition.bounds); + MLNTilePyramidOfflineRegion* result = [self initWithStyleURL:styleURL bounds:bounds fromZoomLevel:definition.minZoom toZoomLevel:definition.maxZoom]; result.includesIdeographicGlyphs = definition.includeIdeographs; return result; } @@ -77,23 +77,23 @@ const float scaleFactor = [NSScreen mainScreen].backingScaleFactor; #endif return mbgl::OfflineTilePyramidRegionDefinition(_styleURL.absoluteString.UTF8String, - MGLLatLngBoundsFromCoordinateBounds(_bounds), + MLNLatLngBoundsFromCoordinateBounds(_bounds), _minimumZoomLevel, _maximumZoomLevel, scaleFactor, _includesIdeographicGlyphs); } - (nullable instancetype)initWithCoder:(NSCoder *)coder { - MGLLogInfo(@"Initializing with coder."); + MLNLogInfo(@"Initializing with coder."); NSURL *styleURL = [coder decodeObjectForKey:@"styleURL"]; CLLocationCoordinate2D sw = CLLocationCoordinate2DMake([coder decodeDoubleForKey:@"southWestLatitude"], [coder decodeDoubleForKey:@"southWestLongitude"]); CLLocationCoordinate2D ne = CLLocationCoordinate2DMake([coder decodeDoubleForKey:@"northEastLatitude"], [coder decodeDoubleForKey:@"northEastLongitude"]); - MGLCoordinateBounds bounds = MGLCoordinateBoundsMake(sw, ne); + MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(sw, ne); double minimumZoomLevel = [coder decodeDoubleForKey:@"minimumZoomLevel"]; double maximumZoomLevel = [coder decodeDoubleForKey:@"maximumZoomLevel"]; - MGLTilePyramidOfflineRegion* result = [self initWithStyleURL:styleURL bounds:bounds fromZoomLevel:minimumZoomLevel toZoomLevel:maximumZoomLevel]; + MLNTilePyramidOfflineRegion* result = [self initWithStyleURL:styleURL bounds:bounds fromZoomLevel:minimumZoomLevel toZoomLevel:maximumZoomLevel]; result.includesIdeographicGlyphs = [coder decodeBoolForKey:@"includesIdeographicGlyphs"]; return result; } @@ -111,7 +111,7 @@ } - (id)copyWithZone:(nullable NSZone *)zone { - MGLTilePyramidOfflineRegion* result = [[[self class] allocWithZone:zone] initWithStyleURL:_styleURL bounds:_bounds fromZoomLevel:_minimumZoomLevel toZoomLevel:_maximumZoomLevel]; + MLNTilePyramidOfflineRegion* result = [[[self class] allocWithZone:zone] initWithStyleURL:_styleURL bounds:_bounds fromZoomLevel:_minimumZoomLevel toZoomLevel:_maximumZoomLevel]; result.includesIdeographicGlyphs = _includesIdeographicGlyphs; return result; } @@ -124,10 +124,10 @@ return NO; } - MGLTilePyramidOfflineRegion *otherRegion = other; + MLNTilePyramidOfflineRegion *otherRegion = other; return (_minimumZoomLevel == otherRegion->_minimumZoomLevel && _maximumZoomLevel == otherRegion->_maximumZoomLevel - && MGLCoordinateBoundsEqualToCoordinateBounds(_bounds, otherRegion->_bounds) + && MLNCoordinateBoundsEqualToCoordinateBounds(_bounds, otherRegion->_bounds) && [_styleURL isEqual:otherRegion->_styleURL] && _includesIdeographicGlyphs == otherRegion->_includesIdeographicGlyphs); } diff --git a/platform/ios/platform/darwin/src/MGLTilePyramidOfflineRegion_Private.h b/platform/ios/platform/darwin/src/MLNTilePyramidOfflineRegion_Private.h similarity index 82% rename from platform/ios/platform/darwin/src/MGLTilePyramidOfflineRegion_Private.h rename to platform/ios/platform/darwin/src/MLNTilePyramidOfflineRegion_Private.h index 90d8e0547..eb88e4c9c 100644 --- a/platform/ios/platform/darwin/src/MGLTilePyramidOfflineRegion_Private.h +++ b/platform/ios/platform/darwin/src/MLNTilePyramidOfflineRegion_Private.h @@ -1,12 +1,12 @@ #import -#import "MGLOfflineRegion.h" +#import "MLNOfflineRegion.h" #include NS_ASSUME_NONNULL_BEGIN -@protocol MGLTilePyramidOfflineRegion_Private +@protocol MLNTilePyramidOfflineRegion_Private /** Initializes and returns an offline region backed by the given C++ region diff --git a/platform/ios/platform/darwin/src/MGLTileServerOptions.h b/platform/ios/platform/darwin/src/MLNTileServerOptions.h similarity index 86% rename from platform/ios/platform/darwin/src/MGLTileServerOptions.h rename to platform/ios/platform/darwin/src/MLNTileServerOptions.h index 38a449431..8c81845db 100644 --- a/platform/ios/platform/darwin/src/MGLTileServerOptions.h +++ b/platform/ios/platform/darwin/src/MLNTileServerOptions.h @@ -1,15 +1,15 @@ #import -#import "MGLFoundation.h" -#import "MGLDefaultStyle.h" +#import "MLNFoundation.h" +#import "MLNDefaultStyle.h" NS_ASSUME_NONNULL_BEGIN /** - The `MGLTileServerOptions` defines server properties such as URL etc... + The `MLNTileServerOptions` defines server properties such as URL etc... */ -MGL_EXPORT -@interface MGLTileServerOptions : NSObject +MLN_EXPORT +@interface MLNTileServerOptions : NSObject /** * API base URL. @@ -104,12 +104,12 @@ MGL_EXPORT /** * Default styles. */ -@property (nonatomic, retain) NSArray* defaultStyles; +@property (nonatomic, retain) NSArray* defaultStyles; /** * Default style */ -@property (nonatomic, retain) MGLDefaultStyle* defaultStyle; +@property (nonatomic, retain) MLNDefaultStyle* defaultStyle; @end diff --git a/platform/ios/platform/darwin/src/MGLTileServerOptions.mm b/platform/ios/platform/darwin/src/MLNTileServerOptions.mm similarity index 81% rename from platform/ios/platform/darwin/src/MGLTileServerOptions.mm rename to platform/ios/platform/darwin/src/MLNTileServerOptions.mm index 82d9ef760..c643eb8dc 100644 --- a/platform/ios/platform/darwin/src/MGLTileServerOptions.mm +++ b/platform/ios/platform/darwin/src/MLNTileServerOptions.mm @@ -1,11 +1,11 @@ -#import "MGLTileServerOptions.h" -#import "NSBundle+MGLAdditions.h" +#import "MLNTileServerOptions.h" +#import "NSBundle+MLNAdditions.h" #if TARGET_OS_OSX -#import "NSProcessInfo+MGLAdditions.h" +#import "NSProcessInfo+MLNAdditions.h" #endif -@implementation MGLTileServerOptions +@implementation MLNTileServerOptions @synthesize baseURL; @synthesize uriSchemeAlias; diff --git a/platform/ios/platform/darwin/src/MGLTileSource.h b/platform/ios/platform/darwin/src/MLNTileSource.h similarity index 71% rename from platform/ios/platform/darwin/src/MGLTileSource.h rename to platform/ios/platform/darwin/src/MLNTileSource.h index 64347cc7e..86f8a543e 100644 --- a/platform/ios/platform/darwin/src/MGLTileSource.h +++ b/platform/ios/platform/darwin/src/MLNTileSource.h @@ -1,48 +1,48 @@ #import -#import "MGLFoundation.h" -#import "MGLSource.h" -#import "MGLTypes.h" +#import "MLNFoundation.h" +#import "MLNSource.h" +#import "MLNTypes.h" NS_ASSUME_NONNULL_BEGIN -@class MGLAttributionInfo; +@class MLNAttributionInfo; /** - Options for `MGLTileSource` objects. + Options for `MLNTileSource` objects. */ -typedef NSString *MGLTileSourceOption NS_STRING_ENUM; +typedef NSString *MLNTileSourceOption NS_STRING_ENUM; /** An `NSNumber` object containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source. The value should be between 0 and 22, inclusive, and less than - `MGLTileSourceOptionMaximumZoomLevel`, if specified. The default value for this + `MLNTileSourceOptionMaximumZoomLevel`, if specified. The default value for this option is 0. This option corresponds to the `minzoom` key in the TileJSON specification. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionMinimumZoomLevel; +FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionMinimumZoomLevel; /** An `NSNumber` object containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source. The value should be between 0 and 22, inclusive, and less than - `MGLTileSourceOptionMinimumZoomLevel`, if specified. The default value for this + `MLNTileSourceOptionMinimumZoomLevel`, if specified. The default value for this option is 22. This option corresponds to the `maxzoom` key in the TileJSON specification. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionMaximumZoomLevel; +FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionMaximumZoomLevel; /** - An `NSValue` object containing an `MGLCoordinateBounds` struct that specifies + An `NSValue` object containing an `MLNCoordinateBounds` struct that specifies the geographic extent of the source. If this option is specified, the SDK avoids requesting any tile that falls @@ -53,7 +53,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionMaximu TileJSON specification. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionCoordinateBounds; +FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionCoordinateBounds; #if TARGET_OS_IPHONE /** @@ -62,66 +62,66 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionCoordi pressed. By default, no attribution statements are displayed. If the - `MGLTileSourceOptionAttributionInfos` option is specified, this option is + `MLNTileSourceOptionAttributionInfos` option is specified, this option is ignored. This option corresponds to the `attribution` key in the TileJSON specification. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionAttributionHTMLString; +FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionAttributionHTMLString; /** - An array of `MGLAttributionInfo` objects defining the buttons to be displayed + An array of `MLNAttributionInfo` objects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed. By default, no attribution statements are displayed. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionAttributionInfos; +FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionAttributionInfos; #else /** An HTML string defining the buttons to be displayed in the map view’s attribution view when the source is part of the map view’s style. By default, no attribution statements are displayed. If the - `MGLTileSourceOptionAttributionInfos` option is specified, this option is + `MLNTileSourceOptionAttributionInfos` option is specified, this option is ignored. This option corresponds to the `attribution` key in the TileJSON specification. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionAttributionHTMLString; +FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionAttributionHTMLString; /** - An array of `MGLAttributionInfo` objects defining the buttons to be displayed + An array of `MLNAttributionInfo` objects defining the buttons to be displayed in the map view’s attribution view when the source is part of the map view’s style. By default, no attribution statements are displayed. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionAttributionInfos; +FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionAttributionInfos; #endif /** An `NSNumber` object containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of - the constants described in `MGLTileCoordinateSystem`. + the constants described in `MLNTileCoordinateSystem`. - The default value for this option is `MGLTileCoordinateSystemXYZ`. + The default value for this option is `MLNTileCoordinateSystemXYZ`. This option corresponds to the `scheme` key in the TileJSON specification. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionTileCoordinateSystem; +FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionTileCoordinateSystem; /** Tile coordinate systems that determine how tile coordinates in tile URLs are interpreted. */ -typedef NS_ENUM(NSUInteger, MGLTileCoordinateSystem) { +typedef NS_ENUM(NSUInteger, MLNTileCoordinateSystem) { /** The origin is at the top-left (northwest), and `y` values increase southwards. @@ -129,7 +129,7 @@ typedef NS_ENUM(NSUInteger, MGLTileCoordinateSystem) { This tile coordinate system is used by Mapbox and OpenStreetMap tile servers. */ - MGLTileCoordinateSystemXYZ = 0, + MLNTileCoordinateSystemXYZ = 0, /** The origin is at the bottom-left (southwest), and `y` values increase @@ -138,45 +138,45 @@ typedef NS_ENUM(NSUInteger, MGLTileCoordinateSystem) { This tile coordinate system is used by tile servers that conform to the Tile Map Service Specification. */ - MGLTileCoordinateSystemTMS + MLNTileCoordinateSystemTMS }; /** The encoding formula used to generate the raster-dem tileset */ -typedef NS_ENUM(NSUInteger, MGLDEMEncoding) { +typedef NS_ENUM(NSUInteger, MLNDEMEncoding) { /** Raster tiles generated with the [Mapbox encoding formula](https://docs.mapbox.com/help/troubleshooting/access-elevation-data/#mapbox-terrain-rgb). */ - MGLDEMEncodingMapbox = 0, + MLNDEMEncodingMapbox = 0, /** Raster tiles generated with the [Mapzen Terrarium encoding formula](https://aws.amazon.com/public-datasets/terrain/). */ - MGLDEMEncodingTerrarium + MLNDEMEncodingTerrarium }; /** - `MGLTileSource` is a map content source that supplies map tiles to be shown on + `MLNTileSource` is a map content source that supplies map tiles to be shown on the map. The location of and metadata about the tiles are defined either by an option dictionary or by an external file that conforms to the TileJSON specification. - A tile source is added to an `MGLStyle` object along with one or more - `MGLRasterStyleLayer` or `MGLVectorStyleLayer` objects. Use a style layer to + A tile source is added to an `MLNStyle` object along with one or more + `MLNRasterStyleLayer` or `MLNVectorStyleLayer` objects. Use a style layer to control the appearance of content supplied by the tile source. A tile source is also known as a tile set. To learn about the structure of a Mapbox-hosted tile set, view it in Mapbox Studio’s Tilesets editor. - Create instances of `MGLRasterTileSource` and `MGLVectorTileSource` in order - to use `MGLTileSource`'s properties and methods. Do not create instances of - `MGLTileSource` directly, and do not create your own subclasses of this class. + Create instances of `MLNRasterTileSource` and `MLNVectorTileSource` in order + to use `MLNTileSource`'s properties and methods. Do not create instances of + `MLNTileSource` directly, and do not create your own subclasses of this class. */ -MGL_EXPORT -@interface MGLTileSource : MGLSource +MLN_EXPORT +@interface MLNTileSource : MLNSource // MARK: Accessing a Source’s Content @@ -192,14 +192,14 @@ MGL_EXPORT // MARK: Accessing Attribution Strings /** - An array of `MGLAttributionInfo` objects that define the attribution + An array of `MLNAttributionInfo` objects that define the attribution statements to be displayed when the map is shown to the user. By default, this array is empty. If the source is initialized with a configuration URL, this array is also empty until the configuration JSON file is loaded. */ -@property (nonatomic, copy, readonly) NSArray *attributionInfos; +@property (nonatomic, copy, readonly) NSArray *attributionInfos; @end diff --git a/platform/ios/platform/darwin/src/MGLTileSource.mm b/platform/ios/platform/darwin/src/MLNTileSource.mm similarity index 56% rename from platform/ios/platform/darwin/src/MGLTileSource.mm rename to platform/ios/platform/darwin/src/MLNTileSource.mm index eef3b3343..54012a445 100644 --- a/platform/ios/platform/darwin/src/MGLTileSource.mm +++ b/platform/ios/platform/darwin/src/MLNTileSource.mm @@ -1,10 +1,10 @@ -#import "MGLTileSource_Private.h" +#import "MLNTileSource_Private.h" -#import "MGLAttributionInfo_Private.h" -#import "MGLGeometry_Private.h" -#import "MGLRasterDEMSource.h" -#import "NSString+MGLAdditions.h" -#import "NSValue+MGLAdditions.h" +#import "MLNAttributionInfo_Private.h" +#import "MLNGeometry_Private.h" +#import "MLNRasterDEMSource.h" +#import "NSString+MLNAdditions.h" +#import "NSValue+MLNAdditions.h" #if TARGET_OS_IPHONE #import @@ -14,41 +14,41 @@ #include -const MGLTileSourceOption MGLTileSourceOptionMinimumZoomLevel = @"MGLTileSourceOptionMinimumZoomLevel"; -const MGLTileSourceOption MGLTileSourceOptionMaximumZoomLevel = @"MGLTileSourceOptionMaximumZoomLevel"; -const MGLTileSourceOption MGLTileSourceOptionCoordinateBounds = @"MGLTileSourceOptionCoordinateBounds"; -const MGLTileSourceOption MGLTileSourceOptionAttributionHTMLString = @"MGLTileSourceOptionAttributionHTMLString"; -const MGLTileSourceOption MGLTileSourceOptionAttributionInfos = @"MGLTileSourceOptionAttributionInfos"; -const MGLTileSourceOption MGLTileSourceOptionTileCoordinateSystem = @"MGLTileSourceOptionTileCoordinateSystem"; -const MGLTileSourceOption MGLTileSourceOptionDEMEncoding = @"MGLTileSourceOptionDEMEncoding"; +const MLNTileSourceOption MLNTileSourceOptionMinimumZoomLevel = @"MLNTileSourceOptionMinimumZoomLevel"; +const MLNTileSourceOption MLNTileSourceOptionMaximumZoomLevel = @"MLNTileSourceOptionMaximumZoomLevel"; +const MLNTileSourceOption MLNTileSourceOptionCoordinateBounds = @"MLNTileSourceOptionCoordinateBounds"; +const MLNTileSourceOption MLNTileSourceOptionAttributionHTMLString = @"MLNTileSourceOptionAttributionHTMLString"; +const MLNTileSourceOption MLNTileSourceOptionAttributionInfos = @"MLNTileSourceOptionAttributionInfos"; +const MLNTileSourceOption MLNTileSourceOptionTileCoordinateSystem = @"MLNTileSourceOptionTileCoordinateSystem"; +const MLNTileSourceOption MLNTileSourceOptionDEMEncoding = @"MLNTileSourceOptionDEMEncoding"; -@implementation MGLTileSource +@implementation MLNTileSource - (NSURL *)configurationURL { - [NSException raise:MGLAbstractClassException - format:@"MGLTileSource is an abstract class"]; + [NSException raise:MLNAbstractClassException + format:@"MLNTileSource is an abstract class"]; return nil; } -- (NSArray *)attributionInfos { +- (NSArray *)attributionInfos { return [self attributionInfosWithFontSize:0 linkColor:nil]; } -- (NSArray *)attributionInfosWithFontSize:(CGFloat)fontSize linkColor:(nullable MGLColor *)linkColor { - return [MGLAttributionInfo attributionInfosFromHTMLString:self.attributionHTMLString +- (NSArray *)attributionInfosWithFontSize:(CGFloat)fontSize linkColor:(nullable MLNColor *)linkColor { + return [MLNAttributionInfo attributionInfosFromHTMLString:self.attributionHTMLString fontSize:fontSize linkColor:linkColor]; } - (NSString *)attributionHTMLString { - [NSException raise:MGLAbstractClassException - format:@"MGLTileSource is an abstract class"]; + [NSException raise:MLNAbstractClassException + format:@"MLNTileSource is an abstract class"]; return nil; } @end -mbgl::Tileset MGLTileSetFromTileURLTemplates(NSArray *tileURLTemplates, NSDictionary * _Nullable options) { +mbgl::Tileset MLNTileSetFromTileURLTemplates(NSArray *tileURLTemplates, NSDictionary * _Nullable options) { mbgl::Tileset tileSet; for (NSString *tileURLTemplate in tileURLTemplates) { @@ -57,49 +57,49 @@ mbgl::Tileset MGLTileSetFromTileURLTemplates(NSArray *tileURLTemplat // set the minimum / maximum zoom range to the values specified by this class if they // were set. otherwise, use the core objects default values - if (NSNumber *minimumZoomLevel = options[MGLTileSourceOptionMinimumZoomLevel]) { + if (NSNumber *minimumZoomLevel = options[MLNTileSourceOptionMinimumZoomLevel]) { if (![minimumZoomLevel isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLTileSourceOptionMinimumZoomLevel must be set to an NSNumber."]; + format:@"MLNTileSourceOptionMinimumZoomLevel must be set to an NSNumber."]; } tileSet.zoomRange.min = minimumZoomLevel.integerValue; } - if (NSNumber *maximumZoomLevel = options[MGLTileSourceOptionMaximumZoomLevel]) { + if (NSNumber *maximumZoomLevel = options[MLNTileSourceOptionMaximumZoomLevel]) { if (![maximumZoomLevel isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLTileSourceOptionMinimumZoomLevel must be set to an NSNumber."]; + format:@"MLNTileSourceOptionMinimumZoomLevel must be set to an NSNumber."]; } tileSet.zoomRange.max = maximumZoomLevel.integerValue; } if (tileSet.zoomRange.min > tileSet.zoomRange.max) { [NSException raise:NSInvalidArgumentException - format:@"MGLTileSourceOptionMinimumZoomLevel must be less than MGLTileSourceOptionMaximumZoomLevel."]; + format:@"MLNTileSourceOptionMinimumZoomLevel must be less than MLNTileSourceOptionMaximumZoomLevel."]; } - if (NSValue *coordinateBounds = options[MGLTileSourceOptionCoordinateBounds]) { + if (NSValue *coordinateBounds = options[MLNTileSourceOptionCoordinateBounds]) { if (![coordinateBounds isKindOfClass:[NSValue class]] - && strcmp(coordinateBounds.objCType, @encode(MGLCoordinateBounds)) == 0) { + && strcmp(coordinateBounds.objCType, @encode(MLNCoordinateBounds)) == 0) { [NSException raise:NSInvalidArgumentException - format:@"MGLTileSourceOptionCoordinateBounds must be set to an NSValue containing an MGLCoordinateBounds."]; + format:@"MLNTileSourceOptionCoordinateBounds must be set to an NSValue containing an MLNCoordinateBounds."]; } - tileSet.bounds = MGLLatLngBoundsFromCoordinateBounds(coordinateBounds.MGLCoordinateBoundsValue); + tileSet.bounds = MLNLatLngBoundsFromCoordinateBounds(coordinateBounds.MLNCoordinateBoundsValue); } - if (NSString *attribution = options[MGLTileSourceOptionAttributionHTMLString]) { + if (NSString *attribution = options[MLNTileSourceOptionAttributionHTMLString]) { if (![attribution isKindOfClass:[NSString class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLTileSourceOptionAttributionHTMLString must be set to a string."]; + format:@"MLNTileSourceOptionAttributionHTMLString must be set to a string."]; } tileSet.attribution = attribution.UTF8String; } - if (NSArray *attributionInfos = options[MGLTileSourceOptionAttributionInfos]) { + if (NSArray *attributionInfos = options[MLNTileSourceOptionAttributionInfos]) { if (![attributionInfos isKindOfClass:[NSArray class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLTileSourceOptionAttributionInfos must be set to a string."]; + format:@"MLNTileSourceOptionAttributionInfos must be set to a string."]; } - NSAttributedString *attributedString = [MGLAttributionInfo attributedStringForAttributionInfos:attributionInfos]; + NSAttributedString *attributedString = [MLNAttributionInfo attributedStringForAttributionInfos:attributionInfos]; #if TARGET_OS_IPHONE static NSString * const NSExcludedElementsDocumentAttribute = @"ExcludedElements"; #endif @@ -114,35 +114,35 @@ mbgl::Tileset MGLTileSetFromTileURLTemplates(NSArray *tileURLTemplat tileSet.attribution = html.UTF8String; } - if (NSNumber *tileCoordinateSystemNumber = options[MGLTileSourceOptionTileCoordinateSystem]) { + if (NSNumber *tileCoordinateSystemNumber = options[MLNTileSourceOptionTileCoordinateSystem]) { if (![tileCoordinateSystemNumber isKindOfClass:[NSValue class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLTileSourceOptionTileCoordinateSystem must be set to an NSValue or NSNumber."]; + format:@"MLNTileSourceOptionTileCoordinateSystem must be set to an NSValue or NSNumber."]; } - MGLTileCoordinateSystem tileCoordinateSystem; + MLNTileCoordinateSystem tileCoordinateSystem; [tileCoordinateSystemNumber getValue:&tileCoordinateSystem]; switch (tileCoordinateSystem) { - case MGLTileCoordinateSystemXYZ: + case MLNTileCoordinateSystemXYZ: tileSet.scheme = mbgl::Tileset::Scheme::XYZ; break; - case MGLTileCoordinateSystemTMS: + case MLNTileCoordinateSystemTMS: tileSet.scheme = mbgl::Tileset::Scheme::TMS; break; } } - if (NSNumber *demEncodingNumber = options[MGLTileSourceOptionDEMEncoding]) { + if (NSNumber *demEncodingNumber = options[MLNTileSourceOptionDEMEncoding]) { if (![demEncodingNumber isKindOfClass:[NSValue class]]) { [NSException raise:NSInvalidArgumentException - format:@"MGLTileSourceOptionDEMEncoding must be set to an NSValue or NSNumber."]; + format:@"MLNTileSourceOptionDEMEncoding must be set to an NSValue or NSNumber."]; } - MGLDEMEncoding demEncoding; + MLNDEMEncoding demEncoding; [demEncodingNumber getValue:&demEncoding]; switch (demEncoding) { - case MGLDEMEncodingMapbox: + case MLNDEMEncodingMapbox: tileSet.encoding = mbgl::Tileset::DEMEncoding::Mapbox; break; - case MGLDEMEncodingTerrarium: + case MLNDEMEncodingTerrarium: tileSet.encoding = mbgl::Tileset::DEMEncoding::Terrarium; break; } diff --git a/platform/ios/platform/darwin/src/MGLTileSource_Private.h b/platform/ios/platform/darwin/src/MLNTileSource_Private.h similarity index 65% rename from platform/ios/platform/darwin/src/MGLTileSource_Private.h rename to platform/ios/platform/darwin/src/MLNTileSource_Private.h index 1b260ca86..9942c8b53 100644 --- a/platform/ios/platform/darwin/src/MGLTileSource_Private.h +++ b/platform/ios/platform/darwin/src/MLNTileSource_Private.h @@ -1,7 +1,7 @@ #import -#import "MGLFoundation.h" -#import "MGLTileSource.h" +#import "MLNFoundation.h" +#import "MLNTileSource.h" NS_ASSUME_NONNULL_BEGIN @@ -9,9 +9,9 @@ namespace mbgl { class Tileset; } -@class MGLAttributionInfo; +@class MLNAttributionInfo; -@interface MGLTileSource (Private) +@interface MLNTileSource (Private) /** An HTML string to be displayed as attribution when the map is shown to a user. @@ -28,11 +28,11 @@ namespace mbgl { @param fontSize The default text size in points, or 0 to use the default. @param linkColor The default link color, or `nil` to use the default. */ -- (NSArray *)attributionInfosWithFontSize:(CGFloat)fontSize linkColor:(nullable MGLColor *)linkColor; +- (NSArray *)attributionInfosWithFontSize:(CGFloat)fontSize linkColor:(nullable MLNColor *)linkColor; @end -MGL_EXPORT -mbgl::Tileset MGLTileSetFromTileURLTemplates(NSArray *tileURLTemplates, NSDictionary * _Nullable options); +MLN_EXPORT +mbgl::Tileset MLNTileSetFromTileURLTemplates(NSArray *tileURLTemplates, NSDictionary * _Nullable options); NS_ASSUME_NONNULL_END diff --git a/platform/ios/platform/darwin/src/MGLTypes.h b/platform/ios/platform/darwin/src/MLNTypes.h similarity index 64% rename from platform/ios/platform/darwin/src/MGLTypes.h rename to platform/ios/platform/darwin/src/MLNTypes.h index 963eda384..4834504e8 100644 --- a/platform/ios/platform/darwin/src/MGLTypes.h +++ b/platform/ios/platform/darwin/src/MLNTypes.h @@ -1,97 +1,97 @@ #import #import -#import "MGLFoundation.h" +#import "MLNFoundation.h" #pragma once #if TARGET_OS_IPHONE @class UIImage; -#define MGLImage UIImage +#define MLNImage UIImage #else @class NSImage; -#define MGLImage NSImage +#define MLNImage NSImage #endif #if TARGET_OS_IPHONE @class UIColor; -#define MGLColor UIColor +#define MLNColor UIColor #else @class NSColor; -#define MGLColor NSColor +#define MLNColor NSColor #endif NS_ASSUME_NONNULL_BEGIN -typedef NSString *MGLExceptionName NS_TYPED_EXTENSIBLE_ENUM; +typedef NSString *MLNExceptionName NS_TYPED_EXTENSIBLE_ENUM; /** :nodoc: Generic exceptions used across multiple disparate classes. Exceptions that are unique to a class or class-cluster should be defined in those headers. */ -FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLAbstractClassException; +FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNAbstractClassException; /** Indicates an error occurred in the Mapbox SDK. */ -FOUNDATION_EXTERN MGL_EXPORT NSErrorDomain const MGLErrorDomain; +FOUNDATION_EXTERN MLN_EXPORT NSErrorDomain const MLNErrorDomain; /** Error constants for the Mapbox SDK. */ -typedef NS_ENUM(NSInteger, MGLErrorCode) { +typedef NS_ENUM(NSInteger, MLNErrorCode) { /** An unknown error occurred. */ - MGLErrorCodeUnknown = -1, + MLNErrorCodeUnknown = -1, /** The resource could not be found. */ - MGLErrorCodeNotFound = 1, + MLNErrorCodeNotFound = 1, /** The connection received an invalid server response. */ - MGLErrorCodeBadServerResponse = 2, + MLNErrorCodeBadServerResponse = 2, /** An attempt to establish a connection failed. */ - MGLErrorCodeConnectionFailed = 3, + MLNErrorCodeConnectionFailed = 3, /** A style parse error occurred while attempting to load the map. */ - MGLErrorCodeParseStyleFailed = 4, + MLNErrorCodeParseStyleFailed = 4, /** An attempt to load the style failed. */ - MGLErrorCodeLoadStyleFailed = 5, + MLNErrorCodeLoadStyleFailed = 5, /** An error occurred while snapshotting the map. */ - MGLErrorCodeSnapshotFailed = 6, + MLNErrorCodeSnapshotFailed = 6, /** Source is in use and cannot be removed */ - MGLErrorCodeSourceIsInUseCannotRemove = 7, + MLNErrorCodeSourceIsInUseCannotRemove = 7, /** Source is in use and cannot be removed */ - MGLErrorCodeSourceIdentifierMismatch = 8, + MLNErrorCodeSourceIdentifierMismatch = 8, /** An error occurred while modifying the offline storage database */ - MGLErrorCodeModifyingOfflineStorageFailed = 9, + MLNErrorCodeModifyingOfflineStorageFailed = 9, /** Source is invalid and cannot be removed from the style (e.g. after a style change) */ - MGLErrorCodeSourceCannotBeRemovedFromStyle = 10, + MLNErrorCodeSourceCannotBeRemovedFromStyle = 10, /** An error occurred while rendering */ - MGLErrorCodeRenderingError = 11, + MLNErrorCodeRenderingError = 11, }; -/** Options for enabling debugging features in an `MGLMapView` instance. */ -typedef NS_OPTIONS(NSUInteger, MGLMapDebugMaskOptions) { +/** Options for enabling debugging features in an `MLNMapView` instance. */ +typedef NS_OPTIONS(NSUInteger, MLNMapDebugMaskOptions) { /** Edges of tile boundaries are shown as thick, red lines to help diagnose tile clipping issues. */ - MGLMapDebugTileBoundariesMask = 1 << 1, + MLNMapDebugTileBoundariesMask = 1 << 1, /** Each tile shows its tile coordinate (x/y/z) in the upper-left corner. */ - MGLMapDebugTileInfoMask = 1 << 2, + MLNMapDebugTileInfoMask = 1 << 2, /** Each tile shows a timestamp indicating when it was loaded. */ - MGLMapDebugTimestampsMask = 1 << 3, + MLNMapDebugTimestampsMask = 1 << 3, /** Edges of glyphs and symbols are shown as faint, green lines to help diagnose collision and label placement issues. */ - MGLMapDebugCollisionBoxesMask = 1 << 4, + MLNMapDebugCollisionBoxesMask = 1 << 4, /** Each drawing operation is replaced by a translucent fill. Overlapping drawing operations appear more prominent to help diagnose overdrawing. @note This option does nothing in Release builds of the SDK. */ - MGLMapDebugOverdrawVisualizationMask = 1 << 5, + MLNMapDebugOverdrawVisualizationMask = 1 << 5, #if !TARGET_OS_IPHONE /** The stencil buffer is shown instead of the color buffer. @note This option does nothing in Release builds of the SDK. */ - MGLMapDebugStencilBufferMask = 1 << 6, + MLNMapDebugStencilBufferMask = 1 << 6, /** The depth buffer is shown instead of the color buffer. @note This option does nothing in Release builds of the SDK. */ - MGLMapDebugDepthBufferMask = 1 << 7, + MLNMapDebugDepthBufferMask = 1 << 7, #endif }; /** A structure containing information about a transition. */ -typedef struct __attribute__((objc_boxable)) MGLTransition { +typedef struct __attribute__((objc_boxable)) MLNTransition { /** The amount of time the animation should take, not including the delay. */ @@ -101,24 +101,24 @@ typedef struct __attribute__((objc_boxable)) MGLTransition { The amount of time in seconds to wait before beginning the animation. */ NSTimeInterval delay; -} MGLTransition; +} MLNTransition; -NS_INLINE NSString *MGLStringFromMGLTransition(MGLTransition transition) { +NS_INLINE NSString *MLNStringFromMLNTransition(MLNTransition transition) { return [NSString stringWithFormat:@"transition { duration: %f, delay: %f }", transition.duration, transition.delay]; } /** - Creates a new `MGLTransition` from the given duration and delay. + Creates a new `MLNTransition` from the given duration and delay. @param duration The amount of time the animation should take, not including the delay. @param delay The amount of time in seconds to wait before beginning the animation. - @return Returns a `MGLTransition` struct containing the transition attributes. + @return Returns a `MLNTransition` struct containing the transition attributes. */ -NS_INLINE MGLTransition MGLTransitionMake(NSTimeInterval duration, NSTimeInterval delay) { - MGLTransition transition; +NS_INLINE MLNTransition MLNTransitionMake(NSTimeInterval duration, NSTimeInterval delay) { + MLNTransition transition; transition.duration = duration; transition.delay = delay; @@ -128,13 +128,13 @@ NS_INLINE MGLTransition MGLTransitionMake(NSTimeInterval duration, NSTimeInterva /** Constants indicating the visibility of different map ornaments. */ -typedef NS_ENUM(NSInteger, MGLOrnamentVisibility) { +typedef NS_ENUM(NSInteger, MLNOrnamentVisibility) { /** A constant indicating that the ornament adapts to the current map state. */ - MGLOrnamentVisibilityAdaptive, + MLNOrnamentVisibilityAdaptive, /** A constant indicating that the ornament is always hidden. */ - MGLOrnamentVisibilityHidden, + MLNOrnamentVisibilityHidden, /** A constant indicating that the ornament is always visible. */ - MGLOrnamentVisibilityVisible + MLNOrnamentVisibilityVisible }; NS_ASSUME_NONNULL_END diff --git a/platform/ios/platform/darwin/src/MLNTypes.m b/platform/ios/platform/darwin/src/MLNTypes.m new file mode 100644 index 000000000..5538365ea --- /dev/null +++ b/platform/ios/platform/darwin/src/MLNTypes.m @@ -0,0 +1,5 @@ +#import "MLNTypes.h" + +const MLNExceptionName MLNAbstractClassException = @"MLNAbstractClassException"; + +NSString * const MLNErrorDomain = @"MLNErrorDomain"; diff --git a/platform/ios/platform/darwin/src/MGLValueEvaluator.h b/platform/ios/platform/darwin/src/MLNValueEvaluator.h similarity index 100% rename from platform/ios/platform/darwin/src/MGLValueEvaluator.h rename to platform/ios/platform/darwin/src/MLNValueEvaluator.h diff --git a/platform/ios/platform/darwin/src/MGLVectorStyleLayer.h b/platform/ios/platform/darwin/src/MLNVectorStyleLayer.h similarity index 71% rename from platform/ios/platform/darwin/src/MGLVectorStyleLayer.h rename to platform/ios/platform/darwin/src/MLNVectorStyleLayer.h index 87853b893..920cdf8c3 100644 --- a/platform/ios/platform/darwin/src/MGLVectorStyleLayer.h +++ b/platform/ios/platform/darwin/src/MLNVectorStyleLayer.h @@ -1,22 +1,22 @@ #import -#import "MGLFoundation.h" -#import "MGLForegroundStyleLayer.h" +#import "MLNFoundation.h" +#import "MLNForegroundStyleLayer.h" NS_ASSUME_NONNULL_BEGIN /** - `MGLVectorStyleLayer` is an abstract superclass for style layers whose content - is defined by an `MGLShapeSource` or `MGLVectorTileSource` object. + `MLNVectorStyleLayer` is an abstract superclass for style layers whose content + is defined by an `MLNShapeSource` or `MLNVectorTileSource` object. - Create instances of `MGLCircleStyleLayer`, `MGLFillStyleLayer`, - `MGLFillExtrusionStyleLayer`, `MGLHeatmapStyleLayer`, `MGLLineStyleLayer`, and - `MGLSymbolStyleLayer` in order to use `MGLVectorStyleLayer`'s properties and - methods. Do not create instances of `MGLVectorStyleLayer` directly, and do not + Create instances of `MLNCircleStyleLayer`, `MLNFillStyleLayer`, + `MLNFillExtrusionStyleLayer`, `MLNHeatmapStyleLayer`, `MLNLineStyleLayer`, and + `MLNSymbolStyleLayer` in order to use `MLNVectorStyleLayer`'s properties and + methods. Do not create instances of `MLNVectorStyleLayer` directly, and do not create your own subclasses of this class. */ -MGL_EXPORT -@interface MGLVectorStyleLayer : MGLForegroundStyleLayer +MLN_EXPORT +@interface MLNVectorStyleLayer : MLNForegroundStyleLayer // MARK: Refining a Style Layer’s Content @@ -45,7 +45,7 @@ MGL_EXPORT `NSCompoundPredicate` along these lines: ```swift - let layer = MGLLineStyleLayer(identifier: "contour", source: terrain) + let layer = MLNLineStyleLayer(identifier: "contour", source: terrain) layer.sourceLayerIdentifier = "contours" layer.predicate = NSPredicate(format: "(index == 5 || index == 10) && CAST(ele, 'NSNumber') >= 1500.0") mapView.style?.addLayer(layer) diff --git a/platform/ios/platform/darwin/src/MGLVectorStyleLayer.mm b/platform/ios/platform/darwin/src/MLNVectorStyleLayer.mm similarity index 73% rename from platform/ios/platform/darwin/src/MGLVectorStyleLayer.mm rename to platform/ios/platform/darwin/src/MLNVectorStyleLayer.mm index 691668629..874ae7a0b 100644 --- a/platform/ios/platform/darwin/src/MGLVectorStyleLayer.mm +++ b/platform/ios/platform/darwin/src/MLNVectorStyleLayer.mm @@ -1,16 +1,16 @@ -#import "MGLVectorStyleLayer.h" -#import "MGLStyleLayer_Private.h" +#import "MLNVectorStyleLayer.h" +#import "MLNStyleLayer_Private.h" -@implementation MGLVectorStyleLayer +@implementation MLNVectorStyleLayer - (void)setPredicate:(NSPredicate *)predicate { - [NSException raise:MGLAbstractClassException - format:@"MGLVectorStyleLayer is an abstract class"]; + [NSException raise:MLNAbstractClassException + format:@"MLNVectorStyleLayer is an abstract class"]; } - (NSPredicate *)predicate { - [NSException raise:MGLAbstractClassException - format:@"MGLVectorStyleLayer is an abstract class"]; + [NSException raise:MLNAbstractClassException + format:@"MLNVectorStyleLayer is an abstract class"]; return nil; } diff --git a/platform/ios/platform/darwin/src/MGLVectorTileSource.h b/platform/ios/platform/darwin/src/MLNVectorTileSource.h similarity index 80% rename from platform/ios/platform/darwin/src/MGLVectorTileSource.h rename to platform/ios/platform/darwin/src/MLNVectorTileSource.h index e594adeb3..c749a4215 100644 --- a/platform/ios/platform/darwin/src/MGLVectorTileSource.h +++ b/platform/ios/platform/darwin/src/MLNVectorTileSource.h @@ -1,33 +1,33 @@ -#import "MGLFeature.h" -#import "MGLFoundation.h" -#import "MGLTileSource.h" +#import "MLNFeature.h" +#import "MLNFoundation.h" +#import "MLNTileSource.h" NS_ASSUME_NONNULL_BEGIN /** - `MGLVectorTileSource` is a map content source that supplies tiled vector data + `MLNVectorTileSource` is a map content source that supplies tiled vector data in Mapbox Vector Tile format to be shown on the map. The location of and metadata about the tiles are defined either by an option dictionary or by an external file that conforms to the TileJSON specification. - A vector tile source is added to an `MGLStyle` object along with one or more - `MGLVectorStyleLayer` objects. A vector style layer defines the appearance of + A vector tile source is added to an `MLNStyle` object along with one or more + `MLNVectorStyleLayer` objects. A vector style layer defines the appearance of any content supplied by the vector tile source. - `MGLVectorTileSource` is optimized for data sets that are too large to fit + `MLNVectorTileSource` is optimized for data sets that are too large to fit completely in memory, such as vector tile sets or data sets managed in Mapbox Studio. For - GeoJSON data, use the `MGLShapeSource` - class. For tiled data that changes dynamically, the `MGLComputedShapeSource` + GeoJSON data, use the `MLNShapeSource` + class. For tiled data that changes dynamically, the `MLNComputedShapeSource` class may be a suitable alternative. Each vector source defined by the style JSON file is represented at runtime by an - `MGLVectorTileSource` object that you can use to initialize new style layers. + `MLNVectorTileSource` object that you can use to initialize new style layers. You can also add and remove sources dynamically using methods such as - `-[MGLStyle addSource:]` and `-[MGLStyle sourceWithIdentifier:]`. + `-[MLNStyle addSource:]` and `-[MLNStyle sourceWithIdentifier:]`. Within each vector tile, each geometric coordinate must lie between −1 × extent and @@ -44,11 +44,11 @@ NS_ASSUME_NONNULL_BEGIN ### Example ```swift - let source = MGLVectorTileSource(identifier: "pois", tileURLTemplates: ["https://example.com/vector-tiles/{z}/{x}/{y}.mvt"], options: [ + let source = MLNVectorTileSource(identifier: "pois", tileURLTemplates: ["https://example.com/vector-tiles/{z}/{x}/{y}.mvt"], options: [ .minimumZoomLevel: 9, .maximumZoomLevel: 16, .attributionInfos: [ - MGLAttributionInfo(title: NSAttributedString(string: "© Mapbox"), url: URL(string: "https://mapbox.com")) + MLNAttributionInfo(title: NSAttributedString(string: "© Mapbox"), url: URL(string: "https://mapbox.com")) ] ]) mapView.style?.addSource(source) @@ -57,10 +57,10 @@ NS_ASSUME_NONNULL_BEGIN #### Related examples See the Data-driven circles example to learn how to add data to your map using - an `MGLVectorTileSource` object. + an `MLNVectorTileSource` object. */ -MGL_EXPORT -@interface MGLVectorTileSource : MGLTileSource +MLN_EXPORT +@interface MLNVectorTileSource : MLNTileSource // MARK: Initializing a Source @@ -69,7 +69,7 @@ MGL_EXPORT URL. After initializing and configuring the source, add it to a map view’s style - using the `-[MGLStyle addSource:]` method. + using the `-[MLNStyle addSource:]` method. The URL may be a full HTTP or HTTPS URL or a canonical URL. The URL should point to a JSON file that conforms to the @@ -92,18 +92,18 @@ MGL_EXPORT guide for information about the format of a tile URL template. After initializing and configuring the source, add it to a map view’s style - using the `-[MGLStyle addSource:]` method. + using the `-[MLNStyle addSource:]` method. @param identifier A string that uniquely identifies the source in the style to which it is added. @param tileURLTemplates An array of tile URL template strings. Only the first string is used; any additional strings are ignored. @param options A dictionary containing configuration options. See - `MGLTileSourceOption` for available keys and values. Pass in `nil` to use + `MLNTileSourceOption` for available keys and values. Pass in `nil` to use the default values. @return An initialized tile source. */ -- (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NSArray *)tileURLTemplates options:(nullable NSDictionary *)options NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NSArray *)tileURLTemplates options:(nullable NSDictionary *)options NS_DESIGNATED_INITIALIZER; // MARK: Accessing a Source’s Content @@ -113,7 +113,7 @@ MGL_EXPORT Each object in the returned array represents a feature loaded by the source and provides access to attributes specified as part of the loaded feature. The - source loads a feature if the source is added to an `MGLMapView`’s style; that + source loads a feature if the source is added to an `MLNMapView`’s style; that style has a layer that uses the source; and the map view has recently scrolled to the region containing the feature. @@ -129,9 +129,9 @@ MGL_EXPORT are loaded: the style may contain a layer that forces the source’s tiles to load but filters out the features in question, preventing them from being drawn. To obtain only _visible_ features, use the - `-[MGLMapView visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:predicate:]` + `-[MLNMapView visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:predicate:]` or - `-[MGLMapView visibleFeaturesInRect:inStyleLayersWithIdentifiers:predicate:]` + `-[MLNMapView visibleFeaturesInRect:inStyleLayersWithIdentifiers:predicate:]` method. @param sourceLayerIdentifiers The source layers to include in the query. Only @@ -139,10 +139,10 @@ MGL_EXPORT array. This array may not be empty. @param predicate A predicate to filter the returned features. Use `nil` to include all loaded features. - @return An array of objects conforming to the `MGLFeature` protocol that + @return An array of objects conforming to the `MLNFeature` protocol that represent features loaded by the source that match the predicate. */ -- (NSArray> *)featuresInSourceLayersWithIdentifiers:(NSSet *)sourceLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(features(sourceLayerIdentifiers:predicate:)); +- (NSArray> *)featuresInSourceLayersWithIdentifiers:(NSSet *)sourceLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(features(sourceLayerIdentifiers:predicate:)); @end diff --git a/platform/ios/platform/darwin/src/MGLVectorTileSource.mm b/platform/ios/platform/darwin/src/MLNVectorTileSource.mm similarity index 79% rename from platform/ios/platform/darwin/src/MGLVectorTileSource.mm rename to platform/ios/platform/darwin/src/MLNVectorTileSource.mm index 0425e1d84..7ede97a81 100644 --- a/platform/ios/platform/darwin/src/MGLVectorTileSource.mm +++ b/platform/ios/platform/darwin/src/MLNVectorTileSource.mm @@ -1,26 +1,26 @@ -#import "MGLVectorTileSource_Private.h" +#import "MLNVectorTileSource_Private.h" -#import "MGLFeature_Private.h" -#import "MGLLoggingConfiguration_Private.h" -#import "MGLSource_Private.h" -#import "MGLTileSource_Private.h" -#import "MGLStyle_Private.h" -#import "MGLMapView_Private.h" +#import "MLNFeature_Private.h" +#import "MLNLoggingConfiguration_Private.h" +#import "MLNSource_Private.h" +#import "MLNTileSource_Private.h" +#import "MLNStyle_Private.h" +#import "MLNMapView_Private.h" -#import "NSPredicate+MGLPrivateAdditions.h" -#import "NSURL+MGLAdditions.h" +#import "NSPredicate+MLNPrivateAdditions.h" +#import "NSURL+MLNAdditions.h" #include #include #include -@interface MGLVectorTileSource () +@interface MLNVectorTileSource () @property (nonatomic, readonly) mbgl::style::VectorSource *rawSource; @end -@implementation MGLVectorTileSource +@implementation MLNVectorTileSource - (instancetype)initWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL { auto source = std::make_unique(identifier.UTF8String, @@ -28,8 +28,8 @@ return self = [super initWithPendingSource:std::move(source)]; } -- (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NSArray *)tileURLTemplates options:(nullable NSDictionary *)options { - mbgl::Tileset tileSet = MGLTileSetFromTileURLTemplates(tileURLTemplates, options); +- (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NSArray *)tileURLTemplates options:(nullable NSDictionary *)options { + mbgl::Tileset tileSet = MLNTileSetFromTileURLTemplates(tileURLTemplates, options); auto source = std::make_unique(identifier.UTF8String, tileSet); return self = [super initWithPendingSource:std::move(source)]; } @@ -39,14 +39,14 @@ } - (NSURL *)configurationURL { - MGLAssertStyleSourceIsValid(); + MLNAssertStyleSourceIsValid(); auto url = self.rawSource->getURL(); return url ? [NSURL URLWithString:@(url->c_str())] : nil; } - (NSString *)attributionHTMLString { if (!self.rawSource) { - MGLAssert(0, @"Source with identifier `%@` was invalidated after a style change", self.identifier); + MLNAssert(0, @"Source with identifier `%@` was invalidated after a style change", self.identifier); return nil; } @@ -54,8 +54,8 @@ return attribution ? @(attribution->c_str()) : nil; } -- (NSArray> *)featuresInSourceLayersWithIdentifiers:(NSSet *)sourceLayerIdentifiers predicate:(nullable NSPredicate *)predicate { - MGLAssertStyleSourceIsValid(); +- (NSArray> *)featuresInSourceLayersWithIdentifiers:(NSSet *)sourceLayerIdentifiers predicate:(nullable NSPredicate *)predicate { + MLNAssertStyleSourceIsValid(); std::optional> optionalSourceLayerIDs; if (sourceLayerIdentifiers) { __block std::vector layerIDs; @@ -72,16 +72,16 @@ } std::vector features; - if ([self.stylable isKindOfClass:[MGLMapView class]]) { - MGLMapView *mapView = (MGLMapView *)self.stylable; + if ([self.stylable isKindOfClass:[MLNMapView class]]) { + MLNMapView *mapView = (MLNMapView *)self.stylable; features = mapView.renderer->querySourceFeatures(self.rawSource->getID(), { optionalSourceLayerIDs, optionalFilter }); } - return MGLFeaturesFromMBGLFeatures(features); + return MLNFeaturesFromMBGLFeatures(features); } @end -@implementation MGLVectorTileSource (Private) +@implementation MLNVectorTileSource (Private) /** An array of locale codes with dedicated name fields in the Mapbox Streets @@ -89,16 +89,16 @@ https://www.mapbox.com/vector-tiles/mapbox-streets-v8/ */ -static NSArray * const MGLMapboxStreetsLanguages = @[ +static NSArray * const MLNMapboxStreetsLanguages = @[ @"ar", @"de", @"en", @"es", @"fr", @"ja", @"ko", @"pt", @"ru", @"vi", @"zh-Hans", @"zh-Hant", ]; /** - Like `MGLMapboxStreetsLanguages`, but deanglicized for use with + Like `MLNMapboxStreetsLanguages`, but deanglicized for use with `+[NSBundle preferredLocalizationsFromArray:forPreferences:]`. */ -static NSArray * const MGLMapboxStreetsAlternativeLanguages = @[ +static NSArray * const MLNMapboxStreetsAlternativeLanguages = @[ @"mul", @"ar", @"de", @"es", @"fr", @"ja", @"ko", @"pt", @"ru", @"vi", @"zh-Hans", @"zh-Hant", ]; @@ -107,7 +107,7 @@ static NSArray * const MGLMapboxStreetsAlternativeLanguages = @[ static dispatch_once_t onceToken; static NSSet *mapboxStreetsLanguages; dispatch_once(&onceToken, ^{ - mapboxStreetsLanguages = [NSSet setWithArray:MGLMapboxStreetsLanguages]; + mapboxStreetsLanguages = [NSSet setWithArray:MLNMapboxStreetsLanguages]; }); return mapboxStreetsLanguages; } @@ -131,7 +131,7 @@ static NSArray * const MGLMapboxStreetsAlternativeLanguages = @[ return [languageCode isEqualToString:@"en"]; }]].count; - NSArray *availableLanguages = acceptsEnglish ? MGLMapboxStreetsLanguages : MGLMapboxStreetsAlternativeLanguages; + NSArray *availableLanguages = acceptsEnglish ? MLNMapboxStreetsLanguages : MLNMapboxStreetsAlternativeLanguages; NSArray *preferredLanguages = [NSBundle preferredLocalizationsFromArray:availableLanguages forPreferences:preferencesArray]; NSString *mostSpecificLanguage; diff --git a/platform/ios/platform/darwin/src/MGLVectorTileSource_Private.h b/platform/ios/platform/darwin/src/MLNVectorTileSource_Private.h similarity index 82% rename from platform/ios/platform/darwin/src/MGLVectorTileSource_Private.h rename to platform/ios/platform/darwin/src/MLNVectorTileSource_Private.h index 8d287ae4c..5829221f5 100644 --- a/platform/ios/platform/darwin/src/MGLVectorTileSource_Private.h +++ b/platform/ios/platform/darwin/src/MLNVectorTileSource_Private.h @@ -1,8 +1,8 @@ -#import "MGLVectorTileSource.h" +#import "MLNVectorTileSource.h" NS_ASSUME_NONNULL_BEGIN -@interface MGLVectorTileSource (Private) +@interface MLNVectorTileSource (Private) @property (nonatomic, readonly, getter=isMapboxStreets) BOOL mapboxStreets; diff --git a/platform/ios/platform/darwin/src/NSArray+MGLAdditions.h b/platform/ios/platform/darwin/src/NSArray+MLNAdditions.h similarity index 96% rename from platform/ios/platform/darwin/src/NSArray+MGLAdditions.h rename to platform/ios/platform/darwin/src/NSArray+MLNAdditions.h index c4dfd8207..217f1a668 100644 --- a/platform/ios/platform/darwin/src/NSArray+MGLAdditions.h +++ b/platform/ios/platform/darwin/src/NSArray+MLNAdditions.h @@ -3,7 +3,7 @@ #import -@interface NSArray (MGLAdditions) +@interface NSArray (MLNAdditions) - (std::vector)mgl_vector; diff --git a/platform/ios/platform/darwin/src/NSArray+MGLAdditions.mm b/platform/ios/platform/darwin/src/NSArray+MLNAdditions.mm similarity index 89% rename from platform/ios/platform/darwin/src/NSArray+MGLAdditions.mm rename to platform/ios/platform/darwin/src/NSArray+MLNAdditions.mm index c5f25c83b..05beb289b 100644 --- a/platform/ios/platform/darwin/src/NSArray+MGLAdditions.mm +++ b/platform/ios/platform/darwin/src/NSArray+MLNAdditions.mm @@ -1,10 +1,10 @@ -#import "NSArray+MGLAdditions.h" +#import "NSArray+MLNAdditions.h" -#import "NSDictionary+MGLAdditions.h" -#import "NSExpression+MGLPrivateAdditions.h" -#import "MGLLoggingConfiguration_Private.h" +#import "NSDictionary+MLNAdditions.h" +#import "NSExpression+MLNPrivateAdditions.h" +#import "MLNLoggingConfiguration_Private.h" -@implementation NSArray (MGLAdditions) +@implementation NSArray (MLNAdditions) - (std::vector)mgl_vector { std::vector vector; @@ -29,7 +29,7 @@ NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] init]; BOOL isSubsequentItem = NO; for (NSAttributedString *component in self) { - MGLAssert([component isKindOfClass:[NSAttributedString class]], @"Items in array must be attributed strings."); + MLNAssert([component isKindOfClass:[NSAttributedString class]], @"Items in array must be attributed strings."); if (isSubsequentItem) { [attributedString appendAttributedString:attributedSeparator]; } diff --git a/platform/ios/platform/darwin/src/NSBundle+MGLAdditions.h b/platform/ios/platform/darwin/src/NSBundle+MLNAdditions.h similarity index 92% rename from platform/ios/platform/darwin/src/NSBundle+MGLAdditions.h rename to platform/ios/platform/darwin/src/NSBundle+MLNAdditions.h index dcafefede..136171e83 100644 --- a/platform/ios/platform/darwin/src/NSBundle+MGLAdditions.h +++ b/platform/ios/platform/darwin/src/NSBundle+MLNAdditions.h @@ -1,6 +1,6 @@ #import -#import "MGLTypes.h" +#import "MLNTypes.h" NS_ASSUME_NONNULL_BEGIN @@ -27,9 +27,9 @@ NS_ASSUME_NONNULL_BEGIN #define NSLocalizedStringWithDefaultValue(key, tbl, bundle, val, comment) \ [[NSBundle mgl_frameworkBundle] localizedStringForKey:(key) value:(val) table:(tbl)] -FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLBundleNotFoundException; +FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNBundleNotFoundException; -@interface NSBundle (MGLAdditions) +@interface NSBundle (MLNAdditions) /// Returns the bundle containing the SDK’s classes and Info.plist file. + (instancetype)mgl_frameworkBundle; diff --git a/platform/ios/platform/darwin/src/NSBundle+MGLAdditions.mm b/platform/ios/platform/darwin/src/NSBundle+MLNAdditions.mm similarity index 82% rename from platform/ios/platform/darwin/src/NSBundle+MGLAdditions.mm rename to platform/ios/platform/darwin/src/NSBundle+MLNAdditions.mm index 968dbf609..ecb13e156 100644 --- a/platform/ios/platform/darwin/src/NSBundle+MGLAdditions.mm +++ b/platform/ios/platform/darwin/src/NSBundle+MLNAdditions.mm @@ -1,13 +1,13 @@ -#import "NSBundle+MGLAdditions.h" +#import "NSBundle+MLNAdditions.h" -#import "MGLSettings.h" +#import "MLNSettings.h" -const MGLExceptionName MGLBundleNotFoundException = @"MGLBundleNotFoundException"; +const MLNExceptionName MLNBundleNotFoundException = @"MLNBundleNotFoundException"; -@implementation NSBundle (MGLAdditions) +@implementation NSBundle (MLNAdditions) + (instancetype)mgl_frameworkBundle { - NSBundle *bundle = [self bundleForClass:[MGLSettings class]]; + NSBundle *bundle = [self bundleForClass:[MLNSettings class]]; if (![bundle.infoDictionary[@"CFBundlePackageType"] isEqualToString:@"FMWK"]) { // For static frameworks, the bundle is the containing application @@ -16,7 +16,7 @@ const MGLExceptionName MGLBundleNotFoundException = @"MGLBundleNotFoundException if (bundlePath) { bundle = [self bundleWithPath:bundlePath]; } else { - [NSException raise:MGLBundleNotFoundException + [NSException raise:MLNBundleNotFoundException format:@"The Mapbox framework bundle could not be found. If using the Mapbox Maps SDK for iOS as a static framework, make sure that Mapbox.bundle is copied into the root of the app bundle."]; } } @@ -41,7 +41,7 @@ const MGLExceptionName MGLBundleNotFoundException = @"MGLBundleNotFoundException // Before SDK 12.2 (bundled with Xcode 10.2): There’s no main bundle identifier when running in a unit test bundle. // 12.2 and after: the above bundle identifier is: com.apple.dt.xctest.tool if (!bundleIdentifier) { - bundleIdentifier = [NSBundle bundleForClass:[MGLSettings class]].bundleIdentifier; + bundleIdentifier = [NSBundle bundleForClass:[MLNSettings class]].bundleIdentifier; } #endif return bundleIdentifier; diff --git a/platform/ios/platform/darwin/src/NSCoder+MGLAdditions.h b/platform/ios/platform/darwin/src/NSCoder+MLNAdditions.h similarity index 68% rename from platform/ios/platform/darwin/src/NSCoder+MGLAdditions.h rename to platform/ios/platform/darwin/src/NSCoder+MLNAdditions.h index 036a99c5a..80e8a92d3 100644 --- a/platform/ios/platform/darwin/src/NSCoder+MGLAdditions.h +++ b/platform/ios/platform/darwin/src/NSCoder+MLNAdditions.h @@ -3,11 +3,11 @@ #import -@interface NSCoder (MGLAdditions) +@interface NSCoder (MLNAdditions) -- (void)encodeMGLCoordinate:(CLLocationCoordinate2D)coordinate forKey:(NSString *)key; +- (void)encodeMLNCoordinate:(CLLocationCoordinate2D)coordinate forKey:(NSString *)key; -- (CLLocationCoordinate2D)decodeMGLCoordinateForKey:(NSString *)key; +- (CLLocationCoordinate2D)decodeMLNCoordinateForKey:(NSString *)key; - (void)mgl_encodeLocationCoordinates2D:(std::vector)coordinates forKey:(NSString *)key; diff --git a/platform/ios/platform/darwin/src/NSCoder+MGLAdditions.mm b/platform/ios/platform/darwin/src/NSCoder+MLNAdditions.mm similarity index 74% rename from platform/ios/platform/darwin/src/NSCoder+MGLAdditions.mm rename to platform/ios/platform/darwin/src/NSCoder+MLNAdditions.mm index 4af6c7588..4199e7820 100644 --- a/platform/ios/platform/darwin/src/NSCoder+MGLAdditions.mm +++ b/platform/ios/platform/darwin/src/NSCoder+MLNAdditions.mm @@ -1,9 +1,9 @@ -#import "NSCoder+MGLAdditions.h" +#import "NSCoder+MLNAdditions.h" -#import "NSArray+MGLAdditions.h" -#import "NSValue+MGLAdditions.h" +#import "NSArray+MLNAdditions.h" +#import "NSValue+MLNAdditions.h" -@implementation NSCoder (MGLAdditions) +@implementation NSCoder (MLNAdditions) - (void)mgl_encodeLocationCoordinates2D:(std::vector)coordinates forKey:(NSString *)key { [self encodeObject:[NSArray mgl_coordinatesFromCoordinates:coordinates] forKey:key]; @@ -14,11 +14,11 @@ return [coordinates mgl_coordinates]; } -- (void)encodeMGLCoordinate:(CLLocationCoordinate2D)coordinate forKey:(NSString *)key { +- (void)encodeMLNCoordinate:(CLLocationCoordinate2D)coordinate forKey:(NSString *)key { [self encodeObject:@{@"latitude": @(coordinate.latitude), @"longitude": @(coordinate.longitude)} forKey:key]; } -- (CLLocationCoordinate2D)decodeMGLCoordinateForKey:(NSString *)key { +- (CLLocationCoordinate2D)decodeMLNCoordinateForKey:(NSString *)key { NSDictionary *coordinate = [self decodeObjectForKey:key]; return CLLocationCoordinate2DMake([coordinate[@"latitude"] doubleValue], [coordinate[@"longitude"] doubleValue]); } diff --git a/platform/ios/platform/darwin/src/NSComparisonPredicate+MGLAdditions.h b/platform/ios/platform/darwin/src/NSComparisonPredicate+MLNAdditions.h similarity index 60% rename from platform/ios/platform/darwin/src/NSComparisonPredicate+MGLAdditions.h rename to platform/ios/platform/darwin/src/NSComparisonPredicate+MLNAdditions.h index 2cd4dd157..c2a0a6e41 100644 --- a/platform/ios/platform/darwin/src/NSComparisonPredicate+MGLAdditions.h +++ b/platform/ios/platform/darwin/src/NSComparisonPredicate+MLNAdditions.h @@ -2,6 +2,6 @@ #include -@interface NSComparisonPredicate (MGLAdditions) +@interface NSComparisonPredicate (MLNAdditions) @end diff --git a/platform/ios/platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm b/platform/ios/platform/darwin/src/NSComparisonPredicate+MLNAdditions.mm similarity index 97% rename from platform/ios/platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm rename to platform/ios/platform/darwin/src/NSComparisonPredicate+MLNAdditions.mm index b2f161343..a1efceeff 100644 --- a/platform/ios/platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm +++ b/platform/ios/platform/darwin/src/NSComparisonPredicate+MLNAdditions.mm @@ -1,11 +1,11 @@ -#import "NSComparisonPredicate+MGLAdditions.h" +#import "NSComparisonPredicate+MLNAdditions.h" -#import "MGLStyleValue_Private.h" +#import "MLNStyleValue_Private.h" -#import "NSPredicate+MGLAdditions.h" -#import "NSExpression+MGLPrivateAdditions.h" +#import "NSPredicate+MLNAdditions.h" +#import "NSExpression+MLNPrivateAdditions.h" -@implementation NSComparisonPredicate (MGLAdditions) +@implementation NSComparisonPredicate (MLNAdditions) - (NSString *)mgl_keyPath { NSExpression *leftExpression = self.leftExpression; @@ -76,7 +76,7 @@ @end -@implementation NSComparisonPredicate (MGLExpressionAdditions) +@implementation NSComparisonPredicate (MLNExpressionAdditions) - (id)mgl_jsonExpressionObject { switch (self.comparisonPredicateModifier) { @@ -172,7 +172,7 @@ self.rightExpression.expressionType == NSConstantValueExpressionType && [self.leftExpression.constantValue isKindOfClass:[NSString class]] && [self.rightExpression.constantValue isKindOfClass:[NSString class]]) { - NSExpression *rightLiteralExpression = [NSExpression expressionWithFormat:@"MGL_FUNCTION('literal', %@)", self.rightExpression]; + NSExpression *rightLiteralExpression = [NSExpression expressionWithFormat:@"MLN_FUNCTION('literal', %@)", self.rightExpression]; NSPredicate *literalPredicate = [NSComparisonPredicate predicateWithLeftExpression:self.leftExpression rightExpression:rightLiteralExpression modifier:NSDirectPredicateModifier diff --git a/platform/ios/platform/darwin/src/NSCompoundPredicate+MGLAdditions.h b/platform/ios/platform/darwin/src/NSCompoundPredicate+MLNAdditions.h similarity index 61% rename from platform/ios/platform/darwin/src/NSCompoundPredicate+MGLAdditions.h rename to platform/ios/platform/darwin/src/NSCompoundPredicate+MLNAdditions.h index 0f9909255..2c00bea64 100644 --- a/platform/ios/platform/darwin/src/NSCompoundPredicate+MGLAdditions.h +++ b/platform/ios/platform/darwin/src/NSCompoundPredicate+MLNAdditions.h @@ -2,6 +2,6 @@ #include -@interface NSCompoundPredicate (MGLAdditions) +@interface NSCompoundPredicate (MLNAdditions) @end diff --git a/platform/ios/platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm b/platform/ios/platform/darwin/src/NSCompoundPredicate+MLNAdditions.mm similarity index 75% rename from platform/ios/platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm rename to platform/ios/platform/darwin/src/NSCompoundPredicate+MLNAdditions.mm index 5eb20da84..d66f0611a 100644 --- a/platform/ios/platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm +++ b/platform/ios/platform/darwin/src/NSCompoundPredicate+MLNAdditions.mm @@ -1,14 +1,14 @@ -#import "NSCompoundPredicate+MGLAdditions.h" +#import "NSCompoundPredicate+MLNAdditions.h" -#import "MGLStyleValue_Private.h" +#import "MLNStyleValue_Private.h" -#import "NSPredicate+MGLPrivateAdditions.h" -#import "NSExpression+MGLPrivateAdditions.h" -#import "MGLLoggingConfiguration_Private.h" +#import "NSPredicate+MLNPrivateAdditions.h" +#import "NSExpression+MLNPrivateAdditions.h" +#import "MLNLoggingConfiguration_Private.h" #include -@implementation NSCompoundPredicate (MGLAdditions) +@implementation NSCompoundPredicate (MLNAdditions) - (std::vector)mgl_subfilters { @@ -21,12 +21,12 @@ @end -@implementation NSCompoundPredicate (MGLExpressionAdditions) +@implementation NSCompoundPredicate (MLNExpressionAdditions) - (id)mgl_jsonExpressionObject { switch (self.compoundPredicateType) { case NSNotPredicateType: { - MGLAssert(self.subpredicates.count <= 1, @"NOT predicate cannot have multiple subpredicates."); + MLNAssert(self.subpredicates.count <= 1, @"NOT predicate cannot have multiple subpredicates."); NSPredicate *subpredicate = self.subpredicates.firstObject; return @[@"!", subpredicate.mgl_jsonExpressionObject]; } diff --git a/platform/ios/platform/darwin/src/NSDate+MGLAdditions.h b/platform/ios/platform/darwin/src/NSDate+MLNAdditions.h similarity index 60% rename from platform/ios/platform/darwin/src/NSDate+MGLAdditions.h rename to platform/ios/platform/darwin/src/NSDate+MLNAdditions.h index 1da03fda6..cb0e2f98e 100644 --- a/platform/ios/platform/darwin/src/NSDate+MGLAdditions.h +++ b/platform/ios/platform/darwin/src/NSDate+MLNAdditions.h @@ -1,17 +1,17 @@ #import -#import "MGLFoundation.h" +#import "MLNFoundation.h" #include NS_ASSUME_NONNULL_BEGIN /// Converts from a duration in seconds to a duration object usable in mbgl. -MGL_EXPORT -mbgl::Duration MGLDurationFromTimeInterval(NSTimeInterval duration); +MLN_EXPORT +mbgl::Duration MLNDurationFromTimeInterval(NSTimeInterval duration); /// Converts from an mbgl duration object to a duration in seconds. -MGL_EXPORT -NSTimeInterval MGLTimeIntervalFromDuration(mbgl::Duration duration); +MLN_EXPORT +NSTimeInterval MLNTimeIntervalFromDuration(mbgl::Duration duration); NS_ASSUME_NONNULL_END diff --git a/platform/ios/platform/darwin/src/NSDate+MGLAdditions.mm b/platform/ios/platform/darwin/src/NSDate+MLNAdditions.mm similarity index 58% rename from platform/ios/platform/darwin/src/NSDate+MGLAdditions.mm rename to platform/ios/platform/darwin/src/NSDate+MLNAdditions.mm index 43aa9798d..5dcb36c28 100644 --- a/platform/ios/platform/darwin/src/NSDate+MGLAdditions.mm +++ b/platform/ios/platform/darwin/src/NSDate+MLNAdditions.mm @@ -1,12 +1,12 @@ -#import "NSDate+MGLAdditions.h" +#import "NSDate+MLNAdditions.h" #import -mbgl::Duration MGLDurationFromTimeInterval(NSTimeInterval duration) +mbgl::Duration MLNDurationFromTimeInterval(NSTimeInterval duration) { return std::chrono::duration_cast(std::chrono::duration(duration)); } -NSTimeInterval MGLTimeIntervalFromDuration(mbgl::Duration duration) +NSTimeInterval MLNTimeIntervalFromDuration(mbgl::Duration duration) { return std::chrono::duration>(duration).count(); } diff --git a/platform/ios/platform/darwin/src/NSDictionary+MGLAdditions.h b/platform/ios/platform/darwin/src/NSDictionary+MLNAdditions.h similarity index 80% rename from platform/ios/platform/darwin/src/NSDictionary+MGLAdditions.h rename to platform/ios/platform/darwin/src/NSDictionary+MLNAdditions.h index 556f21992..eb8d5c28e 100644 --- a/platform/ios/platform/darwin/src/NSDictionary+MGLAdditions.h +++ b/platform/ios/platform/darwin/src/NSDictionary+MLNAdditions.h @@ -4,7 +4,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface NSDictionary (MGLAdditions) +@interface NSDictionary (MLNAdditions) - (mbgl::PropertyMap)mgl_propertyMap; diff --git a/platform/ios/platform/darwin/src/NSDictionary+MGLAdditions.mm b/platform/ios/platform/darwin/src/NSDictionary+MLNAdditions.mm similarity index 80% rename from platform/ios/platform/darwin/src/NSDictionary+MGLAdditions.mm rename to platform/ios/platform/darwin/src/NSDictionary+MLNAdditions.mm index 4bc7ddb3c..8a4b841b0 100644 --- a/platform/ios/platform/darwin/src/NSDictionary+MGLAdditions.mm +++ b/platform/ios/platform/darwin/src/NSDictionary+MLNAdditions.mm @@ -1,9 +1,9 @@ -#import "NSDictionary+MGLAdditions.h" +#import "NSDictionary+MLNAdditions.h" -#import "NSExpression+MGLPrivateAdditions.h" -#import "NSArray+MGLAdditions.h" +#import "NSExpression+MLNPrivateAdditions.h" +#import "NSArray+MLNAdditions.h" -@implementation NSDictionary (MGLAdditions) +@implementation NSDictionary (MLNAdditions) - (mbgl::PropertyMap)mgl_propertyMap { mbgl::PropertyMap propertyMap; diff --git a/platform/ios/platform/darwin/src/NSException+MGLAdditions.h b/platform/ios/platform/darwin/src/NSException+MLNAdditions.h similarity index 58% rename from platform/ios/platform/darwin/src/NSException+MGLAdditions.h rename to platform/ios/platform/darwin/src/NSException+MLNAdditions.h index 274ca50a8..89e62d172 100644 --- a/platform/ios/platform/darwin/src/NSException+MGLAdditions.h +++ b/platform/ios/platform/darwin/src/NSException+MLNAdditions.h @@ -1,4 +1,4 @@ #import -#import "MGLLoggingConfiguration_Private.h" +#import "MLNLoggingConfiguration_Private.h" -#define MGLAssertIsMainThread() MGLAssert([[NSThread currentThread] isMainThread], @"%s must be accessed on the main thread, not %@", __PRETTY_FUNCTION__, [NSThread currentThread]) +#define MLNAssertIsMainThread() MLNAssert([[NSThread currentThread] isMainThread], @"%s must be accessed on the main thread, not %@", __PRETTY_FUNCTION__, [NSThread currentThread]) diff --git a/platform/ios/platform/darwin/src/NSExpression+MGLAdditions.h b/platform/ios/platform/darwin/src/NSExpression+MLNAdditions.h similarity index 89% rename from platform/ios/platform/darwin/src/NSExpression+MGLAdditions.h rename to platform/ios/platform/darwin/src/NSExpression+MLNAdditions.h index 385611443..40b3865f7 100644 --- a/platform/ios/platform/darwin/src/NSExpression+MGLAdditions.h +++ b/platform/ios/platform/darwin/src/NSExpression+MLNAdditions.h @@ -5,13 +5,13 @@ #import #endif -#import "MGLTypes.h" +#import "MLNTypes.h" -@class MGLAttributedExpression; +@class MLNAttributedExpression; NS_ASSUME_NONNULL_BEGIN -typedef NSString *MGLExpressionInterpolationMode NS_TYPED_ENUM; +typedef NSString *MLNExpressionInterpolationMode NS_TYPED_ENUM; /** An `NSString` identifying the `linear` interpolation type in an `NSExpression`. @@ -20,7 +20,7 @@ typedef NSString *MGLExpressionInterpolationMode NS_TYPED_ENUM; interpolate expression operator in the Mapbox Style Specification. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionInterpolationModeLinear; +FOUNDATION_EXTERN MLN_EXPORT const MLNExpressionInterpolationMode MLNExpressionInterpolationModeLinear; /** An `NSString` identifying the `expotential` interpolation type in an `NSExpression`. @@ -29,7 +29,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI interpolate expression operator in the Mapbox Style Specification. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionInterpolationModeExponential; +FOUNDATION_EXTERN MLN_EXPORT const MLNExpressionInterpolationMode MLNExpressionInterpolationModeExponential; /** An `NSString` identifying the `cubic-bezier` interpolation type in an `NSExpression`. @@ -38,14 +38,14 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI interpolate expression operator in the Mapbox Style Specification. */ -FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier; +FOUNDATION_EXTERN MLN_EXPORT const MLNExpressionInterpolationMode MLNExpressionInterpolationModeCubicBezier; /** Methods for creating expressions that use Mapbox-specific functionality and for converting to and from the JSON format defined in the Mapbox Style Specification. */ -@interface NSExpression (MGLAdditions) +@interface NSExpression (MLNAdditions) // MARK: Creating Variable Expressions @@ -110,7 +110,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI @param trueExpression The expression for conditions equal to true. @param falseExpression The expression for conditions equal to false. */ -+ (instancetype)mgl_expressionForConditional:(nonnull NSPredicate *)conditionPredicate trueExpression:(nonnull NSExpression *)trueExpression falseExpresssion:(nonnull NSExpression *)falseExpression NS_SWIFT_NAME(init(forMGLConditional:trueExpression:falseExpression:)); ++ (instancetype)mgl_expressionForConditional:(nonnull NSPredicate *)conditionPredicate trueExpression:(nonnull NSExpression *)trueExpression falseExpresssion:(nonnull NSExpression *)falseExpression NS_SWIFT_NAME(init(forMLNConditional:trueExpression:falseExpression:)); // MARK: Creating Ramp, Scale, and Curve Expressions @@ -129,25 +129,25 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI Use images to cluster point data examples to learn how to use this expression to style a map layer based on an attribute value. */ -+ (instancetype)mgl_expressionForSteppingExpression:(nonnull NSExpression*)steppingExpression fromExpression:(nonnull NSExpression *)minimumExpression stops:(nonnull NSExpression*)stops NS_SWIFT_NAME(init(forMGLStepping:from:stops:)); ++ (instancetype)mgl_expressionForSteppingExpression:(nonnull NSExpression*)steppingExpression fromExpression:(nonnull NSExpression *)minimumExpression stops:(nonnull NSExpression*)stops NS_SWIFT_NAME(init(forMLNStepping:from:stops:)); /** Returns an interpolated function expression specifying the function operator, curve type, parameters and steps. @param inputExpression The interpolating expression input. - @param curveType The curve type could be `MGLExpressionInterpolationModeLinear`, - `MGLExpressionInterpolationModeExponential` and - `MGLExpressionInterpolationModeCubicBezier`. + @param curveType The curve type could be `MLNExpressionInterpolationModeLinear`, + `MLNExpressionInterpolationModeExponential` and + `MLNExpressionInterpolationModeCubicBezier`. @param parameters The parameters expression. @param stops The stops expression. #### Related examples See the - Create a heatmap layer example to learn how to style an `MGLHeatmapStyleLayer` + Create a heatmap layer example to learn how to style an `MLNHeatmapStyleLayer` based on zoom level and point density with this expression. */ -+ (instancetype)mgl_expressionForInterpolatingExpression:(nonnull NSExpression*)inputExpression withCurveType:(nonnull MGLExpressionInterpolationMode)curveType parameters:(nullable NSExpression *)parameters stops:(nonnull NSExpression*)stops NS_SWIFT_NAME(init(forMGLInterpolating:curveType:parameters:stops:)); ++ (instancetype)mgl_expressionForInterpolatingExpression:(nonnull NSExpression*)inputExpression withCurveType:(nonnull MLNExpressionInterpolationMode)curveType parameters:(nullable NSExpression *)parameters stops:(nonnull NSExpression*)stops NS_SWIFT_NAME(init(forMLNInterpolating:curveType:parameters:stops:)); /** Returns a match function expression specifying the input, matching values, @@ -157,13 +157,13 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI @param matchedExpressions The matched values expression dictionary must be condition : value. @param defaultExpression The defaultValue expression to be used in case there is no match. */ -+ (instancetype)mgl_expressionForMatchingExpression:(nonnull NSExpression *)inputExpression inDictionary:(nonnull NSDictionary *)matchedExpressions defaultExpression:(nonnull NSExpression *)defaultExpression NS_SWIFT_NAME(init(forMGLMatchingKey:in:default:)); ++ (instancetype)mgl_expressionForMatchingExpression:(nonnull NSExpression *)inputExpression inDictionary:(nonnull NSDictionary *)matchedExpressions defaultExpression:(nonnull NSExpression *)defaultExpression NS_SWIFT_NAME(init(forMLNMatchingKey:in:default:)); /** - Returns an attributed function expression specifying an `MGLAttributedExpression` constant + Returns an attributed function expression specifying an `MLNAttributedExpression` constant expression array. - @param attributedExpressions The `MGLAttributedExpression` constant expression array. + @param attributedExpressions The `MLNAttributedExpression` constant expression array. */ + (instancetype)mgl_expressionForAttributedExpressions:(nonnull NSArray *)attributedExpressions NS_SWIFT_NAME(init(forAttributedExpressions:)); @@ -197,7 +197,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI @return An initialized expression equivalent to `object`, suitable for use as the value of a style layer attribute. */ -+ (instancetype)expressionWithMGLJSONObject:(id)object NS_SWIFT_NAME(init(mglJSONObject:)); ++ (instancetype)expressionWithMLNJSONObject:(id)object NS_SWIFT_NAME(init(mglJSONObject:)); /** An equivalent Foundation object that can be serialized as JSON. diff --git a/platform/ios/platform/darwin/src/NSExpression+MGLAdditions.mm b/platform/ios/platform/darwin/src/NSExpression+MLNAdditions.mm similarity index 90% rename from platform/ios/platform/darwin/src/NSExpression+MGLAdditions.mm rename to platform/ios/platform/darwin/src/NSExpression+MLNAdditions.mm index 5eff80e8d..da4ddb43e 100644 --- a/platform/ios/platform/darwin/src/NSExpression+MGLAdditions.mm +++ b/platform/ios/platform/darwin/src/NSExpression+MLNAdditions.mm @@ -1,31 +1,31 @@ -#import "MGLFoundation_Private.h" -#import "MGLGeometry_Private.h" -#import "MGLShape_Private.h" -#import "NSExpression+MGLPrivateAdditions.h" +#import "MLNFoundation_Private.h" +#import "MLNGeometry_Private.h" +#import "MLNShape_Private.h" +#import "NSExpression+MLNPrivateAdditions.h" -#import "MGLTypes.h" +#import "MLNTypes.h" #if TARGET_OS_IPHONE - #import "UIColor+MGLAdditions.h" + #import "UIColor+MLNAdditions.h" #else - #import "NSColor+MGLAdditions.h" + #import "NSColor+MLNAdditions.h" #endif -#import "NSPredicate+MGLAdditions.h" -#import "NSValue+MGLStyleAttributeAdditions.h" -#import "MGLVectorTileSource_Private.h" -#import "MGLAttributedExpression.h" +#import "NSPredicate+MLNAdditions.h" +#import "NSValue+MLNStyleAttributeAdditions.h" +#import "MLNVectorTileSource_Private.h" +#import "MLNAttributedExpression.h" #import #import -const MGLExpressionInterpolationMode MGLExpressionInterpolationModeLinear = @"linear"; -const MGLExpressionInterpolationMode MGLExpressionInterpolationModeExponential = @"exponential"; -const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = @"cubic-bezier"; +const MLNExpressionInterpolationMode MLNExpressionInterpolationModeLinear = @"linear"; +const MLNExpressionInterpolationMode MLNExpressionInterpolationModeExponential = @"exponential"; +const MLNExpressionInterpolationMode MLNExpressionInterpolationModeCubicBezier = @"cubic-bezier"; -@interface MGLAftermarketExpressionInstaller: NSObject +@interface MLNAftermarketExpressionInstaller: NSObject @end -@implementation MGLAftermarketExpressionInstaller +@implementation MLNAftermarketExpressionInstaller + (void)load { static dispatch_once_t onceToken; @@ -38,7 +38,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = Adds to NSExpression’s built-in repertoire of functions. */ + (void)installFunctions { - Class MGLAftermarketExpressionInstaller = [self class]; + Class MLNAftermarketExpressionInstaller = [self class]; // NSExpression’s built-in functions are backed by class methods on a // private class, so use a function expression to get at the class. @@ -52,12 +52,12 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = #pragma clang diagnostic ignored "-Wundeclared-selector" #define INSTALL_METHOD(sel) \ { \ - Method method = class_getInstanceMethod(MGLAftermarketExpressionInstaller, @selector(sel)); \ + Method method = class_getInstanceMethod(MLNAftermarketExpressionInstaller, @selector(sel)); \ class_addMethod(NSPredicateUtilities, @selector(sel), method_getImplementation(method), method_getTypeEncoding(method)); \ } #define INSTALL_CONTROL_STRUCTURE(sel) \ { \ - Method method = class_getInstanceMethod(MGLAftermarketExpressionInstaller, @selector(sel:)); \ + Method method = class_getInstanceMethod(MLNAftermarketExpressionInstaller, @selector(sel:)); \ class_addMethod(NSPredicateUtilities, @selector(sel), method_getImplementation(method), method_getTypeEncoding(method)); \ class_addMethod(NSPredicateUtilities, @selector(sel:), method_getImplementation(method), method_getTypeEncoding(method)); \ } @@ -83,10 +83,10 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = // Install functions that resemble control structures, taking arbitrary // numbers of arguments. Vararg aftermarket functions need to be declared // with an explicit and implicit first argument. - INSTALL_CONTROL_STRUCTURE(MGL_LET); - INSTALL_CONTROL_STRUCTURE(MGL_MATCH); - INSTALL_CONTROL_STRUCTURE(MGL_IF); - INSTALL_CONTROL_STRUCTURE(MGL_FUNCTION); + INSTALL_CONTROL_STRUCTURE(MLN_LET); + INSTALL_CONTROL_STRUCTURE(MLN_MATCH); + INSTALL_CONTROL_STRUCTURE(MLN_IF); + INSTALL_CONTROL_STRUCTURE(MLN_FUNCTION); #undef INSTALL_AFTERMARKET_FN #pragma clang diagnostic pop @@ -100,7 +100,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = return [components componentsJoinedByString:@""]; } -- (NSString *)mgl_attributed:(NSArray *)attributedExpressions { +- (NSString *)mgl_attributed:(NSArray *)attributedExpressions { [NSException raise:NSInvalidArgumentException format:@"Text format expressions lack underlying Objective-C implementations."]; return nil; @@ -211,7 +211,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = A placeholder for a method that evaluates an expression based on an arbitrary number of variable names and assigned expressions. */ -- (id)MGL_LET:(NSString *)firstVariableName, ... { +- (id)MLN_LET:(NSString *)firstVariableName, ... { [NSException raise:NSInvalidArgumentException format:@"Assignment expressions lack underlying Objective-C implementations."]; return nil; @@ -220,7 +220,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = /** A placeholder for a method that evaluates an expression and returns the matching element. */ -- (id)MGL_MATCH:(id)firstCondition, ... { +- (id)MLN_MATCH:(id)firstCondition, ... { [NSException raise:NSInvalidArgumentException format:@"Assignment expressions lack underlying Objective-C implementations."]; return nil; @@ -229,7 +229,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = /** A placeholder for a method that evaluates an expression and returns the matching element. */ -- (id)MGL_IF:(id)firstCondition, ... { +- (id)MLN_IF:(id)firstCondition, ... { va_list argumentList; va_start(argumentList, firstCondition); @@ -253,7 +253,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = arguments as an expression according to the Mapbox Style Specification’s expression language. */ -- (id)MGL_FUNCTION:(id)firstArgument, ... { +- (id)MLN_FUNCTION:(id)firstArgument, ... { [NSException raise:NSInvalidArgumentException format:@"Mapbox GL function expressions lack underlying Objective-C implementations."]; return nil; @@ -261,7 +261,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = @end -@implementation NSExpression (MGLPrivateAdditions) +@implementation NSExpression (MLNPrivateAdditions) - (std::vector)mgl_aggregateMBGLValue { if ([self.constantValue isKindOfClass:[NSArray class]] || [self.constantValue isKindOfClass:[NSSet class]]) { @@ -317,8 +317,8 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = // We use long long here to avoid any truncation. return { (int64_t)number.longLongValue }; } - } else if ([value isKindOfClass:[MGLColor class]]) { - auto hexString = [(MGLColor *)value mgl_colorForPremultipliedValue].stringify(); + } else if ([value isKindOfClass:[MLNColor class]]) { + auto hexString = [(MLNColor *)value mgl_colorForPremultipliedValue].stringify(); return { hexString }; } else if (value && value != [NSNull null]) { [NSException raise:NSInvalidArgumentException @@ -409,7 +409,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = @end -@implementation NSObject (MGLExpressionAdditions) +@implementation NSObject (MLNExpressionAdditions) - (NSNumber *)mgl_number { return nil; @@ -433,7 +433,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = @end -@implementation NSNull (MGLExpressionAdditions) +@implementation NSNull (MLNExpressionAdditions) - (id)mgl_jsonExpressionObject { return self; @@ -441,7 +441,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = @end -@implementation NSString (MGLExpressionAdditions) +@implementation NSString (MLNExpressionAdditions) - (id)mgl_jsonExpressionObject { return self; @@ -457,7 +457,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = @end -@implementation NSNumber (MGLExpressionAdditions) +@implementation NSNumber (MLNExpressionAdditions) - (id)mgl_interpolateWithCurveType:(NSString *)curveType parameters:(NSArray *)parameters @@ -488,7 +488,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = @end -@implementation MGLColor (MGLExpressionAdditions) +@implementation MLNColor (MLNExpressionAdditions) - (id)mgl_jsonExpressionObject { auto color = [self mgl_colorForPremultipliedValue]; @@ -500,7 +500,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = @end -@implementation NSArray (MGLExpressionAdditions) +@implementation NSArray (MLNExpressionAdditions) - (id)mgl_jsonExpressionObject { return [self valueForKeyPath:@"mgl_jsonExpressionObject"]; @@ -514,7 +514,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = @end -@implementation NSDictionary (MGLExpressionAdditions) +@implementation NSDictionary (MLNExpressionAdditions) - (id)mgl_jsonExpressionObject { NSMutableDictionary *expressionObject = [NSMutableDictionary dictionaryWithCapacity:self.count]; @@ -534,7 +534,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = @end -@implementation NSExpression (MGLExpressionAdditions) +@implementation NSExpression (MLNExpressionAdditions) - (NSExpression *)mgl_expressionWithContext:(NSDictionary *)context { [NSException raise:NSInternalInconsistencyException @@ -550,7 +550,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = @end -@implementation MGLShape (MGLExpressionAdditions) +@implementation MLNShape (MLNExpressionAdditions) - (id)mgl_jsonExpressionObject { return self.geoJSONDictionary; @@ -558,7 +558,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = @end -@implementation NSExpression (MGLAdditions) +@implementation NSExpression (MLNAdditions) + (NSExpression *)zoomLevelVariableExpression { return [NSExpression expressionForVariable:@"zoomLevel"]; @@ -609,7 +609,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = } } -+ (instancetype)mgl_expressionForInterpolatingExpression:(nonnull NSExpression *)inputExpression withCurveType:(nonnull MGLExpressionInterpolationMode)curveType parameters:(nullable NSExpression *)parameters stops:(nonnull NSExpression *)stops { ++ (instancetype)mgl_expressionForInterpolatingExpression:(nonnull NSExpression *)inputExpression withCurveType:(nonnull MLNExpressionInterpolationMode)curveType parameters:(nullable NSExpression *)parameters stops:(nonnull NSExpression *)stops { NSExpression *sanitizeParams = parameters ? parameters : [NSExpression expressionForConstantValue:nil]; NSString *selectorName = @"mgl_interpolate:withCurveType:parameters:stops:"; @@ -634,7 +634,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = } [optionsArray addObject:defaultExpression]; - return [NSExpression expressionForFunction:@"MGL_MATCH" + return [NSExpression expressionForFunction:@"MLN_MATCH" arguments:optionsArray]; } @@ -647,22 +647,22 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = return [NSExpression expressionForFunction:@"mgl_join:" arguments:@[subexpression]]; } -static NSDictionary *MGLFunctionNamesByExpressionOperator; -static NSDictionary *MGLExpressionOperatorsByFunctionNames; +static NSDictionary *MLNFunctionNamesByExpressionOperator; +static NSDictionary *MLNExpressionOperatorsByFunctionNames; -NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { +NSArray *MLNSubexpressionsWithJSONObjects(NSArray *objects) { NSMutableArray *subexpressions = [NSMutableArray arrayWithCapacity:objects.count]; for (id object in objects) { - NSExpression *expression = [NSExpression expressionWithMGLJSONObject:object]; + NSExpression *expression = [NSExpression expressionWithMLNJSONObject:object]; [subexpressions addObject:expression]; } return subexpressions; } -+ (instancetype)expressionWithMGLJSONObject:(id)object { ++ (instancetype)expressionWithMLNJSONObject:(id)object { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - MGLFunctionNamesByExpressionOperator = @{ + MLNFunctionNamesByExpressionOperator = @{ @"+": @"add:to:", @"-": @"from:subtract:", @"*": @"multiply:by:", @@ -686,7 +686,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { @"distance": @"mgl_distanceFrom:", @"upcase": @"uppercase:", @"downcase": @"lowercase:", - @"let": @"MGL_LET", + @"let": @"MLN_LET", }; }); if (!object || object == [NSNull null]) { @@ -696,8 +696,8 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { if ([object isKindOfClass:[NSString class]] || [object isKindOfClass:[NSNumber class]] || [object isKindOfClass:[NSValue class]] || - [object isKindOfClass:[MGLColor class]] || - [object isKindOfClass:[MGLShape class]]) { + [object isKindOfClass:[MLNColor class]] || + [object isKindOfClass:[MLNShape class]]) { return [NSExpression expressionForConstantValue:object]; } @@ -705,9 +705,9 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { if (object[@"type"]) { NSError *error; NSData *shapeData = [NSJSONSerialization dataWithJSONObject:object options:0 error:&error]; - MGLShape *shape; + MLNShape *shape; if (shapeData && !error) { - shape = [MGLShape shapeWithData:shapeData encoding:NSUTF8StringEncoding error:&error]; + shape = [MLNShape shapeWithData:shapeData encoding:NSUTF8StringEncoding error:&error]; } if (shape && !error) { return [NSExpression expressionForConstantValue:shape]; @@ -716,7 +716,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithCapacity:[object count]]; [object enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) { - dictionary[key] = [NSExpression expressionWithMGLJSONObject:obj]; + dictionary[key] = [NSExpression expressionWithMLNJSONObject:obj]; }]; return [NSExpression expressionForConstantValue:dictionary]; } @@ -725,15 +725,15 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { NSString *op = array.firstObject; if (![op isKindOfClass:[NSString class]]) { - NSArray *subexpressions = MGLSubexpressionsWithJSONObjects(array); - return [NSExpression expressionForFunction:@"MGL_FUNCTION" arguments:subexpressions]; + NSArray *subexpressions = MLNSubexpressionsWithJSONObjects(array); + return [NSExpression expressionForFunction:@"MLN_FUNCTION" arguments:subexpressions]; } NSArray *argumentObjects = [array subarrayWithRange:NSMakeRange(1, array.count - 1)]; - NSString *functionName = MGLFunctionNamesByExpressionOperator[op]; + NSString *functionName = MLNFunctionNamesByExpressionOperator[op]; if (functionName) { - NSArray *subexpressions = MGLSubexpressionsWithJSONObjects(argumentObjects); + NSArray *subexpressions = MLNSubexpressionsWithJSONObjects(argumentObjects); if ([op isEqualToString:@"+"] && argumentObjects.count > 2) { NSExpression *subexpression = [NSExpression expressionForAggregate:subexpressions]; return [NSExpression expressionForFunction:@"sum:" @@ -747,28 +747,28 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { arguments:subexpressions]; } else if ([op isEqualToString:@"collator"]) { // Avoid wrapping collator options object in literal expression. - return [NSExpression expressionForFunction:@"MGL_FUNCTION" arguments:array]; + return [NSExpression expressionForFunction:@"MLN_FUNCTION" arguments:array]; } else if ([op isEqualToString:@"literal"]) { if ([argumentObjects.firstObject isKindOfClass:[NSArray class]]) { - return [NSExpression expressionForAggregate:MGLSubexpressionsWithJSONObjects(argumentObjects.firstObject)]; + return [NSExpression expressionForAggregate:MLNSubexpressionsWithJSONObjects(argumentObjects.firstObject)]; } - return [NSExpression expressionWithMGLJSONObject:argumentObjects.firstObject]; + return [NSExpression expressionWithMLNJSONObject:argumentObjects.firstObject]; } else if ([op isEqualToString:@"to-boolean"]) { - NSExpression *operand = [NSExpression expressionWithMGLJSONObject:argumentObjects.firstObject]; + NSExpression *operand = [NSExpression expressionWithMLNJSONObject:argumentObjects.firstObject]; return [NSExpression expressionForFunction:operand selectorName:@"boolValue" arguments:@[]]; } else if ([op isEqualToString:@"to-number"] || [op isEqualToString:@"number"]) { - NSExpression *operand = [NSExpression expressionWithMGLJSONObject:argumentObjects.firstObject]; + NSExpression *operand = [NSExpression expressionWithMLNJSONObject:argumentObjects.firstObject]; if (argumentObjects.count == 1) { return [NSExpression expressionWithFormat:@"CAST(%@, 'NSNumber')", operand]; } argumentObjects = [argumentObjects subarrayWithRange:NSMakeRange(1, argumentObjects.count - 1)]; - NSArray *subexpressions = MGLSubexpressionsWithJSONObjects(argumentObjects); + NSArray *subexpressions = MLNSubexpressionsWithJSONObjects(argumentObjects); return [NSExpression expressionForFunction:operand selectorName:@"mgl_numberWithFallbackValues:" arguments:subexpressions]; } else if ([op isEqualToString:@"to-string"] || [op isEqualToString:@"string"]) { - NSExpression *operand = [NSExpression expressionWithMGLJSONObject:argumentObjects.firstObject]; + NSExpression *operand = [NSExpression expressionWithMLNJSONObject:argumentObjects.firstObject]; return [NSExpression expressionWithFormat:@"CAST(%@, 'NSString')", operand]; } else if ([op isEqualToString:@"to-color"]) { - NSExpression *operand = [NSExpression expressionWithMGLJSONObject:argumentObjects.firstObject]; + NSExpression *operand = [NSExpression expressionWithMLNJSONObject:argumentObjects.firstObject]; if (argumentObjects.count == 1) { #if TARGET_OS_IPHONE @@ -777,24 +777,24 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { return [NSExpression expressionWithFormat:@"CAST(%@, 'NSColor')", operand]; #endif } - NSArray *subexpressions = MGLSubexpressionsWithJSONObjects(array); - return [NSExpression expressionForFunction:@"MGL_FUNCTION" arguments:subexpressions]; + NSArray *subexpressions = MLNSubexpressionsWithJSONObjects(array); + return [NSExpression expressionForFunction:@"MLN_FUNCTION" arguments:subexpressions]; } else if ([op isEqualToString:@"to-rgba"]) { - NSExpression *operand = [NSExpression expressionWithMGLJSONObject:argumentObjects.firstObject]; + NSExpression *operand = [NSExpression expressionWithMLNJSONObject:argumentObjects.firstObject]; return [NSExpression expressionWithFormat:@"CAST(noindex(%@), 'NSArray')", operand]; } else if ([op isEqualToString:@"get"]) { if (argumentObjects.count == 2) { - NSExpression *operand = [NSExpression expressionWithMGLJSONObject:argumentObjects.lastObject]; + NSExpression *operand = [NSExpression expressionWithMLNJSONObject:argumentObjects.lastObject]; if ([argumentObjects.firstObject isKindOfClass:[NSString class]]) { return [NSExpression expressionWithFormat:@"%@.%K", operand, argumentObjects.firstObject]; } - NSExpression *key = [NSExpression expressionWithMGLJSONObject:argumentObjects.firstObject]; + NSExpression *key = [NSExpression expressionWithMLNJSONObject:argumentObjects.firstObject]; return [NSExpression expressionWithFormat:@"%@.%@", operand, key]; } return [NSExpression expressionForKeyPath:argumentObjects.firstObject]; } else if ([op isEqualToString:@"length"]) { - NSArray *subexpressions = MGLSubexpressionsWithJSONObjects(argumentObjects); + NSArray *subexpressions = MLNSubexpressionsWithJSONObjects(argumentObjects); NSString *function = @"count:"; if ([subexpressions.firstObject expressionType] == NSConstantValueExpressionType && [[subexpressions.firstObject constantValue] isKindOfClass:[NSString class]]) { @@ -802,17 +802,17 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { } return [NSExpression expressionForFunction:function arguments:@[subexpressions.firstObject]]; } else if ([op isEqualToString:@"rgb"]) { - NSArray *subexpressions = MGLSubexpressionsWithJSONObjects(argumentObjects); + NSArray *subexpressions = MLNSubexpressionsWithJSONObjects(argumentObjects); return [NSExpression mgl_expressionForRGBComponents:subexpressions]; } else if ([op isEqualToString:@"rgba"]) { - NSArray *subexpressions = MGLSubexpressionsWithJSONObjects(argumentObjects); + NSArray *subexpressions = MLNSubexpressionsWithJSONObjects(argumentObjects); return [NSExpression mgl_expressionForRGBAComponents:subexpressions]; } else if ([op isEqualToString:@"min"]) { - NSArray *subexpressions = MGLSubexpressionsWithJSONObjects(argumentObjects); + NSArray *subexpressions = MLNSubexpressionsWithJSONObjects(argumentObjects); NSExpression *subexpression = [NSExpression expressionForAggregate:subexpressions]; return [NSExpression expressionForFunction:@"min:" arguments:@[subexpression]]; } else if ([op isEqualToString:@"max"]) { - NSArray *subexpressions = MGLSubexpressionsWithJSONObjects(argumentObjects); + NSArray *subexpressions = MLNSubexpressionsWithJSONObjects(argumentObjects); NSExpression *subexpression = [NSExpression expressionForAggregate:subexpressions]; return [NSExpression expressionForFunction:@"max:" arguments:@[subexpression]]; } else if ([op isEqualToString:@"e"]) { @@ -820,43 +820,43 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { } else if ([op isEqualToString:@"pi"]) { return [NSExpression expressionForConstantValue:@(M_PI)]; } else if ([op isEqualToString:@"concat"]) { - NSArray *subexpressions = MGLSubexpressionsWithJSONObjects(argumentObjects); + NSArray *subexpressions = MLNSubexpressionsWithJSONObjects(argumentObjects); NSExpression *subexpression = [NSExpression expressionForAggregate:subexpressions]; return [NSExpression expressionForFunction:@"mgl_join:" arguments:@[subexpression]]; } else if ([op isEqualToString:@"at"]) { - NSArray *subexpressions = MGLSubexpressionsWithJSONObjects(argumentObjects); + NSArray *subexpressions = MLNSubexpressionsWithJSONObjects(argumentObjects); NSExpression *index = subexpressions.firstObject; NSExpression *operand = subexpressions[1]; return [NSExpression expressionForFunction:@"objectFrom:withIndex:" arguments:@[operand, index]]; } else if ([op isEqualToString:@"has"]) { - NSArray *subexpressions = MGLSubexpressionsWithJSONObjects(argumentObjects); + NSArray *subexpressions = MLNSubexpressionsWithJSONObjects(argumentObjects); NSExpression *operand = argumentObjects.count > 1 ? subexpressions[1] : [NSExpression expressionForEvaluatedObject]; NSExpression *key = subexpressions.firstObject; return [NSExpression expressionForFunction:@"mgl_does:have:" arguments:@[operand, key]]; } else if ([op isEqualToString:@"interpolate"]) { NSArray *interpolationOptions = argumentObjects.firstObject; NSString *curveType = interpolationOptions.firstObject; - MGLExpressionInterpolationMode interpolationMode = MGLExpressionInterpolationModeLinear; + MLNExpressionInterpolationMode interpolationMode = MLNExpressionInterpolationModeLinear; id curveParameters; if ([curveType isEqual:@"exponential"]) { curveParameters = interpolationOptions[1]; - interpolationMode = MGLExpressionInterpolationModeExponential; + interpolationMode = MLNExpressionInterpolationModeExponential; } else if ([curveType isEqualToString:@"cubic-bezier"]) { curveParameters = @[@"literal", [interpolationOptions subarrayWithRange:NSMakeRange(1, 4)]]; - interpolationMode = MGLExpressionInterpolationModeCubicBezier; + interpolationMode = MLNExpressionInterpolationModeCubicBezier; } else { curveParameters = [NSNull null]; } - NSExpression *curveParameterExpression = [NSExpression expressionWithMGLJSONObject:curveParameters]; + NSExpression *curveParameterExpression = [NSExpression expressionWithMLNJSONObject:curveParameters]; argumentObjects = [argumentObjects subarrayWithRange:NSMakeRange(1, argumentObjects.count - 1)]; - NSExpression *inputExpression = [NSExpression expressionWithMGLJSONObject:argumentObjects.firstObject]; + NSExpression *inputExpression = [NSExpression expressionWithMLNJSONObject:argumentObjects.firstObject]; NSArray *stopExpressions = [argumentObjects subarrayWithRange:NSMakeRange(1, argumentObjects.count - 1)]; NSMutableDictionary *stops = [NSMutableDictionary dictionaryWithCapacity:stopExpressions.count / 2]; NSEnumerator *stopEnumerator = stopExpressions.objectEnumerator; while (NSNumber *key = stopEnumerator.nextObject) { NSExpression *valueExpression = stopEnumerator.nextObject; - stops[key] = [NSExpression expressionWithMGLJSONObject:valueExpression]; + stops[key] = [NSExpression expressionWithMLNJSONObject:valueExpression]; } NSExpression *stopExpression = [NSExpression expressionForConstantValue:stops]; return [NSExpression mgl_expressionForInterpolatingExpression:inputExpression @@ -864,11 +864,11 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { parameters:curveParameterExpression stops:stopExpression]; } else if ([op isEqualToString:@"step"]) { - NSExpression *inputExpression = [NSExpression expressionWithMGLJSONObject:argumentObjects[0]]; + NSExpression *inputExpression = [NSExpression expressionWithMLNJSONObject:argumentObjects[0]]; NSArray *stopExpressions = [argumentObjects subarrayWithRange:NSMakeRange(1, argumentObjects.count - 1)]; NSExpression *minimum; if (stopExpressions.count % 2) { - minimum = [NSExpression expressionWithMGLJSONObject:stopExpressions.firstObject]; + minimum = [NSExpression expressionWithMLNJSONObject:stopExpressions.firstObject]; stopExpressions = [stopExpressions subarrayWithRange:NSMakeRange(1, stopExpressions.count - 1)]; } NSMutableDictionary *stops = [NSMutableDictionary dictionaryWithCapacity:stopExpressions.count / 2]; @@ -876,9 +876,9 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { while (NSNumber *key = stopEnumerator.nextObject) { NSExpression *valueExpression = stopEnumerator.nextObject; if (minimum) { - stops[key] = [NSExpression expressionWithMGLJSONObject:valueExpression]; + stops[key] = [NSExpression expressionWithMLNJSONObject:valueExpression]; } else { - minimum = [NSExpression expressionWithMGLJSONObject:valueExpression]; + minimum = [NSExpression expressionWithMLNJSONObject:valueExpression]; } } @@ -911,11 +911,11 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { for (NSUInteger index = 0; index < argumentObjects.count; index++) { if (index % 2 == 0 && index != argumentObjects.count - 1) { - NSPredicate *predicate = [NSPredicate predicateWithMGLJSONObject:argumentObjects[index]]; + NSPredicate *predicate = [NSPredicate predicateWithMLNJSONObject:argumentObjects[index]]; NSExpression *argument = [NSExpression expressionForConstantValue:predicate]; [arguments addObject:argument]; } else { - [arguments addObject:[NSExpression expressionWithMGLJSONObject:argumentObjects[index]]]; + [arguments addObject:[NSExpression expressionWithMLNJSONObject:argumentObjects[index]]]; } } @@ -923,35 +923,35 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { NSPredicate *conditional = [arguments.firstObject constantValue]; return [NSExpression expressionForConditional:conditional trueExpression:arguments[1] falseExpression:arguments[2]]; } - return [NSExpression expressionForFunction:@"MGL_IF" arguments:arguments]; + return [NSExpression expressionForFunction:@"MLN_IF" arguments:arguments]; } else if ([op isEqualToString:@"match"]) { NSMutableArray *optionsArray = [NSMutableArray array]; for (NSUInteger index = 0; index < argumentObjects.count; index++) { - NSExpression *option = [NSExpression expressionWithMGLJSONObject:argumentObjects[index]]; + NSExpression *option = [NSExpression expressionWithMLNJSONObject:argumentObjects[index]]; // match operators with arrays as matching values should not parse arrays as generic functions. if (index > 0 && index < argumentObjects.count - 1 && !(index % 2 == 0) && [argumentObjects[index] isKindOfClass:[NSArray class]]) { - option = [NSExpression expressionForAggregate:MGLSubexpressionsWithJSONObjects(argumentObjects[index])]; + option = [NSExpression expressionForAggregate:MLNSubexpressionsWithJSONObjects(argumentObjects[index])]; } [optionsArray addObject:option]; } - return [NSExpression expressionForFunction:@"MGL_MATCH" + return [NSExpression expressionForFunction:@"MLN_MATCH" arguments:optionsArray]; } else if ([op isEqualToString:@"format"]) { NSMutableArray *attributedExpressions = [NSMutableArray array]; for (NSUInteger index = 0; index < argumentObjects.count; index+=2) { - NSExpression *expression = [NSExpression expressionWithMGLJSONObject:argumentObjects[index]]; + NSExpression *expression = [NSExpression expressionWithMLNJSONObject:argumentObjects[index]]; NSMutableDictionary *attrs = [NSMutableDictionary dictionary]; if ((index + 1) < argumentObjects.count) { attrs = [NSMutableDictionary dictionaryWithDictionary:argumentObjects[index + 1]]; } for (NSString *key in attrs.allKeys) { - attrs[key] = [NSExpression expressionWithMGLJSONObject:attrs[key]]; + attrs[key] = [NSExpression expressionWithMLNJSONObject:attrs[key]]; } - MGLAttributedExpression *attributedExpression = [[MGLAttributedExpression alloc] initWithExpression:expression attributes:attrs]; + MLNAttributedExpression *attributedExpression = [[MLNAttributedExpression alloc] initWithExpression:expression attributes:attrs]; [attributedExpressions addObject:[NSExpression expressionForConstantValue:attributedExpression]]; } @@ -960,13 +960,13 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { } else if ([op isEqualToString:@"coalesce"]) { NSMutableArray *expressions = [NSMutableArray array]; for (id operand in argumentObjects) { - [expressions addObject:[NSExpression expressionWithMGLJSONObject:operand]]; + [expressions addObject:[NSExpression expressionWithMLNJSONObject:operand]]; } return [NSExpression expressionWithFormat:@"mgl_coalesce(%@)", expressions]; } else { - NSArray *subexpressions = MGLSubexpressionsWithJSONObjects(array); - return [NSExpression expressionForFunction:@"MGL_FUNCTION" arguments:subexpressions]; + NSArray *subexpressions = MLNSubexpressionsWithJSONObjects(array); + return [NSExpression expressionForFunction:@"MLN_FUNCTION" arguments:subexpressions]; } } @@ -979,7 +979,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { - (id)mgl_jsonExpressionObject { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - MGLExpressionOperatorsByFunctionNames = @{ + MLNExpressionOperatorsByFunctionNames = @{ @"add:to:": @"+", @"from:subtract:": @"-", @"multiply:by:": @"*", @@ -1005,8 +1005,8 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { @"mgl_log2:" : @"log2", @"mgl_distanceFrom:": @"distance", // Vararg aftermarket expressions need to be declared with an explicit and implicit first argument. - @"MGL_LET": @"let", - @"MGL_LET:": @"let", + @"MLN_LET": @"let", + @"MLN_LET:": @"let", }; }); @@ -1052,7 +1052,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { NSArray *collection = [constantValue mgl_jsonExpressionObject]; return @[@"literal", collection]; } - if ([constantValue isKindOfClass:[MGLColor class]]) { + if ([constantValue isKindOfClass:[MLNColor class]]) { auto color = [constantValue mgl_colorForPremultipliedValue]; if (color.a == 1) { return @[@"rgb", @(color.r * 255), @(color.g * 255), @(color.b * 255)]; @@ -1066,16 +1066,16 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { std::array mglValue = boxedValue.mgl_offsetArrayValue; return @[@"literal", @[@(mglValue[0]), @(mglValue[1])]]; } - if (strcmp([boxedValue objCType], @encode(MGLEdgeInsets)) == 0) { + if (strcmp([boxedValue objCType], @encode(MLNEdgeInsets)) == 0) { // padding [x, y] std::array mglValue = boxedValue.mgl_paddingArrayValue; return @[@"literal", @[@(mglValue[0]), @(mglValue[1]), @(mglValue[2]), @(mglValue[3])]]; } } - if ([constantValue isKindOfClass:[MGLAttributedExpression class]]) { - MGLAttributedExpression *attributedExpression = (MGLAttributedExpression *)constantValue; + if ([constantValue isKindOfClass:[MLNAttributedExpression class]]) { + MLNAttributedExpression *attributedExpression = (MLNAttributedExpression *)constantValue; id jsonObject = attributedExpression.expression.mgl_jsonExpressionObject; - NSMutableDictionary *attributedDictionary = [NSMutableDictionary dictionary]; + NSMutableDictionary *attributedDictionary = [NSMutableDictionary dictionary]; if (attributedExpression.attributes) { attributedDictionary = [NSMutableDictionary dictionaryWithDictionary:attributedExpression.attributes]; @@ -1087,8 +1087,8 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { } return @[jsonObject, attributedDictionary]; } - if ([constantValue isKindOfClass:[MGLShape class]]) { - MGLShape *shape = (MGLShape *)constantValue; + if ([constantValue isKindOfClass:[MLNShape class]]) { + MLNShape *shape = (MLNShape *)constantValue; return shape.geoJSONDictionary; } return self.constantValue; @@ -1115,7 +1115,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { NSString *function = self.function; BOOL hasCollectionProperty = !( ! [self.arguments.firstObject isKindOfClass: [NSExpression class]] || self.arguments.firstObject.expressionType != NSAggregateExpressionType || self.arguments.firstObject.expressionType == NSSubqueryExpressionType); - NSString *op = MGLExpressionOperatorsByFunctionNames[function]; + NSString *op = MLNExpressionOperatorsByFunctionNames[function]; if (op) { NSArray *arguments = self.arguments.mgl_jsonExpressionObject; return [@[op] arrayByAddingObjectsFromArray:arguments]; @@ -1219,12 +1219,12 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { }]; [expressionObject addObject:self.operand.mgl_jsonExpressionObject]; return expressionObject; - } else if ([function isEqualToString:@"MGL_IF"] || - [function isEqualToString:@"MGL_IF:"] || + } else if ([function isEqualToString:@"MLN_IF"] || + [function isEqualToString:@"MLN_IF:"] || [function isEqualToString:@"mgl_if:"]) { return self.mgl_jsonIfExpressionObject; - } else if ([function isEqualToString:@"MGL_MATCH"] || - [function isEqualToString:@"MGL_MATCH:"] || + } else if ([function isEqualToString:@"MLN_MATCH"] || + [function isEqualToString:@"MLN_MATCH:"] || [function isEqualToString:@"mgl_match:"]) { return self.mgl_jsonMatchExpressionObject; } else if ([function isEqualToString:@"mgl_coalesce:"] || @@ -1240,11 +1240,11 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { return @[@"to-number", object]; } #if TARGET_OS_IPHONE - else if ([type isEqualToString:@"UIColor"] || [type isEqualToString:@"MGLColor"]) { + else if ([type isEqualToString:@"UIColor"] || [type isEqualToString:@"MLNColor"]) { return @[@"to-color", object]; } #else - else if ([type isEqualToString:@"NSColor"] || [type isEqualToString:@"MGLColor"]) { + else if ([type isEqualToString:@"NSColor"] || [type isEqualToString:@"MLNColor"]) { return @[@"to-color", object]; } #endif @@ -1255,7 +1255,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { } if (([operand expressionType] != NSConstantValueExpressionType) || ([operand expressionType] == NSConstantValueExpressionType && - [[operand constantValue] isKindOfClass:[MGLColor class]])) { + [[operand constantValue] isKindOfClass:[MLNColor class]])) { return @[@"to-rgba", object]; } } @@ -1264,8 +1264,8 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { } else if ([function isEqualToString:@"mgl_attributed:"]) { return [self mgl_jsonFormatExpressionObject]; - } else if ([function isEqualToString:@"MGL_FUNCTION"] || - [function isEqualToString:@"MGL_FUNCTION:"]) { + } else if ([function isEqualToString:@"MLN_FUNCTION"] || + [function isEqualToString:@"MLN_FUNCTION:"]) { NSExpression *firstOp = self.arguments.firstObject; if (firstOp.expressionType == NSConstantValueExpressionType && [firstOp.constantValue isEqualToString:@"collator"]) { @@ -1291,7 +1291,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { } return self.arguments.mgl_jsonExpressionObject; - } else if (op == (NSString *) [MGLColor class] && [function isEqualToString:@"colorWithRed:green:blue:alpha:"]) { + } else if (op == (NSString *) [MLNColor class] && [function isEqualToString:@"colorWithRed:green:blue:alpha:"]) { NSArray *arguments = self.arguments.mgl_jsonExpressionObject; return [@[@"rgba"] arrayByAddingObjectsFromArray:arguments]; } else if ([function isEqualToString:@"median:"] || @@ -1414,7 +1414,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { } - (id)mgl_jsonMatchExpressionObject { - BOOL isAftermarketFunction = [self.function hasPrefix:@"MGL_MATCH"]; + BOOL isAftermarketFunction = [self.function hasPrefix:@"MLN_MATCH"]; NSUInteger minimumIndex = isAftermarketFunction ? 1 : 0; NSMutableArray *expressionObject = [NSMutableArray arrayWithObjects:@"match", (isAftermarketFunction ? self.arguments.firstObject : self.operand).mgl_jsonExpressionObject, nil]; @@ -1440,7 +1440,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { } - (id)mgl_jsonIfExpressionObject { - BOOL isAftermarketFunction = [self.function hasPrefix:@"MGL_IF"]; + BOOL isAftermarketFunction = [self.function hasPrefix:@"MLN_IF"]; NSUInteger minimumIndex = isAftermarketFunction ? 1 : 0; NSExpression *firstCondition; id condition; @@ -1522,7 +1522,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { If no localization takes place, this method returns the original collection. */ -NSArray *MGLLocalizedCollection(NSArray *collection, NSLocale * _Nullable locale) { +NSArray *MLNLocalizedCollection(NSArray *collection, NSLocale * _Nullable locale) { __block NSMutableArray *localizedCollection; [collection enumerateObjectsUsingBlock:^(NSExpression * _Nonnull item, NSUInteger idx, BOOL * _Nonnull stop) { NSExpression *localizedItem = [item mgl_expressionLocalizedIntoLocale:locale]; @@ -1542,7 +1542,7 @@ NSArray *MGLLocalizedCollection(NSArray *collect If no localization takes place, this method returns the original stop dictionary. */ -NSDictionary *MGLLocalizedStopDictionary(NSDictionary *stops, NSLocale * _Nullable locale) { +NSDictionary *MLNLocalizedStopDictionary(NSDictionary *stops, NSLocale * _Nullable locale) { __block NSMutableDictionary *localizedStops; [stops enumerateKeysAndObjectsUsingBlock:^(id _Nonnull zoomLevel, NSExpression * _Nonnull value, BOOL * _Nonnull stop) { if (![value isKindOfClass:[NSExpression class]]) { @@ -1563,19 +1563,19 @@ NSDictionary *MGLLocalizedStopDictionary(NSDictionar switch (self.expressionType) { case NSConstantValueExpressionType: { if ([self.constantValue isKindOfClass:[NSDictionary class]]) { - NSDictionary *localizedStops = MGLLocalizedStopDictionary(self.constantValue, locale); + NSDictionary *localizedStops = MLNLocalizedStopDictionary(self.constantValue, locale); if (localizedStops != self.constantValue) { return [NSExpression expressionForConstantValue:localizedStops]; } } else if ([self.constantValue isKindOfClass:[NSArray class]]) { - NSArray *localizedValues = MGLLocalizedCollection(self.constantValue, locale); + NSArray *localizedValues = MLNLocalizedCollection(self.constantValue, locale); if (localizedValues != self.constantValue) { return [NSExpression expressionForConstantValue:localizedValues]; } - } else if ([self.constantValue isKindOfClass:[MGLAttributedExpression class]]) { - MGLAttributedExpression *attributedExpression = (MGLAttributedExpression *)self.constantValue; + } else if ([self.constantValue isKindOfClass:[MLNAttributedExpression class]]) { + MLNAttributedExpression *attributedExpression = (MLNAttributedExpression *)self.constantValue; NSExpression *localizedExpression = [attributedExpression.expression mgl_expressionLocalizedIntoLocale:locale]; - MGLAttributedExpression *localizedAttributedExpression = [MGLAttributedExpression attributedExpression:localizedExpression attributes:attributedExpression.attributes]; + MLNAttributedExpression *localizedAttributedExpression = [MLNAttributedExpression attributedExpression:localizedExpression attributes:attributedExpression.attributes]; return [NSExpression expressionForConstantValue:localizedAttributedExpression]; } @@ -1587,7 +1587,7 @@ NSDictionary *MGLLocalizedStopDictionary(NSDictionar NSString *localizedKeyPath = @"name"; if (![locale.localeIdentifier isEqualToString:@"mul"]) { NSArray *preferences = locale ? @[locale.localeIdentifier] : [NSLocale preferredLanguages]; - NSString *preferredLanguage = [MGLVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences]; + NSString *preferredLanguage = [MLNVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences]; if (preferredLanguage) { localizedKeyPath = [NSString stringWithFormat:@"name_%@", preferredLanguage]; } @@ -1619,7 +1619,7 @@ NSDictionary *MGLLocalizedStopDictionary(NSDictionar NSExpression *localizedOperand = [operand mgl_expressionLocalizedIntoLocale:locale]; NSArray *arguments = self.arguments; - NSArray *localizedArguments = MGLLocalizedCollection(arguments, locale); + NSArray *localizedArguments = MLNLocalizedCollection(arguments, locale); if (localizedArguments != arguments) { return [NSExpression expressionForFunction:localizedOperand selectorName:self.function @@ -1649,7 +1649,7 @@ NSDictionary *MGLLocalizedStopDictionary(NSDictionar case NSAggregateExpressionType: { NSArray *collection = self.collection; if ([collection isKindOfClass:[NSArray class]]) { - NSArray *localizedCollection = MGLLocalizedCollection(collection, locale); + NSArray *localizedCollection = MLNLocalizedCollection(collection, locale); if (localizedCollection != collection) { return [NSExpression expressionForAggregate:localizedCollection]; } diff --git a/platform/ios/platform/darwin/src/NSExpression+MGLPrivateAdditions.h b/platform/ios/platform/darwin/src/NSExpression+MLNPrivateAdditions.h similarity index 76% rename from platform/ios/platform/darwin/src/NSExpression+MGLPrivateAdditions.h rename to platform/ios/platform/darwin/src/NSExpression+MLNPrivateAdditions.h index 54bc9068f..651e1e983 100644 --- a/platform/ios/platform/darwin/src/NSExpression+MGLPrivateAdditions.h +++ b/platform/ios/platform/darwin/src/NSExpression+MLNPrivateAdditions.h @@ -5,20 +5,20 @@ #import #endif -#import "NSExpression+MGLAdditions.h" +#import "NSExpression+MLNAdditions.h" #include NS_ASSUME_NONNULL_BEGIN -@interface NSObject (MGLExpressionAdditions) +@interface NSObject (MLNExpressionAdditions) - (nullable NSNumber *)mgl_number; - (nullable NSNumber *)mgl_numberWithFallbackValues:(id)fallbackValue, ... NS_REQUIRES_NIL_TERMINATION; @end -@interface NSExpression (MGLPrivateAdditions) +@interface NSExpression (MLNPrivateAdditions) @property (nonatomic, readonly) mbgl::Value mgl_constantMBGLValue; @property (nonatomic, readonly) std::vector mgl_aggregateMBGLValue; @@ -29,19 +29,19 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface NSNull (MGLExpressionAdditions) +@interface NSNull (MLNExpressionAdditions) @property (nonatomic, readonly) id mgl_jsonExpressionObject; @end -@interface NSString (MGLExpressionAdditions) +@interface NSString (MLNExpressionAdditions) @property (nonatomic, readonly) id mgl_jsonExpressionObject; @end -@interface NSNumber (MGLExpressionAdditions) +@interface NSNumber (MLNExpressionAdditions) - (id)mgl_interpolateWithCurveType:(NSString *)curveType parameters:(NSArray *)parameters stops:(NSDictionary *)stops; - (id)mgl_stepWithMinimum:(id)minimum stops:(NSDictionary *)stops; @@ -50,13 +50,13 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface NSArray (MGLExpressionAdditions) +@interface NSArray (MLNExpressionAdditions) @property (nonatomic, readonly) id mgl_jsonExpressionObject; @end -@interface NSDictionary (MGLExpressionAdditions) +@interface NSDictionary (MLNExpressionAdditions) @property (nonatomic, readonly) id mgl_jsonExpressionObject; @@ -64,13 +64,13 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface MGLColor (MGLExpressionAdditions) +@interface MLNColor (MLNExpressionAdditions) @property (nonatomic, readonly) id mgl_jsonExpressionObject; @end -@interface NSExpression (MGLExpressionAdditions) +@interface NSExpression (MLNExpressionAdditions) - (NSExpression *)mgl_expressionWithContext:(NSDictionary *)context; @@ -79,6 +79,6 @@ NS_ASSUME_NONNULL_BEGIN @end -FOUNDATION_EXTERN NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects); +FOUNDATION_EXTERN NSArray *MLNSubexpressionsWithJSONObjects(NSArray *objects); NS_ASSUME_NONNULL_END diff --git a/platform/ios/platform/darwin/src/NSPredicate+MGLAdditions.h b/platform/ios/platform/darwin/src/NSPredicate+MLNAdditions.h similarity index 90% rename from platform/ios/platform/darwin/src/NSPredicate+MGLAdditions.h rename to platform/ios/platform/darwin/src/NSPredicate+MLNAdditions.h index 48752b7ef..fb3021a49 100644 --- a/platform/ios/platform/darwin/src/NSPredicate+MGLAdditions.h +++ b/platform/ios/platform/darwin/src/NSPredicate+MLNAdditions.h @@ -2,7 +2,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface NSPredicate (MGLAdditions) +@interface NSPredicate (MLNAdditions) // MARK: Converting JSON Expressions @@ -20,9 +20,9 @@ NS_ASSUME_NONNULL_BEGIN @param object A Foundation object deserialized from JSON data, for example using `NSJSONSerialization`. @return An initialized predicate equivalent to `object`, suitable for use - with the `MGLVectorStyleLayer.predicate` property. + with the `MLNVectorStyleLayer.predicate` property. */ -+ (instancetype)predicateWithMGLJSONObject:(id)object NS_SWIFT_NAME(init(mglJSONObject:)); ++ (instancetype)predicateWithMLNJSONObject:(id)object NS_SWIFT_NAME(init(mglJSONObject:)); /** An equivalent Foundation object that can be serialized as JSON. diff --git a/platform/ios/platform/darwin/src/NSPredicate+MGLAdditions.mm b/platform/ios/platform/darwin/src/NSPredicate+MLNAdditions.mm similarity index 86% rename from platform/ios/platform/darwin/src/NSPredicate+MGLAdditions.mm rename to platform/ios/platform/darwin/src/NSPredicate+MLNAdditions.mm index 49974c243..5ccd5047f 100644 --- a/platform/ios/platform/darwin/src/NSPredicate+MGLAdditions.mm +++ b/platform/ios/platform/darwin/src/NSPredicate+MLNAdditions.mm @@ -1,12 +1,12 @@ -#import "NSPredicate+MGLPrivateAdditions.h" +#import "NSPredicate+MLNPrivateAdditions.h" -#import "MGLValueEvaluator.h" -#import "MGLStyleValue_Private.h" -#import "MGLLoggingConfiguration_Private.h" +#import "MLNValueEvaluator.h" +#import "MLNStyleValue_Private.h" +#import "MLNLoggingConfiguration_Private.h" #include -@implementation NSPredicate (MGLPrivateAdditions) +@implementation NSPredicate (MLNPrivateAdditions) - (mbgl::style::Filter)mgl_filter { @@ -27,8 +27,8 @@ + (instancetype)mgl_predicateWithFilter:(mbgl::style::Filter)filter { if (filter.expression) { - id jsonObject = MGLJSONObjectFromMBGLExpression(**filter.expression); - return [NSPredicate predicateWithMGLJSONObject:jsonObject]; + id jsonObject = MLNJSONObjectFromMBGLExpression(**filter.expression); + return [NSPredicate predicateWithMLNJSONObject:jsonObject]; } else { return nil; } @@ -36,18 +36,18 @@ @end -@implementation NSPredicate (MGLAdditions) +@implementation NSPredicate (MLNAdditions) -NSArray *MGLSubpredicatesWithJSONObjects(NSArray *objects) { +NSArray *MLNSubpredicatesWithJSONObjects(NSArray *objects) { NSMutableArray *subpredicates = [NSMutableArray arrayWithCapacity:objects.count]; for (id object in objects) { - NSPredicate *predicate = [NSPredicate predicateWithMGLJSONObject:object]; + NSPredicate *predicate = [NSPredicate predicateWithMLNJSONObject:object]; [subpredicates addObject:predicate]; } return subpredicates; } -static NSDictionary * const MGLPredicateOperatorTypesByJSONOperator = @{ +static NSDictionary * const MLNPredicateOperatorTypesByJSONOperator = @{ @"==": @(NSEqualToPredicateOperatorType), @"!=": @(NSNotEqualToPredicateOperatorType), @"<": @(NSLessThanPredicateOperatorType), @@ -57,7 +57,7 @@ static NSDictionary * const MGLPredicateOperatorTypesByJSONOperator = @{ @"in": @(NSInPredicateOperatorType), }; -+ (instancetype)predicateWithMGLJSONObject:(id)object { ++ (instancetype)predicateWithMLNJSONObject:(id)object { if ([object isEqual:@YES]) { return [NSPredicate predicateWithValue:YES]; } @@ -65,21 +65,21 @@ static NSDictionary * const MGLPredicateOperatorTypesByJSONOperator = @{ return [NSPredicate predicateWithValue:NO]; } - MGLAssert([object isKindOfClass:[NSArray class]], @"Condition for case expression should be an expression."); + MLNAssert([object isKindOfClass:[NSArray class]], @"Condition for case expression should be an expression."); NSArray *objects = (NSArray *)object; NSString *op = objects.firstObject; - NSNumber *operatorTypeNumber = MGLPredicateOperatorTypesByJSONOperator[op]; + NSNumber *operatorTypeNumber = MLNPredicateOperatorTypesByJSONOperator[op]; if (operatorTypeNumber) { NSPredicateOperatorType operatorType = (NSPredicateOperatorType)[operatorTypeNumber unsignedIntegerValue]; NSComparisonPredicateOptions options = 0; if (objects.count > 3) { NSArray *collatorExpression = objects[3]; - MGLCAssert([collatorExpression isKindOfClass:[NSArray class]], @"Collators must be dictionaries."); - MGLCAssert(collatorExpression.count == 2, @"Malformed collator expression"); + MLNCAssert([collatorExpression isKindOfClass:[NSArray class]], @"Collators must be dictionaries."); + MLNCAssert(collatorExpression.count == 2, @"Malformed collator expression"); NSDictionary *collator = collatorExpression[1]; - MGLCAssert([collator isKindOfClass:[NSDictionary class]], @"Malformed collator in collator expression"); + MLNCAssert([collator isKindOfClass:[NSDictionary class]], @"Malformed collator in collator expression"); // Predicate options can’t express specific locales as collators can. if (!collator[@"locale"]) { @@ -92,7 +92,7 @@ static NSDictionary * const MGLPredicateOperatorTypesByJSONOperator = @{ } } - NSArray *subexpressions = MGLSubexpressionsWithJSONObjects([objects subarrayWithRange:NSMakeRange(1, objects.count - 1)]); + NSArray *subexpressions = MLNSubexpressionsWithJSONObjects([objects subarrayWithRange:NSMakeRange(1, objects.count - 1)]); return [NSComparisonPredicate predicateWithLeftExpression:subexpressions[0] rightExpression:subexpressions[1] modifier:NSDirectPredicateModifier @@ -101,7 +101,7 @@ static NSDictionary * const MGLPredicateOperatorTypesByJSONOperator = @{ } if ([op isEqualToString:@"!"]) { - NSArray *subpredicates = MGLSubpredicatesWithJSONObjects([objects subarrayWithRange:NSMakeRange(1, objects.count - 1)]); + NSArray *subpredicates = MLNSubpredicatesWithJSONObjects([objects subarrayWithRange:NSMakeRange(1, objects.count - 1)]); if (subpredicates.count > 1) { NSCompoundPredicate *predicate = [NSCompoundPredicate orPredicateWithSubpredicates:subpredicates]; return [NSCompoundPredicate notPredicateWithSubpredicate:predicate]; @@ -112,7 +112,7 @@ static NSDictionary * const MGLPredicateOperatorTypesByJSONOperator = @{ return [NSPredicate predicateWithValue:YES]; } if ([op isEqualToString:@"all"]) { - NSArray *subpredicates = MGLSubpredicatesWithJSONObjects([objects subarrayWithRange:NSMakeRange(1, objects.count - 1)]); + NSArray *subpredicates = MLNSubpredicatesWithJSONObjects([objects subarrayWithRange:NSMakeRange(1, objects.count - 1)]); if (subpredicates.count == 2) { // Determine if the expression is of BETWEEN type if ([subpredicates[0] isKindOfClass:[NSComparisonPredicate class]] && @@ -152,11 +152,11 @@ static NSDictionary * const MGLPredicateOperatorTypesByJSONOperator = @{ return [NSCompoundPredicate andPredicateWithSubpredicates:subpredicates]; } if ([op isEqualToString:@"any"]) { - NSArray *subpredicates = MGLSubpredicatesWithJSONObjects([objects subarrayWithRange:NSMakeRange(1, objects.count - 1)]); + NSArray *subpredicates = MLNSubpredicatesWithJSONObjects([objects subarrayWithRange:NSMakeRange(1, objects.count - 1)]); return [NSCompoundPredicate orPredicateWithSubpredicates:subpredicates]; } if ([op isEqualToString:@"within"]) { - NSArray *subexpressions = MGLSubexpressionsWithJSONObjects([objects subarrayWithRange:NSMakeRange(1, objects.count - 1)]); + NSArray *subexpressions = MLNSubexpressionsWithJSONObjects([objects subarrayWithRange:NSMakeRange(1, objects.count - 1)]); return [NSComparisonPredicate predicateWithLeftExpression:[NSExpression expressionForEvaluatedObject] rightExpression:subexpressions[0] modifier:NSDirectPredicateModifier @@ -164,7 +164,7 @@ static NSDictionary * const MGLPredicateOperatorTypesByJSONOperator = @{ options:0]; } - NSExpression *expression = [NSExpression expressionWithMGLJSONObject:object]; + NSExpression *expression = [NSExpression expressionWithMLNJSONObject:object]; return [NSComparisonPredicate predicateWithLeftExpression:expression rightExpression:[NSExpression expressionForConstantValue:@YES] modifier:NSDirectPredicateModifier @@ -193,7 +193,7 @@ static NSDictionary * const MGLPredicateOperatorTypesByJSONOperator = @{ @end -@implementation NSPredicate (MGLExpressionAdditions) +@implementation NSPredicate (MLNExpressionAdditions) - (id)mgl_if:(id)firstValue, ... { diff --git a/platform/ios/platform/darwin/src/NSPredicate+MGLPrivateAdditions.h b/platform/ios/platform/darwin/src/NSPredicate+MLNPrivateAdditions.h similarity index 72% rename from platform/ios/platform/darwin/src/NSPredicate+MGLPrivateAdditions.h rename to platform/ios/platform/darwin/src/NSPredicate+MLNPrivateAdditions.h index 051a2775a..cc30e8626 100644 --- a/platform/ios/platform/darwin/src/NSPredicate+MGLPrivateAdditions.h +++ b/platform/ios/platform/darwin/src/NSPredicate+MLNPrivateAdditions.h @@ -1,12 +1,12 @@ #import -#import "NSPredicate+MGLAdditions.h" +#import "NSPredicate+MLNAdditions.h" #include NS_ASSUME_NONNULL_BEGIN -@interface NSPredicate (MGLPrivateAdditions) +@interface NSPredicate (MLNPrivateAdditions) - (mbgl::style::Filter)mgl_filter; @@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface NSPredicate (MGLExpressionAdditions) +@interface NSPredicate (MLNExpressionAdditions) - (nullable id)mgl_if:(id)firstValue, ...; diff --git a/platform/ios/platform/darwin/src/NSString+MGLAdditions.h b/platform/ios/platform/darwin/src/NSString+MLNAdditions.h similarity index 94% rename from platform/ios/platform/darwin/src/NSString+MGLAdditions.h rename to platform/ios/platform/darwin/src/NSString+MLNAdditions.h index 4888c7a00..02b1f1510 100644 --- a/platform/ios/platform/darwin/src/NSString+MGLAdditions.h +++ b/platform/ios/platform/darwin/src/NSString+MLNAdditions.h @@ -2,7 +2,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface NSString (MGLAdditions) +@interface NSString (MLNAdditions) /** Returns the range spanning the entire receiver. */ - (NSRange)mgl_wholeRange; @@ -33,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface NSAttributedString (MGLAdditions) +@interface NSAttributedString (MLNAdditions) /** Returns the range spanning the entire receiver. */ - (NSRange)mgl_wholeRange; diff --git a/platform/ios/platform/darwin/src/NSString+MGLAdditions.m b/platform/ios/platform/darwin/src/NSString+MLNAdditions.m similarity index 96% rename from platform/ios/platform/darwin/src/NSString+MGLAdditions.m rename to platform/ios/platform/darwin/src/NSString+MLNAdditions.m index d452d5667..467054f17 100644 --- a/platform/ios/platform/darwin/src/NSString+MGLAdditions.m +++ b/platform/ios/platform/darwin/src/NSString+MLNAdditions.m @@ -1,10 +1,10 @@ -#import "NSString+MGLAdditions.h" +#import "NSString+MLNAdditions.h" #if TARGET_OS_OSX #import #endif -@implementation NSString (MGLAdditions) +@implementation NSString (MLNAdditions) - (NSRange)mgl_wholeRange { return NSMakeRange(0, self.length); @@ -63,7 +63,7 @@ @end -@implementation NSAttributedString (MGLAdditions) +@implementation NSAttributedString (MLNAdditions) - (NSRange)mgl_wholeRange { return NSMakeRange(0, self.length); diff --git a/platform/ios/platform/darwin/src/NSURL+MGLAdditions.h b/platform/ios/platform/darwin/src/NSURL+MLNAdditions.h similarity index 89% rename from platform/ios/platform/darwin/src/NSURL+MGLAdditions.h rename to platform/ios/platform/darwin/src/NSURL+MLNAdditions.h index 9845a180d..c40592d02 100644 --- a/platform/ios/platform/darwin/src/NSURL+MGLAdditions.h +++ b/platform/ios/platform/darwin/src/NSURL+MLNAdditions.h @@ -2,7 +2,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface NSURL (MGLAdditions) +@interface NSURL (MLNAdditions) /** Returns the given URL, modified if necessary to use the asset: URL scheme diff --git a/platform/ios/platform/darwin/src/NSURL+MGLAdditions.m b/platform/ios/platform/darwin/src/NSURL+MLNAdditions.m similarity index 84% rename from platform/ios/platform/darwin/src/NSURL+MGLAdditions.m rename to platform/ios/platform/darwin/src/NSURL+MLNAdditions.m index 09fdd5c88..c6792bd3e 100644 --- a/platform/ios/platform/darwin/src/NSURL+MGLAdditions.m +++ b/platform/ios/platform/darwin/src/NSURL+MLNAdditions.m @@ -1,6 +1,6 @@ -#import "NSURL+MGLAdditions.h" +#import "NSURL+MLNAdditions.h" -@implementation NSURL (MGLAdditions) +@implementation NSURL (MLNAdditions) - (nullable NSURL *)mgl_URLByStandardizingScheme { if (!self.scheme) { diff --git a/platform/ios/platform/darwin/src/NSValue+MGLAdditions.m b/platform/ios/platform/darwin/src/NSValue+MGLAdditions.m deleted file mode 100644 index 52f26ecee..000000000 --- a/platform/ios/platform/darwin/src/NSValue+MGLAdditions.m +++ /dev/null @@ -1,104 +0,0 @@ -#import "NSValue+MGLAdditions.h" - -@implementation NSValue (MGLAdditions) - -// MARK: Geometry - -+ (instancetype)valueWithMGLCoordinate:(CLLocationCoordinate2D)coordinate { - return [self valueWithBytes:&coordinate objCType:@encode(CLLocationCoordinate2D)]; -} - -- (CLLocationCoordinate2D)MGLCoordinateValue { - CLLocationCoordinate2D coordinate; - [self getValue:&coordinate]; - return coordinate; -} - -+ (instancetype)valueWithMGLMapPoint:(MGLMapPoint)point { - return [self valueWithBytes:&point objCType:@encode(MGLMapPoint)]; -} - --(MGLMapPoint) MGLMapPointValue { - MGLMapPoint point; - [self getValue:&point]; - return point; -} - -+ (instancetype)valueWithMGLCoordinateSpan:(MGLCoordinateSpan)span { - return [self valueWithBytes:&span objCType:@encode(MGLCoordinateSpan)]; -} - -- (MGLCoordinateSpan)MGLCoordinateSpanValue { - MGLCoordinateSpan span; - [self getValue:&span]; - return span; -} - -+ (instancetype)valueWithMGLCoordinateBounds:(MGLCoordinateBounds)bounds { - return [self valueWithBytes:&bounds objCType:@encode(MGLCoordinateBounds)]; -} - -- (MGLCoordinateBounds)MGLCoordinateBoundsValue { - MGLCoordinateBounds bounds; - [self getValue:&bounds]; - return bounds; -} - -+ (instancetype)valueWithMGLCoordinateQuad:(MGLCoordinateQuad)quad { - return [self valueWithBytes:&quad objCType:@encode(MGLCoordinateQuad)]; -} - -- (MGLCoordinateQuad)MGLCoordinateQuadValue { - MGLCoordinateQuad quad; - [self getValue:&quad]; - return quad; -} - -// MARK: Offline maps - -+ (NSValue *)valueWithMGLOfflinePackProgress:(MGLOfflinePackProgress)progress { - return [NSValue value:&progress withObjCType:@encode(MGLOfflinePackProgress)]; -} - -- (MGLOfflinePackProgress)MGLOfflinePackProgressValue { - MGLOfflinePackProgress progress; - [self getValue:&progress]; - return progress; -} - -// MARK: Working with Transition Values - -+ (NSValue *)valueWithMGLTransition:(MGLTransition)transition { - return [NSValue value:&transition withObjCType:@encode(MGLTransition)]; -} - -- (MGLTransition)MGLTransitionValue { - MGLTransition transition; - [self getValue:&transition]; - return transition; -} - -+ (NSValue *)valueWithMGLSphericalPosition:(MGLSphericalPosition)lightPosition -{ - return [NSValue value:&lightPosition withObjCType:@encode(MGLSphericalPosition)]; -} - -- (MGLSphericalPosition)MGLSphericalPositionValue -{ - MGLSphericalPosition lightPosition; - [self getValue:&lightPosition]; - return lightPosition; -} - -+ (NSValue *)valueWithMGLLightAnchor:(MGLLightAnchor)lightAnchor { - return [NSValue value:&lightAnchor withObjCType:@encode(MGLLightAnchor)]; -} - -- (MGLLightAnchor)MGLLightAnchorValue -{ - MGLLightAnchor achorType; - [self getValue:&achorType]; - return achorType; -} - -@end diff --git a/platform/ios/platform/darwin/src/NSValue+MGLAdditions.h b/platform/ios/platform/darwin/src/NSValue+MLNAdditions.h similarity index 59% rename from platform/ios/platform/darwin/src/NSValue+MGLAdditions.h rename to platform/ios/platform/darwin/src/NSValue+MLNAdditions.h index 553fda0e0..c1baedcdf 100644 --- a/platform/ios/platform/darwin/src/NSValue+MGLAdditions.h +++ b/platform/ios/platform/darwin/src/NSValue+MLNAdditions.h @@ -1,16 +1,16 @@ #import -#import "MGLGeometry.h" -#import "MGLLight.h" -#import "MGLOfflinePack.h" -#import "MGLTypes.h" +#import "MLNGeometry.h" +#import "MLNLight.h" +#import "MLNOfflinePack.h" +#import "MLNTypes.h" NS_ASSUME_NONNULL_BEGIN /** Methods for round-tripping values for Mapbox-defined types. */ -@interface NSValue (MGLAdditions) +@interface NSValue (MLNAdditions) // MARK: Working with Geographic Coordinate Values @@ -21,12 +21,12 @@ NS_ASSUME_NONNULL_BEGIN @param coordinate The value for the new object. @return A new value object that contains the geographic coordinate information. */ -+ (instancetype)valueWithMGLCoordinate:(CLLocationCoordinate2D)coordinate; ++ (instancetype)valueWithMLNCoordinate:(CLLocationCoordinate2D)coordinate; /** The Core Location geographic coordinate structure representation of the value. */ -@property (readonly) CLLocationCoordinate2D MGLCoordinateValue; +@property (readonly) CLLocationCoordinate2D MLNCoordinateValue; /** Creates a new value object containing the specified Mapbox map point structure. @@ -34,12 +34,12 @@ NS_ASSUME_NONNULL_BEGIN @param point The value for the new object. @return A new value object that contains the coordinate and zoom level information. */ -+ (instancetype)valueWithMGLMapPoint:(MGLMapPoint)point; ++ (instancetype)valueWithMLNMapPoint:(MLNMapPoint)point; /** The Mapbox map point structure representation of the value. */ -@property (readonly) MGLMapPoint MGLMapPointValue; +@property (readonly) MLNMapPoint MLNMapPointValue; /** Creates a new value object containing the specified Mapbox coordinate span @@ -48,12 +48,12 @@ NS_ASSUME_NONNULL_BEGIN @param span The value for the new object. @return A new value object that contains the coordinate span information. */ -+ (instancetype)valueWithMGLCoordinateSpan:(MGLCoordinateSpan)span; ++ (instancetype)valueWithMLNCoordinateSpan:(MLNCoordinateSpan)span; /** The Mapbox coordinate span structure representation of the value. */ -@property (readonly) MGLCoordinateSpan MGLCoordinateSpanValue; +@property (readonly) MLNCoordinateSpan MLNCoordinateSpanValue; /** Creates a new value object containing the specified Mapbox coordinate bounds @@ -62,12 +62,12 @@ NS_ASSUME_NONNULL_BEGIN @param bounds The value for the new object. @return A new value object that contains the coordinate bounds information. */ -+ (instancetype)valueWithMGLCoordinateBounds:(MGLCoordinateBounds)bounds; ++ (instancetype)valueWithMLNCoordinateBounds:(MLNCoordinateBounds)bounds; /** The Mapbox coordinate bounds structure representation of the value. */ -@property (readonly) MGLCoordinateBounds MGLCoordinateBoundsValue; +@property (readonly) MLNCoordinateBounds MLNCoordinateBoundsValue; /** Creates a new value object containing the specified Mapbox coordinate @@ -76,72 +76,72 @@ NS_ASSUME_NONNULL_BEGIN @param quad The value for the new object. @return A new value object that contains the coordinate quad information. */ -+ (instancetype)valueWithMGLCoordinateQuad:(MGLCoordinateQuad)quad; ++ (instancetype)valueWithMLNCoordinateQuad:(MLNCoordinateQuad)quad; /** The Mapbox coordinate quad structure representation of the value. */ -- (MGLCoordinateQuad)MGLCoordinateQuadValue; +- (MLNCoordinateQuad)MLNCoordinateQuadValue; // MARK: Working with Offline Map Values /** - Creates a new value object containing the given `MGLOfflinePackProgress` + Creates a new value object containing the given `MLNOfflinePackProgress` structure. @param progress The value for the new object. @return A new value object that contains the offline pack progress information. */ -+ (NSValue *)valueWithMGLOfflinePackProgress:(MGLOfflinePackProgress)progress; ++ (NSValue *)valueWithMLNOfflinePackProgress:(MLNOfflinePackProgress)progress; /** - The `MGLOfflinePackProgress` structure representation of the value. + The `MLNOfflinePackProgress` structure representation of the value. */ -@property (readonly) MGLOfflinePackProgress MGLOfflinePackProgressValue; +@property (readonly) MLNOfflinePackProgress MLNOfflinePackProgressValue; // MARK: Working with Transition Values /** - Creates a new value object containing the given `MGLTransition` + Creates a new value object containing the given `MLNTransition` structure. @param transition The value for the new object. @return A new value object that contains the transition information. */ -+ (NSValue *)valueWithMGLTransition:(MGLTransition)transition; ++ (NSValue *)valueWithMLNTransition:(MLNTransition)transition; /** - The `MGLTransition` structure representation of the value. + The `MLNTransition` structure representation of the value. */ -@property (readonly) MGLTransition MGLTransitionValue; +@property (readonly) MLNTransition MLNTransitionValue; /** - Creates a new value object containing the given `MGLSphericalPosition` + Creates a new value object containing the given `MLNSphericalPosition` structure. @param lightPosition The value for the new object. @return A new value object that contains the light position information. */ -+ (instancetype)valueWithMGLSphericalPosition:(MGLSphericalPosition)lightPosition; ++ (instancetype)valueWithMLNSphericalPosition:(MLNSphericalPosition)lightPosition; /** - The `MGLSphericalPosition` structure representation of the value. + The `MLNSphericalPosition` structure representation of the value. */ -@property (readonly) MGLSphericalPosition MGLSphericalPositionValue; +@property (readonly) MLNSphericalPosition MLNSphericalPositionValue; /** - Creates a new value object containing the given `MGLLightAnchor` + Creates a new value object containing the given `MLNLightAnchor` enum. @param lightAnchor The value for the new object. @return A new value object that contains the light anchor information. */ -+ (NSValue *)valueWithMGLLightAnchor:(MGLLightAnchor)lightAnchor; ++ (NSValue *)valueWithMLNLightAnchor:(MLNLightAnchor)lightAnchor; /** - The `MGLLightAnchor` enum representation of the value. + The `MLNLightAnchor` enum representation of the value. */ -@property (readonly) MGLLightAnchor MGLLightAnchorValue; +@property (readonly) MLNLightAnchor MLNLightAnchorValue; @end diff --git a/platform/ios/platform/darwin/src/NSValue+MLNAdditions.m b/platform/ios/platform/darwin/src/NSValue+MLNAdditions.m new file mode 100644 index 000000000..a736e3e5d --- /dev/null +++ b/platform/ios/platform/darwin/src/NSValue+MLNAdditions.m @@ -0,0 +1,104 @@ +#import "NSValue+MLNAdditions.h" + +@implementation NSValue (MLNAdditions) + +// MARK: Geometry + ++ (instancetype)valueWithMLNCoordinate:(CLLocationCoordinate2D)coordinate { + return [self valueWithBytes:&coordinate objCType:@encode(CLLocationCoordinate2D)]; +} + +- (CLLocationCoordinate2D)MLNCoordinateValue { + CLLocationCoordinate2D coordinate; + [self getValue:&coordinate]; + return coordinate; +} + ++ (instancetype)valueWithMLNMapPoint:(MLNMapPoint)point { + return [self valueWithBytes:&point objCType:@encode(MLNMapPoint)]; +} + +-(MLNMapPoint) MLNMapPointValue { + MLNMapPoint point; + [self getValue:&point]; + return point; +} + ++ (instancetype)valueWithMLNCoordinateSpan:(MLNCoordinateSpan)span { + return [self valueWithBytes:&span objCType:@encode(MLNCoordinateSpan)]; +} + +- (MLNCoordinateSpan)MLNCoordinateSpanValue { + MLNCoordinateSpan span; + [self getValue:&span]; + return span; +} + ++ (instancetype)valueWithMLNCoordinateBounds:(MLNCoordinateBounds)bounds { + return [self valueWithBytes:&bounds objCType:@encode(MLNCoordinateBounds)]; +} + +- (MLNCoordinateBounds)MLNCoordinateBoundsValue { + MLNCoordinateBounds bounds; + [self getValue:&bounds]; + return bounds; +} + ++ (instancetype)valueWithMLNCoordinateQuad:(MLNCoordinateQuad)quad { + return [self valueWithBytes:&quad objCType:@encode(MLNCoordinateQuad)]; +} + +- (MLNCoordinateQuad)MLNCoordinateQuadValue { + MLNCoordinateQuad quad; + [self getValue:&quad]; + return quad; +} + +// MARK: Offline maps + ++ (NSValue *)valueWithMLNOfflinePackProgress:(MLNOfflinePackProgress)progress { + return [NSValue value:&progress withObjCType:@encode(MLNOfflinePackProgress)]; +} + +- (MLNOfflinePackProgress)MLNOfflinePackProgressValue { + MLNOfflinePackProgress progress; + [self getValue:&progress]; + return progress; +} + +// MARK: Working with Transition Values + ++ (NSValue *)valueWithMLNTransition:(MLNTransition)transition { + return [NSValue value:&transition withObjCType:@encode(MLNTransition)]; +} + +- (MLNTransition)MLNTransitionValue { + MLNTransition transition; + [self getValue:&transition]; + return transition; +} + ++ (NSValue *)valueWithMLNSphericalPosition:(MLNSphericalPosition)lightPosition +{ + return [NSValue value:&lightPosition withObjCType:@encode(MLNSphericalPosition)]; +} + +- (MLNSphericalPosition)MLNSphericalPositionValue +{ + MLNSphericalPosition lightPosition; + [self getValue:&lightPosition]; + return lightPosition; +} + ++ (NSValue *)valueWithMLNLightAnchor:(MLNLightAnchor)lightAnchor { + return [NSValue value:&lightAnchor withObjCType:@encode(MLNLightAnchor)]; +} + +- (MLNLightAnchor)MLNLightAnchorValue +{ + MLNLightAnchor achorType; + [self getValue:&achorType]; + return achorType; +} + +@end diff --git a/platform/ios/platform/darwin/src/NSValue+MGLStyleAttributeAdditions.h b/platform/ios/platform/darwin/src/NSValue+MLNStyleAttributeAdditions.h similarity index 88% rename from platform/ios/platform/darwin/src/NSValue+MGLStyleAttributeAdditions.h rename to platform/ios/platform/darwin/src/NSValue+MLNStyleAttributeAdditions.h index 0f1e51169..3d1d8e896 100644 --- a/platform/ios/platform/darwin/src/NSValue+MGLStyleAttributeAdditions.h +++ b/platform/ios/platform/darwin/src/NSValue+MLNStyleAttributeAdditions.h @@ -2,7 +2,7 @@ #include -@interface NSValue (MGLStyleAttributeAdditions) +@interface NSValue (MLNStyleAttributeAdditions) + (instancetype)mgl_valueWithOffsetArray:(std::array)offsetArray; + (instancetype)mgl_valueWithPaddingArray:(std::array)paddingArray; diff --git a/platform/ios/platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm b/platform/ios/platform/darwin/src/NSValue+MLNStyleAttributeAdditions.mm similarity index 75% rename from platform/ios/platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm rename to platform/ios/platform/darwin/src/NSValue+MLNStyleAttributeAdditions.mm index aa3e003d0..5a8151102 100644 --- a/platform/ios/platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm +++ b/platform/ios/platform/darwin/src/NSValue+MLNStyleAttributeAdditions.mm @@ -1,12 +1,12 @@ -#import "NSValue+MGLStyleAttributeAdditions.h" -#import "MGLLight.h" -#import "MGLLoggingConfiguration_Private.h" -#import "MGLGeometry_Private.h" +#import "NSValue+MLNStyleAttributeAdditions.h" +#import "MLNLight.h" +#import "MLNLoggingConfiguration_Private.h" +#import "MLNGeometry_Private.h" #if TARGET_OS_IPHONE #import #endif -@implementation NSValue (MGLStyleAttributeAdditions) +@implementation NSValue (MLNStyleAttributeAdditions) + (instancetype)mgl_valueWithOffsetArray:(std::array)offsetArray { @@ -23,18 +23,18 @@ { // Style specification defines padding in clockwise order: top, right, bottom, left. // Foundation defines padding in counterclockwise order: top, left, bottom, right. - MGLEdgeInsets insets = { + MLNEdgeInsets insets = { .top = paddingArray[0], .right = paddingArray[1], .bottom = paddingArray[2], .left = paddingArray[3], }; - return [NSValue value:&insets withObjCType:@encode(MGLEdgeInsets)]; + return [NSValue value:&insets withObjCType:@encode(MLNEdgeInsets)]; } - (std::array)mgl_offsetArrayValue { - MGLAssert(strcmp(self.objCType, @encode(CGVector)) == 0, @"Value does not represent a CGVector"); + MLNAssert(strcmp(self.objCType, @encode(CGVector)) == 0, @"Value does not represent a CGVector"); CGVector vector; [self getValue:&vector]; #if !TARGET_OS_IPHONE @@ -48,8 +48,8 @@ - (std::array)mgl_paddingArrayValue { - MGLAssert(strcmp(self.objCType, @encode(MGLEdgeInsets)) == 0, @"Value does not represent an NSEdgeInsets/UIEdgeInsets"); - MGLEdgeInsets insets; + MLNAssert(strcmp(self.objCType, @encode(MLNEdgeInsets)) == 0, @"Value does not represent an NSEdgeInsets/UIEdgeInsets"); + MLNEdgeInsets insets; [self getValue:&insets]; // Style specification defines padding in clockwise order: top, right, bottom, left. return { @@ -62,8 +62,8 @@ - (std::array)mgl_lightPositionArrayValue { - MGLAssert(strcmp(self.objCType, @encode(MGLSphericalPosition)) == 0, @"Value does not represent an MGLSphericalPosition"); - MGLSphericalPosition lightPosition; + MLNAssert(strcmp(self.objCType, @encode(MLNSphericalPosition)) == 0, @"Value does not represent an MLNSphericalPosition"); + MLNSphericalPosition lightPosition; [self getValue:&lightPosition]; // Style specification defines padding in clockwise order: top, right, bottom, left. return { diff --git a/platform/ios/platform/darwin/test/MGLAttributionInfoTests.m b/platform/ios/platform/darwin/test/MLNAttributionInfoTests.m similarity index 83% rename from platform/ios/platform/darwin/test/MGLAttributionInfoTests.m rename to platform/ios/platform/darwin/test/MLNAttributionInfoTests.m index 896c7ce84..8c4eb9bae 100644 --- a/platform/ios/platform/darwin/test/MGLAttributionInfoTests.m +++ b/platform/ios/platform/darwin/test/MLNAttributionInfoTests.m @@ -1,20 +1,20 @@ #import #import -#import "MGLAttributionInfo_Private.h" +#import "MLNAttributionInfo_Private.h" -@interface MGLAttributionInfoTests : XCTestCase +@interface MLNAttributionInfoTests : XCTestCase @end -@implementation MGLAttributionInfoTests +@implementation MLNAttributionInfoTests - (void)setUp { - [MGLSettings setApiKey:@"pk.feedcafedeadbeefbadebede"]; + [MLNSettings setApiKey:@"pk.feedcafedeadbeefbadebede"]; } - (void)tearDown { - [MGLSettings setApiKey:nil]; + [MLNSettings setApiKey:nil]; } - (void)testParsing { @@ -25,9 +25,9 @@ @"Improve this map", }; - NSMutableArray *infos = [NSMutableArray array]; + NSMutableArray *infos = [NSMutableArray array]; for (NSUInteger i = 0; i < sizeof(htmlStrings) / sizeof(htmlStrings[0]); i++) { - NSArray *subinfos = [MGLAttributionInfo attributionInfosFromHTMLString:htmlStrings[i] + NSArray *subinfos = [MLNAttributionInfo attributionInfosFromHTMLString:htmlStrings[i] fontSize:0 linkColor:nil]; [infos growArrayByAddingAttributionInfosFromArray:subinfos]; @@ -54,10 +54,10 @@ }; CGFloat fontSize = 72; - MGLColor *color = [MGLColor redColor]; - NSMutableArray *infos = [NSMutableArray array]; + MLNColor *color = [MLNColor redColor]; + NSMutableArray *infos = [NSMutableArray array]; for (NSUInteger i = 0; i < sizeof(htmlStrings) / sizeof(htmlStrings[0]); i++) { - NSArray *subinfos = [MGLAttributionInfo attributionInfosFromHTMLString:htmlStrings[i] + NSArray *subinfos = [MLNAttributionInfo attributionInfosFromHTMLString:htmlStrings[i] fontSize:72 linkColor:color]; [infos growArrayByAddingAttributionInfosFromArray:subinfos]; @@ -79,7 +79,7 @@ CGFloat r, g, b, a; [color getRed:&r green:&g blue:&b alpha:&a]; - MGLColor *linkColor = [infos[0].title attribute:NSForegroundColorAttributeName atIndex:0 effectiveRange:nil]; + MLNColor *linkColor = [infos[0].title attribute:NSForegroundColorAttributeName atIndex:0 effectiveRange:nil]; CGFloat linkR, linkG, linkB, linkA; [linkColor getRed:&linkR green:&linkG blue:&linkB alpha:&linkA]; XCTAssertEqual(r, linkR); @@ -97,9 +97,9 @@ @"Hello World", }; - NSMutableArray *infos = [NSMutableArray array]; + NSMutableArray *infos = [NSMutableArray array]; for (NSUInteger i = 0; i < sizeof(htmlStrings) / sizeof(htmlStrings[0]); i++) { - NSArray *subinfos = [MGLAttributionInfo attributionInfosFromHTMLString:htmlStrings[i] + NSArray *subinfos = [MLNAttributionInfo attributionInfosFromHTMLString:htmlStrings[i] fontSize:0 linkColor:nil]; [infos growArrayByAddingAttributionInfosFromArray:subinfos]; diff --git a/platform/ios/platform/darwin/test/MGLClockDirectionFormatterTests.m b/platform/ios/platform/darwin/test/MLNClockDirectionFormatterTests.m similarity index 91% rename from platform/ios/platform/darwin/test/MGLClockDirectionFormatterTests.m rename to platform/ios/platform/darwin/test/MLNClockDirectionFormatterTests.m index 05ebc3af2..7af3644ed 100644 --- a/platform/ios/platform/darwin/test/MGLClockDirectionFormatterTests.m +++ b/platform/ios/platform/darwin/test/MLNClockDirectionFormatterTests.m @@ -1,19 +1,19 @@ #import #import -@interface MGLClockDirectionFormatterTests : XCTestCase +@interface MLNClockDirectionFormatterTests : XCTestCase @end -@implementation MGLClockDirectionFormatterTests +@implementation MLNClockDirectionFormatterTests - (void)testClockDirections { - MGLClockDirectionFormatter *shortFormatter = [[MGLClockDirectionFormatter alloc] init]; + MLNClockDirectionFormatter *shortFormatter = [[MLNClockDirectionFormatter alloc] init]; shortFormatter.unitStyle = NSFormattingUnitStyleShort; - MGLClockDirectionFormatter *mediumFormatter = [[MGLClockDirectionFormatter alloc] init]; + MLNClockDirectionFormatter *mediumFormatter = [[MLNClockDirectionFormatter alloc] init]; - MGLClockDirectionFormatter *longFormatter = [[MGLClockDirectionFormatter alloc] init]; + MLNClockDirectionFormatter *longFormatter = [[MLNClockDirectionFormatter alloc] init]; longFormatter.unitStyle = NSFormattingUnitStyleLong; CLLocationDirection direction; diff --git a/platform/ios/platform/darwin/test/MGLCodingTests.mm b/platform/ios/platform/darwin/test/MLNCodingTests.mm similarity index 79% rename from platform/ios/platform/darwin/test/MGLCodingTests.mm rename to platform/ios/platform/darwin/test/MLNCodingTests.mm index e6417c99f..61180bb43 100644 --- a/platform/ios/platform/darwin/test/MGLCodingTests.mm +++ b/platform/ios/platform/darwin/test/MLNCodingTests.mm @@ -1,51 +1,51 @@ #import #import -#import "MGLFoundation_Private.h" -#import "MGLCluster.h" +#import "MLNFoundation_Private.h" +#import "MLNCluster.h" #if TARGET_OS_IPHONE -#import "MGLUserLocation_Private.h" +#import "MLNUserLocation_Private.h" #endif -@interface MGLCodingTests : XCTestCase +@interface MLNCodingTests : XCTestCase @end -@implementation MGLCodingTests +@implementation MLNCodingTests - (NSString *)temporaryFilePathForClass:(Class)clazz { return [NSTemporaryDirectory() stringByAppendingPathComponent:NSStringFromClass(clazz)]; } - (void)testPointAnnotation { - MGLPointAnnotation *annotation = [[MGLPointAnnotation alloc] init]; + MLNPointAnnotation *annotation = [[MLNPointAnnotation alloc] init]; annotation.coordinate = CLLocationCoordinate2DMake(0.5, 0.5); annotation.title = @"title"; annotation.subtitle = @"subtitle"; - NSString *filePath = [self temporaryFilePathForClass:MGLPointAnnotation.class]; + NSString *filePath = [self temporaryFilePathForClass:MLNPointAnnotation.class]; [NSKeyedArchiver archiveRootObject:annotation toFile:filePath]; - MGLPointAnnotation *unarchivedAnnotation = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNPointAnnotation *unarchivedAnnotation = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; XCTAssertEqualObjects(annotation, unarchivedAnnotation); } - (void)testPointFeature { - MGLPointFeature *pointFeature = [[MGLPointFeature alloc] init]; + MLNPointFeature *pointFeature = [[MLNPointFeature alloc] init]; pointFeature.title = @"title"; pointFeature.subtitle = @"subtitle"; pointFeature.identifier = @(123); pointFeature.attributes = @{@"bbox": @[@1, @2, @3, @4]}; - NSString *filePath = [self temporaryFilePathForClass:MGLPointFeature.class]; + NSString *filePath = [self temporaryFilePathForClass:MLNPointFeature.class]; [NSKeyedArchiver archiveRootObject:pointFeature toFile:filePath]; - MGLPointFeature *unarchivedPointFeature = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNPointFeature *unarchivedPointFeature = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; XCTAssertEqualObjects(pointFeature, unarchivedPointFeature); } - (void)testPointFeatureCluster { - MGLPointFeature *pointFeature = [[MGLPointFeatureCluster alloc] init]; + MLNPointFeature *pointFeature = [[MLNPointFeatureCluster alloc] init]; pointFeature.title = @"title"; pointFeature.subtitle = @"subtitle"; pointFeature.identifier = @(123); @@ -55,18 +55,18 @@ @"point_count" : @(2), }; - XCTAssert([pointFeature isKindOfClass:[MGLPointFeature class]], @""); + XCTAssert([pointFeature isKindOfClass:[MLNPointFeature class]], @""); - NSString *filePath = [self temporaryFilePathForClass:MGLPointFeature.class]; + NSString *filePath = [self temporaryFilePathForClass:MLNPointFeature.class]; [NSKeyedArchiver archiveRootObject:pointFeature toFile:filePath]; - MGLPointFeature *unarchivedPointFeature = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNPointFeature *unarchivedPointFeature = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; XCTAssertEqualObjects(pointFeature, unarchivedPointFeature); // Unarchive process should ensure we still have a cluster - XCTAssert([unarchivedPointFeature isMemberOfClass:[MGLPointFeatureCluster class]]); + XCTAssert([unarchivedPointFeature isMemberOfClass:[MLNPointFeatureCluster class]]); - id cluster = MGL_OBJC_DYNAMIC_CAST_AS_PROTOCOL(unarchivedPointFeature, MGLCluster); + id cluster = MLN_OBJC_DYNAMIC_CAST_AS_PROTOCOL(unarchivedPointFeature, MLNCluster); XCTAssert(cluster); XCTAssert(cluster.clusterIdentifier == 456); @@ -82,13 +82,13 @@ NSUInteger numberOfCoordinates = sizeof(coordinates) / sizeof(CLLocationCoordinate2D); - MGLPolyline *polyline = [MGLPolyline polylineWithCoordinates:coordinates count:numberOfCoordinates]; + MLNPolyline *polyline = [MLNPolyline polylineWithCoordinates:coordinates count:numberOfCoordinates]; polyline.title = @"title"; polyline.subtitle = @"subtitle"; - NSString *filePath = [self temporaryFilePathForClass:[MGLPolyline class]]; + NSString *filePath = [self temporaryFilePathForClass:[MLNPolyline class]]; [NSKeyedArchiver archiveRootObject:polyline toFile:filePath]; - MGLPolyline *unarchivedPolyline = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNPolyline *unarchivedPolyline = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; XCTAssertEqualObjects(polyline, unarchivedPolyline); @@ -107,7 +107,7 @@ }; NSUInteger multiLineCoordinatesCount = sizeof(multiLineCoordinates) / sizeof(CLLocationCoordinate2D); - MGLPolyline *multiLine = [MGLPolyline polylineWithCoordinates:multiLineCoordinates count:multiLineCoordinatesCount]; + MLNPolyline *multiLine = [MLNPolyline polylineWithCoordinates:multiLineCoordinates count:multiLineCoordinatesCount]; CLLocationCoordinate2D multiLineCenter = CLLocationCoordinate2DMake(51.000000, 1.000000); XCTAssertEqual([multiLine coordinate].latitude, multiLineCenter.latitude); @@ -119,7 +119,7 @@ }; NSUInteger segmentCoordinatesCount = sizeof(segmentCoordinates) / sizeof(CLLocationCoordinate2D); - MGLPolyline *segmentLine = [MGLPolyline polylineWithCoordinates:segmentCoordinates count:segmentCoordinatesCount]; + MLNPolyline *segmentLine = [MLNPolyline polylineWithCoordinates:segmentCoordinates count:segmentCoordinatesCount]; CLLocationCoordinate2D segmentCenter = CLLocationCoordinate2DMake(35.0404006631, -85.2604935); XCTAssertEqualWithAccuracy([segmentLine coordinate].latitude, segmentCenter.latitude, 0.0001); @@ -133,7 +133,7 @@ }; NSUInteger sfToBerkeleyCoordinatesCount = sizeof(sfToBerkeleyCoordinates) / sizeof(CLLocationCoordinate2D); - MGLPolyline *sfToBerkeleyLine = [MGLPolyline polylineWithCoordinates:sfToBerkeleyCoordinates count:sfToBerkeleyCoordinatesCount]; + MLNPolyline *sfToBerkeleyLine = [MLNPolyline polylineWithCoordinates:sfToBerkeleyCoordinates count:sfToBerkeleyCoordinatesCount]; CLLocationCoordinate2D sfToBerkeleyCenter = CLLocationCoordinate2DMake(37.8230575118,-122.324867587); XCTAssertEqualWithAccuracy([sfToBerkeleyLine coordinate].latitude, sfToBerkeleyCenter.latitude, 0.0001); @@ -151,14 +151,14 @@ NSUInteger numberOfCoordinates = sizeof(coordinates) / sizeof(CLLocationCoordinate2D); - MGLPolygon *polygon = [MGLPolygon polygonWithCoordinates:coordinates count:numberOfCoordinates]; + MLNPolygon *polygon = [MLNPolygon polygonWithCoordinates:coordinates count:numberOfCoordinates]; polygon.title = nil; polygon.subtitle = @"subtitle"; - NSString *filePath = [self temporaryFilePathForClass:[MGLPolygon class]]; + NSString *filePath = [self temporaryFilePathForClass:[MLNPolygon class]]; [NSKeyedArchiver archiveRootObject:polygon toFile:filePath]; - MGLPolygon *unarchivedPolygon = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNPolygon *unarchivedPolygon = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; [unarchivedPolygon coordinate]; XCTAssertEqualObjects(polygon, unarchivedPolygon); @@ -171,7 +171,7 @@ }; NSUInteger squareCoordinatesCount = sizeof(squareCoordinates) / sizeof(CLLocationCoordinate2D); - MGLPolygon *squarePolygon = [MGLPolygon polygonWithCoordinates:squareCoordinates count:squareCoordinatesCount]; + MLNPolygon *squarePolygon = [MLNPolygon polygonWithCoordinates:squareCoordinates count:squareCoordinatesCount]; CLLocationCoordinate2D squareCenter = CLLocationCoordinate2DMake(100.5, 0.5); XCTAssertEqual([squarePolygon coordinate].latitude, squareCenter.latitude); @@ -194,13 +194,13 @@ NSUInteger numberOfInteriorCoordinates = sizeof(interiorCoordinates) / sizeof(CLLocationCoordinate2D); - MGLPolygon *interiorPolygon = [MGLPolygon polygonWithCoordinates:interiorCoordinates count:numberOfInteriorCoordinates]; - MGLPolygon *polygon = [MGLPolygon polygonWithCoordinates:coordinates count:numberOfCoordinates interiorPolygons:@[interiorPolygon]]; + MLNPolygon *interiorPolygon = [MLNPolygon polygonWithCoordinates:interiorCoordinates count:numberOfInteriorCoordinates]; + MLNPolygon *polygon = [MLNPolygon polygonWithCoordinates:coordinates count:numberOfCoordinates interiorPolygons:@[interiorPolygon]]; - NSString *filePath = [self temporaryFilePathForClass:[MGLPolygon class]]; + NSString *filePath = [self temporaryFilePathForClass:[MLNPolygon class]]; [NSKeyedArchiver archiveRootObject:polygon toFile:filePath]; - MGLPolygon *unarchivedPolygon = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNPolygon *unarchivedPolygon = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; XCTAssertEqualObjects(polygon, unarchivedPolygon); } @@ -212,14 +212,14 @@ }; NSUInteger numberOfCoordinates = sizeof(coordinates) / sizeof(CLLocationCoordinate2D); - MGLPolylineFeature *polylineFeature = [MGLPolylineFeature polylineWithCoordinates:coordinates count:numberOfCoordinates]; + MLNPolylineFeature *polylineFeature = [MLNPolylineFeature polylineWithCoordinates:coordinates count:numberOfCoordinates]; polylineFeature.attributes = @{@"bbox": @[@0, @1, @2, @3]}; polylineFeature.identifier = @"identifier"; - NSString *filePath = [self temporaryFilePathForClass:[MGLPolylineFeature class]]; + NSString *filePath = [self temporaryFilePathForClass:[MLNPolylineFeature class]]; [NSKeyedArchiver archiveRootObject:polylineFeature toFile:filePath]; - MGLPolylineFeature *unarchivedPolylineFeature = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNPolylineFeature *unarchivedPolylineFeature = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; XCTAssertEqualObjects(polylineFeature, unarchivedPolylineFeature); @@ -235,12 +235,12 @@ }; NSUInteger numberOfCoordinates = sizeof(coordinates) / sizeof(CLLocationCoordinate2D); - MGLPolygonFeature *polygonFeature = [MGLPolygonFeature polygonWithCoordinates:coordinates count:numberOfCoordinates]; + MLNPolygonFeature *polygonFeature = [MLNPolygonFeature polygonWithCoordinates:coordinates count:numberOfCoordinates]; - NSString *filePath = [self temporaryFilePathForClass:[MGLPolygonFeature class]]; + NSString *filePath = [self temporaryFilePathForClass:[MLNPolygonFeature class]]; [NSKeyedArchiver archiveRootObject:polygonFeature toFile:filePath]; - MGLPolygonFeature *unarchivedPolygonFeature = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNPolygonFeature *unarchivedPolygonFeature = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; XCTAssertEqualObjects(polygonFeature, unarchivedPolygonFeature); @@ -259,16 +259,16 @@ NSUInteger numberOfCoordinates = sizeof(coordinates) / sizeof(CLLocationCoordinate2D); - MGLPointCollection *pointCollection = [MGLPointCollection pointCollectionWithCoordinates:coordinates count:numberOfCoordinates]; + MLNPointCollection *pointCollection = [MLNPointCollection pointCollectionWithCoordinates:coordinates count:numberOfCoordinates]; CLLocationCoordinate2D pointsCenter = CLLocationCoordinate2DMake(0, 1); XCTAssertEqual([pointCollection coordinate].latitude, pointsCenter.latitude); XCTAssertEqual([pointCollection coordinate].longitude, pointsCenter.longitude); - NSString *filePath = [self temporaryFilePathForClass:[MGLPointCollection class]]; + NSString *filePath = [self temporaryFilePathForClass:[MLNPointCollection class]]; [NSKeyedArchiver archiveRootObject:pointCollection toFile:filePath]; - MGLPointCollection *unarchivedPointCollection = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNPointCollection *unarchivedPointCollection = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; XCTAssertEqualObjects(pointCollection, unarchivedPointCollection); } @@ -276,7 +276,7 @@ - (void)testPointCollectionFeature { NSMutableArray *features = [NSMutableArray array]; for (NSUInteger i = 0; i < 100; i++) { - MGLPointFeature *feature = [[MGLPointFeature alloc] init]; + MLNPointFeature *feature = [[MLNPointFeature alloc] init]; feature.coordinate = CLLocationCoordinate2DMake(arc4random() % 90, arc4random() % 180); [features addObject:feature]; } @@ -290,14 +290,14 @@ NSUInteger numberOfCoordinates = sizeof(coordinates) / sizeof(CLLocationCoordinate2D); - MGLPointCollectionFeature *collection = [MGLPointCollectionFeature pointCollectionWithCoordinates:coordinates count:numberOfCoordinates]; + MLNPointCollectionFeature *collection = [MLNPointCollectionFeature pointCollectionWithCoordinates:coordinates count:numberOfCoordinates]; collection.identifier = @"identifier"; collection.attributes = @{@"bbox": @[@1, @2, @3, @4]}; - NSString *filePath = [self temporaryFilePathForClass:[MGLPointCollectionFeature class]]; + NSString *filePath = [self temporaryFilePathForClass:[MLNPointCollectionFeature class]]; [NSKeyedArchiver archiveRootObject:collection toFile:filePath]; - MGLPointCollectionFeature *unarchivedCollection = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNPointCollectionFeature *unarchivedCollection = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; XCTAssertEqualObjects(collection, unarchivedCollection); @@ -330,10 +330,10 @@ NSUInteger road1CoordinatesCount = sizeof(line1) / sizeof(CLLocationCoordinate2D); NSUInteger road2CoordinatesCount = sizeof(line2) / sizeof(CLLocationCoordinate2D); - MGLPolyline *road1Polyline = [MGLPolyline polylineWithCoordinates:line1 count:road1CoordinatesCount]; - MGLPolyline *road2Polyline = [MGLPolyline polylineWithCoordinates:line1 count:road2CoordinatesCount]; + MLNPolyline *road1Polyline = [MLNPolyline polylineWithCoordinates:line1 count:road1CoordinatesCount]; + MLNPolyline *road2Polyline = [MLNPolyline polylineWithCoordinates:line1 count:road2CoordinatesCount]; - MGLMultiPolyline *roads = [MGLMultiPolyline multiPolylineWithPolylines:@[road1Polyline, road2Polyline]]; + MLNMultiPolyline *roads = [MLNMultiPolyline multiPolylineWithPolylines:@[road1Polyline, road2Polyline]]; CLLocationCoordinate2D roadCenter = CLLocationCoordinate2DMake(100, 40); XCTAssertEqual([roads coordinate].latitude, roadCenter.latitude); @@ -344,17 +344,17 @@ NSMutableArray *polylines = [NSMutableArray array]; for (NSUInteger i = 0; i < 100; i++) { - MGLPolyline *polyline = [MGLPolyline polylineWithCoordinates:coordinates count:numberOfCoordinates]; + MLNPolyline *polyline = [MLNPolyline polylineWithCoordinates:coordinates count:numberOfCoordinates]; [polylines addObject:polyline]; } - MGLMultiPolyline *multiPolyline = [MGLMultiPolyline multiPolylineWithPolylines:polylines]; + MLNMultiPolyline *multiPolyline = [MLNMultiPolyline multiPolylineWithPolylines:polylines]; - NSString *filePath = [self temporaryFilePathForClass:[MGLMultiPolyline class]]; + NSString *filePath = [self temporaryFilePathForClass:[MLNMultiPolyline class]]; [NSKeyedArchiver archiveRootObject:multiPolyline toFile:filePath]; - MGLMultiPolyline *unarchivedMultiPolyline = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; - MGLMultiPolyline *anotherMultipolyline = [MGLMultiPolyline multiPolylineWithPolylines:[polylines subarrayWithRange:NSMakeRange(0, polylines.count/2)]]; + MLNMultiPolyline *unarchivedMultiPolyline = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNMultiPolyline *anotherMultipolyline = [MLNMultiPolyline multiPolylineWithPolylines:[polylines subarrayWithRange:NSMakeRange(0, polylines.count/2)]]; XCTAssertEqualObjects(multiPolyline, unarchivedMultiPolyline); XCTAssertNotEqualObjects(unarchivedMultiPolyline, anotherMultipolyline); @@ -386,9 +386,9 @@ NSUInteger outerCoordinatesCount = sizeof(outerSquare) / sizeof(CLLocationCoordinate2D); NSUInteger innerCoordinatesCount = sizeof(innerSquare) / sizeof(CLLocationCoordinate2D); - MGLPolygon *innerPolygonSquare = [MGLPolygon polygonWithCoordinates:innerSquare count:innerCoordinatesCount]; - MGLPolygon *outerPolygonSquare = [MGLPolygon polygonWithCoordinates:outerSquare count:outerCoordinatesCount interiorPolygons:@[innerPolygonSquare]]; - MGLMultiPolygon *squares = [MGLMultiPolygon multiPolygonWithPolygons:@[outerPolygonSquare, innerPolygonSquare]]; + MLNPolygon *innerPolygonSquare = [MLNPolygon polygonWithCoordinates:innerSquare count:innerCoordinatesCount]; + MLNPolygon *outerPolygonSquare = [MLNPolygon polygonWithCoordinates:outerSquare count:outerCoordinatesCount interiorPolygons:@[innerPolygonSquare]]; + MLNMultiPolygon *squares = [MLNMultiPolygon multiPolygonWithPolygons:@[outerPolygonSquare, innerPolygonSquare]]; CLLocationCoordinate2D squareCenter = CLLocationCoordinate2DMake(100.5, 0.5); XCTAssertEqual([squares coordinate].latitude, squareCenter.latitude); @@ -399,17 +399,17 @@ NSMutableArray *polygons = [NSMutableArray array]; for (NSUInteger i = 0; i < 100; i++) { - MGLPolygon *polygon = [MGLPolygon polygonWithCoordinates:coordinates count:numberOfCoordinates]; + MLNPolygon *polygon = [MLNPolygon polygonWithCoordinates:coordinates count:numberOfCoordinates]; [polygons addObject:polygon]; } - MGLMultiPolygon *multiPolygon = [MGLMultiPolygon multiPolygonWithPolygons:polygons]; + MLNMultiPolygon *multiPolygon = [MLNMultiPolygon multiPolygonWithPolygons:polygons]; - NSString *filePath = [self temporaryFilePathForClass:[MGLMultiPolygon class]]; + NSString *filePath = [self temporaryFilePathForClass:[MLNMultiPolygon class]]; [NSKeyedArchiver archiveRootObject:multiPolygon toFile:filePath]; - MGLMultiPolygon *unarchivedMultiPolygon = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; - MGLMultiPolygon *anotherMultiPolygon = [MGLMultiPolygon multiPolygonWithPolygons:[polygons subarrayWithRange:NSMakeRange(0, polygons.count/2)]]; + MLNMultiPolygon *unarchivedMultiPolygon = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNMultiPolygon *anotherMultiPolygon = [MLNMultiPolygon multiPolygonWithPolygons:[polygons subarrayWithRange:NSMakeRange(0, polygons.count/2)]]; XCTAssertEqualObjects(multiPolygon, unarchivedMultiPolygon); XCTAssertNotEqualObjects(anotherMultiPolygon, unarchivedMultiPolygon); @@ -425,16 +425,16 @@ NSUInteger numberOfCoordinates = sizeof(coordinates) / sizeof(CLLocationCoordinate2D); - MGLPolyline *polyline = [MGLPolyline polylineWithCoordinates:coordinates count:numberOfCoordinates]; - MGLPolygon *polygon = [MGLPolygon polygonWithCoordinates:coordinates count:numberOfCoordinates]; + MLNPolyline *polyline = [MLNPolyline polylineWithCoordinates:coordinates count:numberOfCoordinates]; + MLNPolygon *polygon = [MLNPolygon polygonWithCoordinates:coordinates count:numberOfCoordinates]; - MGLShapeCollection *shapeCollection = [MGLShapeCollection shapeCollectionWithShapes:@[polyline, polygon]]; + MLNShapeCollection *shapeCollection = [MLNShapeCollection shapeCollectionWithShapes:@[polyline, polygon]]; - NSString *filePath = [self temporaryFilePathForClass:[MGLShapeCollection class]]; + NSString *filePath = [self temporaryFilePathForClass:[MLNShapeCollection class]]; [NSKeyedArchiver archiveRootObject:shapeCollection toFile:filePath]; - MGLShapeCollection *unarchivedShapeCollection = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; - MGLShapeCollection *anotherShapeCollection = [MGLShapeCollection shapeCollectionWithShapes:@[polygon]]; + MLNShapeCollection *unarchivedShapeCollection = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNShapeCollection *anotherShapeCollection = [MLNShapeCollection shapeCollectionWithShapes:@[polygon]]; XCTAssertEqualObjects(shapeCollection, unarchivedShapeCollection); XCTAssertNotEqualObjects(shapeCollection, anotherShapeCollection); @@ -451,19 +451,19 @@ NSMutableArray *polylines = [NSMutableArray array]; for (NSUInteger i = 0; i < 100; i++) { - MGLPolylineFeature *polylineFeature = [MGLPolylineFeature polylineWithCoordinates:coordinates count:numberOfCoordinates]; + MLNPolylineFeature *polylineFeature = [MLNPolylineFeature polylineWithCoordinates:coordinates count:numberOfCoordinates]; polylineFeature.identifier = @(arc4random() % 100).stringValue; [polylines addObject:polylineFeature]; } - MGLMultiPolylineFeature *multiPolylineFeature = [MGLMultiPolylineFeature multiPolylineWithPolylines:polylines]; + MLNMultiPolylineFeature *multiPolylineFeature = [MLNMultiPolylineFeature multiPolylineWithPolylines:polylines]; multiPolylineFeature.attributes = @{@"bbox": @[@4, @3, @2, @1]}; - NSString *filePath = [self temporaryFilePathForClass:[MGLMultiPolylineFeature class]]; + NSString *filePath = [self temporaryFilePathForClass:[MLNMultiPolylineFeature class]]; [NSKeyedArchiver archiveRootObject:multiPolylineFeature toFile:filePath]; - MGLMultiPolylineFeature *unarchivedMultiPolylineFeature = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; - MGLMultiPolylineFeature *anotherMultiPolylineFeature = [MGLMultiPolylineFeature multiPolylineWithPolylines:[polylines subarrayWithRange:NSMakeRange(0, polylines.count/2)]]; + MLNMultiPolylineFeature *unarchivedMultiPolylineFeature = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNMultiPolylineFeature *anotherMultiPolylineFeature = [MLNMultiPolylineFeature multiPolylineWithPolylines:[polylines subarrayWithRange:NSMakeRange(0, polylines.count/2)]]; XCTAssertEqualObjects(multiPolylineFeature, unarchivedMultiPolylineFeature); XCTAssertNotEqualObjects(unarchivedMultiPolylineFeature, anotherMultiPolylineFeature); @@ -480,22 +480,22 @@ NSMutableArray *polygons = [NSMutableArray array]; for (NSUInteger i = 0; i < 100; i++ ) { - MGLPolygonFeature *polygonFeature = [MGLPolygonFeature polygonWithCoordinates:coordinates count:numberOfCoordinates]; + MLNPolygonFeature *polygonFeature = [MLNPolygonFeature polygonWithCoordinates:coordinates count:numberOfCoordinates]; polygonFeature.identifier = @(arc4random_uniform(100)).stringValue; [polygons addObject:polygonFeature]; } - MGLMultiPolygonFeature *multiPolygonFeature = [MGLMultiPolygonFeature multiPolygonWithPolygons:polygons]; + MLNMultiPolygonFeature *multiPolygonFeature = [MLNMultiPolygonFeature multiPolygonWithPolygons:polygons]; multiPolygonFeature.attributes = @{@"bbox": @[@(arc4random_uniform(100)), @(arc4random_uniform(100)), @(arc4random_uniform(100)), @(arc4random_uniform(100))]}; - NSString *filePath = [self temporaryFilePathForClass:[MGLMultiPolylineFeature class]]; + NSString *filePath = [self temporaryFilePathForClass:[MLNMultiPolylineFeature class]]; [NSKeyedArchiver archiveRootObject:multiPolygonFeature toFile:filePath]; - MGLMultiPolygonFeature *unarchivedMultiPolygonFeature = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; - MGLMultiPolygonFeature *anotherMultiPolygonFeature = [MGLMultiPolygonFeature multiPolygonWithPolygons:[polygons subarrayWithRange:NSMakeRange(0, polygons.count/2)]]; + MLNMultiPolygonFeature *unarchivedMultiPolygonFeature = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNMultiPolygonFeature *anotherMultiPolygonFeature = [MLNMultiPolygonFeature multiPolygonWithPolygons:[polygons subarrayWithRange:NSMakeRange(0, polygons.count/2)]]; XCTAssertEqualObjects(multiPolygonFeature, unarchivedMultiPolygonFeature); XCTAssertNotEqualObjects(anotherMultiPolygonFeature, unarchivedMultiPolygonFeature); @@ -510,20 +510,20 @@ NSUInteger numberOfCoordinates = sizeof(coordinates) / sizeof(CLLocationCoordinate2D); - MGLPolylineFeature *polyline = [MGLPolylineFeature polylineWithCoordinates:coordinates count:numberOfCoordinates]; - MGLPolygonFeature *polygon = [MGLPolygonFeature polygonWithCoordinates:coordinates count:numberOfCoordinates]; + MLNPolylineFeature *polyline = [MLNPolylineFeature polylineWithCoordinates:coordinates count:numberOfCoordinates]; + MLNPolygonFeature *polygon = [MLNPolygonFeature polygonWithCoordinates:coordinates count:numberOfCoordinates]; - MGLShapeCollectionFeature *shapeCollectionFeature = [MGLShapeCollectionFeature shapeCollectionWithShapes:@[polyline, polygon]]; + MLNShapeCollectionFeature *shapeCollectionFeature = [MLNShapeCollectionFeature shapeCollectionWithShapes:@[polyline, polygon]]; shapeCollectionFeature.identifier = @(arc4random_uniform(100)).stringValue; shapeCollectionFeature.attributes = @{@"bbox":@[@(arc4random_uniform(100)), @(arc4random_uniform(100)), @(arc4random_uniform(100)), @(arc4random_uniform(100))]}; - NSString *filePath = [self temporaryFilePathForClass:[MGLShapeCollectionFeature class]]; + NSString *filePath = [self temporaryFilePathForClass:[MLNShapeCollectionFeature class]]; [NSKeyedArchiver archiveRootObject:shapeCollectionFeature toFile:filePath]; - MGLShapeCollectionFeature *unarchivedShapeCollectionFeature = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNShapeCollectionFeature *unarchivedShapeCollectionFeature = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; XCTAssertEqualObjects(shapeCollectionFeature, unarchivedShapeCollectionFeature); } @@ -542,29 +542,29 @@ [image unlockFocus]; #endif - MGLAnnotationImage *annotationImage = [MGLAnnotationImage annotationImageWithImage:image reuseIdentifier:@(arc4random_uniform(100)).stringValue]; + MLNAnnotationImage *annotationImage = [MLNAnnotationImage annotationImageWithImage:image reuseIdentifier:@(arc4random_uniform(100)).stringValue]; - NSString *filePath = [self temporaryFilePathForClass:[MGLAnnotationImage class]]; + NSString *filePath = [self temporaryFilePathForClass:[MLNAnnotationImage class]]; [NSKeyedArchiver archiveRootObject:annotationImage toFile:filePath]; - MGLAnnotationImage *unarchivedAnnotationImage = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNAnnotationImage *unarchivedAnnotationImage = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; XCTAssertEqualObjects(annotationImage, unarchivedAnnotationImage); } #if TARGET_OS_IPHONE - (void)testAnnotationView { - MGLAnnotationView *annotationView = [[MGLAnnotationView alloc] initWithReuseIdentifier:@"id"]; + MLNAnnotationView *annotationView = [[MLNAnnotationView alloc] initWithReuseIdentifier:@"id"]; annotationView.enabled = NO; annotationView.selected = YES; annotationView.draggable = YES; annotationView.centerOffset = CGVectorMake(10, 10); annotationView.scalesWithViewingDistance = NO; - NSString *filePath = [self temporaryFilePathForClass:[MGLAnnotationView class]]; + NSString *filePath = [self temporaryFilePathForClass:[MLNAnnotationView class]]; [NSKeyedArchiver archiveRootObject:annotationView toFile:filePath]; - MGLAnnotationView *unarchivedAnnotationView = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNAnnotationView *unarchivedAnnotationView = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; XCTAssertEqual(annotationView.enabled, unarchivedAnnotationView.enabled); XCTAssertEqual(annotationView.selected, unarchivedAnnotationView.selected); @@ -576,13 +576,13 @@ #if TARGET_OS_IPHONE - (void)testUserLocation { - MGLUserLocation *userLocation = [[MGLUserLocation alloc] init]; + MLNUserLocation *userLocation = [[MLNUserLocation alloc] init]; userLocation.location = [[CLLocation alloc] initWithLatitude:1 longitude:1]; - NSString *filePath = [self temporaryFilePathForClass:[MGLUserLocation class]]; + NSString *filePath = [self temporaryFilePathForClass:[MLNUserLocation class]]; [NSKeyedArchiver archiveRootObject:userLocation toFile:filePath]; - MGLUserLocation *unarchivedUserLocation = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNUserLocation *unarchivedUserLocation = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; XCTAssertEqualObjects(userLocation, unarchivedUserLocation); unarchivedUserLocation.location = [[CLLocation alloc] initWithLatitude:10 longitude:10]; @@ -592,17 +592,17 @@ #if TARGET_OS_IPHONE - (void)testUserLocationAnnotationView { - MGLUserLocationAnnotationView *annotationView = [[MGLUserLocationAnnotationView alloc] init]; + MLNUserLocationAnnotationView *annotationView = [[MLNUserLocationAnnotationView alloc] init]; annotationView.enabled = NO; annotationView.selected = YES; annotationView.draggable = YES; annotationView.centerOffset = CGVectorMake(10, 10); annotationView.scalesWithViewingDistance = NO; - NSString *filePath = [self temporaryFilePathForClass:[MGLUserLocationAnnotationView class]]; + NSString *filePath = [self temporaryFilePathForClass:[MLNUserLocationAnnotationView class]]; [NSKeyedArchiver archiveRootObject:annotationView toFile:filePath]; - MGLUserLocationAnnotationView *unarchivedAnnotationView = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; + MLNUserLocationAnnotationView *unarchivedAnnotationView = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath]; XCTAssertEqual(annotationView.enabled, unarchivedAnnotationView.enabled); XCTAssertEqual(annotationView.selected, unarchivedAnnotationView.selected); diff --git a/platform/ios/platform/darwin/test/MGLCompassDirectionFormatterTests.m b/platform/ios/platform/darwin/test/MLNCompassDirectionFormatterTests.m similarity index 93% rename from platform/ios/platform/darwin/test/MGLCompassDirectionFormatterTests.m rename to platform/ios/platform/darwin/test/MLNCompassDirectionFormatterTests.m index c4ccc6ac4..d856f6e36 100644 --- a/platform/ios/platform/darwin/test/MGLCompassDirectionFormatterTests.m +++ b/platform/ios/platform/darwin/test/MLNCompassDirectionFormatterTests.m @@ -1,20 +1,20 @@ #import #import -@interface MGLCompassDirectionFormatterTests : XCTestCase +@interface MLNCompassDirectionFormatterTests : XCTestCase @end -@implementation MGLCompassDirectionFormatterTests +@implementation MLNCompassDirectionFormatterTests - (void)testCompassDirections { - MGLCompassDirectionFormatter *shortFormatter = [[MGLCompassDirectionFormatter alloc] init]; + MLNCompassDirectionFormatter *shortFormatter = [[MLNCompassDirectionFormatter alloc] init]; shortFormatter.unitStyle = NSFormattingUnitStyleShort; - MGLCompassDirectionFormatter *mediumFormatter = [[MGLCompassDirectionFormatter alloc] init]; + MLNCompassDirectionFormatter *mediumFormatter = [[MLNCompassDirectionFormatter alloc] init]; XCTAssertEqual(mediumFormatter.unitStyle, NSFormattingUnitStyleMedium, @"Unit style should be medium by default."); - MGLCompassDirectionFormatter *longFormatter = [[MGLCompassDirectionFormatter alloc] init]; + MLNCompassDirectionFormatter *longFormatter = [[MLNCompassDirectionFormatter alloc] init]; longFormatter.unitStyle = NSFormattingUnitStyleLong; CLLocationDirection direction; diff --git a/platform/ios/platform/darwin/test/MGLComputedShapeSourceTests.m b/platform/ios/platform/darwin/test/MLNComputedShapeSourceTests.m similarity index 60% rename from platform/ios/platform/darwin/test/MGLComputedShapeSourceTests.m rename to platform/ios/platform/darwin/test/MLNComputedShapeSourceTests.m index 6eb45913d..06a55fd3d 100644 --- a/platform/ios/platform/darwin/test/MGLComputedShapeSourceTests.m +++ b/platform/ios/platform/darwin/test/MLNComputedShapeSourceTests.m @@ -3,20 +3,20 @@ #import -@interface MGLComputedShapeSourceTests : XCTestCase +@interface MLNComputedShapeSourceTests : XCTestCase @end -@implementation MGLComputedShapeSourceTests +@implementation MLNComputedShapeSourceTests - (void)testInitializer { - MGLComputedShapeSource *source = [[MGLComputedShapeSource alloc] initWithIdentifier:@"id" options:@{}]; + MLNComputedShapeSource *source = [[MLNComputedShapeSource alloc] initWithIdentifier:@"id" options:@{}]; XCTAssertNotNil(source); XCTAssertNotNil(source.requestQueue); XCTAssertNil(source.dataSource); } - (void)testNilOptions { - MGLComputedShapeSource *source = [[MGLComputedShapeSource alloc] initWithIdentifier:@"id" options:nil]; + MLNComputedShapeSource *source = [[MLNComputedShapeSource alloc] initWithIdentifier:@"id" options:nil]; XCTAssertNotNil(source); } diff --git a/platform/ios/platform/darwin/test/MGLCoordinateFormatterTests.m b/platform/ios/platform/darwin/test/MLNCoordinateFormatterTests.m similarity index 90% rename from platform/ios/platform/darwin/test/MGLCoordinateFormatterTests.m rename to platform/ios/platform/darwin/test/MLNCoordinateFormatterTests.m index 2ef1c6276..b5f857937 100644 --- a/platform/ios/platform/darwin/test/MGLCoordinateFormatterTests.m +++ b/platform/ios/platform/darwin/test/MLNCoordinateFormatterTests.m @@ -1,22 +1,22 @@ #import #import -@interface MGLCoordinateFormatterTests : XCTestCase +@interface MLNCoordinateFormatterTests : XCTestCase @end -@implementation MGLCoordinateFormatterTests +@implementation MLNCoordinateFormatterTests - (void)testStrings { - MGLCoordinateFormatter *shortFormatter = [[MGLCoordinateFormatter alloc] init]; + MLNCoordinateFormatter *shortFormatter = [[MLNCoordinateFormatter alloc] init]; shortFormatter.unitStyle = NSFormattingUnitStyleShort; XCTAssertTrue(shortFormatter.allowsSeconds, @"Arcseconds should be allowed by default."); XCTAssertTrue(shortFormatter.allowsMinutes, @"Arcminutes should be allowed by default."); - MGLCoordinateFormatter *mediumFormatter = [[MGLCoordinateFormatter alloc] init]; + MLNCoordinateFormatter *mediumFormatter = [[MLNCoordinateFormatter alloc] init]; XCTAssertEqual(mediumFormatter.unitStyle, NSFormattingUnitStyleMedium, @"Unit style should be medium by default."); - MGLCoordinateFormatter *longFormatter = [[MGLCoordinateFormatter alloc] init]; + MLNCoordinateFormatter *longFormatter = [[MLNCoordinateFormatter alloc] init]; longFormatter.unitStyle = NSFormattingUnitStyleLong; CLLocationCoordinate2D coordinate; diff --git a/platform/ios/platform/darwin/test/MGLDistanceFormatterTests.m b/platform/ios/platform/darwin/test/MLNDistanceFormatterTests.m similarity index 83% rename from platform/ios/platform/darwin/test/MGLDistanceFormatterTests.m rename to platform/ios/platform/darwin/test/MLNDistanceFormatterTests.m index f15ad9d31..2585d37b5 100644 --- a/platform/ios/platform/darwin/test/MGLDistanceFormatterTests.m +++ b/platform/ios/platform/darwin/test/MLNDistanceFormatterTests.m @@ -1,14 +1,14 @@ #import #import -@interface MGLDistanceFormatterTests : XCTestCase +@interface MLNDistanceFormatterTests : XCTestCase @end -@implementation MGLDistanceFormatterTests +@implementation MLNDistanceFormatterTests - (void)testAbbreviatedMetricUnits { - MGLDistanceFormatter *formatter = [[MGLDistanceFormatter alloc] init]; + MLNDistanceFormatter *formatter = [[MLNDistanceFormatter alloc] init]; formatter.numberFormatter.locale = [NSLocale localeWithLocaleIdentifier:@"en_CA"]; for (CLLocationDistance distance=0; distance <= 10000; distance+=5) { NSString *unit = [[formatter stringFromDistance:distance] componentsSeparatedByString:@" "][1]; @@ -18,7 +18,7 @@ } - (void)testAbbreviatedImperialUnits { - MGLDistanceFormatter *formatter = [[MGLDistanceFormatter alloc] init]; + MLNDistanceFormatter *formatter = [[MLNDistanceFormatter alloc] init]; formatter.numberFormatter.locale = [NSLocale localeWithLocaleIdentifier:@"en_US"]; for (CLLocationDistance distance=0; distance <= 10000; distance+=5) { NSString *unit = [[formatter stringFromDistance:distance] componentsSeparatedByString:@" "][1]; diff --git a/platform/ios/platform/darwin/test/MGLDocumentationExampleTests.swift b/platform/ios/platform/darwin/test/MLNDocumentationExampleTests.swift similarity index 74% rename from platform/ios/platform/darwin/test/MGLDocumentationExampleTests.swift rename to platform/ios/platform/darwin/test/MLNDocumentationExampleTests.swift index 185ed29f4..d39928c3f 100644 --- a/platform/ios/platform/darwin/test/MGLDocumentationExampleTests.swift +++ b/platform/ios/platform/darwin/test/MLNDocumentationExampleTests.swift @@ -6,7 +6,7 @@ import Mapbox compile. To add an example: - 1. Add a test case named in the form testMGLClass or testMGLClass$method. + 1. Add a test case named in the form testMLNClass or testMLNClass$method. 2. Wrap the code you'd like to appear in the documentation within the following comment blocks: ``` @@ -19,25 +19,25 @@ import Mapbox 4. Run `make darwin-update-examples` to extract example code from the test method below and insert it into the header. */ -class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { - var mapView: MGLMapView! +class MLNDocumentationExampleTests: XCTestCase, MLNMapViewDelegate { + var mapView: MLNMapView! var styleLoadingExpectation: XCTestExpectation! - static let styleURL = Bundle(for: MGLDocumentationExampleTests.self).url(forResource: "one-liner", withExtension: "json")! + static let styleURL = Bundle(for: MLNDocumentationExampleTests.self).url(forResource: "one-liner", withExtension: "json")! - // Mock MGLOfflineStorage singleton so that it doesn't start long-running tasks that could interfere with other tests. - fileprivate class MGLOfflineStorageMock { - static let shared = MGLOfflineStorageMock() - func addPack(for: MGLOfflineRegion, withContext: Data, completionHandler: MGLOfflinePackAdditionCompletionHandler? = nil) { - XCTAssert(MGLOfflineStorage.shared.responds(to: #selector(MGLOfflineStorage.shared.addPack(for:withContext:completionHandler:)))) + // Mock MLNOfflineStorage singleton so that it doesn't start long-running tasks that could interfere with other tests. + fileprivate class MLNOfflineStorageMock { + static let shared = MLNOfflineStorageMock() + func addPack(for: MLNOfflineRegion, withContext: Data, completionHandler: MLNOfflinePackAdditionCompletionHandler? = nil) { + XCTAssert(MLNOfflineStorage.shared.responds(to: #selector(MLNOfflineStorage.shared.addPack(for:withContext:completionHandler:)))) if let completionHandler = completionHandler { - completionHandler(nil, NSError(domain: "MGLDocumentationExampleError", code: 0, userInfo: [NSLocalizedDescriptionKey: "\(#function) is mocked and not functional."])) + completionHandler(nil, NSError(domain: "MLNDocumentationExampleError", code: 0, userInfo: [NSLocalizedDescriptionKey: "\(#function) is mocked and not functional."])) } } } override func setUp() { super.setUp() - mapView = MGLMapView(frame: CGRect(x: 0, y: 0, width: 256, height: 256), styleURL: MGLDocumentationExampleTests.styleURL) + mapView = MLNMapView(frame: CGRect(x: 0, y: 0, width: 256, height: 256), styleURL: MLNDocumentationExampleTests.styleURL) mapView.delegate = self styleLoadingExpectation = expectation(description: "Map view should finish loading style") waitForExpectations(timeout: 10, handler: nil) @@ -49,15 +49,15 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { super.tearDown() } - func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) { + func mapView(_ mapView: MLNMapView, didFinishLoading style: MLNStyle) { styleLoadingExpectation.fulfill() } - func testMGLLight() { + func testMLNLight() { //#-example-code - let light = MGLLight() - let position = MGLSphericalPosition(radial: 5, azimuthal: 180, polar: 80) - light.position = NSExpression(forConstantValue: NSValue(mglSphericalPosition: position)) + let light = MLNLight() + let position = MLNSphericalPosition(radial: 5, azimuthal: 180, polar: 80) + light.position = NSExpression(forConstantValue: NSValue(mlnSphericalPosition: position)) light.anchor = NSExpression(forConstantValue: "map") mapView.style?.light = light //#-end-example-code @@ -65,36 +65,36 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { XCTAssertNotNil(mapView.style?.light) } - func testMGLTilePyramidOfflineRegion() { - class MGLStyle { + func testMLNTilePyramidOfflineRegion() { + class MLNStyle { static var lightStyleURL: URL { - return MGLDocumentationExampleTests.styleURL + return MLNDocumentationExampleTests.styleURL } } - typealias MGLOfflineStorage = MGLOfflineStorageMock + typealias MLNOfflineStorage = MLNOfflineStorageMock //#-example-code let northeast = CLLocationCoordinate2D(latitude: 40.989329, longitude: -102.062592) let southwest = CLLocationCoordinate2D(latitude: 36.986207, longitude: -109.049896) - let bbox = MGLCoordinateBounds(sw: southwest, ne: northeast) + let bbox = MLNCoordinateBounds(sw: southwest, ne: northeast) - let region = MGLTilePyramidOfflineRegion(styleURL: MGLStyle.lightStyleURL, bounds: bbox, fromZoomLevel: 11, toZoomLevel: 14) + let region = MLNTilePyramidOfflineRegion(styleURL: MLNStyle.lightStyleURL, bounds: bbox, fromZoomLevel: 11, toZoomLevel: 14) let context = "Tile Pyramid Region".data(using: .utf8) - MGLOfflineStorage.shared.addPack(for: region, withContext: context!) + MLNOfflineStorage.shared.addPack(for: region, withContext: context!) //#-end-example-code XCTAssertNotNil(region) } - func testMGLShapeOfflineRegion() { - class MGLStyle { + func testMLNShapeOfflineRegion() { + class MLNStyle { static var lightStyleURL: URL { - return MGLDocumentationExampleTests.styleURL + return MLNDocumentationExampleTests.styleURL } } - typealias MGLOfflineStorage = MGLOfflineStorageMock + typealias MLNOfflineStorage = MLNOfflineStorageMock //#-example-code var coordinates = [ @@ -103,72 +103,72 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { CLLocationCoordinate2D(latitude: 45.530883, longitude: -122.678833) ] - let triangle = MGLPolygon(coordinates: &coordinates, count: UInt(coordinates.count)) - let region = MGLShapeOfflineRegion(styleURL: MGLStyle.lightStyleURL, shape: triangle, fromZoomLevel: 11, toZoomLevel: 14) + let triangle = MLNPolygon(coordinates: &coordinates, count: UInt(coordinates.count)) + let region = MLNShapeOfflineRegion(styleURL: MLNStyle.lightStyleURL, shape: triangle, fromZoomLevel: 11, toZoomLevel: 14) let context = "Triangle Region".data(using: .utf8) - MGLOfflineStorage.shared.addPack(for: region, withContext: context!) + MLNOfflineStorage.shared.addPack(for: region, withContext: context!) //#-end-example-code XCTAssertNotNil(region) } - func testMGLOfflinePack() { - typealias MGLOfflineStorage = MGLOfflineStorageMock + func testMLNOfflinePack() { + typealias MLNOfflineStorage = MLNOfflineStorageMock let northeast = CLLocationCoordinate2D(latitude: 40.989329, longitude: -102.062592) let southwest = CLLocationCoordinate2D(latitude: 36.986207, longitude: -109.049896) - let bbox = MGLCoordinateBounds(sw: southwest, ne: northeast) - let region = MGLTilePyramidOfflineRegion(styleURL: MGLDocumentationExampleTests.styleURL, bounds: bbox, fromZoomLevel: 11, toZoomLevel: 14) + let bbox = MLNCoordinateBounds(sw: southwest, ne: northeast) + let region = MLNTilePyramidOfflineRegion(styleURL: MLNDocumentationExampleTests.styleURL, bounds: bbox, fromZoomLevel: 11, toZoomLevel: 14) let context = "Tile Pyramid Region".data(using: .utf8)! //#-example-code - MGLOfflineStorage.shared.addPack(for: region, withContext: context) { (pack, error) in + MLNOfflineStorage.shared.addPack(for: region, withContext: context) { (pack, error) in guard let pack = pack else { // If adding the pack fails, log an error to console. print("Error:", error?.localizedDescription ?? "unknown error adding pack at \(#file)(\(#line)) in \(#function)") return } - // Start an MGLOfflinePack download + // Start an MLNOfflinePack download pack.resume() } //#-end-example-code } - func testMGLShape$shapeWithData_encoding_error_() { - let mainBundle = Bundle(for: MGLDocumentationExampleTests.self) + func testMLNShape$shapeWithData_encoding_error_() { + let mainBundle = Bundle(for: MLNDocumentationExampleTests.self) //#-example-code let url = mainBundle.url(forResource: "amsterdam", withExtension: "geojson")! let data = try! Data(contentsOf: url) - let feature = try! MGLShape(data: data, encoding: String.Encoding.utf8.rawValue) as! MGLShapeCollectionFeature + let feature = try! MLNShape(data: data, encoding: String.Encoding.utf8.rawValue) as! MLNShapeCollectionFeature //#-end-example-code - XCTAssertNotNil(feature.shapes.first as? MGLPolygonFeature) + XCTAssertNotNil(feature.shapes.first as? MLNPolygonFeature) } - func testMGLShapeSource() { + func testMLNShapeSource() { //#-example-code var coordinates: [CLLocationCoordinate2D] = [ CLLocationCoordinate2D(latitude: 37.77, longitude: -122.42), CLLocationCoordinate2D(latitude: 38.91, longitude: -77.04), ] - let polyline = MGLPolylineFeature(coordinates: &coordinates, count: UInt(coordinates.count)) - let source = MGLShapeSource(identifier: "lines", features: [polyline], options: nil) + let polyline = MLNPolylineFeature(coordinates: &coordinates, count: UInt(coordinates.count)) + let source = MLNShapeSource(identifier: "lines", features: [polyline], options: nil) mapView.style?.addSource(source) //#-end-example-code XCTAssertNotNil(mapView.style?.source(withIdentifier: "lines")) } - func testMGLRasterTileSource() { + func testMLNRasterTileSource() { //#-example-code - let source = MGLRasterTileSource(identifier: "clouds", tileURLTemplates: ["https://example.com/raster-tiles/{z}/{x}/{y}.png"], options: [ + let source = MLNRasterTileSource(identifier: "clouds", tileURLTemplates: ["https://example.com/raster-tiles/{z}/{x}/{y}.png"], options: [ .minimumZoomLevel: 9, .maximumZoomLevel: 16, .tileSize: 512, .attributionInfos: [ - MGLAttributionInfo(title: NSAttributedString(string: "© Mapbox"), url: URL(string: "https://mapbox.com")) + MLNAttributionInfo(title: NSAttributedString(string: "© Mapbox"), url: URL(string: "https://mapbox.com")) ] ]) mapView.style?.addSource(source) @@ -177,11 +177,11 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { XCTAssertNotNil(mapView.style?.source(withIdentifier: "clouds")) } - func testMGLRasterDEMSource() { + func testMLNRasterDEMSource() { // We want to use mapbox.terrain-rgb in the example, but using a mapbox: // URL requires setting an access token. So this identically named - // subclass of MGLRasterDEMSource swaps in a nonexistent URL. - class MGLRasterDEMSource: Mapbox.MGLRasterDEMSource { + // subclass of MLNRasterDEMSource swaps in a nonexistent URL. + class MLNRasterDEMSource: Mapbox.MLNRasterDEMSource { override init(identifier: String, configurationURL: URL, tileSize: CGFloat = 256) { let bogusURL = URL(string: "https://example.com/raster-rgb.json")! super.init(identifier: identifier, configurationURL: bogusURL, tileSize: tileSize) @@ -190,20 +190,20 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { //#-example-code let terrainRGBURL = URL(string: "maptiler://sources/terrain-rgb")! - let source = MGLRasterDEMSource(identifier: "hills", configurationURL: terrainRGBURL) + let source = MLNRasterDEMSource(identifier: "hills", configurationURL: terrainRGBURL) mapView.style?.addSource(source) //#-end-example-code XCTAssertNotNil(mapView.style?.source(withIdentifier: "hills")) } - func testMGLVectorTileSource() { + func testMLNVectorTileSource() { //#-example-code - let source = MGLVectorTileSource(identifier: "pois", tileURLTemplates: ["https://example.com/vector-tiles/{z}/{x}/{y}.mvt"], options: [ + let source = MLNVectorTileSource(identifier: "pois", tileURLTemplates: ["https://example.com/vector-tiles/{z}/{x}/{y}.mvt"], options: [ .minimumZoomLevel: 9, .maximumZoomLevel: 16, .attributionInfos: [ - MGLAttributionInfo(title: NSAttributedString(string: "© Mapbox"), url: URL(string: "https://mapbox.com")) + MLNAttributionInfo(title: NSAttributedString(string: "© Mapbox"), url: URL(string: "https://mapbox.com")) ] ]) mapView.style?.addSource(source) @@ -212,38 +212,38 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { XCTAssertNotNil(mapView.style?.source(withIdentifier: "pois")) } - func testMGLPolyline() { + func testMLNPolyline() { //#-example-code let coordinates = [ CLLocationCoordinate2D(latitude: 35.68476, longitude: -220.24257), CLLocationCoordinate2D(latitude: 37.78428, longitude: -122.41310) ] - let polyline = MGLPolyline(coordinates: coordinates, count: UInt(coordinates.count)) + let polyline = MLNPolyline(coordinates: coordinates, count: UInt(coordinates.count)) //#-end-example-code XCTAssertNotNil(polyline) } - func testMGLImageSource() { + func testMLNImageSource() { //#-example-code - let coordinates = MGLCoordinateQuad( + let coordinates = MLNCoordinateQuad( topLeft: CLLocationCoordinate2D(latitude: 46.437, longitude: -80.425), bottomLeft: CLLocationCoordinate2D(latitude: 37.936, longitude: -80.425), bottomRight: CLLocationCoordinate2D(latitude: 37.936, longitude: -71.516), topRight: CLLocationCoordinate2D(latitude: 46.437, longitude: -71.516)) - let source = MGLImageSource(identifier: "radar", coordinateQuad: coordinates, url: URL(string: "https://maplibre.org/maplibre-gl-js-docs/assets/radar.gif")!) + let source = MLNImageSource(identifier: "radar", coordinateQuad: coordinates, url: URL(string: "https://maplibre.org/maplibre-gl-js-docs/assets/radar.gif")!) mapView.style?.addSource(source) //#-end-example-code XCTAssertNotNil(mapView.style?.source(withIdentifier: "radar")) } - func testMGLCircleStyleLayer() { - let population = MGLVectorTileSource(identifier: "population", configurationURL: URL(string: "https://example.com/style.json")!) + func testMLNCircleStyleLayer() { + let population = MLNVectorTileSource(identifier: "population", configurationURL: URL(string: "https://example.com/style.json")!) mapView.style?.addSource(population) //#-example-code - let layer = MGLCircleStyleLayer(identifier: "circles", source: population) + let layer = MLNCircleStyleLayer(identifier: "circles", source: population) layer.sourceLayerIdentifier = "population" #if os(macOS) layer.circleColor = NSExpression(forConstantValue: NSColor.green) @@ -253,7 +253,7 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { let stops = NSExpression(forConstantValue: [12: 2, 22: 180]) - layer.circleRadius = NSExpression(forMGLInterpolating: .zoomLevelVariable, + layer.circleRadius = NSExpression(forMLNInterpolating: .zoomLevelVariable, curveType: .exponential, parameters: NSExpression(forConstantValue: 1.75), stops: stops) @@ -266,17 +266,17 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { XCTAssertNotNil(mapView.style?.layer(withIdentifier: "circles")) } - func testMGLLineStyleLayer() { - let trails = MGLVectorTileSource(identifier: "trails", configurationURL: URL(string: "https://example.com/style.json")!) + func testMLNLineStyleLayer() { + let trails = MLNVectorTileSource(identifier: "trails", configurationURL: URL(string: "https://example.com/style.json")!) mapView.style?.addSource(trails) //#-example-code - let layer = MGLLineStyleLayer(identifier: "trails-path", source: trails) + let layer = MLNLineStyleLayer(identifier: "trails-path", source: trails) layer.sourceLayerIdentifier = "trails" let stops = NSExpression(forConstantValue: [14: 2, 18: 20]) - layer.lineWidth = NSExpression(forMGLInterpolating: .zoomLevelVariable, + layer.lineWidth = NSExpression(forMLNInterpolating: .zoomLevelVariable, curveType: .exponential, parameters: NSExpression(forConstantValue: 1.5), stops: stops) @@ -294,12 +294,12 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { XCTAssertNotNil(mapView.style?.layer(withIdentifier: "trails-path")) } - func testMGLFillStyleLayer() { - let parks = MGLVectorTileSource(identifier: "parks", configurationURL: URL(string: "https://example.com/style.json")!) + func testMLNFillStyleLayer() { + let parks = MLNVectorTileSource(identifier: "parks", configurationURL: URL(string: "https://example.com/style.json")!) mapView.style?.addSource(parks) //#-example-code - let layer = MGLFillStyleLayer(identifier: "parks", source: parks) + let layer = MLNFillStyleLayer(identifier: "parks", source: parks) layer.sourceLayerIdentifier = "parks" #if os(macOS) layer.fillColor = NSExpression(forConstantValue: NSColor.green) @@ -313,12 +313,12 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { XCTAssertNotNil(mapView.style?.layer(withIdentifier: "parks")) } - func testMGLFillExtrusionStyleLayer() { - let buildings = MGLVectorTileSource(identifier: "buildings", configurationURL: URL(string: "https://example.com/style.json")!) + func testMLNFillExtrusionStyleLayer() { + let buildings = MLNVectorTileSource(identifier: "buildings", configurationURL: URL(string: "https://example.com/style.json")!) mapView.style?.addSource(buildings) //#-example-code - let layer = MGLFillExtrusionStyleLayer(identifier: "buildings", source: buildings) + let layer = MLNFillExtrusionStyleLayer(identifier: "buildings", source: buildings) layer.sourceLayerIdentifier = "building" layer.fillExtrusionHeight = NSExpression(forKeyPath: "height") layer.fillExtrusionBase = NSExpression(forKeyPath: "min_height") @@ -329,20 +329,20 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { XCTAssertNotNil(mapView.style?.layer(withIdentifier: "buildings")) } - func testMGLHeatmapStyleLayer() { - let earthquakes = MGLShapeSource(identifier: "earthquakes", url: URL(string: "https://example.com/earthquakes.json")!, options: [:]) + func testMLNHeatmapStyleLayer() { + let earthquakes = MLNShapeSource(identifier: "earthquakes", url: URL(string: "https://example.com/earthquakes.json")!, options: [:]) mapView.style?.addSource(earthquakes) //#-example-code - let layer = MGLHeatmapStyleLayer(identifier: "earthquake-heat", source: earthquakes) + let layer = MLNHeatmapStyleLayer(identifier: "earthquake-heat", source: earthquakes) - layer.heatmapWeight = NSExpression(forMGLInterpolating: .zoomLevelVariable, + layer.heatmapWeight = NSExpression(forMLNInterpolating: .zoomLevelVariable, curveType: .linear, parameters: nil, stops: NSExpression(forConstantValue: [0: 0, 6: 1])) - layer.heatmapIntensity = NSExpression(forMGLInterpolating: .zoomLevelVariable, + layer.heatmapIntensity = NSExpression(forMLNInterpolating: .zoomLevelVariable, curveType: .linear, parameters: nil, stops: NSExpression(forConstantValue: [0: 1, @@ -354,12 +354,12 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { XCTAssertNotNil(mapView.style?.layer(withIdentifier: "earthquake-heat")) } - func testMGLSymbolStyleLayer() { - let pois = MGLVectorTileSource(identifier: "pois", configurationURL: URL(string: "https://example.com/style.json")!) + func testMLNSymbolStyleLayer() { + let pois = MLNVectorTileSource(identifier: "pois", configurationURL: URL(string: "https://example.com/style.json")!) mapView.style?.addSource(pois) //#-example-code - let layer = MGLSymbolStyleLayer(identifier: "coffeeshops", source: pois) + let layer = MLNSymbolStyleLayer(identifier: "coffeeshops", source: pois) layer.sourceLayerIdentifier = "pois" layer.iconImageName = NSExpression(forConstantValue: "coffee") layer.iconScale = NSExpression(forConstantValue: 0.5) @@ -379,19 +379,19 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { XCTAssertNotNil(mapView.style?.layer(withIdentifier: "coffeeshops")) } - func testMGLRasterStyleLayer() { - let source = MGLRasterTileSource(identifier: "clouds", tileURLTemplates: ["https://example.com/raster-tiles/{z}/{x}/{y}.png"], options: [ + func testMLNRasterStyleLayer() { + let source = MLNRasterTileSource(identifier: "clouds", tileURLTemplates: ["https://example.com/raster-tiles/{z}/{x}/{y}.png"], options: [ .minimumZoomLevel: 9, .maximumZoomLevel: 16, .tileSize: 512, .attributionInfos: [ - MGLAttributionInfo(title: NSAttributedString(string: "© Mapbox"), url: URL(string: "https://mapbox.com")) + MLNAttributionInfo(title: NSAttributedString(string: "© Mapbox"), url: URL(string: "https://mapbox.com")) ] ]) mapView.style?.addSource(source) //#-example-code - let layer = MGLRasterStyleLayer(identifier: "clouds", source: source) + let layer = MLNRasterStyleLayer(identifier: "clouds", source: source) layer.rasterOpacity = NSExpression(forConstantValue: 0.5) mapView.style?.addLayer(layer) //#-end-example-code @@ -399,24 +399,24 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { XCTAssertNotNil(mapView.style?.layer(withIdentifier: "clouds")) } - func testMGLHillshadeStyleLayer() { - let source = MGLRasterDEMSource(identifier: "dem", tileURLTemplates: ["https://example.com/raster-rgb/{z}/{x}/{y}.png"], options: [ + func testMLNHillshadeStyleLayer() { + let source = MLNRasterDEMSource(identifier: "dem", tileURLTemplates: ["https://example.com/raster-rgb/{z}/{x}/{y}.png"], options: [ .minimumZoomLevel: 9, .maximumZoomLevel: 16, .tileSize: 256, .attributionInfos: [ - MGLAttributionInfo(title: NSAttributedString(string: "© Mapbox"), url: URL(string: "https://mapbox.com")) + MLNAttributionInfo(title: NSAttributedString(string: "© Mapbox"), url: URL(string: "https://mapbox.com")) ] ]) mapView.style?.addSource(source) - let canals = MGLVectorTileSource(identifier: "canals", configurationURL: URL(string: "https://example.com/style.json")!) + let canals = MLNVectorTileSource(identifier: "canals", configurationURL: URL(string: "https://example.com/style.json")!) mapView.style?.addSource(canals) - let canalShadowLayer = MGLLineStyleLayer(identifier: "waterway-river-canal-shadow", source: canals) + let canalShadowLayer = MLNLineStyleLayer(identifier: "waterway-river-canal-shadow", source: canals) mapView.style?.addLayer(canalShadowLayer) //#-example-code - let layer = MGLHillshadeStyleLayer(identifier: "hills", source: source) + let layer = MLNHillshadeStyleLayer(identifier: "hills", source: source) layer.hillshadeExaggeration = NSExpression(forConstantValue: 0.6) if let canalShadowLayer = mapView.style?.layer(withIdentifier: "waterway-river-canal-shadow") { mapView.style?.insertLayer(layer, below: canalShadowLayer) @@ -426,12 +426,12 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { XCTAssertNotNil(mapView.style?.layer(withIdentifier: "hills")) } - func testMGLVectorStyleLayer$predicate() { - let terrain = MGLVectorTileSource(identifier: "terrain", configurationURL: URL(string: "https://example.com/style.json")!) + func testMLNVectorStyleLayer$predicate() { + let terrain = MLNVectorTileSource(identifier: "terrain", configurationURL: URL(string: "https://example.com/style.json")!) mapView.style?.addSource(terrain) //#-example-code - let layer = MGLLineStyleLayer(identifier: "contour", source: terrain) + let layer = MLNLineStyleLayer(identifier: "contour", source: terrain) layer.sourceLayerIdentifier = "contours" layer.predicate = NSPredicate(format: "(index == 5 || index == 10) && CAST(ele, 'NSNumber') >= 1500.0") mapView.style?.addLayer(layer) @@ -440,7 +440,7 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { XCTAssertNotNil(mapView.style?.layer(withIdentifier: "contour")) } - func testMGLMapView() { + func testMLNMapView() { //#-example-code #if os(macOS) class MapClickGestureRecognizer: NSClickGestureRecognizer { @@ -458,8 +458,8 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { //#-end-example-code } - func testMGLMapSnapshotter() { - let expectation = self.expectation(description: "MGLMapSnapshotter should produce a snapshot") + func testMLNMapSnapshotter() { + let expectation = self.expectation(description: "MLNMapSnapshotter should produce a snapshot") #if os(macOS) var image: NSImage? { didSet { @@ -474,19 +474,19 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { } #endif - class MGLStyle { + class MLNStyle { static var satelliteStreetsStyleURL: URL { - return MGLDocumentationExampleTests.styleURL + return MLNDocumentationExampleTests.styleURL } } //#-example-code - let camera = MGLMapCamera(lookingAtCenter: CLLocationCoordinate2D(latitude: 37.7184, longitude: -122.4365), altitude: 100, pitch: 20, heading: 0) + let camera = MLNMapCamera(lookingAtCenter: CLLocationCoordinate2D(latitude: 37.7184, longitude: -122.4365), altitude: 100, pitch: 20, heading: 0) - let options = MGLMapSnapshotOptions(styleURL: MGLStyle.satelliteStreetsStyleURL, camera: camera, size: CGSize(width: 320, height: 480)) + let options = MLNMapSnapshotOptions(styleURL: MLNStyle.satelliteStreetsStyleURL, camera: camera, size: CGSize(width: 320, height: 480)) options.zoomLevel = 10 - let snapshotter = MGLMapSnapshotter(options: options) + let snapshotter = MLNMapSnapshotter(options: options) snapshotter.start { (snapshot, error) in if let error = error { fatalError(error.localizedDescription) @@ -500,7 +500,7 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { _ = image } - func testMGLCluster() { + func testMLNCluster() { enum ExampleError: Error { case unexpectedFeatureType @@ -528,20 +528,20 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { do { //#-example-code - let shape = try! MGLShape(data: clusterShapeData, encoding: String.Encoding.utf8.rawValue) + let shape = try! MLNShape(data: clusterShapeData, encoding: String.Encoding.utf8.rawValue) - guard let pointFeature = shape as? MGLPointFeature else { + guard let pointFeature = shape as? MLNPointFeature else { throw ExampleError.unexpectedFeatureType } // Check for cluster conformance - guard let cluster = pointFeature as? MGLCluster else { + guard let cluster = pointFeature as? MLNCluster else { throw ExampleError.featureIsNotACluster } - // Currently the only supported class that conforms to `MGLCluster` is - // `MGLPointFeatureCluster` - guard cluster is MGLPointFeatureCluster else { + // Currently the only supported class that conforms to `MLNCluster` is + // `MLNPointFeatureCluster` + guard cluster is MLNPointFeatureCluster else { throw ExampleError.unexpectedFeatureType } @@ -555,7 +555,7 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { } } - func testMGLAttributedExpression() { + func testMLNAttributedExpression() { //#-example-code #if os(macOS) let redColor = NSColor.red @@ -563,23 +563,23 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { let redColor = UIColor.red #endif let expression = NSExpression(forConstantValue: "Foo") - let attributes: [MGLAttributedExpressionKey: NSExpression] = [.fontNamesAttribute : NSExpression(forConstantValue: ["DIN Offc Pro Italic", + let attributes: [MLNAttributedExpressionKey: NSExpression] = [.fontNamesAttribute : NSExpression(forConstantValue: ["DIN Offc Pro Italic", "Arial Unicode MS Regular"]), .fontScaleAttribute: NSExpression(forConstantValue: 1.2), .fontColorAttribute: NSExpression(forConstantValue: redColor)] - let attributedExpression = MGLAttributedExpression(expression, attributes:attributes) + let attributedExpression = MLNAttributedExpression(expression, attributes:attributes) //#-end-example-code XCTAssertNotNil(attributedExpression) } - func testMGLShapeSourceOptionClusterProperties() { + func testMLNShapeSourceOptionClusterProperties() { //#-example-code let firstExpression = NSExpression(format: "sum:({$featureAccumulated, sumValue})") let secondExpression = NSExpression(forKeyPath: "magnitude") let clusterPropertiesDictionary = ["sumValue" : [firstExpression, secondExpression]] - let options : [MGLShapeSourceOption : Any] = [.clustered : true, + let options : [MLNShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary] //#-end-example-code let geoJSON: [String: Any] = [ @@ -600,11 +600,11 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { ] let clusterShapeData = try! JSONSerialization.data(withJSONObject: geoJSON, options: []) - let shape = try! MGLShape(data: clusterShapeData, encoding: String.Encoding.utf8.rawValue) - let source = MGLShapeSource(identifier: "source", shape: shape, options: options) + let shape = try! MLNShape(data: clusterShapeData, encoding: String.Encoding.utf8.rawValue) + let source = MLNShapeSource(identifier: "source", shape: shape, options: options) mapView.style?.addSource(source) } - // For testMGLMapView(). + // For testMLNMapView(). func myCustomFunction() {} } diff --git a/platform/ios/platform/darwin/test/MGLDocumentationGuideTests.swift b/platform/ios/platform/darwin/test/MLNDocumentationGuideTests.swift similarity index 81% rename from platform/ios/platform/darwin/test/MGLDocumentationGuideTests.swift rename to platform/ios/platform/darwin/test/MLNDocumentationGuideTests.swift index 8b74619f4..47b29c52e 100644 --- a/platform/ios/platform/darwin/test/MGLDocumentationGuideTests.swift +++ b/platform/ios/platform/darwin/test/MLNDocumentationGuideTests.swift @@ -21,14 +21,14 @@ import Mapbox 4. Run `make darwin-style-code` to extract example code from the test method below and insert it into the guide. */ -class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { - var mapView: MGLMapView! +class MLNDocumentationGuideTests: XCTestCase, MLNMapViewDelegate { + var mapView: MLNMapView! var styleLoadingExpectation: XCTestExpectation! override func setUp() { super.setUp() - let styleURL = Bundle(for: MGLDocumentationGuideTests.self).url(forResource: "one-liner", withExtension: "json") - mapView = MGLMapView(frame: CGRect(x: 0, y: 0, width: 256, height: 256), styleURL: styleURL) + let styleURL = Bundle(for: MLNDocumentationGuideTests.self).url(forResource: "one-liner", withExtension: "json") + mapView = MLNMapView(frame: CGRect(x: 0, y: 0, width: 256, height: 256), styleURL: styleURL) mapView.delegate = self styleLoadingExpectation = expectation(description: "Map view should finish loading style") waitForExpectations(timeout: 10, handler: nil) @@ -40,7 +40,7 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { super.tearDown() } - func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) { + func mapView(_ mapView: MLNMapView, didFinishLoading style: MLNStyle) { styleLoadingExpectation.fulfill() } @@ -67,7 +67,7 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { #endif // Based on the zoom and `stops`, change the color. - var functionExpression = NSExpression(forMGLStepping: .zoomLevelVariable, + var functionExpression = NSExpression(forMLNStepping: .zoomLevelVariable, from: NSExpression(forConstantValue: stops[0]), stops: NSExpression(forConstantValue: stops)) @@ -79,7 +79,7 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { 20.0: 18.0] functionExpression = NSExpression( - forMGLStepping: .zoomLevelVariable, + forMLNStepping: .zoomLevelVariable, from: NSExpression(forConstantValue: initialValue), stops: NSExpression(forConstantValue: stopsLineWidth) ) @@ -91,10 +91,10 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { func testMigratingToExpressions$Linear() { //#-example-code let url = URL(string: "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.geojson")! - let symbolSource = MGLSource(identifier: "source") - let symbolLayer = MGLSymbolStyleLayer(identifier: "place-city-sm", source: symbolSource) + let symbolSource = MLNSource(identifier: "source") + let symbolLayer = MLNSymbolStyleLayer(identifier: "place-city-sm", source: symbolSource) - let source = MGLShapeSource(identifier: "earthquakes", url: url, options: nil) + let source = MLNShapeSource(identifier: "earthquakes", url: url, options: nil) let mag = 1.0 // Update based on earthquake GeoJSON data mapView.style?.addSource(source) @@ -116,12 +116,12 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { ] #endif - let layer = MGLCircleStyleLayer(identifier: "circles", source: source) + let layer = MLNCircleStyleLayer(identifier: "circles", source: source) let circleExpression : NSExpression if #available(iOS 15, *) { circleExpression = NSExpression( - forMGLInterpolating: NSExpression(forConstantValue: mag), + forMLNInterpolating: NSExpression(forConstantValue: mag), curveType: .linear, parameters: nil, stops: NSExpression(forConstantValue: stops)) @@ -140,8 +140,8 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { } func testMigratingToExpressions$LinearConvenience() { - let source = MGLShapeSource(identifier: "circles", shape: nil, options: nil) - let layer = MGLCircleStyleLayer(identifier: "circles", source: source) + let source = MLNShapeSource(identifier: "circles", shape: nil, options: nil) + let layer = MLNCircleStyleLayer(identifier: "circles", source: source) #if os(macOS) let stops: [NSNumber: NSColor] = [ @@ -162,7 +162,7 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { #endif //#-example-code - layer.circleColor = NSExpression(forMGLInterpolating: NSExpression(forKeyPath: "mag"), curveType: .linear, parameters: nil, stops: NSExpression(forConstantValue: stops)) + layer.circleColor = NSExpression(forMLNInterpolating: NSExpression(forKeyPath: "mag"), curveType: .linear, parameters: nil, stops: NSExpression(forConstantValue: stops)) //#-end-example-code layer.circleRadius = NSExpression(forConstantValue: 10) @@ -170,8 +170,8 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { } func testMigratingToExpressions$Exponential() { - let source = MGLShapeSource(identifier: "circles", shape: nil, options: nil) - let layer = MGLCircleStyleLayer(identifier: "circles", source: source) + let source = MLNShapeSource(identifier: "circles", shape: nil, options: nil) + let layer = MLNCircleStyleLayer(identifier: "circles", source: source) //#-example-code let stops = [ @@ -180,7 +180,7 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { 18: 18, ] - layer.circleRadius = NSExpression(forMGLInterpolating: .zoomLevelVariable, + layer.circleRadius = NSExpression(forMLNInterpolating: .zoomLevelVariable, curveType: .exponential, parameters: NSExpression(forConstantValue: 1.5), stops: NSExpression(forConstantValue: stops)) @@ -188,8 +188,8 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { } func testMigratingToExpressions$ExponentialConvenience() { - let source = MGLShapeSource(identifier: "circles", shape: nil, options: nil) - let layer = MGLCircleStyleLayer(identifier: "circles", source: source) + let source = MLNShapeSource(identifier: "circles", shape: nil, options: nil) + let layer = MLNCircleStyleLayer(identifier: "circles", source: source) //#-example-code let stops = [ @@ -198,12 +198,12 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { 18: 18, ] - layer.circleRadius = NSExpression(forMGLInterpolating: NSExpression.zoomLevelVariable, curveType: MGLExpressionInterpolationMode.exponential, parameters: NSExpression(forConstantValue: 1.5), stops: NSExpression(forConstantValue: stops)) + layer.circleRadius = NSExpression(forMLNInterpolating: NSExpression.zoomLevelVariable, curveType: MLNExpressionInterpolationMode.exponential, parameters: NSExpression(forConstantValue: 1.5), stops: NSExpression(forConstantValue: stops)) //#-end-example-code } func testMigratingToExpressions$Interval() { - let source = MGLShapeSource(identifier: "circles", shape: nil, options: nil) - let layer = MGLCircleStyleLayer(identifier: "circles", source: source) + let source = MLNShapeSource(identifier: "circles", shape: nil, options: nil) + let layer = MLNCircleStyleLayer(identifier: "circles", source: source) //#-example-code #if os(macOS) @@ -215,7 +215,7 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { 10: .white, ] - layer.circleColor = NSExpression(forMGLStepping: .zoomLevelVariable, + layer.circleColor = NSExpression(forMLNStepping: .zoomLevelVariable, from: NSExpression(forConstantValue: NSColor.green), stops: NSExpression(forConstantValue: stops)) #else @@ -227,7 +227,7 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { 10: .white, ] - layer.circleColor = NSExpression(forMGLStepping: .zoomLevelVariable, + layer.circleColor = NSExpression(forMLNStepping: .zoomLevelVariable, from: NSExpression(forConstantValue: UIColor.green), stops: NSExpression(forConstantValue: stops)) #endif @@ -235,8 +235,8 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { } func testMigratingToExpressions$Categorical() { - let source = MGLShapeSource(identifier: "circles", shape: nil, options: nil) - let layer = MGLCircleStyleLayer(identifier: "circles", source: source) + let source = MLNShapeSource(identifier: "circles", shape: nil, options: nil) + let layer = MLNCircleStyleLayer(identifier: "circles", source: source) //#-example-code // Category type @@ -253,7 +253,7 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { let red = NSExpression(forConstantValue: NSColor.red) let yellow = NSExpression(forConstantValue: NSColor.yellow) - layer.circleColor = NSExpression(forMGLMatchingKey: type, + layer.circleColor = NSExpression(forMLNMatchingKey: type, in: [earthquake:orange, explosion:red, quarryBlast:yellow], default: defaultColor) #else @@ -264,7 +264,7 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { XCTExpectFailure("Awaiting unit test refactoring for https://github.com/maplibre/maplibre-gl-native/issues/331") - layer.circleColor = NSExpression(forMGLMatchingKey: type, + layer.circleColor = NSExpression(forMLNMatchingKey: type, in: [earthquake:orange, explosion:red, quarryBlast:yellow], default: defaultColor) #endif @@ -272,8 +272,8 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { } func testMigratingToExpressions$CategoricalValue() { - let source = MGLShapeSource(identifier: "circles", shape: nil, options: nil) - let layer = MGLCircleStyleLayer(identifier: "circles", source: source) + let source = MLNShapeSource(identifier: "circles", shape: nil, options: nil) + let layer = MLNCircleStyleLayer(identifier: "circles", source: source) //#-example-code #if os(macOS) @@ -294,8 +294,8 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { //#-end-example-code } func testMigratingToExpressions$Identity() { - let source = MGLShapeSource(identifier: "circles", shape: nil, options: nil) - let layer = MGLCircleStyleLayer(identifier: "circles", source: source) + let source = MLNShapeSource(identifier: "circles", shape: nil, options: nil) + let layer = MLNCircleStyleLayer(identifier: "circles", source: source) //#-example-code layer.circleRadius = NSExpression(forKeyPath: "mag") @@ -303,8 +303,8 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { } func testMigratingToExpressions$Multiply() { - let source = MGLShapeSource(identifier: "circles", shape: nil, options: nil) - let layer = MGLCircleStyleLayer(identifier: "circles", source: source) + let source = MLNShapeSource(identifier: "circles", shape: nil, options: nil) + let layer = MLNCircleStyleLayer(identifier: "circles", source: source) //#-example-code layer.circleRadius = NSExpression(forFunction: "multiply:by:", arguments: [NSExpression(forKeyPath: "mag"), 3]) @@ -312,10 +312,10 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { } func testMigratingToExpressions$Cast() { - let source = MGLShapeSource(identifier: "circles", shape: nil, options: nil) + let source = MLNShapeSource(identifier: "circles", shape: nil, options: nil) //#-example-code - let magnitudeLayer = MGLSymbolStyleLayer(identifier: "mag-layer", source: source) + let magnitudeLayer = MLNSymbolStyleLayer(identifier: "mag-layer", source: source) magnitudeLayer.text = NSExpression(format: "CAST(mag, 'NSString')") mapView.style?.addLayer(magnitudeLayer) //#-end-example-code diff --git a/platform/ios/platform/darwin/test/MGLExpressionTests.mm b/platform/ios/platform/darwin/test/MLNExpressionTests.mm similarity index 81% rename from platform/ios/platform/darwin/test/MGLExpressionTests.mm rename to platform/ios/platform/darwin/test/MLNExpressionTests.mm index d4037753e..61ecfefb2 100644 --- a/platform/ios/platform/darwin/test/MGLExpressionTests.mm +++ b/platform/ios/platform/darwin/test/MLNExpressionTests.mm @@ -1,47 +1,47 @@ #import -#import "MGLStyleLayerTests.h" +#import "MLNStyleLayerTests.h" #import -#import "MGLTypes.h" -#import "NSExpression+MGLPrivateAdditions.h" -#import "NSValue+MGLAdditions.h" +#import "MLNTypes.h" +#import "NSExpression+MLNPrivateAdditions.h" +#import "NSValue+MLNAdditions.h" #if TARGET_OS_IPHONE -#import "UIColor+MGLAdditions.h" +#import "UIColor+MLNAdditions.h" #else -#import "NSColor+MGLAdditions.h" +#import "NSColor+MLNAdditions.h" #endif -#import "MGLAttributedExpression.h" +#import "MLNAttributedExpression.h" -#define MGLAssertEqualValues(actual, expected, ...) \ +#define MLNAssertEqualValues(actual, expected, ...) \ XCTAssertTrue(actual.is<__typeof__(expected)>()); \ if (actual.is<__typeof__(expected)>()) { \ XCTAssertEqual(actual.get<__typeof__(expected)>(), expected, __VA_ARGS__); \ } -#define MGLAssertEqualValuesWithAccuracy(actual, expected, accuracy, ...) \ +#define MLNAssertEqualValuesWithAccuracy(actual, expected, accuracy, ...) \ XCTAssertTrue(actual.is<__typeof__(expected)>()); \ if (actual.is<__typeof__(expected)>()) { \ XCTAssertEqualWithAccuracy(actual.get<__typeof__(expected)>(), expected, accuracy, __VA_ARGS__); \ } -#define MGLConstantExpression(constant) \ +#define MLNConstantExpression(constant) \ [NSExpression expressionForConstantValue:constant] -#define MGLAssertConstantEqualsValue(constant, value, ...) \ - MGLAssertEqualValues(MGLConstantExpression(constant).mgl_constantMBGLValue, value, __VA_ARGS__); +#define MLNAssertConstantEqualsValue(constant, value, ...) \ + MLNAssertEqualValues(MLNConstantExpression(constant).mgl_constantMBGLValue, value, __VA_ARGS__); -#define MGLAssertConstantEqualsValueWithAccuracy(constant, value, accuracy, ...) \ - MGLAssertEqualValuesWithAccuracy(MGLConstantExpression(constant).mgl_constantMBGLValue, value, accuracy, __VA_ARGS__); +#define MLNAssertConstantEqualsValueWithAccuracy(constant, value, accuracy, ...) \ + MLNAssertEqualValuesWithAccuracy(MLNConstantExpression(constant).mgl_constantMBGLValue, value, accuracy, __VA_ARGS__); using namespace std::string_literals; -@interface MGLExpressionTests : XCTestCase +@interface MLNExpressionTests : XCTestCase @end -@implementation MGLExpressionTests +@implementation MLNExpressionTests // MARK: - Utility @@ -56,7 +56,7 @@ using namespace std::string_literals; return predicate; } -// MARK: - Objective-C Example Code for MGL Expressions +// MARK: - Objective-C Example Code for MLN Expressions - (void)testSteppingExpression { //#-example-code @@ -79,7 +79,7 @@ using namespace std::string_literals; - (void)testSteppingExpression_ColorOverZoom { //#-example-code // Objective-C sample of how to create a stepping expression with color. - NSExpression *constantExpression = [NSExpression expressionWithFormat:@"%@", [MGLColor redColor]]; + NSExpression *constantExpression = [NSExpression expressionWithFormat:@"%@", [MLNColor redColor]]; NSExpression *stops = [NSExpression expressionForConstantValue:@{@18: constantExpression}]; NSExpression *functionExpression; @@ -116,7 +116,7 @@ using namespace std::string_literals; // How to create expressions with iOS 15 functionExpression = [NSExpression mgl_expressionForInterpolatingExpression:NSExpression.zoomLevelVariableExpression - withCurveType:MGLExpressionInterpolationModeLinear + withCurveType:MLNExpressionInterpolationModeLinear parameters:nil stops:stops]; } else { @@ -134,23 +134,23 @@ using namespace std::string_literals; // MARK: - Valuation tests - (void)testStringValuation { - MGLAssertConstantEqualsValue(@"bar", "bar"s, @"NSString should convert to std::string."); - MGLAssertConstantEqualsValue(@"🆔🆗🇦🇶", "🆔🆗🇦🇶"s, @"NSString with non-ASCII characters should convert losslessly to std::string."); + MLNAssertConstantEqualsValue(@"bar", "bar"s, @"NSString should convert to std::string."); + MLNAssertConstantEqualsValue(@"🆔🆗🇦🇶", "🆔🆗🇦🇶"s, @"NSString with non-ASCII characters should convert losslessly to std::string."); } - (void)testColorValuation { - MGLAssertConstantEqualsValue([MGLColor redColor], "rgba(255,0,0,1)"s, @"MGLColor should convert to std::string containing CSS color string."); + MLNAssertConstantEqualsValue([MLNColor redColor], "rgba(255,0,0,1)"s, @"MLNColor should convert to std::string containing CSS color string."); } - (void)testBooleanValuation { - MGLAssertConstantEqualsValue(@NO, false, @"Boolean NSNumber should convert to bool."); - MGLAssertConstantEqualsValue(@YES, true, @"Boolean NSNumber should convert to bool."); + MLNAssertConstantEqualsValue(@NO, false, @"Boolean NSNumber should convert to bool."); + MLNAssertConstantEqualsValue(@YES, true, @"Boolean NSNumber should convert to bool."); } - (void)testDoubleValuation { - MGLAssertConstantEqualsValue(@DBL_MIN, DBL_MIN, @"Double NSNumber should convert to double."); - MGLAssertConstantEqualsValue(@DBL_MAX, DBL_MAX, @"Double NSNumber should convert to double."); + MLNAssertConstantEqualsValue(@DBL_MIN, DBL_MIN, @"Double NSNumber should convert to double."); + MLNAssertConstantEqualsValue(@DBL_MAX, DBL_MAX, @"Double NSNumber should convert to double."); } - (void)testFloatValuation { @@ -159,53 +159,53 @@ using namespace std::string_literals; // we just check that things are in the ballpark here with integer values // and some lower-precision checks. - MGLAssertConstantEqualsValue(@-1.0f, -1.0, @"Float NSNumber should convert to double."); - MGLAssertConstantEqualsValue(@1.0f, 1.0, @"Float NSNumber should convert to double."); - MGLAssertConstantEqualsValueWithAccuracy(@-23.232342f, -23.232342, 0.000001, @"Float NSNumber should convert to double."); - MGLAssertConstantEqualsValueWithAccuracy(@23.232342f, 23.232342, 0.000001, @"Float NSNumber should convert to double."); - MGLAssertConstantEqualsValueWithAccuracy(@-FLT_MAX, static_cast(-FLT_MAX), 0.000001, @"Float NSNumber should convert to double."); - MGLAssertConstantEqualsValueWithAccuracy(@FLT_MAX, static_cast(FLT_MAX), 0.000001, @"Float NSNumber should convert to double."); + MLNAssertConstantEqualsValue(@-1.0f, -1.0, @"Float NSNumber should convert to double."); + MLNAssertConstantEqualsValue(@1.0f, 1.0, @"Float NSNumber should convert to double."); + MLNAssertConstantEqualsValueWithAccuracy(@-23.232342f, -23.232342, 0.000001, @"Float NSNumber should convert to double."); + MLNAssertConstantEqualsValueWithAccuracy(@23.232342f, 23.232342, 0.000001, @"Float NSNumber should convert to double."); + MLNAssertConstantEqualsValueWithAccuracy(@-FLT_MAX, static_cast(-FLT_MAX), 0.000001, @"Float NSNumber should convert to double."); + MLNAssertConstantEqualsValueWithAccuracy(@FLT_MAX, static_cast(FLT_MAX), 0.000001, @"Float NSNumber should convert to double."); } - (void)testIntegerValuation { // Negative integers should always come back as int64_t per mbgl::Value definition. - MGLAssertConstantEqualsValue(@SHRT_MIN, static_cast(SHRT_MIN), @"Negative short NSNumber should convert to int64_t."); - MGLAssertConstantEqualsValue(@INT_MIN, static_cast(INT_MIN), @"Negative int NSNumber should convert to int64_t."); - MGLAssertConstantEqualsValue(@LONG_MIN, static_cast(LONG_MIN), @"Negative long NSNumber should convert to int64_t."); - MGLAssertConstantEqualsValue(@LLONG_MIN, static_cast(LLONG_MIN), @"Negative long long NSNumber should convert to int64_t."); - MGLAssertConstantEqualsValue(@NSIntegerMin, static_cast(NSIntegerMin), @"Negative NSInteger NSNumber should convert to int64_t."); + MLNAssertConstantEqualsValue(@SHRT_MIN, static_cast(SHRT_MIN), @"Negative short NSNumber should convert to int64_t."); + MLNAssertConstantEqualsValue(@INT_MIN, static_cast(INT_MIN), @"Negative int NSNumber should convert to int64_t."); + MLNAssertConstantEqualsValue(@LONG_MIN, static_cast(LONG_MIN), @"Negative long NSNumber should convert to int64_t."); + MLNAssertConstantEqualsValue(@LLONG_MIN, static_cast(LLONG_MIN), @"Negative long long NSNumber should convert to int64_t."); + MLNAssertConstantEqualsValue(@NSIntegerMin, static_cast(NSIntegerMin), @"Negative NSInteger NSNumber should convert to int64_t."); // Positive integers should always come back as uint64_t per mbgl::Value definition. - MGLAssertConstantEqualsValue(@SHRT_MAX, static_cast(SHRT_MAX), @"Positive short NSNumber should convert to uint64_t."); - MGLAssertConstantEqualsValue(@INT_MAX, static_cast(INT_MAX), @"Positive int NSNumber should convert to uint64_t."); - MGLAssertConstantEqualsValue(@LONG_MAX, static_cast(LONG_MAX), @"Positive long NSNumber should convert to uint64_t."); - MGLAssertConstantEqualsValue(@LLONG_MAX, static_cast(LLONG_MAX), @"Positive long long NSNumber should convert to uint64_t."); - MGLAssertConstantEqualsValue(@NSIntegerMax, static_cast(NSIntegerMax), @"Positive NSInteger NSNumber should convert to uint64_t."); + MLNAssertConstantEqualsValue(@SHRT_MAX, static_cast(SHRT_MAX), @"Positive short NSNumber should convert to uint64_t."); + MLNAssertConstantEqualsValue(@INT_MAX, static_cast(INT_MAX), @"Positive int NSNumber should convert to uint64_t."); + MLNAssertConstantEqualsValue(@LONG_MAX, static_cast(LONG_MAX), @"Positive long NSNumber should convert to uint64_t."); + MLNAssertConstantEqualsValue(@LLONG_MAX, static_cast(LLONG_MAX), @"Positive long long NSNumber should convert to uint64_t."); + MLNAssertConstantEqualsValue(@NSIntegerMax, static_cast(NSIntegerMax), @"Positive NSInteger NSNumber should convert to uint64_t."); } - (void)testUnsignedIntegerValuation { // Zero-value integers should always come back as uint64_t per mbgl::Value definition // (using the interpretation that zero is not negative). We use the unsigned long long // value just for parity with the positive integer test. - MGLAssertConstantEqualsValue(@(static_cast(0)), static_cast(0), @"Unsigned short NSNumber should convert to uint64_t."); - MGLAssertConstantEqualsValue(@0u, static_cast(0), @"Unsigned int NSNumber should convert to uint64_t."); - MGLAssertConstantEqualsValue(@0UL, static_cast(0), @"Unsigned long NSNumber should convert to uint64_t."); - MGLAssertConstantEqualsValue(@0ULL, static_cast(0), @"Unsigned long long NSNumber should convert to uint64_t."); - MGLAssertConstantEqualsValue(@(static_cast(0)), static_cast(0), @"Unsigned NSUInteger NSNumber should convert to uint64_t."); + MLNAssertConstantEqualsValue(@(static_cast(0)), static_cast(0), @"Unsigned short NSNumber should convert to uint64_t."); + MLNAssertConstantEqualsValue(@0u, static_cast(0), @"Unsigned int NSNumber should convert to uint64_t."); + MLNAssertConstantEqualsValue(@0UL, static_cast(0), @"Unsigned long NSNumber should convert to uint64_t."); + MLNAssertConstantEqualsValue(@0ULL, static_cast(0), @"Unsigned long long NSNumber should convert to uint64_t."); + MLNAssertConstantEqualsValue(@(static_cast(0)), static_cast(0), @"Unsigned NSUInteger NSNumber should convert to uint64_t."); // Positive integers should always come back as uint64_t per mbgl::Value definition. // We use the unsigned long long value because it can store the highest number on // both 32- and 64-bit and won't overflow. - MGLAssertConstantEqualsValue(@USHRT_MAX, static_cast(USHRT_MAX), @"Unsigned short NSNumber should convert to uint64_t."); - MGLAssertConstantEqualsValue(@UINT_MAX, static_cast(UINT_MAX), @"Unsigned int NSNumber should convert to uint64_t."); - MGLAssertConstantEqualsValue(@ULONG_MAX, static_cast(ULONG_MAX), @"Unsigned long NSNumber should convert to uint64_t."); - MGLAssertConstantEqualsValue(@ULLONG_MAX, static_cast(ULLONG_MAX), @"Unsigned long long NSNumber should convert to uint64_t."); - MGLAssertConstantEqualsValue(@NSUIntegerMax, static_cast(NSUIntegerMax), @"Unsigned NSUInteger NSNumber should convert to uint64_t."); + MLNAssertConstantEqualsValue(@USHRT_MAX, static_cast(USHRT_MAX), @"Unsigned short NSNumber should convert to uint64_t."); + MLNAssertConstantEqualsValue(@UINT_MAX, static_cast(UINT_MAX), @"Unsigned int NSNumber should convert to uint64_t."); + MLNAssertConstantEqualsValue(@ULONG_MAX, static_cast(ULONG_MAX), @"Unsigned long NSNumber should convert to uint64_t."); + MLNAssertConstantEqualsValue(@ULLONG_MAX, static_cast(ULLONG_MAX), @"Unsigned long long NSNumber should convert to uint64_t."); + MLNAssertConstantEqualsValue(@NSUIntegerMax, static_cast(NSUIntegerMax), @"Unsigned NSUInteger NSNumber should convert to uint64_t."); } - (void)testNullValuation { mbgl::NullValue nullValue; - MGLAssertConstantEqualsValue([NSNull null], nullValue, @"NSNull should convert to mbgl::NullValue."); + MLNAssertConstantEqualsValue([NSNull null], nullValue, @"NSNull should convert to mbgl::NullValue."); } // MARK: - Feature type tests @@ -234,7 +234,7 @@ using namespace std::string_literals; NSExpression *expression = [NSExpression expressionForVariable:@"zoomLevel"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, @[@"zoom"]); XCTAssertEqualObjects([NSExpression expressionWithFormat:@"$zoomLevel"].mgl_jsonExpressionObject, @[@"zoom"]); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:@[@"zoom"]], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:@[@"zoom"]], expression); NSMutableDictionary *context = [@{@"zoomLevel": @16} mutableCopy]; XCTAssertEqualObjects([expression expressionValueWithObject:nil context:context], @16); } @@ -242,7 +242,7 @@ using namespace std::string_literals; NSExpression *expression = [NSExpression expressionForVariable:@"heatmapDensity"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, @[@"heatmap-density"]); XCTAssertEqualObjects([NSExpression expressionWithFormat:@"$heatmapDensity"].mgl_jsonExpressionObject, @[@"heatmap-density"]); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:@[@"heatmap-density"]], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:@[@"heatmap-density"]], expression); NSMutableDictionary *context = [@{@"heatmapDensity": @1} mutableCopy]; XCTAssertEqualObjects([expression expressionValueWithObject:nil context:context], @1); } @@ -250,7 +250,7 @@ using namespace std::string_literals; NSExpression *expression = [NSExpression expressionForVariable:@"lineProgress"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, @[@"line-progress"]); XCTAssertEqualObjects([NSExpression expressionWithFormat:@"$lineProgress"].mgl_jsonExpressionObject, @[@"line-progress"]); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:@[@"line-progress"]], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:@[@"line-progress"]], expression); NSMutableDictionary *context = [@{@"lineProgress": @1} mutableCopy]; XCTAssertEqualObjects([expression expressionValueWithObject:nil context:context], @1); } @@ -258,47 +258,47 @@ using namespace std::string_literals; NSExpression *expression = [NSExpression expressionForVariable:@"featureAccumulated"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, @[@"accumulated"]); XCTAssertEqualObjects([NSExpression expressionWithFormat:@"$featureAccumulated"].mgl_jsonExpressionObject, @[@"accumulated"]); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:@[@"accumulated"]], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:@[@"accumulated"]], expression); } { NSExpression *expression = [NSExpression expressionForVariable:@"geometryType"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, @[@"geometry-type"]); XCTAssertEqualObjects([NSExpression expressionWithFormat:@"$geometryType"].mgl_jsonExpressionObject, @[@"geometry-type"]); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:@[@"geometry-type"]], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:@[@"geometry-type"]], expression); } { NSExpression *expression = [NSExpression expressionForVariable:@"featureIdentifier"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, @[@"id"]); XCTAssertEqualObjects([NSExpression expressionWithFormat:@"$featureIdentifier"].mgl_jsonExpressionObject, @[@"id"]); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:@[@"id"]], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:@[@"id"]], expression); } { NSExpression *expression = [NSExpression expressionForVariable:@"featureAttributes"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, @[@"properties"]); XCTAssertEqualObjects([NSExpression expressionWithFormat:@"$featureAttributes"].mgl_jsonExpressionObject, @[@"properties"]); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:@[@"properties"]], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:@[@"properties"]], expression); } { NSExpression *expression = [NSExpression expressionForVariable:@"loremIpsum"]; NSArray *jsonExpression = @[@"var", @"loremIpsum"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([NSExpression expressionWithFormat:@"$loremIpsum"].mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); NSMutableDictionary *context = [@{@"loremIpsum": @"Lorem ipsum dolor sit amet"} mutableCopy]; XCTAssertEqualObjects([expression expressionValueWithObject:nil context:context], @"Lorem ipsum dolor sit amet"); } { - NSDictionary *context = @{@"loremIpsum": MGLConstantExpression(@"Lorem ipsum dolor sit amet")}; + NSDictionary *context = @{@"loremIpsum": MLNConstantExpression(@"Lorem ipsum dolor sit amet")}; #if TARGET_OS_IPHONE XCTExpectFailure(@"Awaiting unit test refactoring for https://github.com/maplibre/maplibre-gl-native/issues/331"); #endif - NSExpression *expression = [NSExpression expressionWithFormat:@"MGL_LET('loremIpsum', 'Lorem ipsum dolor sit amet', uppercase($loremIpsum))", context]; + NSExpression *expression = [NSExpression expressionWithFormat:@"MLN_LET('loremIpsum', 'Lorem ipsum dolor sit amet', uppercase($loremIpsum))", context]; NSExpression *compatibilityExpression = [NSExpression expressionWithFormat:@"FUNCTION(uppercase($loremIpsum), 'mgl_expressionWithContext:', %@)", context]; NSArray *jsonExpression = @[@"let", @"loremIpsum", @"Lorem ipsum dolor sit amet", @[@"upcase", @[@"var", @"loremIpsum"]]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects(compatibilityExpression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } } @@ -307,28 +307,28 @@ using namespace std::string_literals; NSExpression *expression = [NSExpression expressionForConstantValue:nil]; XCTAssert(expression.mgl_jsonExpressionObject == [NSNull null]); XCTAssert([NSExpression expressionWithFormat:@"nil"].mgl_jsonExpressionObject == [NSNull null]); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:[NSNull null]], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:[NSNull null]], expression); XCTAssertNil([expression expressionValueWithObject:nil context:nil]); } { NSExpression *expression = [NSExpression expressionForConstantValue:@1]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, @1); XCTAssertEqualObjects([NSExpression expressionWithFormat:@"1"].mgl_jsonExpressionObject, @1); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:@1], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:@1], expression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @1); } { NSExpression *expression = [NSExpression expressionForConstantValue:@YES]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, @YES); XCTAssertEqualObjects([NSExpression expressionWithFormat:@"TRUE"].mgl_jsonExpressionObject, @YES); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:@YES], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:@YES], expression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @YES); } { NSExpression *expression = [NSExpression expressionForConstantValue:nil]; XCTAssert(expression.mgl_jsonExpressionObject == [NSNull null]); XCTAssert([NSExpression expressionWithFormat:@"nil"].mgl_jsonExpressionObject == [NSNull null]); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:[NSNull null]], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:[NSNull null]], expression); XCTAssertNil([expression expressionValueWithObject:nil context:nil]); } { @@ -341,7 +341,7 @@ using namespace std::string_literals; #endif XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); // No way to distinguish offsets from ordinary arrays in expressions. - XCTAssertEqualObjects([[NSExpression expressionWithMGLJSONObject:jsonExpression].collection valueForKeyPath:@"constantValue"], jsonExpression.lastObject); + XCTAssertEqualObjects([[NSExpression expressionWithMLNJSONObject:jsonExpression].collection valueForKeyPath:@"constantValue"], jsonExpression.lastObject); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @(vector)); } { @@ -356,11 +356,11 @@ using namespace std::string_literals; NSArray *jsonExpression = @[@"literal", @[@1, @4, @3, @2]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); // No way to distinguish offsets from ordinary arrays in expressions. - XCTAssertEqualObjects([[NSExpression expressionWithMGLJSONObject:jsonExpression].collection valueForKeyPath:@"constantValue"], jsonExpression.lastObject); + XCTAssertEqualObjects([[NSExpression expressionWithMLNJSONObject:jsonExpression].collection valueForKeyPath:@"constantValue"], jsonExpression.lastObject); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], value); } { - MGLColor *color = [MGLColor mgl_colorWithColor:{ 255.0/255, 239.0/255, 213.0/255, 1 }]; // papayawhip + MLNColor *color = [MLNColor mgl_colorWithColor:{ 255.0/255, 239.0/255, 213.0/255, 1 }]; // papayawhip NSExpression *expression = [NSExpression expressionForConstantValue:color]; NSArray *jsonExpression = @[@"rgb", @255, @239, @213]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); @@ -372,7 +372,7 @@ using namespace std::string_literals; float red = (255.0 * alpha) / 255; float green = (239.0 * alpha) / 255; float blue = (213.0 * alpha) / 255; - MGLColor *color = [MGLColor mgl_colorWithColor:{ red, green, blue, alpha }]; // papayawhip + MLNColor *color = [MLNColor mgl_colorWithColor:{ red, green, blue, alpha }]; // papayawhip NSExpression *expression = [NSExpression expressionForConstantValue:color]; NSArray *jsonExpression = @[@"rgba", @255.0, @239.0, @213.0, @0.5]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); @@ -381,8 +381,8 @@ using namespace std::string_literals; { // Transform color components to non-premultiplied values NSArray *jsonExpression = @[@"rgba", @255.0, @239.0, @213.0, @0.5]; - NSExpression *papayawhipExpression = [NSExpression expressionWithMGLJSONObject:jsonExpression]; - MGLColor *papayaWhipColor = [papayawhipExpression expressionValueWithObject:nil context:nil]; + NSExpression *papayawhipExpression = [NSExpression expressionWithMLNJSONObject:jsonExpression]; + MLNColor *papayaWhipColor = [papayawhipExpression expressionValueWithObject:nil context:nil]; CGFloat convertedRed = 0.0, convertedGreen = 0.0, convertedBlue = 0.0, convertedAlpha = 0.0; [papayaWhipColor getRed:&convertedRed green:&convertedGreen blue:&convertedBlue alpha:&convertedAlpha]; @@ -404,31 +404,31 @@ using namespace std::string_literals; NSArray *jsonExpression = @[@"get", @"highway"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([NSExpression expressionWithFormat:@"highway"].mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *expression = [NSExpression expressionWithFormat:@"%@.population", @{@"population": MGLConstantExpression(@12000)}]; + NSExpression *expression = [NSExpression expressionWithFormat:@"%@.population", @{@"population": MLNConstantExpression(@12000)}]; NSArray *jsonExpression = @[@"get", @"population", @[@"literal", @{@"population": @12000}]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *expression = [NSExpression expressionWithFormat:@"%@.uppercase('population')", @{@"POPULATION": MGLConstantExpression(@12000)}]; + NSExpression *expression = [NSExpression expressionWithFormat:@"%@.uppercase('population')", @{@"POPULATION": MLNConstantExpression(@12000)}]; NSArray *jsonExpression = @[@"get", @[@"upcase", @"population"], @[@"literal", @{@"POPULATION": @12000}]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionForKeyPath:@"lineStyle.color"]; NSArray *jsonExpression = @[@"get", @"color", @[@"get", @"lineStyle"]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionForKeyPath:@"map.box.gl"]; NSArray *jsonExpression = @[@"get", @"gl", @[@"get", @"box", @[@"get", @"map"]]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } } @@ -444,43 +444,43 @@ using namespace std::string_literals; NSArray *jsonExpression = @[@"+", @1, @2, @2, @3, @4, @7, @9]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @28); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionWithFormat:@"count({1, 2, 2, 3, 4, 7, 9})"]; NSArray *jsonExpression = @[@"length", @[@"literal", @[@1, @2, @2, @3, @4, @7, @9]]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @7); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionWithFormat:@"min({1, 2, 2, 3, 4, 7, 9})"]; NSArray *jsonExpression = @[@"min", @1, @2, @2, @3, @4, @7, @9]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @1); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionWithFormat:@"max({1, 2, 2, 3, 4, 7, 9})"]; NSArray *jsonExpression = @[@"max", @1, @2, @2, @3, @4, @7, @9]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @9); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } } - (void)testArithmeticExpressionObject { - NSArray *arguments = @[MGLConstantExpression(@1), MGLConstantExpression(@1)]; + NSArray *arguments = @[MLNConstantExpression(@1), MLNConstantExpression(@1)]; { NSExpression *expression = [NSExpression expressionForFunction:@"add:to:" arguments:arguments]; NSArray *jsonExpression = @[@"+", @1, @1]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([NSExpression expressionWithFormat:@"1 + 1"].mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *testExpression = [NSExpression expressionWithFormat:@"sum:({1, 1, 2})"]; - NSExpression *expression = [NSExpression expressionForFunction:@"sum:" arguments:@[[NSExpression expressionForAggregate:@[MGLConstantExpression(@1), MGLConstantExpression(@1), MGLConstantExpression(@2)]]]]; + NSExpression *expression = [NSExpression expressionForFunction:@"sum:" arguments:@[[NSExpression expressionForAggregate:@[MLNConstantExpression(@1), MLNConstantExpression(@1), MLNConstantExpression(@2)]]]]; NSArray *jsonExpression = @[@"+", @1, @1, @2]; @@ -489,58 +489,58 @@ using namespace std::string_literals; XCTAssertEqualObjects(expression, testExpression); } { - NSExpression *expression = [NSExpression expressionForFunction:@"sum:" arguments:@[MGLConstantExpression(@1), MGLConstantExpression(@1), MGLConstantExpression(@2)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"sum:" arguments:@[MLNConstantExpression(@1), MLNConstantExpression(@1), MLNConstantExpression(@2)]]; NSArray *jsonExpression = @[@"+", @1, @1, @2]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - // - [NSExpression expressionWithMGLJSONObject:] creates an expression with an aggregate expression as an argument. This is not equal to an expression with an array of expressions as an argument. For testing purposes, we will compare their operands and arrays of expressions. - NSExpression *aggregateExpression = [NSExpression expressionWithMGLJSONObject:jsonExpression]; + // - [NSExpression expressionWithMLNJSONObject:] creates an expression with an aggregate expression as an argument. This is not equal to an expression with an array of expressions as an argument. For testing purposes, we will compare their operands and arrays of expressions. + NSExpression *aggregateExpression = [NSExpression expressionWithMLNJSONObject:jsonExpression]; XCTAssertEqualObjects(aggregateExpression.operand, expression.operand); XCTAssertEqualObjects(aggregateExpression.arguments.firstObject.collection, expression.arguments); } { - NSArray *threeArguments = @[MGLConstantExpression(@1), MGLConstantExpression(@1), MGLConstantExpression(@1)]; + NSArray *threeArguments = @[MLNConstantExpression(@1), MLNConstantExpression(@1), MLNConstantExpression(@1)]; NSExpression *expression = [NSExpression expressionForFunction:@"add:to:" arguments:threeArguments]; NSArray *jsonExpression = @[@"+", @1, @1, @1]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); jsonExpression = @[@"+", @[@"+", @1, @1], @1]; XCTAssertEqualObjects([NSExpression expressionWithFormat:@"1 + 1 + 1"].mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], [NSExpression expressionWithFormat:@"1 + 1 + 1"]); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], [NSExpression expressionWithFormat:@"1 + 1 + 1"]); } { NSExpression *expression = [NSExpression expressionForFunction:@"from:subtract:" arguments:arguments]; NSArray *jsonExpression = @[@"-", @1, @1]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([NSExpression expressionWithFormat:@"1 - 1"].mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionForFunction:@"multiply:by:" arguments:arguments]; NSArray *jsonExpression = @[@"*", @1, @1]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([NSExpression expressionWithFormat:@"1 * 1"].mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionForFunction:@"divide:by:" arguments:arguments]; NSArray *jsonExpression = @[@"/", @1, @1]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([NSExpression expressionWithFormat:@"1 / 1"].mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionForFunction:@"modulus:by:" arguments:arguments]; NSArray *jsonExpression = @[@"%", @1, @1]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); // NSExpression lacks a shorthand operator for modulus. - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionForFunction:@"max:" arguments:arguments]; NSArray *jsonExpression = @[@"max", @1, @1]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - NSExpression *aggregateExpression = [NSExpression expressionWithMGLJSONObject:jsonExpression]; + NSExpression *aggregateExpression = [NSExpression expressionWithMLNJSONObject:jsonExpression]; XCTAssertEqualObjects(aggregateExpression.operand, expression.operand); XCTAssertEqualObjects(aggregateExpression.arguments.firstObject.collection, expression.arguments); } @@ -549,78 +549,78 @@ using namespace std::string_literals; NSArray *jsonExpression = @[@"min", @1, @1]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - NSExpression *aggregateExpression = [NSExpression expressionWithMGLJSONObject:jsonExpression]; + NSExpression *aggregateExpression = [NSExpression expressionWithMLNJSONObject:jsonExpression]; XCTAssertEqualObjects(aggregateExpression.operand, expression.operand); XCTAssertEqualObjects(aggregateExpression.arguments.firstObject.collection, expression.arguments); } { - NSExpression *expression = [NSExpression expressionForFunction:@"ceiling:" arguments:@[MGLConstantExpression(@1.5)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"ceiling:" arguments:@[MLNConstantExpression(@1.5)]]; NSArray *jsonExpression = @[@"ceil", @1.5]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @2); } { - NSExpression *expression = [NSExpression expressionForFunction:@"ceiling:" arguments:@[MGLConstantExpression(@-1.5)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"ceiling:" arguments:@[MLNConstantExpression(@-1.5)]]; NSArray *jsonExpression = @[@"ceil", @-1.5]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @-1); } { - NSExpression *expression = [NSExpression expressionForFunction:@"ceiling:" arguments:@[MGLConstantExpression(@2)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"ceiling:" arguments:@[MLNConstantExpression(@2)]]; NSArray *jsonExpression = @[@"ceil", @2]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @2); } { - NSExpression *expression = [NSExpression expressionForFunction:@"ceiling:" arguments:@[MGLConstantExpression(@-2)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"ceiling:" arguments:@[MLNConstantExpression(@-2)]]; NSArray *jsonExpression = @[@"ceil", @-2]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @-2); } { - NSExpression *expression = [NSExpression expressionForFunction:@"trunc:" arguments:@[MGLConstantExpression(@1.5)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"trunc:" arguments:@[MLNConstantExpression(@1.5)]]; NSArray *jsonExpression = @[@"-", @1.5, @[@"%", @1.5, @1]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @1); } { - NSExpression *expression = [NSExpression expressionForFunction:@"trunc:" arguments:@[MGLConstantExpression(@-1.5)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"trunc:" arguments:@[MLNConstantExpression(@-1.5)]]; NSArray *jsonExpression = @[@"-", @-1.5, @[@"%", @-1.5, @1]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @-1); } { - NSExpression *expression = [NSExpression expressionForFunction:@"abs:" arguments:@[MGLConstantExpression(@2)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"abs:" arguments:@[MLNConstantExpression(@2)]]; NSArray *jsonExpression = @[@"abs", @2]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @2); } { - NSExpression *expression = [NSExpression expressionForFunction:@"abs:" arguments:@[MGLConstantExpression(@-2)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"abs:" arguments:@[MLNConstantExpression(@-2)]]; NSArray *jsonExpression = @[@"abs", @-2]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @2); } { - NSExpression *expression = [NSExpression expressionForFunction:@"floor:" arguments:@[MGLConstantExpression(@1.5)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"floor:" arguments:@[MLNConstantExpression(@1.5)]]; NSArray *jsonExpression = @[@"floor", @1.5]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @1); } { - NSExpression *expression = [NSExpression expressionForFunction:@"floor:" arguments:@[MGLConstantExpression(@-1.5)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"floor:" arguments:@[MLNConstantExpression(@-1.5)]]; NSArray *jsonExpression = @[@"floor", @-1.5]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @-2); } { - NSExpression *expression = [NSExpression expressionForFunction:@"floor:" arguments:@[MGLConstantExpression(@2)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"floor:" arguments:@[MLNConstantExpression(@2)]]; NSArray *jsonExpression = @[@"floor", @2]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @2); } { - NSExpression *expression = [NSExpression expressionForFunction:@"floor:" arguments:@[MGLConstantExpression(@-2)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"floor:" arguments:@[MLNConstantExpression(@-2)]]; NSArray *jsonExpression = @[@"floor", @-2]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @-2); @@ -629,25 +629,25 @@ using namespace std::string_literals; #if TARGET_OS_IPHONE XCTExpectFailure(@"Awaiting unit test refactoring for https://github.com/maplibre/maplibre-gl-native/issues/331"); #endif - NSExpression *expression = [NSExpression expressionForFunction:@"mgl_round:" arguments:@[MGLConstantExpression(@1.5)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"mgl_round:" arguments:@[MLNConstantExpression(@1.5)]]; NSArray *jsonExpression = @[@"round", @1.5]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @2); } { - NSExpression *expression = [NSExpression expressionForFunction:@"mgl_round:" arguments:@[MGLConstantExpression(@-1.5)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"mgl_round:" arguments:@[MLNConstantExpression(@-1.5)]]; NSArray *jsonExpression = @[@"round", @-1.5]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @-2); } { - NSExpression *expression = [NSExpression expressionForFunction:@"mgl_round:" arguments:@[MGLConstantExpression(@2.5)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"mgl_round:" arguments:@[MLNConstantExpression(@2.5)]]; NSArray *jsonExpression = @[@"round", @2.5]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @3); } { - NSExpression *expression = [NSExpression expressionForFunction:@"mgl_round:" arguments:@[MGLConstantExpression(@-2.5)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"mgl_round:" arguments:@[MLNConstantExpression(@-2.5)]]; NSArray *jsonExpression = @[@"round", @-2.5]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @-3); @@ -655,119 +655,119 @@ using namespace std::string_literals; } - (void)testTrigonometricExpressionObject { - NSArray *arguments = @[MGLConstantExpression(@1), MGLConstantExpression(@1)]; + NSArray *arguments = @[MLNConstantExpression(@1), MLNConstantExpression(@1)]; { NSExpression *expression = [NSExpression expressionForFunction:@"sqrt:" arguments:arguments]; NSArray *jsonExpression = @[@"sqrt", @1, @1]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionForFunction:@"ln:" arguments:arguments]; NSArray *jsonExpression = @[@"ln", @1, @1]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { #if TARGET_OS_IPHONE XCTExpectFailure(@"Awaiting unit test refactoring for https://github.com/maplibre/maplibre-gl-native/issues/331"); #endif - NSExpression *expression = [NSExpression expressionForFunction:@"mgl_log2:" arguments:@[MGLConstantExpression(@1024)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"mgl_log2:" arguments:@[MLNConstantExpression(@1024)]]; NSArray *jsonExpression = @[@"log2", @1024]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @10); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionForFunction:@"raise:toPower:" arguments:arguments]; NSArray *jsonExpression = @[@"^", @1, @1]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([NSExpression expressionWithFormat:@"1 ** 1"].mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *expression = [NSExpression expressionForFunction:@"exp:" arguments:@[MGLConstantExpression(@0)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"exp:" arguments:@[MLNConstantExpression(@0)]]; NSArray *jsonExpression = @[@"^", @[@"e"], @0]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @1); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionForConstantValue:@(M_E)]; NSArray *jsonExpression = @[@"e"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @(M_E)); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionForConstantValue:@(M_PI)]; NSArray *jsonExpression = @[@"pi"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @(M_PI)); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *expression = [NSExpression expressionForFunction:@"mgl_acos:" arguments:@[MGLConstantExpression(@1)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"mgl_acos:" arguments:@[MLNConstantExpression(@1)]]; NSArray *jsonExpression = @[@"acos", @1]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @0); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *expression = [NSExpression expressionForFunction:@"mgl_cos:" arguments:@[MGLConstantExpression(@0)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"mgl_cos:" arguments:@[MLNConstantExpression(@0)]]; NSArray *jsonExpression = @[@"cos", @0]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @1); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *expression = [NSExpression expressionForFunction:@"mgl_asin:" arguments:@[MGLConstantExpression(@0)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"mgl_asin:" arguments:@[MLNConstantExpression(@0)]]; NSArray *jsonExpression = @[@"asin", @0]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @0); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *expression = [NSExpression expressionForFunction:@"mgl_sin:" arguments:@[MGLConstantExpression(@0)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"mgl_sin:" arguments:@[MLNConstantExpression(@0)]]; NSArray *jsonExpression = @[@"sin", @0]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @0); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *expression = [NSExpression expressionForFunction:@"mgl_atan:" arguments:@[MGLConstantExpression(@20)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"mgl_atan:" arguments:@[MLNConstantExpression(@20)]]; NSArray *jsonExpression = @[@"atan", @20]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); NSNumber *value = [expression expressionValueWithObject:nil context:nil]; XCTAssertEqualWithAccuracy(value.doubleValue, 1.52, 0.001); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *expression = [NSExpression expressionForFunction:@"mgl_tan:" arguments:@[MGLConstantExpression(@0)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"mgl_tan:" arguments:@[MLNConstantExpression(@0)]]; NSArray *jsonExpression = @[@"tan", @0]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @0); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } } - (void)testShapeDistanceExpressionObject { { - MGLPointAnnotation *point = [[MGLPointAnnotation alloc] init]; + MLNPointAnnotation *point = [[MLNPointAnnotation alloc] init]; point.coordinate = CLLocationCoordinate2DMake(1, -1); #if TARGET_OS_IPHONE XCTExpectFailure(@"Awaiting unit test refactoring for https://github.com/maplibre/maplibre-gl-native/issues/331"); #endif - NSExpression *expression = [NSExpression expressionForFunction:@"mgl_distanceFrom:" arguments:@[MGLConstantExpression(point)]]; + NSExpression *expression = [NSExpression expressionForFunction:@"mgl_distanceFrom:" arguments:@[MLNConstantExpression(point)]]; NSArray *jsonExpression = @[@"distance", @{@"type": @"Point", @"coordinates": @[@-1, @1]}]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertThrowsSpecificNamed([expression expressionValueWithObject:nil context:nil], NSException, NSInvalidArgumentException); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } } - (void)testStringFormattingExpressionObject { - NSArray *arguments = @[MGLConstantExpression(@"MacDonald")]; + NSArray *arguments = @[MLNConstantExpression(@"MacDonald")]; { NSExpression *expression = [NSExpression expressionWithFormat:@"FUNCTION('Old', 'stringByAppendingString:', 'MacDonald')"]; #if TARGET_OS_IPHONE @@ -779,7 +779,7 @@ using namespace std::string_literals; XCTAssertEqualObjects(aftermarketExpression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @"OldMacDonald"); XCTAssertEqualObjects([aftermarketExpression expressionValueWithObject:nil context:nil], @"OldMacDonald"); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], aftermarketExpression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], aftermarketExpression); } { NSExpression *expression = [NSExpression expressionForFunction:@"mgl_join:" arguments:@[@"Old", @"MacDonald"]]; @@ -788,26 +788,26 @@ using namespace std::string_literals; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects(aftermarketExpression.mgl_jsonExpressionObject, expression.mgl_jsonExpressionObject); - NSExpression *aggregateExpression = [NSExpression expressionWithMGLJSONObject:jsonExpression]; + NSExpression *aggregateExpression = [NSExpression expressionWithMLNJSONObject:jsonExpression]; XCTAssertEqualObjects(aggregateExpression.operand, expression.operand); } { NSExpression *expression = [NSExpression expressionForFunction:@"uppercase:" arguments:arguments]; NSArray *jsonExpression = @[@"upcase", @"MacDonald"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionForFunction:@"lowercase:" arguments:arguments]; NSArray *jsonExpression = @[@"downcase", @"MacDonald"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionForFunction:@"length:" arguments:arguments]; NSArray *jsonExpression = @[@"length", @"MacDonald"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } } @@ -818,7 +818,7 @@ using namespace std::string_literals; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); // NSExpression is unable to evaluate -[NSNumber boolValue] by itself // because it returns a primitive instead of an object. - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionWithFormat:@"FUNCTION(postalCode, 'mgl_number')"]; @@ -830,7 +830,7 @@ using namespace std::string_literals; // NSExpression is unable to evaluate NSNumber’s -floatValue, // -doubleValue, or -decimalValue by themselves because they each return // a primitive instead of an object. - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], [NSExpression expressionWithFormat:@"CAST(postalCode, 'NSNumber')"]); } { @@ -843,7 +843,7 @@ using namespace std::string_literals; // NSExpression is unable to evaluate NSNumber’s -floatValue, // -doubleValue, or -decimalValue by themselves because they each return // a primitive instead of an object. - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionWithFormat:@"CAST(postalCode, 'NSNumber')"]; @@ -852,7 +852,7 @@ using namespace std::string_literals; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects(compatibilityExpression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:@{@"postalCode": @"02134"} context:nil], @02134); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionWithFormat:@"CAST(number, 'NSString')"]; @@ -862,7 +862,7 @@ using namespace std::string_literals; XCTAssertEqualObjects(compatibilityExpression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:@{@"number": @1.5} context:nil], @"1.5"); XCTAssertEqualObjects([compatibilityExpression expressionValueWithObject:@{@"number": @1.5} context:nil], @"1.5"); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { #if TARGET_OS_IPHONE @@ -873,13 +873,13 @@ using namespace std::string_literals; NSArray *jsonExpression = @[@"to-color", @[@"get", @"x"]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { #if TARGET_OS_IPHONE XCTExpectFailure(@"Awaiting unit test refactoring for https://github.com/maplibre/maplibre-gl-native/issues/331"); #endif - NSExpression *expression = [NSExpression expressionWithFormat:@"MGL_FUNCTION('to-color', x, y, z)"]; + NSExpression *expression = [NSExpression expressionWithFormat:@"MLN_FUNCTION('to-color', x, y, z)"]; NSArray *jsonExpression = @[@"to-color", @[@"get", @"x"], @[@"get", @"y"], @[@"get", @"z"]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); } @@ -887,13 +887,13 @@ using namespace std::string_literals; NSExpression *expression = [NSExpression expressionWithFormat:@"CAST(noindex(x), 'NSArray')"]; NSArray *jsonExpression = @[@"to-rgba", @[@"get", @"x"]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *expression = [NSExpression expressionWithFormat:@"CAST(noindex(%@), 'NSArray')", MGLConstantExpression(MGLColor.blueColor)]; + NSExpression *expression = [NSExpression expressionWithFormat:@"CAST(noindex(%@), 'NSArray')", MLNConstantExpression(MLNColor.blueColor)]; NSArray *jsonExpression = @[@"to-rgba", @[@"rgb", @0, @0, @255]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionWithFormat:@"CAST(noindex('x'), 'NSArray')"]; @@ -903,44 +903,44 @@ using namespace std::string_literals; - (void)testInterpolationExpressionObject { { - NSDictionary *stops = @{@0: MGLConstantExpression(@100), @10: MGLConstantExpression(@200)}; + NSDictionary *stops = @{@0: MLNConstantExpression(@100), @10: MLNConstantExpression(@200)}; XCTExpectFailure(@"Awaiting unit test refactoring for https://github.com/maplibre/maplibre-gl-native/issues/331"); NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:(x, 'linear', nil, %@)", stops]; NSExpression *compatibilityExpression = [NSExpression expressionWithFormat:@"FUNCTION(x, 'mgl_interpolateWithCurveType:parameters:stops:', 'linear', nil, %@)", stops]; NSArray *jsonExpression = @[@"interpolate", @[@"linear"], @[@"get", @"x"], @0, @100, @10, @200]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects(compatibilityExpression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSDictionary *stops = @{@1: MGLConstantExpression(@2), @3: MGLConstantExpression(@6)}; + NSDictionary *stops = @{@1: MLNConstantExpression(@2), @3: MLNConstantExpression(@6)}; NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:(x, 'exponential', 2, %@)", stops]; NSArray *jsonExpression = @[@"interpolate", @[@"exponential", @2], @[@"get", @"x"], @1, @2, @3, @6]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSDictionary *stops = @{@0: MGLConstantExpression(@0), @100: MGLConstantExpression(@100)}; + NSDictionary *stops = @{@0: MLNConstantExpression(@0), @100: MLNConstantExpression(@100)}; NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:(x, 'cubic-bezier', { 0.42, 0, 0.58, 1 }, %@)", stops]; NSArray *jsonExpression = @[@"interpolate", @[@"cubic-bezier", @0.42, @0, @0.58, @1], @[@"get", @"x"], @0, @0, @100, @100]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSDictionary *stops = @{@0: MGLConstantExpression(@111), @1: MGLConstantExpression(@1111)}; + NSDictionary *stops = @{@0: MLNConstantExpression(@111), @1: MLNConstantExpression(@1111)}; NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_step:from:stops:(x, 11, %@)", stops]; NSExpression *compatibilityExpression = [NSExpression expressionWithFormat:@"FUNCTION(x, 'mgl_stepWithMinimum:stops:', 11, %@)", stops]; NSArray *jsonExpression = @[@"step", @[@"get", @"x"], @11, @0, @111, @1, @1111]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects(compatibilityExpression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSDictionary *stops = @{@0: MGLConstantExpression(@111), @1: MGLConstantExpression(@1111)}; + NSDictionary *stops = @{@0: MLNConstantExpression(@111), @1: MLNConstantExpression(@1111)}; NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_step:from:stops:($zoomLevel, 11, %@)", stops]; NSArray *jsonExpression = @[@"step", @[@"zoom"], @11, @0, @111, @1, @1111]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSDictionary *stops = @{}; @@ -959,39 +959,39 @@ using namespace std::string_literals; #if TARGET_OS_IPHONE XCTExpectFailure(@"Awaiting unit test refactoring for https://github.com/maplibre/maplibre-gl-native/issues/331"); #endif - NSExpression *expression = [NSExpression expressionWithFormat:@"MGL_MATCH(2 - 1, %@, %@, %@, %@, 'default')", MGLConstantExpression(@1), - MGLConstantExpression(@"one"), - MGLConstantExpression(@0), - MGLConstantExpression(@"zero")]; + NSExpression *expression = [NSExpression expressionWithFormat:@"MLN_MATCH(2 - 1, %@, %@, %@, %@, 'default')", MLNConstantExpression(@1), + MLNConstantExpression(@"one"), + MLNConstantExpression(@0), + MLNConstantExpression(@"zero")]; NSExpression *predicate = [NSExpression expressionWithFormat:@"2 - 1"]; - NSExpression *compatibilityExpression = [NSExpression expressionWithFormat:@"FUNCTION(%@, 'mgl_match:', %@)", predicate, @[MGLConstantExpression(@1), - MGLConstantExpression(@"one"), - MGLConstantExpression(@0), - MGLConstantExpression(@"zero"), - MGLConstantExpression(@"default")]]; + NSExpression *compatibilityExpression = [NSExpression expressionWithFormat:@"FUNCTION(%@, 'mgl_match:', %@)", predicate, @[MLNConstantExpression(@1), + MLNConstantExpression(@"one"), + MLNConstantExpression(@0), + MLNConstantExpression(@"zero"), + MLNConstantExpression(@"default")]]; NSArray *jsonExpression = @[@"match", @[@"-", @2, @1], @1, @"one", @0, @"zero", @"default"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects(compatibilityExpression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *expression = [NSExpression expressionWithFormat:@"MGL_MATCH(2 * 1, %@, %@, 'default')", MGLConstantExpression(@1), MGLConstantExpression(@"one")]; + NSExpression *expression = [NSExpression expressionWithFormat:@"MLN_MATCH(2 * 1, %@, %@, 'default')", MLNConstantExpression(@1), MLNConstantExpression(@"one")]; NSArray *jsonExpression = @[@"match", @[@"*", @2, @1], @1, @"one", @"default"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *expression = [NSExpression expressionWithFormat:@"MGL_MATCH(x, {'a', 'A'}, 'Apple', {'b', 'B'}, 'Banana', 'Kumquat')"]; + NSExpression *expression = [NSExpression expressionWithFormat:@"MLN_MATCH(x, {'a', 'A'}, 'Apple', {'b', 'B'}, 'Banana', 'Kumquat')"]; NSArray *jsonExpression = @[@"match", @[@"get", @"x"], @[@"a", @"A"], @"Apple", @[@"b", @"B"], @"Banana", @"Kumquat"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *expression = [NSExpression expressionWithFormat:@"MGL_MATCH(x, %@, 'Apple', %@, 'Banana', 'Kumquat')", + NSExpression *expression = [NSExpression expressionWithFormat:@"MLN_MATCH(x, %@, 'Apple', %@, 'Banana', 'Kumquat')", @[@"a", @"A"], @"Bb"]; NSArray *jsonExpression = @[@"match", @[@"get", @"x"], @[@"a", @"A"], @"Apple", @"Bb", @"Banana", @"Kumquat"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression].description, expression.description); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression].description, expression.description); } } @@ -1012,7 +1012,7 @@ using namespace std::string_literals; NSArray *jsonExpression = @[@"coalesce", @[@"get", @"x"], @[@"get", @"y"], @[@"get", @"z"], @0]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects(compatibilityExpression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } } @@ -1027,41 +1027,41 @@ using namespace std::string_literals; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([NSExpression expressionWithFormat:@"TERNARY(1 = 2, TRUE, FALSE)"].mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @NO); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionWithFormat:@"TERNARY(0 = 1, TRUE, TERNARY(1 = 2, TRUE, FALSE))"]; NSArray *jsonExpression = @[@"case", @[@"==", @0, @1], @YES, @[@"case", @[@"==", @1, @2], @YES, @NO]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @NO); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { #if TARGET_OS_IPHONE XCTExpectFailure(@"Awaiting unit test refactoring for https://github.com/maplibre/maplibre-gl-native/issues/331"); #endif - NSExpression *expression = [NSExpression expressionWithFormat:@"MGL_IF(%@, %@, %@)", + NSExpression *expression = [NSExpression expressionWithFormat:@"MLN_IF(%@, %@, %@)", [NSExpression expressionWithFormat:@"%@", [NSPredicate predicateWithFormat:@"1 = 2"]], - MGLConstantExpression(@YES), - MGLConstantExpression(@NO)]; - NSExpression *compatibilityExpression = [NSExpression expressionWithFormat:@"FUNCTION(%@, 'mgl_if:', %@)", [NSPredicate predicateWithFormat:@"1 = 2"], @[MGLConstantExpression(@YES), MGLConstantExpression(@NO)]]; + MLNConstantExpression(@YES), + MLNConstantExpression(@NO)]; + NSExpression *compatibilityExpression = [NSExpression expressionWithFormat:@"FUNCTION(%@, 'mgl_if:', %@)", [NSPredicate predicateWithFormat:@"1 = 2"], @[MLNConstantExpression(@YES), MLNConstantExpression(@NO)]]; NSArray *jsonExpression = @[@"case", @[@"==", @1, @2], @YES, @NO]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects(compatibilityExpression.mgl_jsonExpressionObject, jsonExpression); expression = [NSExpression expressionWithFormat:@"TERNARY(1 = 2, YES, NO)"]; - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @NO); } { - NSExpression *expression = [NSExpression expressionWithFormat:@"MGL_IF(%@, %@, %@, %@, %@)", + NSExpression *expression = [NSExpression expressionWithFormat:@"MLN_IF(%@, %@, %@, %@, %@)", [NSExpression expressionWithFormat:@"%@", [NSPredicate predicateWithFormat:@"1 = 2"]], - MGLConstantExpression(@YES), + MLNConstantExpression(@YES), [NSExpression expressionWithFormat:@"%@", [NSPredicate predicateWithFormat:@"1 = 1"]], - MGLConstantExpression(@YES), - MGLConstantExpression(@NO)]; + MLNConstantExpression(@YES), + MLNConstantExpression(@NO)]; NSArray *jsonExpression = @[@"case", @[@"==", @1, @2], @YES, @[@"==", @1, @1], @YES, @NO]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @YES); } { @@ -1076,58 +1076,58 @@ using namespace std::string_literals; @[@"get", @"name_en"] ]; NSExpression *expression = [NSExpression expressionWithFormat:@"TERNARY(area < 80000, abbr, name_en)"]; - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); } } - (void)testLookupExpressionObject { { - NSExpression *array = [NSExpression expressionForAggregate:@[MGLConstantExpression(@9), - MGLConstantExpression(@8), - MGLConstantExpression(@7)]]; + NSExpression *array = [NSExpression expressionForAggregate:@[MLNConstantExpression(@9), + MLNConstantExpression(@8), + MLNConstantExpression(@7)]]; NSExpression *expression = [NSExpression expressionForFunction:@"objectFrom:withIndex:" - arguments:@[array, MGLConstantExpression(@"FIRST")]]; + arguments:@[array, MLNConstantExpression(@"FIRST")]]; NSArray *jsonExpression = @[@"at", @0, @[ @"literal", @[@9, @8, @7]]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); } { - NSExpression *array = [NSExpression expressionForAggregate:@[MGLConstantExpression(@9), - MGLConstantExpression(@8), - MGLConstantExpression(@7)]]; + NSExpression *array = [NSExpression expressionForAggregate:@[MLNConstantExpression(@9), + MLNConstantExpression(@8), + MLNConstantExpression(@7)]]; NSExpression *expression = [NSExpression expressionForFunction:@"objectFrom:withIndex:" - arguments:@[array, MGLConstantExpression(@"LAST")]]; + arguments:@[array, MLNConstantExpression(@"LAST")]]; NSArray *jsonExpression = @[@"at", @[@"-", @[@"length", @[ @"literal", @[@9, @8, @7]]], @1], @[ @"literal", @[@9, @8, @7]]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); } { - NSExpression *array = [NSExpression expressionForAggregate:@[MGLConstantExpression(@9), - MGLConstantExpression(@8), - MGLConstantExpression(@7)]]; + NSExpression *array = [NSExpression expressionForAggregate:@[MLNConstantExpression(@9), + MLNConstantExpression(@8), + MLNConstantExpression(@7)]]; NSExpression *expression = [NSExpression expressionForFunction:@"objectFrom:withIndex:" - arguments:@[array, MGLConstantExpression(@"SIZE")]]; + arguments:@[array, MLNConstantExpression(@"SIZE")]]; NSArray *jsonExpression = @[@"length", @[ @"literal", @[@9, @8, @7]]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); } { - NSExpression *array = [NSExpression expressionForAggregate:@[MGLConstantExpression(@9), - MGLConstantExpression(@8), - MGLConstantExpression(@7)]]; + NSExpression *array = [NSExpression expressionForAggregate:@[MLNConstantExpression(@9), + MLNConstantExpression(@8), + MLNConstantExpression(@7)]]; NSExpression *expression = [NSExpression expressionForFunction:@"objectFrom:withIndex:" - arguments:@[array, MGLConstantExpression(@1)]]; + arguments:@[array, MLNConstantExpression(@1)]]; NSArray *jsonExpression = @[@"at", @1, @[ @"literal", @[@9, @8, @7]]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *array = [NSExpression expressionForAggregate:@[MGLConstantExpression(@9), - MGLConstantExpression(@8), - MGLConstantExpression(@7)]]; + NSExpression *array = [NSExpression expressionForAggregate:@[MLNConstantExpression(@9), + MLNConstantExpression(@8), + MLNConstantExpression(@7)]]; NSExpression *expression = [NSExpression expressionForFunction:@"objectFrom:withIndex:" arguments:@[array, [NSExpression expressionForKeyPath:@"x"]]]; NSArray *jsonExpression = @[@"at", @[@"get", @"x"], @[ @"literal", @[@9, @8, @7]]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { #if TARGET_OS_IPHONE @@ -1140,15 +1140,15 @@ using namespace std::string_literals; NSArray *jsonExpression = @[@"has", @"x"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects(compatibilityExpression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionForFunction:@"mgl_does:have:" - arguments:@[MGLConstantExpression(@{@"x": MGLConstantExpression(@0)}), - MGLConstantExpression(@"x")]]; + arguments:@[MLNConstantExpression(@{@"x": MLNConstantExpression(@0)}), + MLNConstantExpression(@"x")]]; NSArray *jsonExpression = @[@"has", @"x", @[@"literal", @{@"x": @0}]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression = [NSExpression expressionForFunction:@"mgl_does:have:" @@ -1156,14 +1156,14 @@ using namespace std::string_literals; [NSExpression expressionForConstantValue:@"x"]]]; NSArray *jsonExpression = @[@"has", @"x", @[@"properties"]]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { NSExpression *expression; expression = [NSExpression expressionWithFormat:@"TERNARY(key != nil, 1, 0)"]; NSArray *jsonExpression = @[@"case", @[@"!=", @[@"get", @"key"], [NSNull null]], @1, @0]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); XCTAssertEqualObjects([expression expressionValueWithObject:@{} context:nil], @NO); XCTAssertEqualObjects([expression expressionValueWithObject:@{@"key": @"🗝"} context:nil], @YES); } @@ -1174,152 +1174,152 @@ using namespace std::string_literals; NSArray *jsonExpression = @[@"case", @[@"!=", @[@"get", @"key", @[@"literal", dictionary]], [NSNull null]], @1, @0]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); // The dictionary isn’t equal enough. - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression].description, expression.description); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression].description, expression.description); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @YES); } } - (void)testFormatExpressionObject { { - MGLAttributedExpression *attribute1 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"foo"] + MLNAttributedExpression *attribute1 = [MLNAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"foo"] fontNames:nil fontScale:@(1.2)]; - MGLAttributedExpression *attribute2 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"biz"] + MLNAttributedExpression *attribute2 = [MLNAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"biz"] fontNames:nil fontScale:@(1.0)]; - MGLAttributedExpression *attribute3 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"bar"] + MLNAttributedExpression *attribute3 = [MLNAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"bar"] fontNames:nil fontScale:@(0.8)]; - MGLAttributedExpression *attribute4 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"\r"] + MLNAttributedExpression *attribute4 = [MLNAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"\r"] fontNames:@[] fontScale:nil]; #if TARGET_OS_IPHONE XCTExpectFailure(@"Awaiting unit test refactoring for https://github.com/maplibre/maplibre-gl-native/issues/331"); #endif NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@, %@, %@, %@)", - MGLConstantExpression(attribute1), - MGLConstantExpression(attribute4), - MGLConstantExpression(attribute2), - MGLConstantExpression(attribute3)]; + MLNConstantExpression(attribute1), + MLNConstantExpression(attribute4), + MLNConstantExpression(attribute2), + MLNConstantExpression(attribute3)]; NSArray *jsonExpression = @[@"format", @"foo", @{@"font-scale": @1.2}, @"\r", @{}, @"biz", @{@"font-scale": @1.0}, @"bar", @{@"font-scale": @0.8}]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - MGLAttributedExpression *attribute1 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"foo"] + MLNAttributedExpression *attribute1 = [MLNAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"foo"] fontNames:nil fontScale:@(1.2)]; - MGLAttributedExpression *attribute2 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"biz"] + MLNAttributedExpression *attribute2 = [MLNAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"biz"] fontNames:nil fontScale:@(1.0)]; - MGLAttributedExpression *attribute3 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"bar"] + MLNAttributedExpression *attribute3 = [MLNAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"bar"] fontNames:nil fontScale:@(0.8)]; - MGLAttributedExpression *attribute4 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"\n"] + MLNAttributedExpression *attribute4 = [MLNAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"\n"] fontNames:@[] fontScale:nil]; NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@, %@, %@, %@)", - MGLConstantExpression(attribute1), - MGLConstantExpression(attribute4), - MGLConstantExpression(attribute2), - MGLConstantExpression(attribute3)]; + MLNConstantExpression(attribute1), + MLNConstantExpression(attribute4), + MLNConstantExpression(attribute2), + MLNConstantExpression(attribute3)]; NSArray *jsonExpression = @[@"format", @"foo", @{@"font-scale": @1.2}, @"\n", @{}, @"biz", @{@"font-scale": @1.0}, @"bar", @{@"font-scale": @0.8}]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - MGLAttributedExpression *attribute1 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"foo"] + MLNAttributedExpression *attribute1 = [MLNAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"foo"] fontNames:nil fontScale:@(1.2)]; - NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@)", MGLConstantExpression(attribute1)]; + NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@)", MLNConstantExpression(attribute1)]; - NSExpression *compatibilityExpression = [NSExpression expressionForFunction:@"mgl_attributed:" arguments:@[MGLConstantExpression(attribute1)]]; + NSExpression *compatibilityExpression = [NSExpression expressionForFunction:@"mgl_attributed:" arguments:@[MLNConstantExpression(attribute1)]]; NSArray *jsonExpression = @[@"format", @"foo", @{@"font-scale": @1.2}]; XCTAssertEqualObjects(compatibilityExpression.mgl_jsonExpressionObject, expression.mgl_jsonExpressionObject); XCTAssertEqualObjects(compatibilityExpression, expression); XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - MGLAttributedExpression *attribute1 = [[MGLAttributedExpression alloc] initWithExpression:[NSExpression expressionForConstantValue:@"foo"] - attributes:@{ MGLFontScaleAttribute: MGLConstantExpression(@(1.2)), - MGLFontColorAttribute: MGLConstantExpression(@"yellow") }] ; - NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@)", MGLConstantExpression(attribute1)]; + MLNAttributedExpression *attribute1 = [[MLNAttributedExpression alloc] initWithExpression:[NSExpression expressionForConstantValue:@"foo"] + attributes:@{ MLNFontScaleAttribute: MLNConstantExpression(@(1.2)), + MLNFontColorAttribute: MLNConstantExpression(@"yellow") }] ; + NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@)", MLNConstantExpression(attribute1)]; - NSExpression *compatibilityExpression = [NSExpression expressionForFunction:@"mgl_attributed:" arguments:@[MGLConstantExpression(attribute1)]]; + NSExpression *compatibilityExpression = [NSExpression expressionForFunction:@"mgl_attributed:" arguments:@[MLNConstantExpression(attribute1)]]; NSArray *jsonExpression = @[ @"format", @"foo", @{ @"font-scale": @1.2, @"text-color": @"yellow" } ]; XCTAssertEqualObjects(compatibilityExpression.mgl_jsonExpressionObject, expression.mgl_jsonExpressionObject); XCTAssertEqualObjects(compatibilityExpression, expression); XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - MGLAttributedExpression *attribute1 = [[MGLAttributedExpression alloc] initWithExpression:[NSExpression expressionForConstantValue:@"foo"]] ; - NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@)", MGLConstantExpression(attribute1)]; + MLNAttributedExpression *attribute1 = [[MLNAttributedExpression alloc] initWithExpression:[NSExpression expressionForConstantValue:@"foo"]] ; + NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@)", MLNConstantExpression(attribute1)]; NSArray *jsonExpression = @[ @"format", @"foo", @{ } ]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *fontNames = [NSExpression expressionForAggregate:@[ MGLConstantExpression(@"DIN Offc Pro Bold"), MGLConstantExpression(@"Arial Unicode MS Bold") ]]; - MGLAttributedExpression *attribute1 = [[MGLAttributedExpression alloc] initWithExpression:[NSExpression expressionForConstantValue:@"foo"] - attributes:@{ MGLFontScaleAttribute: MGLConstantExpression(@(1.2)), - MGLFontColorAttribute: MGLConstantExpression(@"yellow"), - MGLFontNamesAttribute: fontNames + NSExpression *fontNames = [NSExpression expressionForAggregate:@[ MLNConstantExpression(@"DIN Offc Pro Bold"), MLNConstantExpression(@"Arial Unicode MS Bold") ]]; + MLNAttributedExpression *attribute1 = [[MLNAttributedExpression alloc] initWithExpression:[NSExpression expressionForConstantValue:@"foo"] + attributes:@{ MLNFontScaleAttribute: MLNConstantExpression(@(1.2)), + MLNFontColorAttribute: MLNConstantExpression(@"yellow"), + MLNFontNamesAttribute: fontNames }] ; - NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@)", MGLConstantExpression(attribute1)]; + NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@)", MLNConstantExpression(attribute1)]; NSArray *jsonExpression = @[ @"format", @"foo", @{ @"font-scale": @1.2, @"text-color": @"yellow" , @"text-font" : @[ @"literal", @[ @"DIN Offc Pro Bold", @"Arial Unicode MS Bold" ]]} ]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *fontNames = [NSExpression expressionForAggregate:@[ MGLConstantExpression(@"DIN Offc Pro Bold"), MGLConstantExpression(@"Arial Unicode MS Bold") ]]; - MGLAttributedExpression *attribute1 = [[MGLAttributedExpression alloc] initWithExpression:[NSExpression expressionForConstantValue:@"foo"] - attributes:@{ MGLFontScaleAttribute: MGLConstantExpression(@(1.2)), - MGLFontColorAttribute: MGLConstantExpression([MGLColor redColor]), - MGLFontNamesAttribute: fontNames + NSExpression *fontNames = [NSExpression expressionForAggregate:@[ MLNConstantExpression(@"DIN Offc Pro Bold"), MLNConstantExpression(@"Arial Unicode MS Bold") ]]; + MLNAttributedExpression *attribute1 = [[MLNAttributedExpression alloc] initWithExpression:[NSExpression expressionForConstantValue:@"foo"] + attributes:@{ MLNFontScaleAttribute: MLNConstantExpression(@(1.2)), + MLNFontColorAttribute: MLNConstantExpression([MLNColor redColor]), + MLNFontNamesAttribute: fontNames }] ; - NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@)", MGLConstantExpression(attribute1)]; + NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@)", MLNConstantExpression(attribute1)]; NSArray *jsonExpression = @[ @"format", @"foo", @{ @"font-scale": @1.2, @"text-color": @[@"rgb", @255, @0, @0] , @"text-font" : @[ @"literal", @[ @"DIN Offc Pro Bold", @"Arial Unicode MS Bold" ]]} ]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *fontNames = [NSExpression expressionForAggregate:@[ MGLConstantExpression(@"DIN Offc Pro Bold"), MGLConstantExpression(@"Arial Unicode MS Bold") ]]; - MGLAttributedExpression *attribute1 = [[MGLAttributedExpression alloc] initWithExpression:[NSExpression expressionWithFormat:@"CAST(x, 'NSString')"] - attributes:@{ MGLFontScaleAttribute: MGLConstantExpression(@(1.2)), - MGLFontColorAttribute: MGLConstantExpression([MGLColor redColor]), - MGLFontNamesAttribute: fontNames + NSExpression *fontNames = [NSExpression expressionForAggregate:@[ MLNConstantExpression(@"DIN Offc Pro Bold"), MLNConstantExpression(@"Arial Unicode MS Bold") ]]; + MLNAttributedExpression *attribute1 = [[MLNAttributedExpression alloc] initWithExpression:[NSExpression expressionWithFormat:@"CAST(x, 'NSString')"] + attributes:@{ MLNFontScaleAttribute: MLNConstantExpression(@(1.2)), + MLNFontColorAttribute: MLNConstantExpression([MLNColor redColor]), + MLNFontNamesAttribute: fontNames }] ; - NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@)", MGLConstantExpression(attribute1)]; + NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_attributed:(%@)", MLNConstantExpression(attribute1)]; NSArray *jsonExpression = @[ @"format", @[@"to-string", @[@"get", @"x"]], @{ @"font-scale": @1.2, @"text-color": @[@"rgb", @255, @0, @0] , @"text-font" : @[ @"literal", @[ @"DIN Offc Pro Bold", @"Arial Unicode MS Bold" ]]} ]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - MGLAttributedExpression *attribute1 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"foo"] + MLNAttributedExpression *attribute1 = [MLNAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"foo"] fontNames:nil fontScale:@(1.2)]; - MGLAttributedExpression *attribute2 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"biz"] + MLNAttributedExpression *attribute2 = [MLNAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"biz"] fontNames:nil fontScale:@(1.0)]; - MGLAttributedExpression *attribute3 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"bar"] + MLNAttributedExpression *attribute3 = [MLNAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"bar"] fontNames:nil fontScale:@(0.8)]; - MGLAttributedExpression *attribute4 = [MGLAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"\n"] + MLNAttributedExpression *attribute4 = [MLNAttributedExpression attributedExpression:[NSExpression expressionForConstantValue:@"\n"] fontNames:@[] fontScale:nil]; - NSExpression *expression = [NSExpression mgl_expressionForAttributedExpressions:@[MGLConstantExpression(attribute1), - MGLConstantExpression(attribute4), - MGLConstantExpression(attribute2), - MGLConstantExpression(attribute3)]]; + NSExpression *expression = [NSExpression mgl_expressionForAttributedExpressions:@[MLNConstantExpression(attribute1), + MLNConstantExpression(attribute4), + MLNConstantExpression(attribute2), + MLNConstantExpression(attribute3)]]; NSArray *jsonExpression = @[@"format", @"foo", @{@"font-scale": @1.2}, @"\n", @{}, @"biz", @{@"font-scale": @1.0}, @"bar", @{@"font-scale": @0.8}]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } } @@ -1328,47 +1328,47 @@ using namespace std::string_literals; #if TARGET_OS_IPHONE XCTExpectFailure(@"Awaiting unit test refactoring for https://github.com/maplibre/maplibre-gl-native/issues/331"); #endif - NSExpression *expression = [NSExpression expressionWithFormat:@"MGL_FUNCTION('random', 1, 2, 3, 4, 5)"]; + NSExpression *expression = [NSExpression expressionWithFormat:@"MLN_FUNCTION('random', 1, 2, 3, 4, 5)"]; NSArray *jsonExpression = @[@"random", @1, @2, @3, @4, @5]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSExpression *expression = [NSExpression expressionWithFormat:@"MGL_FUNCTION('random', 1, 2, 3, 4)"]; + NSExpression *expression = [NSExpression expressionWithFormat:@"MLN_FUNCTION('random', 1, 2, 3, 4)"]; XCTAssertThrowsSpecificNamed([expression expressionValueWithObject:nil context:nil], NSException, NSInvalidArgumentException); } { NSArray *arguments = @[ - MGLConstantExpression(@"one"), MGLConstantExpression(@1), + MLNConstantExpression(@"one"), MLNConstantExpression(@1), [NSExpression expressionForVariable:@"one"], ]; - NSExpression *nullaryExpression = [NSExpression expressionForFunction:@"MGL_LET" arguments:arguments]; - NSExpression *unaryExpression = [NSExpression expressionForFunction:@"MGL_LET:" arguments:arguments]; + NSExpression *nullaryExpression = [NSExpression expressionForFunction:@"MLN_LET" arguments:arguments]; + NSExpression *unaryExpression = [NSExpression expressionForFunction:@"MLN_LET:" arguments:arguments]; XCTAssertEqualObjects(nullaryExpression.mgl_jsonExpressionObject, unaryExpression.mgl_jsonExpressionObject); } { NSArray *arguments = @[ [NSExpression expressionForVariable:@"x"], - MGLConstantExpression(@YES), MGLConstantExpression(@"yes"), - MGLConstantExpression(@NO), MGLConstantExpression(@"no"), + MLNConstantExpression(@YES), MLNConstantExpression(@"yes"), + MLNConstantExpression(@NO), MLNConstantExpression(@"no"), ]; - NSExpression *nullaryExpression = [NSExpression expressionForFunction:@"MGL_MATCH" arguments:arguments]; - NSExpression *unaryExpression = [NSExpression expressionForFunction:@"MGL_MATCH:" arguments:arguments]; + NSExpression *nullaryExpression = [NSExpression expressionForFunction:@"MLN_MATCH" arguments:arguments]; + NSExpression *unaryExpression = [NSExpression expressionForFunction:@"MLN_MATCH:" arguments:arguments]; XCTAssertEqualObjects(nullaryExpression.mgl_jsonExpressionObject, unaryExpression.mgl_jsonExpressionObject); } { NSArray *arguments = @[ [NSPredicate predicateWithValue:YES], - MGLConstantExpression(@"yes"), MGLConstantExpression(@"no"), + MLNConstantExpression(@"yes"), MLNConstantExpression(@"no"), ]; - NSExpression *nullaryExpression = [NSExpression expressionForFunction:@"MGL_IF" arguments:arguments]; - NSExpression *unaryExpression = [NSExpression expressionForFunction:@"MGL_IF:" arguments:arguments]; + NSExpression *nullaryExpression = [NSExpression expressionForFunction:@"MLN_IF" arguments:arguments]; + NSExpression *unaryExpression = [NSExpression expressionForFunction:@"MLN_IF:" arguments:arguments]; XCTAssertEqualObjects(nullaryExpression.mgl_jsonExpressionObject, unaryExpression.mgl_jsonExpressionObject); } { - NSArray *arguments = @[MGLConstantExpression(@"zoom")]; - NSExpression *nullaryExpression = [NSExpression expressionForFunction:@"MGL_FUNCTION" arguments:arguments]; - NSExpression *unaryExpression = [NSExpression expressionForFunction:@"MGL_FUNCTION:" arguments:arguments]; + NSArray *arguments = @[MLNConstantExpression(@"zoom")]; + NSExpression *nullaryExpression = [NSExpression expressionForFunction:@"MLN_FUNCTION" arguments:arguments]; + NSExpression *unaryExpression = [NSExpression expressionForFunction:@"MLN_FUNCTION:" arguments:arguments]; XCTAssertEqualObjects(nullaryExpression.mgl_jsonExpressionObject, unaryExpression.mgl_jsonExpressionObject); } } @@ -1377,30 +1377,30 @@ using namespace std::string_literals; - (void)testLocalization { { - NSExpression *original = MGLConstantExpression(@""); + NSExpression *original = MLNConstantExpression(@""); NSExpression *expected = original; XCTAssertEqualObjects([original mgl_expressionLocalizedIntoLocale:nil], expected); } { - NSExpression *original = MGLConstantExpression(@"Old MacDonald"); + NSExpression *original = MLNConstantExpression(@"Old MacDonald"); NSExpression *expected = original; XCTAssertEqualObjects([original mgl_expressionLocalizedIntoLocale:nil], expected); } { - NSExpression *original = MGLConstantExpression(@"{name_en}"); + NSExpression *original = MLNConstantExpression(@"{name_en}"); NSExpression *expected = original; XCTAssertEqualObjects([original mgl_expressionLocalizedIntoLocale:nil], expected); } { NSExpression *keyExpression = [NSExpression expressionForKeyPath:@"name_en"]; - MGLAttributedExpression *attributedExpression = [MGLAttributedExpression attributedExpression:keyExpression attributes:@{}]; + MLNAttributedExpression *attributedExpression = [MLNAttributedExpression attributedExpression:keyExpression attributes:@{}]; NSExpression *original = [NSExpression expressionForConstantValue:attributedExpression]; #if TARGET_OS_IPHONE XCTExpectFailure(@"Awaiting unit test refactoring for https://github.com/maplibre/maplibre-gl-native/issues/331"); #endif NSExpression *coalesceExpression = [NSExpression expressionWithFormat:@"mgl_coalesce({%K, %K})", @"name_en", @"name"]; - MGLAttributedExpression *expectedAttributedExpression = [MGLAttributedExpression attributedExpression:coalesceExpression attributes:@{}]; + MLNAttributedExpression *expectedAttributedExpression = [MLNAttributedExpression attributedExpression:coalesceExpression attributes:@{}]; NSExpression *expected = [NSExpression expressionForConstantValue:expectedAttributedExpression]; XCTAssertEqualObjects([original mgl_expressionLocalizedIntoLocale:nil], expected); } @@ -1489,7 +1489,7 @@ using namespace std::string_literals; ], @5, @[@"get", @"name"] ]; - NSExpression *expression = [NSExpression expressionWithMGLJSONObject:jsonExpression]; + NSExpression *expression = [NSExpression expressionWithMLNJSONObject:jsonExpression]; NSExpression *localizedExpression = [expression mgl_expressionLocalizedIntoLocale:[NSLocale localeWithLocaleIdentifier:@"mul"]]; XCTAssertEqualObjects(localizedExpression.mgl_jsonExpressionObject, localizedJSONExpression); } @@ -1498,32 +1498,32 @@ using namespace std::string_literals; - (void)testConvenienceInitializers { { NSExpression *expression = [NSExpression mgl_expressionForConditional:[NSPredicate predicateWithFormat:@"1 = 2"] - trueExpression:MGLConstantExpression(@YES) - falseExpresssion:MGLConstantExpression(@NO)]; + trueExpression:MLNConstantExpression(@YES) + falseExpresssion:MLNConstantExpression(@NO)]; NSArray *jsonExpression = @[@"case", @[@"==", @1, @2], @YES, @NO]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @NO); } { - NSDictionary *stops = @{@0: MGLConstantExpression(@111), @1: MGLConstantExpression(@1111)}; + NSDictionary *stops = @{@0: MLNConstantExpression(@111), @1: MLNConstantExpression(@1111)}; NSExpression *expression = [NSExpression mgl_expressionForSteppingExpression:[NSExpression expressionForKeyPath:@"x"] fromExpression:[NSExpression expressionForConstantValue:@11] stops:[NSExpression expressionForConstantValue:stops]]; NSArray *jsonExpression = @[@"step", @[@"get", @"x"], @11, @0, @111, @1, @1111]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSDictionary *stops = @{@0: MGLConstantExpression(@100), @10: MGLConstantExpression(@200)}; + NSDictionary *stops = @{@0: MLNConstantExpression(@100), @10: MLNConstantExpression(@200)}; NSExpression *expression = [NSExpression mgl_expressionForInterpolatingExpression:[NSExpression expressionForKeyPath:@"x"] - withCurveType:MGLExpressionInterpolationModeLinear + withCurveType:MLNExpressionInterpolationModeLinear parameters:nil stops:[NSExpression expressionForConstantValue:stops]]; NSArray *jsonExpression = @[@"interpolate", @[@"linear"], @[@"get", @"x"], @0, @100, @10, @200]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { #if TARGET_OS_IPHONE @@ -1534,16 +1534,16 @@ using namespace std::string_literals; NSArray *jsonExpression = @[@"concat", @"Old", @"MacDonald"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([expression expressionValueWithObject:nil context:nil], @"OldMacDonald"); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } { - NSDictionary *values = @{ MGLConstantExpression(@1): MGLConstantExpression(@"one") }; + NSDictionary *values = @{ MLNConstantExpression(@1): MLNConstantExpression(@"one") }; NSExpression *expression = [NSExpression mgl_expressionForMatchingExpression:[NSExpression expressionWithFormat:@"2 * 1"] inDictionary:values defaultExpression:[NSExpression expressionForConstantValue:@"default"]]; NSArray *jsonExpression = @[@"match", @[@"*", @2, @1], @1, @"one", @"default"]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression expressionWithMLNJSONObject:jsonExpression], expression); } } diff --git a/platform/ios/platform/darwin/test/MGLFeatureTests.mm b/platform/ios/platform/darwin/test/MLNFeatureTests.mm similarity index 80% rename from platform/ios/platform/darwin/test/MGLFeatureTests.mm rename to platform/ios/platform/darwin/test/MLNFeatureTests.mm index ce65df5e8..bc14eabca 100644 --- a/platform/ios/platform/darwin/test/MGLFeatureTests.mm +++ b/platform/ios/platform/darwin/test/MLNFeatureTests.mm @@ -2,14 +2,14 @@ #import #import -#import "MGLFoundation_Private.h" -#import "../../darwin/src/MGLFeature_Private.h" +#import "MLNFoundation_Private.h" +#import "../../darwin/src/MLNFeature_Private.h" -@interface MGLFeatureTests : XCTestCase +@interface MLNFeatureTests : XCTestCase @end -@implementation MGLFeatureTests +@implementation MLNFeatureTests - (void)testGeometryConversion { std::vector features; @@ -39,51 +39,51 @@ }; features.push_back(mbgl::Feature { polygon }); - NSArray *> *shapes = MGLFeaturesFromMBGLFeatures(features); + NSArray *> *shapes = MLNFeaturesFromMBGLFeatures(features); XCTAssertEqual(shapes.count, 3UL, @"All features should be converted into shapes"); - MGLPointFeature *pointShape = (MGLPointFeature *)shapes[0]; - XCTAssertTrue([pointShape isKindOfClass:[MGLPointFeature class]]); - XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:pointShape.coordinate], - [NSValue valueWithMGLCoordinate:CLLocationCoordinate2DMake(29.95, -90.066667)]); + MLNPointFeature *pointShape = (MLNPointFeature *)shapes[0]; + XCTAssertTrue([pointShape isKindOfClass:[MLNPointFeature class]]); + XCTAssertEqualObjects([NSValue valueWithMLNCoordinate:pointShape.coordinate], + [NSValue valueWithMLNCoordinate:CLLocationCoordinate2DMake(29.95, -90.066667)]); - MGLPolylineFeature *polylineShape = (MGLPolylineFeature *)shapes[1]; - XCTAssertTrue([polylineShape isKindOfClass:[MGLPolylineFeature class]]); + MLNPolylineFeature *polylineShape = (MLNPolylineFeature *)shapes[1]; + XCTAssertTrue([polylineShape isKindOfClass:[MLNPolylineFeature class]]); XCTAssertEqual(polylineShape.pointCount, 2UL); CLLocationCoordinate2D polylineCoordinates[2]; [polylineShape getCoordinates:polylineCoordinates range:NSMakeRange(0, polylineShape.pointCount)]; - XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:polylineCoordinates[0]], - [NSValue valueWithMGLCoordinate:CLLocationCoordinate2DMake(39.1, -84.516667)]); - XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:polylineCoordinates[1]], - [NSValue valueWithMGLCoordinate:CLLocationCoordinate2DMake(29.95, -90.066667)]); + XCTAssertEqualObjects([NSValue valueWithMLNCoordinate:polylineCoordinates[0]], + [NSValue valueWithMLNCoordinate:CLLocationCoordinate2DMake(39.1, -84.516667)]); + XCTAssertEqualObjects([NSValue valueWithMLNCoordinate:polylineCoordinates[1]], + [NSValue valueWithMLNCoordinate:CLLocationCoordinate2DMake(29.95, -90.066667)]); - MGLPolygonFeature *polygonShape = (MGLPolygonFeature *)shapes[2]; - XCTAssertTrue([polygonShape isKindOfClass:[MGLPolygonFeature class]]); + MLNPolygonFeature *polygonShape = (MLNPolygonFeature *)shapes[2]; + XCTAssertTrue([polygonShape isKindOfClass:[MLNPolygonFeature class]]); XCTAssertEqual(polygonShape.pointCount, 4UL); CLLocationCoordinate2D *polygonCoordinates = polygonShape.coordinates; XCTAssertNotEqual(polygonCoordinates, nil); - XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:polygonCoordinates[0]], - [NSValue valueWithMGLCoordinate:CLLocationCoordinate2DMake(1, 1)]); - XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:polygonCoordinates[1]], - [NSValue valueWithMGLCoordinate:CLLocationCoordinate2DMake(1, 4)]); - XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:polygonCoordinates[2]], - [NSValue valueWithMGLCoordinate:CLLocationCoordinate2DMake(4, 4)]); - XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:polygonCoordinates[3]], - [NSValue valueWithMGLCoordinate:CLLocationCoordinate2DMake(4, 1)]); - NSArray *interiorPolygons = polygonShape.interiorPolygons; + XCTAssertEqualObjects([NSValue valueWithMLNCoordinate:polygonCoordinates[0]], + [NSValue valueWithMLNCoordinate:CLLocationCoordinate2DMake(1, 1)]); + XCTAssertEqualObjects([NSValue valueWithMLNCoordinate:polygonCoordinates[1]], + [NSValue valueWithMLNCoordinate:CLLocationCoordinate2DMake(1, 4)]); + XCTAssertEqualObjects([NSValue valueWithMLNCoordinate:polygonCoordinates[2]], + [NSValue valueWithMLNCoordinate:CLLocationCoordinate2DMake(4, 4)]); + XCTAssertEqualObjects([NSValue valueWithMLNCoordinate:polygonCoordinates[3]], + [NSValue valueWithMLNCoordinate:CLLocationCoordinate2DMake(4, 1)]); + NSArray *interiorPolygons = polygonShape.interiorPolygons; XCTAssertEqual(interiorPolygons.count, 1UL); - MGLPolygon *interiorPolygon = interiorPolygons.firstObject; + MLNPolygon *interiorPolygon = interiorPolygons.firstObject; XCTAssertEqual(interiorPolygon.pointCount, 4UL); CLLocationCoordinate2D interiorPolygonCoordinates[4]; [interiorPolygon getCoordinates:interiorPolygonCoordinates range:NSMakeRange(0, interiorPolygon.pointCount)]; - XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:interiorPolygonCoordinates[0]], - [NSValue valueWithMGLCoordinate:CLLocationCoordinate2DMake(2, 2)]); - XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:interiorPolygonCoordinates[1]], - [NSValue valueWithMGLCoordinate:CLLocationCoordinate2DMake(2, 3)]); - XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:interiorPolygonCoordinates[2]], - [NSValue valueWithMGLCoordinate:CLLocationCoordinate2DMake(3, 3)]); - XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:interiorPolygonCoordinates[3]], - [NSValue valueWithMGLCoordinate:CLLocationCoordinate2DMake(3, 2)]); + XCTAssertEqualObjects([NSValue valueWithMLNCoordinate:interiorPolygonCoordinates[0]], + [NSValue valueWithMLNCoordinate:CLLocationCoordinate2DMake(2, 2)]); + XCTAssertEqualObjects([NSValue valueWithMLNCoordinate:interiorPolygonCoordinates[1]], + [NSValue valueWithMLNCoordinate:CLLocationCoordinate2DMake(2, 3)]); + XCTAssertEqualObjects([NSValue valueWithMLNCoordinate:interiorPolygonCoordinates[2]], + [NSValue valueWithMLNCoordinate:CLLocationCoordinate2DMake(3, 3)]); + XCTAssertEqualObjects([NSValue valueWithMLNCoordinate:interiorPolygonCoordinates[3]], + [NSValue valueWithMLNCoordinate:CLLocationCoordinate2DMake(3, 2)]); } - (void)testClusterGeometryConversion { @@ -94,16 +94,16 @@ pointFeature.properties["cluster_id"] = 1ULL; pointFeature.properties["point_count"] = 5ULL; - id feature = MGLFeatureFromMBGLFeature(pointFeature); + id feature = MLNFeatureFromMBGLFeature(pointFeature); - XCTAssert([feature conformsToProtocol:@protocol(MGLFeature)]); + XCTAssert([feature conformsToProtocol:@protocol(MLNFeature)]); - id cluster = MGL_OBJC_DYNAMIC_CAST_AS_PROTOCOL(feature, MGLCluster); + id cluster = MLN_OBJC_DYNAMIC_CAST_AS_PROTOCOL(feature, MLNCluster); XCTAssert(cluster); XCTAssert(cluster.clusterIdentifier == 1); XCTAssert(cluster.clusterPointCount == 5); - XCTAssert([cluster isMemberOfClass:[MGLPointFeatureCluster class]]); + XCTAssert([cluster isMemberOfClass:[MLNPointFeatureCluster class]]); } - (void)testPropertyConversion { @@ -124,12 +124,12 @@ vector.push_back(true); features.push_back(pointFeature); - NSArray *> *shapes = MGLFeaturesFromMBGLFeatures(features); + NSArray *> *shapes = MLNFeaturesFromMBGLFeatures(features); XCTAssertEqual(shapes.count, 1UL, @"All features should be converted into shapes"); - MGLShape *shape = shapes.firstObject; - XCTAssertTrue([shape conformsToProtocol:@protocol(MGLFeature)]); - XCTAssertTrue([shape isKindOfClass:[MGLShape class]]); + MLNShape *shape = shapes.firstObject; + XCTAssertTrue([shape conformsToProtocol:@protocol(MLNFeature)]); + XCTAssertTrue([shape isKindOfClass:[MLNShape class]]); NSNumber *identifier = shape.identifier; XCTAssertTrue([identifier isKindOfClass:[NSNumber class]], @"Feature identifier should be NSNumber"); @@ -176,7 +176,7 @@ } - (void)testPointFeatureGeoJSONDictionary { - MGLPointFeature *pointFeature = [[MGLPointFeature alloc] init]; + MLNPointFeature *pointFeature = [[MLNPointFeature alloc] init]; CLLocationCoordinate2D coordinate = { 10, 10 }; pointFeature.coordinate = coordinate; @@ -214,7 +214,7 @@ CLLocationCoordinate2D coord1 = { 0, 0 }; CLLocationCoordinate2D coord2 = { 10, 10 }; CLLocationCoordinate2D coords[] = { coord1, coord2 }; - MGLPolylineFeature *polyLineFeature = [MGLPolylineFeature polylineWithCoordinates:coords count:2]; + MLNPolylineFeature *polyLineFeature = [MLNPolylineFeature polylineWithCoordinates:coords count:2]; // A GeoJSON feature NSDictionary *geoJSONFeature = [polyLineFeature geoJSONDictionary]; @@ -231,7 +231,7 @@ CLLocationCoordinate2D coord2 = { 10, 10 }; CLLocationCoordinate2D coord3 = { 0, 0 }; CLLocationCoordinate2D coords[] = { coord1, coord2, coord3 }; - MGLPolygonFeature *polygonFeature = [MGLPolygonFeature polygonWithCoordinates:coords count:3]; + MLNPolygonFeature *polygonFeature = [MLNPolygonFeature polygonWithCoordinates:coords count:3]; // A GeoJSON feature NSDictionary *geoJSONFeature = [polygonFeature geoJSONDictionary]; @@ -250,10 +250,10 @@ CLLocationCoordinate2D coord3 = { 0, 0 }; CLLocationCoordinate2D coords[] = { coord1, coord2, coord3 }; - MGLPolyline *polyLine1 = [MGLPolyline polylineWithCoordinates:coords count:3]; - MGLPolyline *polyLine2 = [MGLPolyline polylineWithCoordinates:coords count:3]; + MLNPolyline *polyLine1 = [MLNPolyline polylineWithCoordinates:coords count:3]; + MLNPolyline *polyLine2 = [MLNPolyline polylineWithCoordinates:coords count:3]; - MGLMultiPolylineFeature *multiPolylineFeature = [MGLMultiPolylineFeature multiPolylineWithPolylines:@[polyLine1, polyLine2]]; + MLNMultiPolylineFeature *multiPolylineFeature = [MLNMultiPolylineFeature multiPolylineWithPolylines:@[polyLine1, polyLine2]]; // A GeoJSON feature NSDictionary *geoJSONFeature = [multiPolylineFeature geoJSONDictionary]; @@ -275,10 +275,10 @@ CLLocationCoordinate2D coord3 = { 0, 0 }; CLLocationCoordinate2D coords[] = { coord1, coord2, coord3 }; - MGLPolygon *polygon1 = [MGLPolygon polygonWithCoordinates:coords count:3]; - MGLPolygon *polygon2 = [MGLPolygon polygonWithCoordinates:coords count:3]; + MLNPolygon *polygon1 = [MLNPolygon polygonWithCoordinates:coords count:3]; + MLNPolygon *polygon2 = [MLNPolygon polygonWithCoordinates:coords count:3]; - MGLMultiPolygonFeature *multiPolylineFeature = [MGLMultiPolygonFeature multiPolygonWithPolygons:@[polygon1, polygon2]]; + MLNMultiPolygonFeature *multiPolylineFeature = [MLNMultiPolygonFeature multiPolygonWithPolygons:@[polygon1, polygon2]]; // A GeoJSON feature NSDictionary *geoJSONFeature = [multiPolylineFeature geoJSONDictionary]; @@ -300,7 +300,7 @@ CLLocationCoordinate2D coord2 = { 10, 10 }; CLLocationCoordinate2D coord3 = { 0, 0 }; CLLocationCoordinate2D coords[] = { coord1, coord2, coord3 }; - MGLPointCollectionFeature *pointCollectionFeature = [MGLPointCollectionFeature pointCollectionWithCoordinates:coords count:3]; + MLNPointCollectionFeature *pointCollectionFeature = [MLNPointCollectionFeature pointCollectionWithCoordinates:coords count:3]; // A GeoJSON feature NSDictionary *geoJSONFeature = [pointCollectionFeature geoJSONDictionary]; @@ -315,16 +315,16 @@ } - (void)testShapeCollectionFeatureGeoJSONDictionary { - MGLPointFeature *pointFeature = [[MGLPointFeature alloc] init]; + MLNPointFeature *pointFeature = [[MLNPointFeature alloc] init]; CLLocationCoordinate2D pointCoordinate = { 10, 10 }; pointFeature.coordinate = pointCoordinate; CLLocationCoordinate2D coord1 = { 0, 0 }; CLLocationCoordinate2D coord2 = { 10, 10 }; CLLocationCoordinate2D coords[] = { coord1, coord2 }; - MGLPolylineFeature *polylineFeature = [MGLPolylineFeature polylineWithCoordinates:coords count:2]; + MLNPolylineFeature *polylineFeature = [MLNPolylineFeature polylineWithCoordinates:coords count:2]; - MGLShapeCollectionFeature *shapeCollectionFeature = [MGLShapeCollectionFeature shapeCollectionWithShapes:@[pointFeature, polylineFeature]]; + MLNShapeCollectionFeature *shapeCollectionFeature = [MLNShapeCollectionFeature shapeCollectionWithShapes:@[pointFeature, polylineFeature]]; // A GeoJSON feature NSDictionary *geoJSONFeature = [shapeCollectionFeature geoJSONDictionary]; @@ -348,7 +348,7 @@ XCTAssertEqualObjects(geoJSONFeature[@"geometry"], expectedGeometry); // When the shape collection is created with an empty array of shapes - shapeCollectionFeature = [MGLShapeCollectionFeature shapeCollectionWithShapes:@[]]; + shapeCollectionFeature = [MLNShapeCollectionFeature shapeCollectionWithShapes:@[]]; // it has the correct (empty) geometry geoJSONFeature = [shapeCollectionFeature geoJSONDictionary]; diff --git a/platform/ios/platform/darwin/test/MGLGeometryTests.mm b/platform/ios/platform/darwin/test/MLNGeometryTests.mm similarity index 55% rename from platform/ios/platform/darwin/test/MGLGeometryTests.mm rename to platform/ios/platform/darwin/test/MLNGeometryTests.mm index e3b1836e8..0f98572c3 100644 --- a/platform/ios/platform/darwin/test/MGLGeometryTests.mm +++ b/platform/ios/platform/darwin/test/MLNGeometryTests.mm @@ -1,37 +1,37 @@ #import #import -#import "../../darwin/src/MGLGeometry_Private.h" +#import "../../darwin/src/MLNGeometry_Private.h" -@interface MGLGeometryTests : XCTestCase +@interface MLNGeometryTests : XCTestCase @end -@implementation MGLGeometryTests +@implementation MLNGeometryTests - (void)testCoordinateBoundsIsEmpty { - MGLCoordinateBounds emptyBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(10, 0)); - XCTAssertTrue(MGLCoordinateBoundsIsEmpty(emptyBounds)); - XCTAssertFalse(MGLCoordinateSpanEqualToCoordinateSpan(MGLCoordinateSpanZero, MGLCoordinateBoundsGetCoordinateSpan(emptyBounds))); + MLNCoordinateBounds emptyBounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(10, 0)); + XCTAssertTrue(MLNCoordinateBoundsIsEmpty(emptyBounds)); + XCTAssertFalse(MLNCoordinateSpanEqualToCoordinateSpan(MLNCoordinateSpanZero, MLNCoordinateBoundsGetCoordinateSpan(emptyBounds))); } - (void)testAngleConversions { - XCTAssertEqualWithAccuracy(-180, MGLDegreesFromRadians(-M_PI), 1e-5); - XCTAssertEqual(0, MGLDegreesFromRadians(0)); - XCTAssertEqualWithAccuracy(45, MGLDegreesFromRadians(M_PI_4), 1e-5); - XCTAssertEqualWithAccuracy(90, MGLDegreesFromRadians(M_PI_2), 1e-5); - XCTAssertEqualWithAccuracy(180, MGLDegreesFromRadians(M_PI), 1e-5); - XCTAssertEqualWithAccuracy(360, MGLDegreesFromRadians(2 * M_PI), 1e-5); - XCTAssertEqualWithAccuracy(720, MGLDegreesFromRadians(4 * M_PI), 1e-5); + XCTAssertEqualWithAccuracy(-180, MLNDegreesFromRadians(-M_PI), 1e-5); + XCTAssertEqual(0, MLNDegreesFromRadians(0)); + XCTAssertEqualWithAccuracy(45, MLNDegreesFromRadians(M_PI_4), 1e-5); + XCTAssertEqualWithAccuracy(90, MLNDegreesFromRadians(M_PI_2), 1e-5); + XCTAssertEqualWithAccuracy(180, MLNDegreesFromRadians(M_PI), 1e-5); + XCTAssertEqualWithAccuracy(360, MLNDegreesFromRadians(2 * M_PI), 1e-5); + XCTAssertEqualWithAccuracy(720, MLNDegreesFromRadians(4 * M_PI), 1e-5); - XCTAssertEqualWithAccuracy(-360, MGLDegreesFromRadians(MGLRadiansFromDegrees(-360)), 1e-4); - XCTAssertEqualWithAccuracy(-180, MGLDegreesFromRadians(MGLRadiansFromDegrees(-180)), 1e-5); - XCTAssertEqualWithAccuracy(-90, MGLDegreesFromRadians(MGLRadiansFromDegrees(-90)), 1e-5); - XCTAssertEqualWithAccuracy(-45, MGLDegreesFromRadians(MGLRadiansFromDegrees(-45)), 1e-5); - XCTAssertEqualWithAccuracy(0, MGLDegreesFromRadians(MGLRadiansFromDegrees(0)), 1e-5); - XCTAssertEqualWithAccuracy(45, MGLDegreesFromRadians(MGLRadiansFromDegrees(45)), 1e-5); - XCTAssertEqualWithAccuracy(90, MGLDegreesFromRadians(MGLRadiansFromDegrees(90)), 1e-5); - XCTAssertEqualWithAccuracy(180, MGLDegreesFromRadians(MGLRadiansFromDegrees(180)), 1e-5); - XCTAssertEqualWithAccuracy(360, MGLDegreesFromRadians(MGLRadiansFromDegrees(360)), 1e-4); + XCTAssertEqualWithAccuracy(-360, MLNDegreesFromRadians(MLNRadiansFromDegrees(-360)), 1e-4); + XCTAssertEqualWithAccuracy(-180, MLNDegreesFromRadians(MLNRadiansFromDegrees(-180)), 1e-5); + XCTAssertEqualWithAccuracy(-90, MLNDegreesFromRadians(MLNRadiansFromDegrees(-90)), 1e-5); + XCTAssertEqualWithAccuracy(-45, MLNDegreesFromRadians(MLNRadiansFromDegrees(-45)), 1e-5); + XCTAssertEqualWithAccuracy(0, MLNDegreesFromRadians(MLNRadiansFromDegrees(0)), 1e-5); + XCTAssertEqualWithAccuracy(45, MLNDegreesFromRadians(MLNRadiansFromDegrees(45)), 1e-5); + XCTAssertEqualWithAccuracy(90, MLNDegreesFromRadians(MLNRadiansFromDegrees(90)), 1e-5); + XCTAssertEqualWithAccuracy(180, MLNDegreesFromRadians(MLNRadiansFromDegrees(180)), 1e-5); + XCTAssertEqualWithAccuracy(360, MLNDegreesFromRadians(MLNRadiansFromDegrees(360)), 1e-4); } - (void)testAltitudeConversions { @@ -39,91 +39,91 @@ CGSize midSize = CGSizeMake(600, 800); CGSize shortSize = CGSizeMake(600, 400); - XCTAssertEqualWithAccuracy(1800, MGLAltitudeForZoomLevel(MGLZoomLevelForAltitude(1800, 0, 0, midSize), 0, 0, midSize), 1e-8); - XCTAssertLessThan(MGLZoomLevelForAltitude(1800, 0, 0, midSize), MGLZoomLevelForAltitude(1800, 0, 0, tallSize)); - XCTAssertGreaterThan(MGLZoomLevelForAltitude(1800, 0, 0, midSize), MGLZoomLevelForAltitude(1800, 0, 0, shortSize)); + XCTAssertEqualWithAccuracy(1800, MLNAltitudeForZoomLevel(MLNZoomLevelForAltitude(1800, 0, 0, midSize), 0, 0, midSize), 1e-8); + XCTAssertLessThan(MLNZoomLevelForAltitude(1800, 0, 0, midSize), MLNZoomLevelForAltitude(1800, 0, 0, tallSize)); + XCTAssertGreaterThan(MLNZoomLevelForAltitude(1800, 0, 0, midSize), MLNZoomLevelForAltitude(1800, 0, 0, shortSize)); - XCTAssertEqualWithAccuracy(0, MGLZoomLevelForAltitude(MGLAltitudeForZoomLevel(0, 0, 0, midSize), 0, 0, midSize), 1e-8); - XCTAssertEqualWithAccuracy(18, MGLZoomLevelForAltitude(MGLAltitudeForZoomLevel(18, 0, 0, midSize), 0, 0, midSize), 1e-8); + XCTAssertEqualWithAccuracy(0, MLNZoomLevelForAltitude(MLNAltitudeForZoomLevel(0, 0, 0, midSize), 0, 0, midSize), 1e-8); + XCTAssertEqualWithAccuracy(18, MLNZoomLevelForAltitude(MLNAltitudeForZoomLevel(18, 0, 0, midSize), 0, 0, midSize), 1e-8); - XCTAssertEqualWithAccuracy(0, MGLZoomLevelForAltitude(MGLAltitudeForZoomLevel(0, 0, 40, midSize), 0, 40, midSize), 1e-8); - XCTAssertEqualWithAccuracy(18, MGLZoomLevelForAltitude(MGLAltitudeForZoomLevel(18, 0, 40, midSize), 0, 40, midSize), 1e-8); + XCTAssertEqualWithAccuracy(0, MLNZoomLevelForAltitude(MLNAltitudeForZoomLevel(0, 0, 40, midSize), 0, 40, midSize), 1e-8); + XCTAssertEqualWithAccuracy(18, MLNZoomLevelForAltitude(MLNAltitudeForZoomLevel(18, 0, 40, midSize), 0, 40, midSize), 1e-8); - XCTAssertEqualWithAccuracy(0, MGLZoomLevelForAltitude(MGLAltitudeForZoomLevel(0, 60, 40, midSize), 60, 40, midSize), 1e-8); - XCTAssertEqualWithAccuracy(18, MGLZoomLevelForAltitude(MGLAltitudeForZoomLevel(18, 60, 40, midSize), 60, 40, midSize), 1e-8); + XCTAssertEqualWithAccuracy(0, MLNZoomLevelForAltitude(MLNAltitudeForZoomLevel(0, 60, 40, midSize), 60, 40, midSize), 1e-8); + XCTAssertEqualWithAccuracy(18, MLNZoomLevelForAltitude(MLNAltitudeForZoomLevel(18, 60, 40, midSize), 60, 40, midSize), 1e-8); } - (void)testGeometryBoxing { CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(38.9131982, -77.0325453144239); - CLLocationCoordinate2D roundTrippedCoordinate = [NSValue valueWithMGLCoordinate:coordinate].MGLCoordinateValue; + CLLocationCoordinate2D roundTrippedCoordinate = [NSValue valueWithMLNCoordinate:coordinate].MLNCoordinateValue; XCTAssertEqual(coordinate.latitude, roundTrippedCoordinate.latitude, @"Latitude should round-trip."); XCTAssertEqual(coordinate.longitude, roundTrippedCoordinate.longitude, @"Longitude should round-trip."); - MGLCoordinateSpan span = MGLCoordinateSpanMake(4.383333333333335, -4.299999999999997); - MGLCoordinateSpan roundTrippedSpan = [NSValue valueWithMGLCoordinateSpan:span].MGLCoordinateSpanValue; + MLNCoordinateSpan span = MLNCoordinateSpanMake(4.383333333333335, -4.299999999999997); + MLNCoordinateSpan roundTrippedSpan = [NSValue valueWithMLNCoordinateSpan:span].MLNCoordinateSpanValue; XCTAssertEqual(span.latitudeDelta, roundTrippedSpan.latitudeDelta, @"Latitude delta should round-trip."); XCTAssertEqual(span.longitudeDelta, roundTrippedSpan.longitudeDelta, @"Longitude delta should round-trip."); - MGLCoordinateBounds bounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(38.9131982, -77.0325453144239), + MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(38.9131982, -77.0325453144239), CLLocationCoordinate2DMake(37.7757368, -122.4135302)); - MGLCoordinateBounds roundTrippedBounds = [NSValue valueWithMGLCoordinateBounds:bounds].MGLCoordinateBoundsValue; + MLNCoordinateBounds roundTrippedBounds = [NSValue valueWithMLNCoordinateBounds:bounds].MLNCoordinateBoundsValue; - XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:bounds.sw], - [NSValue valueWithMGLCoordinate:roundTrippedBounds.sw], + XCTAssertEqualObjects([NSValue valueWithMLNCoordinate:bounds.sw], + [NSValue valueWithMLNCoordinate:roundTrippedBounds.sw], @"Southwest should round-trip."); - XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:bounds.ne], - [NSValue valueWithMGLCoordinate:roundTrippedBounds.ne], + XCTAssertEqualObjects([NSValue valueWithMLNCoordinate:bounds.ne], + [NSValue valueWithMLNCoordinate:roundTrippedBounds.ne], @"Northeast should round-trip."); } - (void)testCoordinateInCoordinateBounds { CLLocationCoordinate2D ne = CLLocationCoordinate2DMake(45, -104); CLLocationCoordinate2D sw = CLLocationCoordinate2DMake(41, -111); - MGLCoordinateBounds wyoming = MGLCoordinateBoundsMake(sw, ne); + MLNCoordinateBounds wyoming = MLNCoordinateBoundsMake(sw, ne); CLLocationCoordinate2D centerOfWyoming = CLLocationCoordinate2DMake(43, -107.5); - XCTAssertTrue(MGLCoordinateInCoordinateBounds(ne, wyoming)); - XCTAssertTrue(MGLCoordinateInCoordinateBounds(sw, wyoming)); - XCTAssertTrue(MGLCoordinateInCoordinateBounds(centerOfWyoming, wyoming)); + XCTAssertTrue(MLNCoordinateInCoordinateBounds(ne, wyoming)); + XCTAssertTrue(MLNCoordinateInCoordinateBounds(sw, wyoming)); + XCTAssertTrue(MLNCoordinateInCoordinateBounds(centerOfWyoming, wyoming)); CLLocationCoordinate2D australia = CLLocationCoordinate2DMake(-25, 135); CLLocationCoordinate2D brazil = CLLocationCoordinate2DMake(-12, -50); CLLocationCoordinate2D china = CLLocationCoordinate2DMake(35, 100); - XCTAssertFalse(MGLCoordinateInCoordinateBounds(australia, wyoming)); - XCTAssertFalse(MGLCoordinateInCoordinateBounds(brazil, wyoming)); - XCTAssertFalse(MGLCoordinateInCoordinateBounds(china, wyoming)); - XCTAssertFalse(MGLCoordinateInCoordinateBounds(kCLLocationCoordinate2DInvalid, wyoming)); + XCTAssertFalse(MLNCoordinateInCoordinateBounds(australia, wyoming)); + XCTAssertFalse(MLNCoordinateInCoordinateBounds(brazil, wyoming)); + XCTAssertFalse(MLNCoordinateInCoordinateBounds(china, wyoming)); + XCTAssertFalse(MLNCoordinateInCoordinateBounds(kCLLocationCoordinate2DInvalid, wyoming)); } - (void)testGeoJSONDeserialization { NSData *data = [@"{\"type\": \"Feature\", \"geometry\": {\"type\": \"Point\", \"coordinates\": [0, 0]}, \"properties\": {}}" dataUsingEncoding:NSUTF8StringEncoding]; NSError *error; - MGLPointFeature *feature = (MGLPointFeature *)[MGLShape shapeWithData:data encoding:NSUTF8StringEncoding error:&error]; + MLNPointFeature *feature = (MLNPointFeature *)[MLNShape shapeWithData:data encoding:NSUTF8StringEncoding error:&error]; XCTAssertNil(error, @"Valid GeoJSON data should produce no error on deserialization."); XCTAssertNotNil(feature, @"Valid GeoJSON data should produce an object on deserialization."); - XCTAssertTrue([feature isKindOfClass:[MGLPointFeature class]], @"Valid GeoJSON point feature data should produce an MGLPointFeature."); + XCTAssertTrue([feature isKindOfClass:[MLNPointFeature class]], @"Valid GeoJSON point feature data should produce an MLNPointFeature."); XCTAssertEqual(feature.attributes.count, 0UL); XCTAssertEqual(feature.coordinate.latitude, 0); XCTAssertEqual(feature.coordinate.longitude, 0); data = [@"{\"type\": \"Feature\", \"feature\": {\"type\": \"Point\", \"coordinates\": [0, 0]}}" dataUsingEncoding:NSUTF8StringEncoding]; error = nil; - MGLShape *shape = [MGLShape shapeWithData:data encoding:NSUTF8StringEncoding error:&error]; + MLNShape *shape = [MLNShape shapeWithData:data encoding:NSUTF8StringEncoding error:&error]; XCTAssertNotNil(error, @"Invalid GeoJSON data should produce an error on deserialization."); XCTAssertNil(shape, @"Invalid GeoJSON data should produce no object on deserialization."); } - (void)testGeoJSONSerialization { - MGLPointFeature *feature = [[MGLPointFeature alloc] init]; + MLNPointFeature *feature = [[MLNPointFeature alloc] init]; feature.identifier = @504; feature.coordinate = CLLocationCoordinate2DMake(29.95, -90.066667); NSData *data = [feature geoJSONDataUsingEncoding:NSUTF8StringEncoding]; - XCTAssertNotNil(data, @"MGLPointFeature should serialize as an UTF-8 string data object."); + XCTAssertNotNil(data, @"MLNPointFeature should serialize as an UTF-8 string data object."); NSError *error; NSDictionary *serializedGeoJSON = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error]; XCTAssertNil(error, @"Serialized GeoJSON data should be deserializable JSON."); @@ -141,70 +141,70 @@ }, @"properties": @{}, }; - XCTAssertEqualObjects(serializedGeoJSON, geoJSON, @"MGLPointFeature should serialize as a GeoJSON point feature."); + XCTAssertEqualObjects(serializedGeoJSON, geoJSON, @"MLNPointFeature should serialize as a GeoJSON point feature."); } -- (void)testMGLCoordinateBoundsToMGLCoordinateQuad { - MGLCoordinateBounds bounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(37.936, -80.425), +- (void)testMLNCoordinateBoundsToMLNCoordinateQuad { + MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(37.936, -80.425), CLLocationCoordinate2DMake(46.437, -71.516)); - MGLCoordinateQuad quad = MGLCoordinateQuadFromCoordinateBounds(bounds); - XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:bounds.sw], - [NSValue valueWithMGLCoordinate:quad.bottomLeft], + MLNCoordinateQuad quad = MLNCoordinateQuadFromCoordinateBounds(bounds); + XCTAssertEqualObjects([NSValue valueWithMLNCoordinate:bounds.sw], + [NSValue valueWithMLNCoordinate:quad.bottomLeft], @"Bounds southwest should be bottom left of quad."); - XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:bounds.ne], - [NSValue valueWithMGLCoordinate:quad.topRight], + XCTAssertEqualObjects([NSValue valueWithMLNCoordinate:bounds.ne], + [NSValue valueWithMLNCoordinate:quad.topRight], @"Bounds northeast should be top right of quad."); - XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:CLLocationCoordinate2DMake(46.437, -80.425)], - [NSValue valueWithMGLCoordinate:quad.topLeft], + XCTAssertEqualObjects([NSValue valueWithMLNCoordinate:CLLocationCoordinate2DMake(46.437, -80.425)], + [NSValue valueWithMLNCoordinate:quad.topLeft], @"Quad top left should be computed correctly."); - XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:CLLocationCoordinate2DMake(37.936, -71.516)], - [NSValue valueWithMGLCoordinate:quad.bottomRight], + XCTAssertEqualObjects([NSValue valueWithMLNCoordinate:CLLocationCoordinate2DMake(37.936, -71.516)], + [NSValue valueWithMLNCoordinate:quad.bottomRight], @"Quad bottom right should be computed correctly."); } -- (void)testMGLMapPoint { - MGLMapPoint point = MGLMapPointForCoordinate(CLLocationCoordinate2DMake(37.936, -80.425), 0.0); +- (void)testMLNMapPoint { + MLNMapPoint point = MLNMapPointForCoordinate(CLLocationCoordinate2DMake(37.936, -80.425), 0.0); - MGLMapPoint roundTrippedPoint = [NSValue valueWithMGLMapPoint:point].MGLMapPointValue; + MLNMapPoint roundTrippedPoint = [NSValue valueWithMLNMapPoint:point].MLNMapPointValue; XCTAssertEqual(point.x, roundTrippedPoint.x); XCTAssertEqual(point.y, roundTrippedPoint.y); XCTAssertEqual(point.zoomLevel, roundTrippedPoint.zoomLevel); } -- (void)testMGLLocationCoordinate2DIsValid { +- (void)testMLNLocationCoordinate2DIsValid { { CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(37.936, -71.516); - XCTAssertTrue(MGLLocationCoordinate2DIsValid(coordinate)); + XCTAssertTrue(MLNLocationCoordinate2DIsValid(coordinate)); } { CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(46.816368, 5.844469); - XCTAssertTrue(MGLLocationCoordinate2DIsValid(coordinate)); + XCTAssertTrue(MLNLocationCoordinate2DIsValid(coordinate)); } { CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(-21.512680, 23.334703); - XCTAssertTrue(MGLLocationCoordinate2DIsValid(coordinate)); + XCTAssertTrue(MLNLocationCoordinate2DIsValid(coordinate)); } { CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(-44.947936, -73.081313); - XCTAssertTrue(MGLLocationCoordinate2DIsValid(coordinate)); + XCTAssertTrue(MLNLocationCoordinate2DIsValid(coordinate)); } { CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(19.333630, 203.555405); - XCTAssertTrue(MGLLocationCoordinate2DIsValid(coordinate)); + XCTAssertTrue(MLNLocationCoordinate2DIsValid(coordinate)); } { CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(23.254696, -240.795323); - XCTAssertTrue(MGLLocationCoordinate2DIsValid(coordinate)); + XCTAssertTrue(MLNLocationCoordinate2DIsValid(coordinate)); } { CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(91, 361); - XCTAssertFalse(MGLLocationCoordinate2DIsValid(coordinate)); + XCTAssertFalse(MLNLocationCoordinate2DIsValid(coordinate)); } { CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(-91, -361); - XCTAssertFalse(MGLLocationCoordinate2DIsValid(coordinate)); + XCTAssertFalse(MLNLocationCoordinate2DIsValid(coordinate)); } } diff --git a/platform/ios/platform/darwin/test/MGLHeatmapColorTests.mm b/platform/ios/platform/darwin/test/MLNHeatmapColorTests.mm similarity index 85% rename from platform/ios/platform/darwin/test/MGLHeatmapColorTests.mm rename to platform/ios/platform/darwin/test/MLNHeatmapColorTests.mm index 986effe73..ecc24e43e 100644 --- a/platform/ios/platform/darwin/test/MGLHeatmapColorTests.mm +++ b/platform/ios/platform/darwin/test/MLNHeatmapColorTests.mm @@ -1,19 +1,19 @@ #import #import -#import "MGLStyleLayer_Private.h" +#import "MLNStyleLayer_Private.h" #include -@interface MGLHeatmapColorTests : XCTestCase +@interface MLNHeatmapColorTests : XCTestCase @end -@implementation MGLHeatmapColorTests +@implementation MLNHeatmapColorTests - (void)testProperties { - MGLPointFeature *feature = [[MGLPointFeature alloc] init]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil]; - MGLHeatmapStyleLayer *layer = [[MGLHeatmapStyleLayer alloc] initWithIdentifier:@"layerID" source:source]; + MLNPointFeature *feature = [[MLNPointFeature alloc] init]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil]; + MLNHeatmapStyleLayer *layer = [[MLNHeatmapStyleLayer alloc] initWithIdentifier:@"layerID" source:source]; auto rawLayer = static_cast(layer.rawLayer); @@ -21,7 +21,7 @@ @"heatmap-color should be unset initially."); NSExpression *defaultExpression = layer.heatmapColor; - NSExpression *constantExpression = [NSExpression expressionWithFormat:@"%@", [MGLColor redColor]]; + NSExpression *constantExpression = [NSExpression expressionWithFormat:@"%@", [MLNColor redColor]]; layer.heatmapColor = constantExpression; @@ -31,8 +31,8 @@ XCTAssertEqualObjects(layer.heatmapColor, constantExpression, @"heatmapColor should round-trip constant value expressions."); - constantExpression = [NSExpression expressionWithFormat:@"%@", [MGLColor redColor]]; - NSExpression *constantExpression2 = [NSExpression expressionWithFormat:@"%@", [MGLColor blueColor]]; + constantExpression = [NSExpression expressionWithFormat:@"%@", [MLNColor redColor]]; + NSExpression *constantExpression2 = [NSExpression expressionWithFormat:@"%@", [MLNColor blueColor]]; #if TARGET_OS_IPHONE XCTExpectFailure(@"Awaiting unit test refactoring for https://github.com/maplibre/maplibre-gl-native/issues/331"); #endif @@ -55,12 +55,12 @@ @"heatmapColor should return the default value after being unset."); functionExpression = [NSExpression expressionWithFormat:@"mgl_step:from:stops:($zoomLevel, %@, %@)", constantExpression, @{@18: constantExpression}]; - XCTAssertThrowsSpecificNamed(layer.heatmapColor = functionExpression, NSException, NSInvalidArgumentException, @"MGLHeatmapLayer should raise an exception if a camera expression is applied to heatmapColor."); + XCTAssertThrowsSpecificNamed(layer.heatmapColor = functionExpression, NSException, NSInvalidArgumentException, @"MLNHeatmapLayer should raise an exception if a camera expression is applied to heatmapColor."); functionExpression = [NSExpression expressionForKeyPath:@"bogus"]; - XCTAssertThrowsSpecificNamed(layer.heatmapColor = functionExpression, NSException, NSInvalidArgumentException, @"MGLHeatmapLayer should raise an exception if a data expression is applied to heatmapColor."); + XCTAssertThrowsSpecificNamed(layer.heatmapColor = functionExpression, NSException, NSInvalidArgumentException, @"MLNHeatmapLayer should raise an exception if a data expression is applied to heatmapColor."); functionExpression = [NSExpression expressionWithFormat:@"mgl_step:from:stops:(bogus, %@, %@)", constantExpression, @{@18: constantExpression}]; functionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: functionExpression}]; - XCTAssertThrowsSpecificNamed(layer.heatmapColor = functionExpression, NSException, NSInvalidArgumentException, @"MGLHeatmapLayer should raise an exception if a camera-data expression is applied to a property that does not support key paths to feature attributes."); + XCTAssertThrowsSpecificNamed(layer.heatmapColor = functionExpression, NSException, NSInvalidArgumentException, @"MLNHeatmapLayer should raise an exception if a camera-data expression is applied to a property that does not support key paths to feature attributes."); } @end diff --git a/platform/ios/platform/darwin/test/MGLImageSourceTests.m b/platform/ios/platform/darwin/test/MLNImageSourceTests.m similarity index 59% rename from platform/ios/platform/darwin/test/MGLImageSourceTests.m rename to platform/ios/platform/darwin/test/MLNImageSourceTests.m index 38fcd3870..a23e2d25b 100644 --- a/platform/ios/platform/darwin/test/MGLImageSourceTests.m +++ b/platform/ios/platform/darwin/test/MLNImageSourceTests.m @@ -2,37 +2,37 @@ #import -@interface MGLImageSourceTests : XCTestCase +@interface MLNImageSourceTests : XCTestCase @end -@implementation MGLImageSourceTests +@implementation MLNImageSourceTests -- (void)testMGLImageSourceWithImageURL { +- (void)testMLNImageSourceWithImageURL { - MGLCoordinateQuad quad = { { 80, 37}, { 81, 37}, { 81, 39}, { 80, 39}}; - MGLImageSource *source = [[MGLImageSource alloc] initWithIdentifier:@"source-id" coordinateQuad:quad URL:[NSURL URLWithString:@"http://host/image.png"]]; + MLNCoordinateQuad quad = { { 80, 37}, { 81, 37}, { 81, 39}, { 80, 39}}; + MLNImageSource *source = [[MLNImageSource alloc] initWithIdentifier:@"source-id" coordinateQuad:quad URL:[NSURL URLWithString:@"http://host/image.png"]]; XCTAssertNotNil(source.URL); XCTAssertEqualObjects(source.URL.absoluteString, @"http://host/image.png"); XCTAssertNil(source.image); } -- (void)testMGLImageSourceWithImage { +- (void)testMLNImageSourceWithImage { NSString *imageName = @"RadarImage"; #if TARGET_OS_IPHONE - MGLImage *image = [MGLImage imageNamed:imageName + MLNImage *image = [MLNImage imageNamed:imageName inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; #else - MGLImage *image = [[NSBundle bundleForClass:[self class]] imageForResource:imageName]; + MLNImage *image = [[NSBundle bundleForClass:[self class]] imageForResource:imageName]; #endif XCTAssertNotNil(image); - MGLCoordinateQuad quad = { { 80, 37}, { 81, 37}, { 81, 39}, { 80, 39}}; - MGLImageSource *source = [[MGLImageSource alloc] initWithIdentifier:@"source-id" coordinateQuad:quad image:image]; + MLNCoordinateQuad quad = { { 80, 37}, { 81, 37}, { 81, 39}, { 80, 39}}; + MLNImageSource *source = [[MLNImageSource alloc] initWithIdentifier:@"source-id" coordinateQuad:quad image:image]; XCTAssertNotNil(source.image); XCTAssertEqualObjects(source.image, image); diff --git a/platform/ios/platform/darwin/test/MGLImageTests.mm b/platform/ios/platform/darwin/test/MLNImageTests.mm similarity index 85% rename from platform/ios/platform/darwin/test/MGLImageTests.mm rename to platform/ios/platform/darwin/test/MLNImageTests.mm index 6f3e1d1eb..f91122e6a 100644 --- a/platform/ios/platform/darwin/test/MGLImageTests.mm +++ b/platform/ios/platform/darwin/test/MLNImageTests.mm @@ -2,20 +2,20 @@ #import #if TARGET_OS_IPHONE - #import "UIImage+MGLAdditions.h" - #define MGLImageResizingModeTile UIImageResizingModeTile - #define MGLImageResizingModeStretch UIImageResizingModeStretch + #import "UIImage+MLNAdditions.h" + #define MLNImageResizingModeTile UIImageResizingModeTile + #define MLNImageResizingModeStretch UIImageResizingModeStretch #else - #import "NSImage+MGLAdditions.h" - #define MGLImageResizingModeTile NSImageResizingModeTile - #define MGLImageResizingModeStretch NSImageResizingModeStretch + #import "NSImage+MLNAdditions.h" + #define MLNImageResizingModeTile NSImageResizingModeTile + #define MLNImageResizingModeStretch NSImageResizingModeStretch #endif -@interface MGLImageTests : XCTestCase +@interface MLNImageTests : XCTestCase @end -@implementation MGLImageTests +@implementation MLNImageTests - (void)testStretching { #if TARGET_OS_IPHONE @@ -48,8 +48,8 @@ XCTAssertTrue(styleImage->getStretchX().empty()); XCTAssertTrue(styleImage->getStretchY().empty()); - MGLImage *imageAfter = [[MGLImage alloc] initWithMGLStyleImage:*styleImage]; - XCTAssertEqual(imageAfter.resizingMode, MGLImageResizingModeTile); + MLNImage *imageAfter = [[MLNImage alloc] initWithMLNStyleImage:*styleImage]; + XCTAssertEqual(imageAfter.resizingMode, MLNImageResizingModeTile); XCTAssertEqual(imageAfter.capInsets.top, 0); XCTAssertEqual(imageAfter.capInsets.left, 0); XCTAssertEqual(imageAfter.capInsets.bottom, 0); @@ -81,8 +81,8 @@ XCTAssertEqual(stretchY.front(), mbgl::style::ImageStretch(0, 24 * scale)); } - MGLImage *imageAfter = [[MGLImage alloc] initWithMGLStyleImage:*styleImage]; - XCTAssertEqual(imageAfter.resizingMode, MGLImageResizingModeStretch); + MLNImage *imageAfter = [[MLNImage alloc] initWithMLNStyleImage:*styleImage]; + XCTAssertEqual(imageAfter.resizingMode, MLNImageResizingModeStretch); XCTAssertEqual(imageAfter.capInsets.top, 0); XCTAssertEqual(imageAfter.capInsets.left, 0); XCTAssertEqual(imageAfter.capInsets.bottom, 0); @@ -120,8 +120,8 @@ XCTAssertEqual(stretchY.front(), mbgl::style::ImageStretch(1 * scale, 21 * scale)); } - MGLImage *imageAfter = [[MGLImage alloc] initWithMGLStyleImage:*styleImage]; - XCTAssertEqual(imageAfter.resizingMode, MGLImageResizingModeStretch); + MLNImage *imageAfter = [[MLNImage alloc] initWithMLNStyleImage:*styleImage]; + XCTAssertEqual(imageAfter.resizingMode, MLNImageResizingModeStretch); XCTAssertEqual(imageAfter.capInsets.top, 1); XCTAssertEqual(imageAfter.capInsets.left, 2); XCTAssertEqual(imageAfter.capInsets.bottom, 3); diff --git a/platform/ios/platform/darwin/test/MGLLightTest.mm.ejs b/platform/ios/platform/darwin/test/MLNLightTest.mm.ejs similarity index 61% rename from platform/ios/platform/darwin/test/MGLLightTest.mm.ejs rename to platform/ios/platform/darwin/test/MLNLightTest.mm.ejs index 35ff58b6d..fd7fa19ab 100644 --- a/platform/ios/platform/darwin/test/MGLLightTest.mm.ejs +++ b/platform/ios/platform/darwin/test/MLNLightTest.mm.ejs @@ -7,38 +7,38 @@ #import #import -#import "MGLLight_Private.h" +#import "MLNLight_Private.h" -#import "../../darwin/src/NSDate+MGLAdditions.h" +#import "../../darwin/src/NSDate+MLNAdditions.h" #import #import #include -@interface MGLLightTest : XCTestCase +@interface MLNLightTest : XCTestCase @end -@implementation MGLLightTest +@implementation MLNLightTest - (void)testProperties { - MGLTransition defaultTransition = MGLTransitionMake(0, 0); - MGLTransition transition = MGLTransitionMake(6, 3); - mbgl::style::TransitionOptions transitionOptions { { MGLDurationFromTimeInterval(6) }, { MGLDurationFromTimeInterval(3) } }; + MLNTransition defaultTransition = MLNTransitionMake(0, 0); + MLNTransition transition = MLNTransitionMake(6, 3); + mbgl::style::TransitionOptions transitionOptions { { MLNDurationFromTimeInterval(6) }, { MLNDurationFromTimeInterval(3) } }; <% for (const property of properties) { -%> // <%- property.name %> { mbgl::style::Light light; - MGLLight *mglLight = [[MGLLight alloc] initWithMBGLLight:&light]; - auto lightFromMGLLight = mglLight.mbglLight; + MLNLight *mglLight = [[MLNLight alloc] initWithMBGLLight:&light]; + auto lightFromMLNLight = mglLight.mbglLight; - XCTAssertEqual(light.getDefault<%- camelize(property.name) -%>(), lightFromMGLLight.get<%- camelize(property.name) -%>()); + XCTAssertEqual(light.getDefault<%- camelize(property.name) -%>(), lightFromMLNLight.get<%- camelize(property.name) -%>()); <% if (property.transition) { -%> - auto <%- camelizeWithLeadingLowercase(property.name) -%>Transition = lightFromMGLLight.get<%- camelize(property.name) -%>Transition(); - XCTAssert(<%- camelizeWithLeadingLowercase(property.name) -%>Transition.delay && MGLTimeIntervalFromDuration(*<%- camelizeWithLeadingLowercase(property.name) -%>Transition.delay) == defaultTransition.delay); - XCTAssert(<%- camelizeWithLeadingLowercase(property.name) -%>Transition.duration && MGLTimeIntervalFromDuration(*<%- camelizeWithLeadingLowercase(property.name) -%>Transition.duration) == defaultTransition.duration); + auto <%- camelizeWithLeadingLowercase(property.name) -%>Transition = lightFromMLNLight.get<%- camelize(property.name) -%>Transition(); + XCTAssert(<%- camelizeWithLeadingLowercase(property.name) -%>Transition.delay && MLNTimeIntervalFromDuration(*<%- camelizeWithLeadingLowercase(property.name) -%>Transition.delay) == defaultTransition.delay); + XCTAssert(<%- camelizeWithLeadingLowercase(property.name) -%>Transition.duration && MLNTimeIntervalFromDuration(*<%- camelizeWithLeadingLowercase(property.name) -%>Transition.duration) == defaultTransition.duration); <% } -%> <% if (property.type == "enum" && property.default) { -%> @@ -58,14 +58,14 @@ light.set<%- camelize(property.name) -%>Transition(transitionOptions); <% } -%> - mglLight = [[MGLLight alloc] initWithMBGLLight:&light]; - lightFromMGLLight = mglLight.mbglLight; + mglLight = [[MLNLight alloc] initWithMBGLLight:&light]; + lightFromMLNLight = mglLight.mbglLight; - XCTAssertEqual(light.get<%- camelize(property.name) -%>(), lightFromMGLLight.get<%- camelize(property.name) -%>()); + XCTAssertEqual(light.get<%- camelize(property.name) -%>(), lightFromMLNLight.get<%- camelize(property.name) -%>()); <% if (property.transition) { -%> - <%- camelizeWithLeadingLowercase(property.name) -%>Transition = lightFromMGLLight.get<%- camelize(property.name) -%>Transition(); - XCTAssert(<%- camelizeWithLeadingLowercase(property.name) -%>Transition.delay && MGLTimeIntervalFromDuration(*<%- camelizeWithLeadingLowercase(property.name) -%>Transition.delay) == transition.delay); - XCTAssert(<%- camelizeWithLeadingLowercase(property.name) -%>Transition.duration && MGLTimeIntervalFromDuration(*<%- camelizeWithLeadingLowercase(property.name) -%>Transition.duration) == transition.duration); + <%- camelizeWithLeadingLowercase(property.name) -%>Transition = lightFromMLNLight.get<%- camelize(property.name) -%>Transition(); + XCTAssert(<%- camelizeWithLeadingLowercase(property.name) -%>Transition.delay && MLNTimeIntervalFromDuration(*<%- camelizeWithLeadingLowercase(property.name) -%>Transition.delay) == transition.delay); + XCTAssert(<%- camelizeWithLeadingLowercase(property.name) -%>Transition.duration && MLNTimeIntervalFromDuration(*<%- camelizeWithLeadingLowercase(property.name) -%>Transition.duration) == transition.duration); <% } -%> } @@ -74,15 +74,15 @@ } - (void)testValueAdditions { - MGLSphericalPosition position = MGLSphericalPositionMake(1.15, 210, 30); + MLNSphericalPosition position = MLNSphericalPositionMake(1.15, 210, 30); - XCTAssertEqual([NSValue valueWithMGLSphericalPosition:position].MGLSphericalPositionValue.radial, position.radial); - XCTAssertEqual([NSValue valueWithMGLSphericalPosition:position].MGLSphericalPositionValue.azimuthal, position.azimuthal); - XCTAssertEqual([NSValue valueWithMGLSphericalPosition:position].MGLSphericalPositionValue.polar, position.polar); + XCTAssertEqual([NSValue valueWithMLNSphericalPosition:position].MLNSphericalPositionValue.radial, position.radial); + XCTAssertEqual([NSValue valueWithMLNSphericalPosition:position].MLNSphericalPositionValue.azimuthal, position.azimuthal); + XCTAssertEqual([NSValue valueWithMLNSphericalPosition:position].MLNSphericalPositionValue.polar, position.polar); <% for (const property of properties) { -%> <% if (property.type == "enum") { -%> <% for (const value in property.values) { -%> - XCTAssertEqual([NSValue valueWithMGLLight<%- camelize(property.name) %>:MGLLight<%- camelize(property.name) %><%- camelize(value) %>].MGLLight<%- camelize(property.name) %>Value, MGLLight<%- camelize(property.name) %><%- camelize(value) %>); + XCTAssertEqual([NSValue valueWithMLNLight<%- camelize(property.name) %>:MLNLight<%- camelize(property.name) %><%- camelize(value) %>].MLNLight<%- camelize(property.name) %>Value, MLNLight<%- camelize(property.name) %><%- camelize(value) %>); <% } -%> <% } -%> <% } -%> diff --git a/platform/ios/platform/darwin/test/MGLMapCameraTests.m b/platform/ios/platform/darwin/test/MLNMapCameraTests.m similarity index 91% rename from platform/ios/platform/darwin/test/MGLMapCameraTests.m rename to platform/ios/platform/darwin/test/MLNMapCameraTests.m index 9fbf6b9e4..e507110b7 100644 --- a/platform/ios/platform/darwin/test/MGLMapCameraTests.m +++ b/platform/ios/platform/darwin/test/MLNMapCameraTests.m @@ -3,17 +3,17 @@ #import #import -@interface MGLMapCameraTests : XCTestCase +@interface MLNMapCameraTests : XCTestCase @end -@implementation MGLMapCameraTests +@implementation MLNMapCameraTests - (void)testEyeCoordinateInitialization { CLLocationCoordinate2D fountainSquare = CLLocationCoordinate2DMake(39.10152215, -84.5124439696089); CLLocationCoordinate2D unionTerminal = CLLocationCoordinate2DMake(39.10980955, -84.5352778794236); - MGLMapCamera *camera = [MGLMapCamera cameraLookingAtCenterCoordinate:fountainSquare + MLNMapCamera *camera = [MLNMapCamera cameraLookingAtCenterCoordinate:fountainSquare fromEyeCoordinate:fountainSquare eyeAltitude:1000]; MKMapCamera *mkCamera = [MKMapCamera cameraLookingAtCenterCoordinate:fountainSquare @@ -30,7 +30,7 @@ XCTAssertEqual(camera.heading, 0, @"Camera directly over center coordinate should be unrotated."); XCTAssertEqual(camera.heading, mkCamera.heading, @"Camera directly over center coordinate should have same heading as MapKit."); - camera = [MGLMapCamera cameraLookingAtCenterCoordinate:fountainSquare + camera = [MLNMapCamera cameraLookingAtCenterCoordinate:fountainSquare fromEyeCoordinate:unionTerminal eyeAltitude:1000]; mkCamera = [MKMapCamera cameraLookingAtCenterCoordinate:fountainSquare @@ -50,7 +50,7 @@ - (void)testViewingDistanceInitialization { CLLocationCoordinate2D fountainSquare = CLLocationCoordinate2DMake(39.10152215, -84.5124439696089); - MGLMapCamera *camera = [MGLMapCamera cameraLookingAtCenterCoordinate:fountainSquare + MLNMapCamera *camera = [MLNMapCamera cameraLookingAtCenterCoordinate:fountainSquare acrossDistance:10000 pitch:0 heading:0]; @@ -61,13 +61,13 @@ XCTAssertEqualWithAccuracy(camera.altitude, 10000, 0.01, @"Untilted camera should use distance verbatim."); XCTAssertEqualWithAccuracy(camera.altitude, mkCamera.altitude, 0.01, @"Untilted camera altitude should match MapKit."); - camera = [MGLMapCamera cameraLookingAtCenterCoordinate:fountainSquare + camera = [MLNMapCamera cameraLookingAtCenterCoordinate:fountainSquare altitude:10000 pitch:0 heading:0]; XCTAssertEqual(camera.altitude, 10000, @"Untilted camera should use altitude verbatim."); - camera = [MGLMapCamera cameraLookingAtCenterCoordinate:fountainSquare + camera = [MLNMapCamera cameraLookingAtCenterCoordinate:fountainSquare acrossDistance:10000 pitch:60 heading:0]; @@ -78,7 +78,7 @@ XCTAssertEqualWithAccuracy(camera.altitude, 5000, 0.01, @"Tilted camera altitude should account for pitch."); XCTAssertEqualWithAccuracy(camera.altitude, mkCamera.altitude, 0.01, @"Tilted camera altitude should match MapKit."); - camera = [MGLMapCamera cameraLookingAtCenterCoordinate:fountainSquare + camera = [MLNMapCamera cameraLookingAtCenterCoordinate:fountainSquare altitude:10000 pitch:60 heading:0]; @@ -86,7 +86,7 @@ } - (void)testViewingDistance { - MGLMapCamera *camera = [MGLMapCamera camera]; + MLNMapCamera *camera = [MLNMapCamera camera]; camera.altitude = 10000; XCTAssertEqual(camera.altitude, 10000); XCTAssertEqual(camera.viewingDistance, 10000); diff --git a/platform/ios/platform/darwin/test/MGLMapProjectionTests.m b/platform/ios/platform/darwin/test/MLNMapProjectionTests.m similarity index 77% rename from platform/ios/platform/darwin/test/MGLMapProjectionTests.m rename to platform/ios/platform/darwin/test/MLNMapProjectionTests.m index 9278141d2..1f4999e3e 100644 --- a/platform/ios/platform/darwin/test/MGLMapProjectionTests.m +++ b/platform/ios/platform/darwin/test/MLNMapProjectionTests.m @@ -3,30 +3,30 @@ #import #if TARGET_OS_IPHONE - #define MGLEdgeInsets UIEdgeInsets - #define MGLEdgeInsetsMake UIEdgeInsetsMake + #define MLNEdgeInsets UIEdgeInsets + #define MLNEdgeInsetsMake UIEdgeInsetsMake #else - #define MGLEdgeInsets NSEdgeInsets - #define MGLEdgeInsetsMake NSEdgeInsetsMake + #define MLNEdgeInsets NSEdgeInsets + #define MLNEdgeInsetsMake NSEdgeInsetsMake #endif -@interface MGLMapProjectionTests : XCTestCase +@interface MLNMapProjectionTests : XCTestCase -@property (nonatomic, retain) MGLMapView *mapView; -@property (nonatomic, retain) MGLMapProjection *mapProjection; +@property (nonatomic, retain) MLNMapView *mapView; +@property (nonatomic, retain) MLNMapProjection *mapProjection; @end -@implementation MGLMapProjectionTests +@implementation MLNMapProjectionTests - (void)setUp { [super setUp]; - [MGLSettings setApiKey:@"pk.feedcafedeadbeefbadebede"]; + [MLNSettings setApiKey:@"pk.feedcafedeadbeefbadebede"]; NSURL *styleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"one-liner" withExtension:@"json"]; - self.mapView = [[MGLMapView alloc] initWithFrame:CGRectMake(0, 0, 200, 200) styleURL:styleURL]; + self.mapView = [[MLNMapView alloc] initWithFrame:CGRectMake(0, 0, 200, 200) styleURL:styleURL]; - [self.mapView setVisibleCoordinateBounds:MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(1.0, 1.0), + [self.mapView setVisibleCoordinateBounds:MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(1.0, 1.0), CLLocationCoordinate2DMake(2.0, 2.0))]; self.mapProjection = self.mapView.mapProjection; @@ -35,7 +35,7 @@ - (void)tearDown { self.mapView = nil; self.mapProjection = nil; - [MGLSettings setApiKey:nil]; + [MLNSettings setApiKey:nil]; [super tearDown]; } @@ -46,11 +46,11 @@ } - (void)testMapProjectionCameraSet { - MGLCoordinateBounds newBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(3.0, 3.0), + MLNCoordinateBounds newBounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(3.0, 3.0), CLLocationCoordinate2DMake(4.0, 4.0)); - MGLEdgeInsets paddings = MGLEdgeInsetsMake(10.0, 10.0, 10.0, 10.0); + MLNEdgeInsets paddings = MLNEdgeInsetsMake(10.0, 10.0, 10.0, 10.0); - MGLMapCamera *newCamera = [self.mapView cameraThatFitsCoordinateBounds:newBounds edgePadding:paddings]; + MLNMapCamera *newCamera = [self.mapView cameraThatFitsCoordinateBounds:newBounds edgePadding:paddings]; [self.mapProjection setCamera:newCamera withEdgeInsets:paddings]; XCTAssertTrue([self.mapProjection.camera isEqualToMapCamera:newCamera], @@ -70,9 +70,9 @@ } - (void)testMapProjectionVisibleBoundsSet { - MGLCoordinateBounds newBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(3.0, 3.0), + MLNCoordinateBounds newBounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(3.0, 3.0), CLLocationCoordinate2DMake(4.0, 4.0)); - MGLEdgeInsets paddings = MGLEdgeInsetsMake(10.0, 10.0, 10.0, 10.0); + MLNEdgeInsets paddings = MLNEdgeInsetsMake(10.0, 10.0, 10.0, 10.0); [self.mapProjection setVisibleCoordinateBounds:newBounds edgePadding:paddings]; diff --git a/platform/ios/platform/darwin/test/MGLMapSnapshotterTests.m b/platform/ios/platform/darwin/test/MLNMapSnapshotterTests.m similarity index 74% rename from platform/ios/platform/darwin/test/MGLMapSnapshotterTests.m rename to platform/ios/platform/darwin/test/MLNMapSnapshotterTests.m index 9e5f0718a..8bd99685e 100644 --- a/platform/ios/platform/darwin/test/MGLMapSnapshotterTests.m +++ b/platform/ios/platform/darwin/test/MLNMapSnapshotterTests.m @@ -1,7 +1,7 @@ #import #import -MGLImage *MGLNormalizedImage(MGLImage *sourceImage) { +MLNImage *MLNNormalizedImage(MLNImage *sourceImage) { #if TARGET_OS_IPHONE CGSize scaledSize = CGSizeMake(sourceImage.size.width * sourceImage.scale, sourceImage.size.height * sourceImage.scale); UIGraphicsBeginImageContextWithOptions(scaledSize, NO, UIScreen.mainScreen.scale); @@ -17,17 +17,17 @@ MGLImage *MGLNormalizedImage(MGLImage *sourceImage) { #endif } -BOOL MGLEqualImages(MGLImage *leftImage, MGLImage *rightImage) { +BOOL MLNEqualImages(MLNImage *leftImage, MLNImage *rightImage) { #if TARGET_OS_IPHONE - NSData *leftData = UIImagePNGRepresentation(MGLNormalizedImage(leftImage)); - NSData *rightData = UIImagePNGRepresentation(MGLNormalizedImage(rightImage)); + NSData *leftData = UIImagePNGRepresentation(MLNNormalizedImage(leftImage)); + NSData *rightData = UIImagePNGRepresentation(MLNNormalizedImage(rightImage)); return [leftData isEqualToData:rightData]; #else - CGImageRef leftCGImage = [MGLNormalizedImage(leftImage) CGImageForProposedRect:nil context:nil hints:nil]; + CGImageRef leftCGImage = [MLNNormalizedImage(leftImage) CGImageForProposedRect:nil context:nil hints:nil]; NSBitmapImageRep *leftImageRep = [[NSBitmapImageRep alloc] initWithCGImage:leftCGImage]; NSData *leftData = [leftImageRep representationUsingType:NSPNGFileType properties:@{}]; - CGImageRef rightCGImage = [MGLNormalizedImage(rightImage) CGImageForProposedRect:nil context:nil hints:nil]; + CGImageRef rightCGImage = [MLNNormalizedImage(rightImage) CGImageForProposedRect:nil context:nil hints:nil]; NSBitmapImageRep *rightImageRep = [[NSBitmapImageRep alloc] initWithCGImage:rightCGImage]; NSData *rightData = [rightImageRep representationUsingType:NSPNGFileType properties:@{}]; @@ -35,7 +35,7 @@ BOOL MGLEqualImages(MGLImage *leftImage, MGLImage *rightImage) { #endif } -MGLImage *MGLImageFromCurrentContext(void) { +MLNImage *MLNImageFromCurrentContext(void) { #if TARGET_OS_IPHONE return UIGraphicsGetImageFromCurrentImageContext(); #else @@ -49,26 +49,26 @@ MGLImage *MGLImageFromCurrentContext(void) { #endif } -@interface MGLMapSnapshotterTests : XCTestCase +@interface MLNMapSnapshotterTests : XCTestCase @property (nonatomic) XCTestExpectation *styleLoadingExpectation; -@property (nonatomic, copy, nullable) void (^runtimeStylingActions)(MGLStyle *style); +@property (nonatomic, copy, nullable) void (^runtimeStylingActions)(MLNStyle *style); @end -@implementation MGLMapSnapshotterTests +@implementation MLNMapSnapshotterTests - (void)setUp { [super setUp]; - [MGLSettings setApiKey:@"pk.feedcafedeadbeefbadebede"]; + [MLNSettings setApiKey:@"pk.feedcafedeadbeefbadebede"]; - [MGLOfflineStorage sharedOfflineStorage].delegate = self; + [MLNOfflineStorage sharedOfflineStorage].delegate = self; } - (void)tearDown { - [MGLSettings setApiKey:nil]; - [MGLOfflineStorage sharedOfflineStorage].delegate = nil; + [MLNSettings setApiKey:nil]; + [MLNOfflineStorage sharedOfflineStorage].delegate = nil; self.styleLoadingExpectation = nil; self.runtimeStylingActions = nil; [super tearDown]; @@ -91,21 +91,21 @@ MGLImage *MGLImageFromCurrentContext(void) { #endif NSURL *styleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"one-liner" withExtension:@"json"]; - MGLMapCamera *camera = [MGLMapCamera camera]; - MGLMapSnapshotOptions *options = [[MGLMapSnapshotOptions alloc] initWithStyleURL:styleURL camera:camera size:CGSizeMake(500, 500)]; + MLNMapCamera *camera = [MLNMapCamera camera]; + MLNMapSnapshotOptions *options = [[MLNMapSnapshotOptions alloc] initWithStyleURL:styleURL camera:camera size:CGSizeMake(500, 500)]; - MGLMapSnapshotter *snapshotter = [[MGLMapSnapshotter alloc] initWithOptions:options]; + MLNMapSnapshotter *snapshotter = [[MLNMapSnapshotter alloc] initWithOptions:options]; snapshotter.delegate = self; - [snapshotter startWithOverlayHandler:^(MGLMapSnapshotOverlay * _Nonnull snapshotOverlay) { + [snapshotter startWithOverlayHandler:^(MLNMapSnapshotOverlay * _Nonnull snapshotOverlay) { XCTAssertNotNil(snapshotOverlay); if (snapshotOverlay) { XCTAssertNotEqual(snapshotOverlay.context, NULL); - MGLImage *imageFromContext = MGLImageFromCurrentContext(); - XCTAssertTrue(MGLEqualImages(blankImage, imageFromContext), @"Base map in snapshot should be blank."); + MLNImage *imageFromContext = MLNImageFromCurrentContext(); + XCTAssertTrue(MLNEqualImages(blankImage, imageFromContext), @"Base map in snapshot should be blank."); } [overlayExpectation fulfill]; - } completionHandler:^(MGLMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { + } completionHandler:^(MLNMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { XCTAssertNil(error); XCTAssertNotNil(snapshot); if (snapshot) { @@ -122,13 +122,13 @@ MGLImage *MGLImageFromCurrentContext(void) { XCTestExpectation *completionExpectation = [self expectationWithDescription:@"Completion handler should get called."]; NSURL *styleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"one-liner" withExtension:@"json"]; - MGLMapCamera *camera = [MGLMapCamera camera]; - MGLMapSnapshotOptions *options = [[MGLMapSnapshotOptions alloc] initWithStyleURL:styleURL camera:camera size:CGSizeMake(500, 500)]; + MLNMapCamera *camera = [MLNMapCamera camera]; + MLNMapSnapshotOptions *options = [[MLNMapSnapshotOptions alloc] initWithStyleURL:styleURL camera:camera size:CGSizeMake(500, 500)]; - MGLMapSnapshotter *snapshotter = [[MGLMapSnapshotter alloc] initWithOptions:options]; + MLNMapSnapshotter *snapshotter = [[MLNMapSnapshotter alloc] initWithOptions:options]; snapshotter.delegate = self; - [snapshotter startWithCompletionHandler:^(MGLMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { + [snapshotter startWithCompletionHandler:^(MLNMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { XCTAssertNil(error); XCTAssertNotNil(snapshot); if (snapshot) { @@ -141,17 +141,17 @@ MGLImage *MGLImageFromCurrentContext(void) { } - (void)testRuntimeStyling { - [self testStyleURL:nil camera:[MGLMapCamera camera] applyingRuntimeStylingActions:^(MGLStyle *style) { - MGLBackgroundStyleLayer *backgroundLayer = [[MGLBackgroundStyleLayer alloc] initWithIdentifier:@"background"]; - backgroundLayer.backgroundColor = [NSExpression expressionForConstantValue:[MGLColor orangeColor]]; + [self testStyleURL:nil camera:[MLNMapCamera camera] applyingRuntimeStylingActions:^(MLNStyle *style) { + MLNBackgroundStyleLayer *backgroundLayer = [[MLNBackgroundStyleLayer alloc] initWithIdentifier:@"background"]; + backgroundLayer.backgroundColor = [NSExpression expressionForConstantValue:[MLNColor orangeColor]]; [style addLayer:backgroundLayer]; - } expectedImageName:@"Fixtures/MGLMapSnapshotterTests/background"]; + } expectedImageName:@"Fixtures/MLNMapSnapshotterTests/background"]; } - (void)testLocalGlyphRendering { - [[NSUserDefaults standardUserDefaults] setObject:@[@"PingFang TC"] forKey:@"MGLIdeographicFontFamilyName"]; + [[NSUserDefaults standardUserDefaults] setObject:@[@"PingFang TC"] forKey:@"MLNIdeographicFontFamilyName"]; NSURL *styleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"mixed" withExtension:@"json"]; - [self testStyleURL:styleURL camera:nil applyingRuntimeStylingActions:^(MGLStyle *style) {} expectedImageName:@"Fixtures/MGLMapSnapshotterTests/PingFang"]; + [self testStyleURL:styleURL camera:nil applyingRuntimeStylingActions:^(MLNStyle *style) {} expectedImageName:@"Fixtures/MLNMapSnapshotterTests/PingFang"]; } /** @@ -161,7 +161,7 @@ MGLImage *MGLImageFromCurrentContext(void) { @param camera The camera to show, or `nil` to show the style’s default camera. @param expectedImageName Name of the test fixture image in Media.xcassets. */ -- (void)testStyleURL:(nullable NSURL *)styleURL camera:(nullable MGLMapCamera *)camera applyingRuntimeStylingActions:(void (^)(MGLStyle *style))actions expectedImageName:(NSString *)expectedImageName { +- (void)testStyleURL:(nullable NSURL *)styleURL camera:(nullable MLNMapCamera *)camera applyingRuntimeStylingActions:(void (^)(MLNStyle *style))actions expectedImageName:(NSString *)expectedImageName { self.styleLoadingExpectation = [self expectationWithDescription:@"Style should finish loading."]; XCTestExpectation *overlayExpectation = [self expectationWithDescription:@"Overlay handler should get called."]; XCTestExpectation *completionExpectation = [self expectationWithDescription:@"Completion handler should get called."]; @@ -177,31 +177,31 @@ MGLImage *MGLImageFromCurrentContext(void) { styleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"one-liner" withExtension:@"json"]; } - MGLMapCamera *defaultCamera = camera ?: [MGLMapCamera camera]; + MLNMapCamera *defaultCamera = camera ?: [MLNMapCamera camera]; if (!camera) { defaultCamera.centerCoordinate = kCLLocationCoordinate2DInvalid; defaultCamera.heading = -1; defaultCamera.pitch = -1; } - MGLMapSnapshotOptions *options = [[MGLMapSnapshotOptions alloc] initWithStyleURL:styleURL camera:defaultCamera size:expectedImage.size]; + MLNMapSnapshotOptions *options = [[MLNMapSnapshotOptions alloc] initWithStyleURL:styleURL camera:defaultCamera size:expectedImage.size]; if (!camera) { options.zoomLevel = -1; } - MGLMapSnapshotter *snapshotter = [[MGLMapSnapshotter alloc] initWithOptions:options]; + MLNMapSnapshotter *snapshotter = [[MLNMapSnapshotter alloc] initWithOptions:options]; snapshotter.delegate = self; self.runtimeStylingActions = actions; - [snapshotter startWithOverlayHandler:^(MGLMapSnapshotOverlay * _Nonnull snapshotOverlay) { + [snapshotter startWithOverlayHandler:^(MLNMapSnapshotOverlay * _Nonnull snapshotOverlay) { XCTAssertNotNil(snapshotOverlay); // This image comparison returns false, but they are identical when inspecting them manually // if (snapshotOverlay) { // XCTAssertNotEqual(snapshotOverlay.context, NULL); -// MGLImage *actualImage = MGLImageFromCurrentContext(); -// XCTAssertTrue(MGLEqualImages(expectedImage, actualImage), @"Bare snapshot before ornamentation differs from expected image."); +// MLNImage *actualImage = MLNImageFromCurrentContext(); +// XCTAssertTrue(MLNEqualImages(expectedImage, actualImage), @"Bare snapshot before ornamentation differs from expected image."); // } [overlayExpectation fulfill]; - } completionHandler:^(MGLMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { + } completionHandler:^(MLNMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { XCTAssertNil(error); XCTAssertNotNil(snapshot); if (snapshot) { @@ -214,9 +214,9 @@ MGLImage *MGLImageFromCurrentContext(void) { self.runtimeStylingActions = nil; } -// MARK: MGLMapSnapshotterDelegate methods +// MARK: MLNMapSnapshotterDelegate methods -- (void)mapSnapshotter:(MGLMapSnapshotter *)snapshotter didFinishLoadingStyle:(MGLStyle *)style { +- (void)mapSnapshotter:(MLNMapSnapshotter *)snapshotter didFinishLoadingStyle:(MLNStyle *)style { XCTAssertNotNil(snapshotter); XCTAssertNotNil(style); @@ -227,10 +227,10 @@ MGLImage *MGLImageFromCurrentContext(void) { [self.styleLoadingExpectation fulfill]; } -// MARK: MGLOfflineStorageDelegate methods +// MARK: MLNOfflineStorageDelegate methods -- (NSURL *)offlineStorage:(MGLOfflineStorage *)storage URLForResourceOfKind:(MGLResourceKind)kind withURL:(NSURL *)url { - if (kind == MGLResourceKindGlyphs && [url.scheme isEqualToString:@"local"]) { +- (NSURL *)offlineStorage:(MLNOfflineStorage *)storage URLForResourceOfKind:(MLNResourceKind)kind withURL:(NSURL *)url { + if (kind == MLNResourceKindGlyphs && [url.scheme isEqualToString:@"local"]) { return [[NSBundle bundleForClass:[self class]] URLForResource:@"glyphs" withExtension:@"pbf"]; } return url; diff --git a/platform/ios/platform/darwin/test/MGLMapViewTests.m b/platform/ios/platform/darwin/test/MLNMapViewTests.m similarity index 81% rename from platform/ios/platform/darwin/test/MGLMapViewTests.m rename to platform/ios/platform/darwin/test/MLNMapViewTests.m index 75cfcfff3..b54e02cf7 100644 --- a/platform/ios/platform/darwin/test/MGLMapViewTests.m +++ b/platform/ios/platform/darwin/test/MLNMapViewTests.m @@ -3,42 +3,42 @@ #import #if TARGET_OS_IPHONE - #define MGLEdgeInsetsZero UIEdgeInsetsZero + #define MLNEdgeInsetsZero UIEdgeInsetsZero #else - #define MGLEdgeInsetsZero NSEdgeInsetsZero + #define MLNEdgeInsetsZero NSEdgeInsetsZero #endif -static MGLMapView *mapView; +static MLNMapView *mapView; -@interface MGLMapViewTests : XCTestCase +@interface MLNMapViewTests : XCTestCase @end -@implementation MGLMapViewTests +@implementation MLNMapViewTests - (void)setUp { [super setUp]; - [MGLSettings setApiKey:@"pk.feedcafedeadbeefbadebede"]; + [MLNSettings setApiKey:@"pk.feedcafedeadbeefbadebede"]; NSURL *styleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"one-liner" withExtension:@"json"]; - mapView = [[MGLMapView alloc] initWithFrame:CGRectMake(0, 0, 64, 64) styleURL:styleURL]; + mapView = [[MLNMapView alloc] initWithFrame:CGRectMake(0, 0, 64, 64) styleURL:styleURL]; } - (void)tearDown { mapView = nil; - [MGLSettings setApiKey:nil]; + [MLNSettings setApiKey:nil]; [super tearDown]; } - (void)testCoordinateBoundsConversion { [mapView setCenterCoordinate:CLLocationCoordinate2DMake(33, 179)]; - MGLCoordinateBounds leftAntimeridianBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(-75, 175), CLLocationCoordinate2DMake(75, 180)); + MLNCoordinateBounds leftAntimeridianBounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(-75, 175), CLLocationCoordinate2DMake(75, 180)); CGRect leftAntimeridianBoundsRect = [mapView convertCoordinateBounds:leftAntimeridianBounds toRectToView:mapView]; - MGLCoordinateBounds rightAntimeridianBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(-75, -180), CLLocationCoordinate2DMake(75, -175)); + MLNCoordinateBounds rightAntimeridianBounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(-75, -180), CLLocationCoordinate2DMake(75, -175)); CGRect rightAntimeridianBoundsRect = [mapView convertCoordinateBounds:rightAntimeridianBounds toRectToView:mapView]; - MGLCoordinateBounds spanningBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(24, 140), CLLocationCoordinate2DMake(44, 240)); + MLNCoordinateBounds spanningBounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(24, 140), CLLocationCoordinate2DMake(44, 240)); CGRect spanningBoundsRect = [mapView convertCoordinateBounds:spanningBounds toRectToView:mapView]; // If the resulting CGRect from -convertCoordinateBounds:toRectToView: @@ -51,25 +51,25 @@ static MGLMapView *mapView; #if TARGET_OS_IPHONE - (void)testUserTrackingModeCompletion { __block BOOL completed = NO; - [mapView setUserTrackingMode:MGLUserTrackingModeNone animated:NO completionHandler:^{ + [mapView setUserTrackingMode:MLNUserTrackingModeNone animated:NO completionHandler:^{ completed = YES; }]; XCTAssertTrue(completed, @"Completion block should get called synchronously when the mode is unchanged."); completed = NO; - [mapView setUserTrackingMode:MGLUserTrackingModeNone animated:YES completionHandler:^{ + [mapView setUserTrackingMode:MLNUserTrackingModeNone animated:YES completionHandler:^{ completed = YES; }]; XCTAssertTrue(completed, @"Completion block should get called synchronously when the mode is unchanged."); completed = NO; - [mapView setUserTrackingMode:MGLUserTrackingModeFollow animated:NO completionHandler:^{ + [mapView setUserTrackingMode:MLNUserTrackingModeFollow animated:NO completionHandler:^{ completed = YES; }]; XCTAssertTrue(completed, @"Completion block should get called synchronously when there’s no location."); completed = NO; - [mapView setUserTrackingMode:MGLUserTrackingModeFollowWithHeading animated:YES completionHandler:^{ + [mapView setUserTrackingMode:MLNUserTrackingModeFollowWithHeading animated:YES completionHandler:^{ completed = YES; }]; XCTAssertTrue(completed, @"Completion block should get called synchronously when there’s no location."); @@ -89,14 +89,14 @@ static MGLMapView *mapView; XCTAssertTrue(completed, @"Completion block should get called synchronously when the target coordinate is unchanged."); completed = NO; - [mapView setUserTrackingMode:MGLUserTrackingModeFollow animated:NO completionHandler:nil]; + [mapView setUserTrackingMode:MLNUserTrackingModeFollow animated:NO completionHandler:nil]; [mapView setTargetCoordinate:CLLocationCoordinate2DMake(39.128106, -84.516293) animated:YES completionHandler:^{ completed = YES; }]; XCTAssertTrue(completed, @"Completion block should get called synchronously when not tracking user course."); completed = NO; - [mapView setUserTrackingMode:MGLUserTrackingModeFollowWithCourse animated:NO completionHandler:nil]; + [mapView setUserTrackingMode:MLNUserTrackingModeFollowWithCourse animated:NO completionHandler:nil]; [mapView setTargetCoordinate:CLLocationCoordinate2DMake(39.224407, -84.394957) animated:YES completionHandler:^{ completed = YES; }]; @@ -106,8 +106,8 @@ static MGLMapView *mapView; - (void)testVisibleCoordinatesCompletion { XCTestExpectation *expectation = [self expectationWithDescription:@"Completion block should get called when not animated"]; - MGLCoordinateBounds unitBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1)); - [mapView setVisibleCoordinateBounds:unitBounds edgePadding:MGLEdgeInsetsZero animated:NO completionHandler:^{ + MLNCoordinateBounds unitBounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1)); + [mapView setVisibleCoordinateBounds:unitBounds edgePadding:MLNEdgeInsetsZero animated:NO completionHandler:^{ [expectation fulfill]; }]; [self waitForExpectations:@[expectation] timeout:1]; @@ -133,20 +133,20 @@ static MGLMapView *mapView; - (void)testShowAnnotationsCompletion { __block BOOL completed = NO; - [mapView showAnnotations:@[] edgePadding:MGLEdgeInsetsZero animated:NO completionHandler:^{ + [mapView showAnnotations:@[] edgePadding:MLNEdgeInsetsZero animated:NO completionHandler:^{ completed = YES; }]; XCTAssertTrue(completed, @"Completion block should get called synchronously when there are no annotations to show."); XCTestExpectation *expectation = [self expectationWithDescription:@"Completion block should get called when not animated"]; - MGLPointAnnotation *annotation = [[MGLPointAnnotation alloc] init]; - [mapView showAnnotations:@[annotation] edgePadding:MGLEdgeInsetsZero animated:NO completionHandler:^{ + MLNPointAnnotation *annotation = [[MLNPointAnnotation alloc] init]; + [mapView showAnnotations:@[annotation] edgePadding:MLNEdgeInsetsZero animated:NO completionHandler:^{ [expectation fulfill]; }]; [self waitForExpectations:@[expectation] timeout:1]; expectation = [self expectationWithDescription:@"Completion block should get called when animated."]; - [mapView showAnnotations:@[annotation] edgePadding:MGLEdgeInsetsZero animated:YES completionHandler:^{ + [mapView showAnnotations:@[annotation] edgePadding:MLNEdgeInsetsZero animated:YES completionHandler:^{ [expectation fulfill]; }]; [self waitForExpectations:@[expectation] timeout:1]; diff --git a/platform/ios/platform/darwin/test/MGLNSDateAdditionsTests.mm b/platform/ios/platform/darwin/test/MLNNSDateAdditionsTests.mm similarity index 54% rename from platform/ios/platform/darwin/test/MGLNSDateAdditionsTests.mm rename to platform/ios/platform/darwin/test/MLNNSDateAdditionsTests.mm index 6d8d95102..a17546f39 100644 --- a/platform/ios/platform/darwin/test/MGLNSDateAdditionsTests.mm +++ b/platform/ios/platform/darwin/test/MLNNSDateAdditionsTests.mm @@ -1,20 +1,20 @@ #import #include -#import "../../darwin/src/NSDate+MGLAdditions.h" +#import "../../darwin/src/NSDate+MLNAdditions.h" using namespace std::chrono_literals; -@interface MGLNSDateAdditionsTests : XCTestCase +@interface MLNNSDateAdditionsTests : XCTestCase @end -@implementation MGLNSDateAdditionsTests +@implementation MLNNSDateAdditionsTests - (void)testDurationToNSTimeInterval { NSTimeInterval timeInterval = 5; - mbgl::Duration duration = MGLDurationFromTimeInterval(timeInterval); - NSTimeInterval durationTimeInterval = MGLTimeIntervalFromDuration(duration); + mbgl::Duration duration = MLNDurationFromTimeInterval(timeInterval); + NSTimeInterval durationTimeInterval = MLNTimeIntervalFromDuration(duration); mbgl::Duration expectedDuration = 5s; mbgl::Duration expectedDurationMiliSeconds = 5000ms; @@ -22,18 +22,18 @@ using namespace std::chrono_literals; mbgl::Duration expectedDurationNanoSeconds = 5000000000ns; XCTAssertEqual(timeInterval, durationTimeInterval); - XCTAssertEqual(timeInterval, MGLTimeIntervalFromDuration(expectedDuration)); - XCTAssertEqual(timeInterval, MGLTimeIntervalFromDuration(expectedDurationMiliSeconds)); - XCTAssertEqual(timeInterval, MGLTimeIntervalFromDuration(expectedDurationMicroSeconds)); - XCTAssertEqual(timeInterval, MGLTimeIntervalFromDuration(expectedDurationNanoSeconds)); + XCTAssertEqual(timeInterval, MLNTimeIntervalFromDuration(expectedDuration)); + XCTAssertEqual(timeInterval, MLNTimeIntervalFromDuration(expectedDurationMiliSeconds)); + XCTAssertEqual(timeInterval, MLNTimeIntervalFromDuration(expectedDurationMicroSeconds)); + XCTAssertEqual(timeInterval, MLNTimeIntervalFromDuration(expectedDurationNanoSeconds)); mbgl::Duration durationMiliSeconds = 2500ms; mbgl::Duration durationMicroSeconds = 2500000us; mbgl::Duration durationNanoSeconds = 2500000000ns; - XCTAssertEqual(NSTimeInterval(2.5), MGLTimeIntervalFromDuration(durationMiliSeconds)); - XCTAssertEqual(NSTimeInterval(2.5), MGLTimeIntervalFromDuration(durationMicroSeconds)); - XCTAssertEqual(NSTimeInterval(2.5), MGLTimeIntervalFromDuration(durationNanoSeconds)); + XCTAssertEqual(NSTimeInterval(2.5), MLNTimeIntervalFromDuration(durationMiliSeconds)); + XCTAssertEqual(NSTimeInterval(2.5), MLNTimeIntervalFromDuration(durationMicroSeconds)); + XCTAssertEqual(NSTimeInterval(2.5), MLNTimeIntervalFromDuration(durationNanoSeconds)); } diff --git a/platform/ios/platform/darwin/test/MGLNSStringAdditionsTests.m b/platform/ios/platform/darwin/test/MLNNSStringAdditionsTests.m similarity index 98% rename from platform/ios/platform/darwin/test/MGLNSStringAdditionsTests.m rename to platform/ios/platform/darwin/test/MLNNSStringAdditionsTests.m index 872a8ce66..0fc03525e 100644 --- a/platform/ios/platform/darwin/test/MGLNSStringAdditionsTests.m +++ b/platform/ios/platform/darwin/test/MLNNSStringAdditionsTests.m @@ -1,12 +1,12 @@ #import -#import "NSString+MGLAdditions.h" +#import "NSString+MLNAdditions.h" -@interface MGLNSStringAdditionsTests : XCTestCase +@interface MLNNSStringAdditionsTests : XCTestCase @end -@implementation MGLNSStringAdditionsTests +@implementation MLNNSStringAdditionsTests - (void)testTitleCasedString { NSLocale *locale = [NSLocale localeWithLocaleIdentifier:@"en_US"]; diff --git a/platform/ios/platform/darwin/test/MGLOfflinePackTests.mm b/platform/ios/platform/darwin/test/MLNOfflinePackTests.mm similarity index 73% rename from platform/ios/platform/darwin/test/MGLOfflinePackTests.mm rename to platform/ios/platform/darwin/test/MLNOfflinePackTests.mm index 6b454ee8c..a4ec74667 100644 --- a/platform/ios/platform/darwin/test/MGLOfflinePackTests.mm +++ b/platform/ios/platform/darwin/test/MLNOfflinePackTests.mm @@ -1,33 +1,33 @@ #import #import -#import "MGLOfflinePack_Private.h" -#import "MGLTestAssertionHandler.h" +#import "MLNOfflinePack_Private.h" +#import "MLNTestAssertionHandler.h" -@interface MGLOfflinePackTests : XCTestCase +@interface MLNOfflinePackTests : XCTestCase @end -@implementation MGLOfflinePackTests +@implementation MLNOfflinePackTests - (void)testInvalidation { - MGLOfflinePack *invalidPack = [[MGLOfflinePack alloc] init]; + MLNOfflinePack *invalidPack = [[MLNOfflinePack alloc] init]; - XCTAssertEqual(invalidPack.state, MGLOfflinePackStateInvalid, @"Offline pack should be invalid when initialized independently of MGLOfflineStorage."); + XCTAssertEqual(invalidPack.state, MLNOfflinePackStateInvalid, @"Offline pack should be invalid when initialized independently of MLNOfflineStorage."); - XCTAssertThrowsSpecificNamed(invalidPack.region, NSException, MGLInvalidOfflinePackException, @"Invalid offline pack should raise an exception when accessing its region."); - XCTAssertThrowsSpecificNamed(invalidPack.context, NSException, MGLInvalidOfflinePackException, @"Invalid offline pack should raise an exception when accessing its context."); - XCTAssertThrowsSpecificNamed([invalidPack resume], NSException, MGLInvalidOfflinePackException, @"Invalid offline pack should raise an exception when being resumed."); - XCTAssertThrowsSpecificNamed([invalidPack suspend], NSException, MGLInvalidOfflinePackException, @"Invalid offline pack should raise an exception when being suspended."); + XCTAssertThrowsSpecificNamed(invalidPack.region, NSException, MLNInvalidOfflinePackException, @"Invalid offline pack should raise an exception when accessing its region."); + XCTAssertThrowsSpecificNamed(invalidPack.context, NSException, MLNInvalidOfflinePackException, @"Invalid offline pack should raise an exception when accessing its context."); + XCTAssertThrowsSpecificNamed([invalidPack resume], NSException, MLNInvalidOfflinePackException, @"Invalid offline pack should raise an exception when being resumed."); + XCTAssertThrowsSpecificNamed([invalidPack suspend], NSException, MLNInvalidOfflinePackException, @"Invalid offline pack should raise an exception when being suspended."); } - (void)testInvalidatingAnInvalidPack { - MGLOfflinePack *invalidPack = [[MGLOfflinePack alloc] init]; + MLNOfflinePack *invalidPack = [[MLNOfflinePack alloc] init]; XCTAssertThrowsSpecificNamed([invalidPack invalidate], NSException, NSInternalInconsistencyException, @"Invalid offline pack should raise an exception when being invalidated."); // Now try again, without asserts NSAssertionHandler *oldHandler = [NSAssertionHandler currentHandler]; - MGLTestAssertionHandler *newHandler = [[MGLTestAssertionHandler alloc] initWithTestCase:self]; + MLNTestAssertionHandler *newHandler = [[MLNTestAssertionHandler alloc] initWithTestCase:self]; [[[NSThread currentThread] threadDictionary] setValue:newHandler forKey:NSAssertionHandlerKey]; // Make sure this doesn't crash without asserts @@ -37,7 +37,7 @@ } - (void)testProgressBoxing { - MGLOfflinePackProgress progress = { + MLNOfflinePackProgress progress = { .countOfResourcesCompleted = 3, .countOfResourcesExpected = 2, .countOfBytesCompleted = 7, @@ -45,7 +45,7 @@ .countOfTileBytesCompleted = 6, .maximumResourcesExpected = UINT64_MAX, }; - MGLOfflinePackProgress roundTrippedProgress = [NSValue valueWithMGLOfflinePackProgress:progress].MGLOfflinePackProgressValue; + MLNOfflinePackProgress roundTrippedProgress = [NSValue valueWithMLNOfflinePackProgress:progress].MLNOfflinePackProgressValue; XCTAssertEqual(progress.countOfResourcesCompleted, roundTrippedProgress.countOfResourcesCompleted, @"Completed resources should round-trip."); XCTAssertEqual(progress.countOfResourcesExpected, roundTrippedProgress.countOfResourcesExpected, @"Expected resources should round-trip."); diff --git a/platform/ios/platform/darwin/test/MGLOfflineRegionTests.m b/platform/ios/platform/darwin/test/MLNOfflineRegionTests.m similarity index 68% rename from platform/ios/platform/darwin/test/MGLOfflineRegionTests.m rename to platform/ios/platform/darwin/test/MLNOfflineRegionTests.m index de5f34ae9..ada5873c8 100644 --- a/platform/ios/platform/darwin/test/MGLOfflineRegionTests.m +++ b/platform/ios/platform/darwin/test/MLNOfflineRegionTests.m @@ -2,35 +2,35 @@ #import -@interface MGLOfflineRegionTests : XCTestCase +@interface MLNOfflineRegionTests : XCTestCase @end -@implementation MGLOfflineRegionTests +@implementation MLNOfflineRegionTests - (void)setUp { [super setUp]; - [MGLSettings useWellKnownTileServer:MGLMapTiler]; + [MLNSettings useWellKnownTileServer:MLNMapTiler]; } - (void)testStyleURLs { - MGLCoordinateBounds bounds = MGLCoordinateBoundsMake(kCLLocationCoordinate2DInvalid, kCLLocationCoordinate2DInvalid); - MGLTilePyramidOfflineRegion *region = [[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:nil bounds:bounds fromZoomLevel:0 toZoomLevel:DBL_MAX]; - XCTAssertEqualObjects(region.styleURL, [MGLStyle defaultStyleURL], @"Default style expected."); + MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(kCLLocationCoordinate2DInvalid, kCLLocationCoordinate2DInvalid); + MLNTilePyramidOfflineRegion *region = [[MLNTilePyramidOfflineRegion alloc] initWithStyleURL:nil bounds:bounds fromZoomLevel:0 toZoomLevel:DBL_MAX]; + XCTAssertEqualObjects(region.styleURL, [MLNStyle defaultStyleURL], @"Default style expected."); NSURL *localURL = [NSURL URLWithString:@"beautiful.style"]; - XCTAssertThrowsSpecificNamed([[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:localURL bounds:bounds fromZoomLevel:0 toZoomLevel:DBL_MAX], NSException, MGLInvalidStyleURLException, @"No exception raised when initializing region with a local file URL as the style URL."); + XCTAssertThrowsSpecificNamed([[MLNTilePyramidOfflineRegion alloc] initWithStyleURL:localURL bounds:bounds fromZoomLevel:0 toZoomLevel:DBL_MAX], NSException, MLNInvalidStyleURLException, @"No exception raised when initializing region with a local file URL as the style URL."); } - (void)testTilePyramidRegionEquality { - [MGLSettings useWellKnownTileServer:MGLMapTiler]; - MGLCoordinateBounds bounds = MGLCoordinateBoundsMake(kCLLocationCoordinate2DInvalid, kCLLocationCoordinate2DInvalid); - MGLTilePyramidOfflineRegion *original = [[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:[[MGLStyle predefinedStyle:@"Bright"] url] bounds:bounds fromZoomLevel:5 toZoomLevel:10]; - MGLTilePyramidOfflineRegion *copy = [original copy]; + [MLNSettings useWellKnownTileServer:MLNMapTiler]; + MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(kCLLocationCoordinate2DInvalid, kCLLocationCoordinate2DInvalid); + MLNTilePyramidOfflineRegion *original = [[MLNTilePyramidOfflineRegion alloc] initWithStyleURL:[[MLNStyle predefinedStyle:@"Bright"] url] bounds:bounds fromZoomLevel:5 toZoomLevel:10]; + MLNTilePyramidOfflineRegion *copy = [original copy]; XCTAssertEqualObjects(original, copy, @"Tile pyramid region should be equal to its copy."); XCTAssertEqualObjects(original.styleURL, copy.styleURL, @"Style URL has changed."); - XCTAssert(MGLCoordinateBoundsEqualToCoordinateBounds(original.bounds, copy.bounds), @"Bounds have changed."); + XCTAssert(MLNCoordinateBoundsEqualToCoordinateBounds(original.bounds, copy.bounds), @"Bounds have changed."); XCTAssertEqual(original.minimumZoomLevel, copy.minimumZoomLevel, @"Minimum zoom level has changed."); XCTAssertEqual(original.maximumZoomLevel, copy.maximumZoomLevel, @"Maximum zoom level has changed."); XCTAssertEqual(original.includesIdeographicGlyphs, copy.includesIdeographicGlyphs, @"Include ideographs has changed."); @@ -39,12 +39,12 @@ - (void)testGeometryRegionEquality { NSString *geojson = @"{\"type\": \"Point\", \"coordinates\": [-3.8671874999999996, 52.482780222078226] }"; NSError *error; - MGLShape *shape = [MGLShape shapeWithData: [geojson dataUsingEncoding:NSUTF8StringEncoding] encoding: NSUTF8StringEncoding error:&error]; + MLNShape *shape = [MLNShape shapeWithData: [geojson dataUsingEncoding:NSUTF8StringEncoding] encoding: NSUTF8StringEncoding error:&error]; XCTAssertNil(error); - MGLShapeOfflineRegion *original = [[MGLShapeOfflineRegion alloc] initWithStyleURL:[[MGLStyle predefinedStyle:@"Bright"] url] shape:shape fromZoomLevel:5 toZoomLevel:10]; + MLNShapeOfflineRegion *original = [[MLNShapeOfflineRegion alloc] initWithStyleURL:[[MLNStyle predefinedStyle:@"Bright"] url] shape:shape fromZoomLevel:5 toZoomLevel:10]; original.includesIdeographicGlyphs = NO; - MGLShapeOfflineRegion *copy = [original copy]; + MLNShapeOfflineRegion *copy = [original copy]; XCTAssertEqualObjects(original, copy, @"Shape region should be equal to its copy."); XCTAssertEqualObjects(original.styleURL, copy.styleURL, @"Style URL has changed."); @@ -58,8 +58,8 @@ // Tile pyramid offline region { - MGLCoordinateBounds bounds = MGLCoordinateBoundsMake(kCLLocationCoordinate2DInvalid, kCLLocationCoordinate2DInvalid); - MGLTilePyramidOfflineRegion *tilePyramidOfflineRegion = [[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:[[MGLStyle predefinedStyle:@"Bright"] url] bounds:bounds fromZoomLevel:5 toZoomLevel:10]; + MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(kCLLocationCoordinate2DInvalid, kCLLocationCoordinate2DInvalid); + MLNTilePyramidOfflineRegion *tilePyramidOfflineRegion = [[MLNTilePyramidOfflineRegion alloc] initWithStyleURL:[[MLNStyle predefinedStyle:@"Bright"] url] bounds:bounds fromZoomLevel:5 toZoomLevel:10]; XCTAssertFalse(tilePyramidOfflineRegion.includesIdeographicGlyphs, @"tile pyramid offline region should not include ideographic glyphs"); } @@ -67,9 +67,9 @@ { NSString *geojson = @"{\"type\": \"Point\", \"coordinates\": [-3.8671874999999996, 52.482780222078226] }"; NSError *error; - MGLShape *shape = [MGLShape shapeWithData: [geojson dataUsingEncoding:NSUTF8StringEncoding] encoding: NSUTF8StringEncoding error:&error]; + MLNShape *shape = [MLNShape shapeWithData: [geojson dataUsingEncoding:NSUTF8StringEncoding] encoding: NSUTF8StringEncoding error:&error]; XCTAssertNil(error); - MGLShapeOfflineRegion *shapeOfflineRegion = [[MGLShapeOfflineRegion alloc] initWithStyleURL:[[MGLStyle predefinedStyle:@"Bright"] url] shape:shape fromZoomLevel:5 toZoomLevel:10]; + MLNShapeOfflineRegion *shapeOfflineRegion = [[MLNShapeOfflineRegion alloc] initWithStyleURL:[[MLNStyle predefinedStyle:@"Bright"] url] shape:shape fromZoomLevel:5 toZoomLevel:10]; XCTAssertFalse(shapeOfflineRegion.includesIdeographicGlyphs, @"tile pyramid offline region should not include ideographic glyphs"); } } diff --git a/platform/ios/platform/darwin/test/MGLOfflineStorageTests.mm b/platform/ios/platform/darwin/test/MLNOfflineStorageTests.mm similarity index 80% rename from platform/ios/platform/darwin/test/MGLOfflineStorageTests.mm rename to platform/ios/platform/darwin/test/MLNOfflineStorageTests.mm index 439190857..d7d57e15b 100644 --- a/platform/ios/platform/darwin/test/MGLOfflineStorageTests.mm +++ b/platform/ios/platform/darwin/test/MLNOfflineStorageTests.mm @@ -1,10 +1,10 @@ #import #import -#import "MGLOfflineStorage_Private.h" -#import "NSBundle+MGLAdditions.h" -#import "NSDate+MGLAdditions.h" -#import "MGLTestAssertionHandler.h" +#import "MLNOfflineStorage_Private.h" +#import "NSBundle+MLNAdditions.h" +#import "NSDate+MLNAdditions.h" +#import "MLNTestAssertionHandler.h" #include #include @@ -12,10 +12,10 @@ #pragma clang diagnostic ignored "-Wshadow" -@interface MGLOfflineStorageTests : XCTestCase +@interface MLNOfflineStorageTests : XCTestCase @end -@implementation MGLOfflineStorageTests +@implementation MLNOfflineStorageTests + (void)tearDown { NSURL *cacheDirectoryURL = [[NSFileManager defaultManager] URLForDirectory:NSApplicationSupportDirectory @@ -29,7 +29,7 @@ XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:cacheDirectoryURL.path], @"Directory containing database should exist."); NSURL *cacheURL = [cacheDirectoryURL URLByAppendingPathComponent:@"cache.db"]; - XCTAssertEqualObjects(cacheURL, MGLOfflineStorage.sharedOfflineStorage.databaseURL); + XCTAssertEqualObjects(cacheURL, MLNOfflineStorage.sharedOfflineStorage.databaseURL); [[NSFileManager defaultManager] removeItemAtURL:cacheURL error:nil]; XCTAssertFalse([[NSFileManager defaultManager] fileExistsAtPath:cacheURL.path], @"Database should not exist."); @@ -37,27 +37,27 @@ - (void)setUp { [super setUp]; - [MGLSettings useWellKnownTileServer:MGLMapTiler]; + [MLNSettings useWellKnownTileServer:MLNMapTiler]; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - XCTestExpectation *expectation = [self keyValueObservingExpectationForObject:[MGLOfflineStorage sharedOfflineStorage] keyPath:@"packs" handler:^BOOL(id _Nonnull observedObject, NSDictionary * _Nonnull change) { + XCTestExpectation *expectation = [self keyValueObservingExpectationForObject:[MLNOfflineStorage sharedOfflineStorage] keyPath:@"packs" handler:^BOOL(id _Nonnull observedObject, NSDictionary * _Nonnull change) { const auto changeKind = static_cast([change[NSKeyValueChangeKindKey] unsignedLongValue]); return changeKind == NSKeyValueChangeSetting; }]; - if ([MGLOfflineStorage sharedOfflineStorage].packs) { + if ([MLNOfflineStorage sharedOfflineStorage].packs) { [expectation fulfill]; [self waitForExpectationsWithTimeout:0 handler:nil]; } else { [self waitForExpectationsWithTimeout:10 handler:nil]; } - XCTAssertNotNil([MGLOfflineStorage sharedOfflineStorage].packs, @"Shared offline storage object should have a non-nil collection of packs by this point."); + XCTAssertNotNil([MLNOfflineStorage sharedOfflineStorage].packs, @"Shared offline storage object should have a non-nil collection of packs by this point."); }); } -- (NSURL *)offlineStorage:(MGLOfflineStorage *)storage - URLForResourceOfKind:(MGLResourceKind)kind +- (NSURL *)offlineStorage:(MLNOfflineStorage *)storage + URLForResourceOfKind:(MLNResourceKind)kind withURL:(NSURL *)url { if ([url.scheme isEqual: @"test"] && [url.host isEqual: @"api"]) { return [NSURL URLWithString:@"https://api.mapbox.com"]; @@ -67,20 +67,20 @@ } - (void)testSharedObject { - XCTAssertEqual([MGLOfflineStorage sharedOfflineStorage], [MGLOfflineStorage sharedOfflineStorage], @"There should only be one shared offline storage object."); + XCTAssertEqual([MLNOfflineStorage sharedOfflineStorage], [MLNOfflineStorage sharedOfflineStorage], @"There should only be one shared offline storage object."); } - (void)testAddPackForBounds { - NSUInteger countOfPacks = [MGLOfflineStorage sharedOfflineStorage].packs.count; + NSUInteger countOfPacks = [MLNOfflineStorage sharedOfflineStorage].packs.count; - NSURL *styleURL = [[MGLStyle predefinedStyle:@"Bright"] url]; + NSURL *styleURL = [[MLNStyle predefinedStyle:@"Bright"] url]; /// Somewhere near Grape Grove, Ohio, United States. - MGLCoordinateBounds bounds = { + MLNCoordinateBounds bounds = { { .latitude = 39.70358155855172, .longitude = -83.69506472545841 }, { .latitude = 39.703818870225376, .longitude = -83.69420641857361 }, }; double zoomLevel = 20; - MGLTilePyramidOfflineRegion *region = [[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:styleURL bounds:bounds fromZoomLevel:zoomLevel toZoomLevel:zoomLevel]; + MLNTilePyramidOfflineRegion *region = [[MLNTilePyramidOfflineRegion alloc] initWithStyleURL:styleURL bounds:bounds fromZoomLevel:zoomLevel toZoomLevel:zoomLevel]; NSString *nameKey = @"Name"; NSString *name = @"🍇 Grape Grove"; @@ -89,24 +89,24 @@ nameKey: name, }]; - __block MGLOfflinePack *pack; - [self keyValueObservingExpectationForObject:[MGLOfflineStorage sharedOfflineStorage] keyPath:@"packs" handler:^BOOL(id _Nonnull observedObject, NSDictionary * _Nonnull change) { + __block MLNOfflinePack *pack; + [self keyValueObservingExpectationForObject:[MLNOfflineStorage sharedOfflineStorage] keyPath:@"packs" handler:^BOOL(id _Nonnull observedObject, NSDictionary * _Nonnull change) { const auto changeKind = static_cast([change[NSKeyValueChangeKindKey] unsignedLongValue]); NSIndexSet *indices = change[NSKeyValueChangeIndexesKey]; return changeKind == NSKeyValueChangeInsertion && indices.count == 1; }]; XCTestExpectation *additionCompletionHandlerExpectation = [self expectationWithDescription:@"add pack completion handler"]; - [[MGLOfflineStorage sharedOfflineStorage] addPackForRegion:region withContext:context completionHandler:^(MGLOfflinePack * _Nullable completionHandlerPack, NSError * _Nullable error) { + [[MLNOfflineStorage sharedOfflineStorage] addPackForRegion:region withContext:context completionHandler:^(MLNOfflinePack * _Nullable completionHandlerPack, NSError * _Nullable error) { XCTAssertNotNil(completionHandlerPack, @"Added pack should exist."); - XCTAssertEqual(completionHandlerPack.state, MGLOfflinePackStateInactive, @"New pack should initially have inactive state."); + XCTAssertEqual(completionHandlerPack.state, MLNOfflinePackStateInactive, @"New pack should initially have inactive state."); pack = completionHandlerPack; [additionCompletionHandlerExpectation fulfill]; }]; [self waitForExpectationsWithTimeout:5 handler:nil]; - XCTAssertEqual([MGLOfflineStorage sharedOfflineStorage].packs.count, countOfPacks + 1, @"Added pack should have been added to the canonical collection of packs owned by the shared offline storage object. This assertion can fail if this test is run before -testAAALoadPacks."); + XCTAssertEqual([MLNOfflineStorage sharedOfflineStorage].packs.count, countOfPacks + 1, @"Added pack should have been added to the canonical collection of packs owned by the shared offline storage object. This assertion can fail if this test is run before -testAAALoadPacks."); - XCTAssertEqual(pack, [MGLOfflineStorage sharedOfflineStorage].packs.lastObject, @"Pack should be appended to end of packs array."); + XCTAssertEqual(pack, [MLNOfflineStorage sharedOfflineStorage].packs.lastObject, @"Pack should be appended to end of packs array."); XCTAssertEqualObjects(pack.region, region, @"Added pack’s region has changed."); @@ -115,29 +115,29 @@ XCTAssert([userInfo[nameKey] isKindOfClass:[NSString class]], @"Name of offline pack isn’t a string."); XCTAssertEqualObjects(userInfo[nameKey], name, @"Name of offline pack has changed."); - XCTAssertEqual(pack.state, MGLOfflinePackStateInactive, @"New pack should initially have inactive state."); + XCTAssertEqual(pack.state, MLNOfflinePackStateInactive, @"New pack should initially have inactive state."); [self keyValueObservingExpectationForObject:pack keyPath:@"state" handler:^BOOL(id _Nonnull observedObject, NSDictionary * _Nonnull change) { const auto changeKind = static_cast([change[NSKeyValueChangeKindKey] unsignedLongValue]); - const auto state = static_cast([change[NSKeyValueChangeNewKey] longValue]); - return changeKind == NSKeyValueChangeSetting && state == MGLOfflinePackStateInactive; + const auto state = static_cast([change[NSKeyValueChangeNewKey] longValue]); + return changeKind == NSKeyValueChangeSetting && state == MLNOfflinePackStateInactive; }]; - [self expectationForNotification:MGLOfflinePackProgressChangedNotification object:pack handler:^BOOL(NSNotification * _Nonnull notification) { - MGLOfflinePack *notificationPack = notification.object; - XCTAssert([notificationPack isKindOfClass:[MGLOfflinePack class]], @"Object of notification should be an MGLOfflinePack."); + [self expectationForNotification:MLNOfflinePackProgressChangedNotification object:pack handler:^BOOL(NSNotification * _Nonnull notification) { + MLNOfflinePack *notificationPack = notification.object; + XCTAssert([notificationPack isKindOfClass:[MLNOfflinePack class]], @"Object of notification should be an MLNOfflinePack."); NSDictionary *userInfo = notification.userInfo; XCTAssertNotNil(userInfo, @"Progress change notification should have a userInfo dictionary."); - NSNumber *stateNumber = userInfo[MGLOfflinePackUserInfoKeyState]; + NSNumber *stateNumber = userInfo[MLNOfflinePackUserInfoKeyState]; XCTAssert([stateNumber isKindOfClass:[NSNumber class]], @"Progress change notification’s state should be an NSNumber."); XCTAssertEqual(stateNumber.integerValue, pack.state, @"State in a progress change notification should match the pack’s state."); - NSValue *progressValue = userInfo[MGLOfflinePackUserInfoKeyProgress]; + NSValue *progressValue = userInfo[MLNOfflinePackUserInfoKeyProgress]; XCTAssert([progressValue isKindOfClass:[NSValue class]], @"Progress change notification’s progress should be an NSValue."); - XCTAssertEqualObjects(progressValue, [NSValue valueWithMGLOfflinePackProgress:pack.progress], @"Progress change notification’s progress should match pack’s progress."); + XCTAssertEqualObjects(progressValue, [NSValue valueWithMLNOfflinePackProgress:pack.progress], @"Progress change notification’s progress should match pack’s progress."); - return notificationPack == pack && pack.state == MGLOfflinePackStateInactive; + return notificationPack == pack && pack.state == MLNOfflinePackStateInactive; }]; [pack requestProgress]; [self waitForExpectationsWithTimeout:5 handler:nil]; @@ -149,7 +149,7 @@ }]; XCTestExpectation *contextCompletionHandlerExpectation = [self expectationWithDescription:@"set pack completion context handler"]; - __weak MGLOfflinePack *weakPack = pack; + __weak MLNOfflinePack *weakPack = pack; [pack setContext:newContext completionHandler:^(NSError * _Nullable error) { XCTAssertNil(error); XCTAssertNotNil(weakPack); @@ -160,15 +160,15 @@ } - (void)testAddPackForGeometry { - NSUInteger countOfPacks = [MGLOfflineStorage sharedOfflineStorage].packs.count; + NSUInteger countOfPacks = [MLNOfflineStorage sharedOfflineStorage].packs.count; - NSURL *styleURL = [[MGLStyle predefinedStyle:@"Bright"] url]; + NSURL *styleURL = [[MLNStyle predefinedStyle:@"Bright"] url]; double zoomLevel = 20; NSString *geojson = @"{ \"type\": \"Polygon\", \"coordinates\": [ [ [ 5.1299285888671875, 52.10365839097971 ], [ 5.103063583374023, 52.110037078604236 ], [ 5.080232620239258, 52.09548601177304 ], [ 5.106925964355469, 52.07987524347506 ], [ 5.1299285888671875, 52.10365839097971 ] ] ]}"; NSError *error; - MGLShape *shape = [MGLShape shapeWithData: [geojson dataUsingEncoding:NSUTF8StringEncoding] encoding: NSUTF8StringEncoding error:&error]; + MLNShape *shape = [MLNShape shapeWithData: [geojson dataUsingEncoding:NSUTF8StringEncoding] encoding: NSUTF8StringEncoding error:&error]; XCTAssertNil(error); - MGLShapeOfflineRegion *region = [[MGLShapeOfflineRegion alloc] initWithStyleURL:styleURL shape:shape fromZoomLevel:zoomLevel toZoomLevel:zoomLevel]; + MLNShapeOfflineRegion *region = [[MLNShapeOfflineRegion alloc] initWithStyleURL:styleURL shape:shape fromZoomLevel:zoomLevel toZoomLevel:zoomLevel]; region.includesIdeographicGlyphs = NO; NSString *nameKey = @"Name"; @@ -176,24 +176,24 @@ NSData *context = [NSKeyedArchiver archivedDataWithRootObject:@{nameKey: name}]; - __block MGLOfflinePack *pack; - [self keyValueObservingExpectationForObject:[MGLOfflineStorage sharedOfflineStorage] keyPath:@"packs" handler:^BOOL(id _Nonnull observedObject, NSDictionary * _Nonnull change) { + __block MLNOfflinePack *pack; + [self keyValueObservingExpectationForObject:[MLNOfflineStorage sharedOfflineStorage] keyPath:@"packs" handler:^BOOL(id _Nonnull observedObject, NSDictionary * _Nonnull change) { const auto changeKind = static_cast([change[NSKeyValueChangeKindKey] unsignedLongValue]); NSIndexSet *indices = change[NSKeyValueChangeIndexesKey]; return changeKind == NSKeyValueChangeInsertion && indices.count == 1; }]; XCTestExpectation *additionCompletionHandlerExpectation = [self expectationWithDescription:@"add pack completion handler"]; - [[MGLOfflineStorage sharedOfflineStorage] addPackForRegion:region withContext:context completionHandler:^(MGLOfflinePack * _Nullable completionHandlerPack, NSError * _Nullable error) { + [[MLNOfflineStorage sharedOfflineStorage] addPackForRegion:region withContext:context completionHandler:^(MLNOfflinePack * _Nullable completionHandlerPack, NSError * _Nullable error) { XCTAssertNotNil(completionHandlerPack, @"Added pack should exist."); - XCTAssertEqual(completionHandlerPack.state, MGLOfflinePackStateInactive, @"New pack should initially have inactive state."); + XCTAssertEqual(completionHandlerPack.state, MLNOfflinePackStateInactive, @"New pack should initially have inactive state."); pack = completionHandlerPack; [additionCompletionHandlerExpectation fulfill]; }]; [self waitForExpectationsWithTimeout:5 handler:nil]; - XCTAssertEqual([MGLOfflineStorage sharedOfflineStorage].packs.count, countOfPacks + 1, @"Added pack should have been added to the canonical collection of packs owned by the shared offline storage object. This assertion can fail if this test is run before -testAAALoadPacks."); + XCTAssertEqual([MLNOfflineStorage sharedOfflineStorage].packs.count, countOfPacks + 1, @"Added pack should have been added to the canonical collection of packs owned by the shared offline storage object. This assertion can fail if this test is run before -testAAALoadPacks."); - XCTAssertEqual(pack, [MGLOfflineStorage sharedOfflineStorage].packs.lastObject, @"Pack should be appended to end of packs array."); + XCTAssertEqual(pack, [MLNOfflineStorage sharedOfflineStorage].packs.lastObject, @"Pack should be appended to end of packs array."); XCTAssertEqualObjects(pack.region, region, @"Added pack’s region has changed."); @@ -202,29 +202,29 @@ XCTAssert([userInfo[nameKey] isKindOfClass:[NSString class]], @"Name of offline pack isn’t a string."); XCTAssertEqualObjects(userInfo[nameKey], name, @"Name of offline pack has changed."); - XCTAssertEqual(pack.state, MGLOfflinePackStateInactive, @"New pack should initially have inactive state."); + XCTAssertEqual(pack.state, MLNOfflinePackStateInactive, @"New pack should initially have inactive state."); [self keyValueObservingExpectationForObject:pack keyPath:@"state" handler:^BOOL(id _Nonnull observedObject, NSDictionary * _Nonnull change) { const auto changeKind = static_cast([change[NSKeyValueChangeKindKey] unsignedLongValue]); - const auto state = static_cast([change[NSKeyValueChangeNewKey] longValue]); - return changeKind == NSKeyValueChangeSetting && state == MGLOfflinePackStateInactive; + const auto state = static_cast([change[NSKeyValueChangeNewKey] longValue]); + return changeKind == NSKeyValueChangeSetting && state == MLNOfflinePackStateInactive; }]; - [self expectationForNotification:MGLOfflinePackProgressChangedNotification object:pack handler:^BOOL(NSNotification * _Nonnull notification) { - MGLOfflinePack *notificationPack = notification.object; - XCTAssert([notificationPack isKindOfClass:[MGLOfflinePack class]], @"Object of notification should be an MGLOfflinePack."); + [self expectationForNotification:MLNOfflinePackProgressChangedNotification object:pack handler:^BOOL(NSNotification * _Nonnull notification) { + MLNOfflinePack *notificationPack = notification.object; + XCTAssert([notificationPack isKindOfClass:[MLNOfflinePack class]], @"Object of notification should be an MLNOfflinePack."); NSDictionary *userInfo = notification.userInfo; XCTAssertNotNil(userInfo, @"Progress change notification should have a userInfo dictionary."); - NSNumber *stateNumber = userInfo[MGLOfflinePackUserInfoKeyState]; + NSNumber *stateNumber = userInfo[MLNOfflinePackUserInfoKeyState]; XCTAssert([stateNumber isKindOfClass:[NSNumber class]], @"Progress change notification’s state should be an NSNumber."); XCTAssertEqual(stateNumber.integerValue, pack.state, @"State in a progress change notification should match the pack’s state."); - NSValue *progressValue = userInfo[MGLOfflinePackUserInfoKeyProgress]; + NSValue *progressValue = userInfo[MLNOfflinePackUserInfoKeyProgress]; XCTAssert([progressValue isKindOfClass:[NSValue class]], @"Progress change notification’s progress should be an NSValue."); - XCTAssertEqualObjects(progressValue, [NSValue valueWithMGLOfflinePackProgress:pack.progress], @"Progress change notification’s progress should match pack’s progress."); + XCTAssertEqualObjects(progressValue, [NSValue valueWithMLNOfflinePackProgress:pack.progress], @"Progress change notification’s progress should match pack’s progress."); - return notificationPack == pack && pack.state == MGLOfflinePackStateInactive; + return notificationPack == pack && pack.state == MLNOfflinePackStateInactive; }]; [pack requestProgress]; [self waitForExpectationsWithTimeout:5 handler:nil]; @@ -233,21 +233,21 @@ - (void)testInvalidatePack { XCTestExpectation *expectation = [self expectationWithDescription:@"Expect offline pack to be invalidated without an error."]; - MGLCoordinateBounds bounds = { + MLNCoordinateBounds bounds = { { .latitude = 48.8660, .longitude = 2.3306 }, { .latitude = 48.8603, .longitude = 2.3213 }, }; NSURL *styleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"one-liner" withExtension:@"json"]; - MGLTilePyramidOfflineRegion *region = [[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:styleURL bounds:bounds fromZoomLevel:10 toZoomLevel:11]; + MLNTilePyramidOfflineRegion *region = [[MLNTilePyramidOfflineRegion alloc] initWithStyleURL:styleURL bounds:bounds fromZoomLevel:10 toZoomLevel:11]; NSString *nameKey = @"Name"; NSString *name = @"Paris square"; NSData *context = [NSKeyedArchiver archivedDataWithRootObject:@{nameKey: name}]; - [[MGLOfflineStorage sharedOfflineStorage] addPackForRegion:region withContext:context completionHandler:^(MGLOfflinePack * _Nullable pack, NSError * _Nullable error) { + [[MLNOfflineStorage sharedOfflineStorage] addPackForRegion:region withContext:context completionHandler:^(MLNOfflinePack * _Nullable pack, NSError * _Nullable error) { XCTAssertNotNil(pack); - [[MGLOfflineStorage sharedOfflineStorage] invalidatePack:pack withCompletionHandler:^(NSError * _Nullable) { + [[MLNOfflineStorage sharedOfflineStorage] invalidatePack:pack withCompletionHandler:^(NSError * _Nullable) { XCTAssertNotNil(pack); XCTAssertNil(error); [expectation fulfill]; @@ -257,26 +257,26 @@ } - (void)testRemovePack { - NSUInteger countOfPacks = [MGLOfflineStorage sharedOfflineStorage].packs.count; + NSUInteger countOfPacks = [MLNOfflineStorage sharedOfflineStorage].packs.count; - MGLOfflinePack *pack = [MGLOfflineStorage sharedOfflineStorage].packs.lastObject; + MLNOfflinePack *pack = [MLNOfflineStorage sharedOfflineStorage].packs.lastObject; XCTAssertNotNil(pack, @"Added pack should still exist."); - [self keyValueObservingExpectationForObject:[MGLOfflineStorage sharedOfflineStorage] keyPath:@"packs" handler:^BOOL(id _Nonnull observedObject, NSDictionary * _Nonnull change) { + [self keyValueObservingExpectationForObject:[MLNOfflineStorage sharedOfflineStorage] keyPath:@"packs" handler:^BOOL(id _Nonnull observedObject, NSDictionary * _Nonnull change) { const auto changeKind = static_cast([change[NSKeyValueChangeKindKey] unsignedLongValue]); NSIndexSet *indices = change[NSKeyValueChangeIndexesKey]; return changeKind == NSKeyValueChangeRemoval && indices.count == 1; }]; XCTestExpectation *completionHandlerExpectation = [self expectationWithDescription:@"remove pack completion handler"]; - [[MGLOfflineStorage sharedOfflineStorage] removePack:pack withCompletionHandler:^(NSError * _Nullable error) { - XCTAssertEqual(pack.state, MGLOfflinePackStateInvalid, @"Removed pack should be invalid in the completion handler."); + [[MLNOfflineStorage sharedOfflineStorage] removePack:pack withCompletionHandler:^(NSError * _Nullable error) { + XCTAssertEqual(pack.state, MLNOfflinePackStateInvalid, @"Removed pack should be invalid in the completion handler."); [completionHandlerExpectation fulfill]; }]; [self waitForExpectationsWithTimeout:5 handler:nil]; - XCTAssertEqual(pack.state, MGLOfflinePackStateInvalid, @"Removed pack should have been invalidated synchronously."); + XCTAssertEqual(pack.state, MLNOfflinePackStateInvalid, @"Removed pack should have been invalidated synchronously."); - XCTAssertEqual([MGLOfflineStorage sharedOfflineStorage].packs.count, countOfPacks - 1, @"Removed pack should have been removed from the canonical collection of packs owned by the shared offline storage object. This assertion can fail if this test is run before -testAAALoadPacks or -testAddPack."); + XCTAssertEqual([MLNOfflineStorage sharedOfflineStorage].packs.count, countOfPacks - 1, @"Removed pack should have been removed from the canonical collection of packs owned by the shared offline storage object. This assertion can fail if this test is run before -testAAALoadPacks or -testAddPack."); } - (void)testBackupExclusion { @@ -307,9 +307,9 @@ XCTestExpectation *expectation = [self expectationWithDescription:@"added packs"]; - NSURL *styleURL = [[MGLStyle predefinedStyle:@"Bright"] url]; + NSURL *styleURL = [[MLNStyle predefinedStyle:@"Bright"] url]; - MGLCoordinateBounds bounds[] = { + MLNCoordinateBounds bounds[] = { {{51.5, -0.2}, {51.6, -0.1}}, // London {{60.1, 24.8}, {60.3, 25.1}}, // Helsinki {{38.9, -77.1}, {38.9, -77.0}}, // DC @@ -325,14 +325,14 @@ for (int i = 0; i < count; i++) { dispatch_group_enter(group); - MGLTilePyramidOfflineRegion *region = [[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:styleURL bounds:bounds[i] fromZoomLevel:20 toZoomLevel:20]; + MLNTilePyramidOfflineRegion *region = [[MLNTilePyramidOfflineRegion alloc] initWithStyleURL:styleURL bounds:bounds[i] fromZoomLevel:20 toZoomLevel:20]; NSData *context = [NSKeyedArchiver archivedDataWithRootObject:@{ @"index": @(i) }]; - [[MGLOfflineStorage sharedOfflineStorage] addPackForRegion:region + [[MLNOfflineStorage sharedOfflineStorage] addPackForRegion:region withContext:context - completionHandler:^(MGLOfflinePack * _Nullable pack, NSError * _Nullable error) { + completionHandler:^(MLNOfflinePack * _Nullable pack, NSError * _Nullable error) { XCTAssertNotNil(pack); XCTAssertNil(error); @@ -351,12 +351,12 @@ [self addPacks:1]; - NSUInteger countOfPacks = [MGLOfflineStorage sharedOfflineStorage].packs.count; + NSUInteger countOfPacks = [MLNOfflineStorage sharedOfflineStorage].packs.count; - MGLOfflinePack *pack = [MGLOfflineStorage sharedOfflineStorage].packs.lastObject; + MLNOfflinePack *pack = [MLNOfflineStorage sharedOfflineStorage].packs.lastObject; XCTAssertNotNil(pack, @"Added pack should still exist."); - [self keyValueObservingExpectationForObject:[MGLOfflineStorage sharedOfflineStorage] keyPath:@"packs" handler:^BOOL(id _Nonnull observedObject, NSDictionary * _Nonnull change) { + [self keyValueObservingExpectationForObject:[MLNOfflineStorage sharedOfflineStorage] keyPath:@"packs" handler:^BOOL(id _Nonnull observedObject, NSDictionary * _Nonnull change) { const auto changeKind = static_cast([change[NSKeyValueChangeKindKey] unsignedLongValue]); NSIndexSet *indices = change[NSKeyValueChangeIndexesKey]; return changeKind == NSKeyValueChangeRemoval && indices.count == 1; @@ -364,15 +364,15 @@ XCTestExpectation *completionHandlerExpectation = [self expectationWithDescription:@"remove pack completion handler"]; - [[MGLOfflineStorage sharedOfflineStorage] removePack:pack withCompletionHandler:nil]; + [[MLNOfflineStorage sharedOfflineStorage] removePack:pack withCompletionHandler:nil]; NSAssertionHandler *oldHandler = [NSAssertionHandler currentHandler]; - MGLTestAssertionHandler *newHandler = [[MGLTestAssertionHandler alloc] initWithTestCase:self]; + MLNTestAssertionHandler *newHandler = [[MLNTestAssertionHandler alloc] initWithTestCase:self]; [[[NSThread currentThread] threadDictionary] setValue:newHandler forKey:NSAssertionHandlerKey]; - [[MGLOfflineStorage sharedOfflineStorage] removePack:pack withCompletionHandler:^(NSError * _Nullable error) { - XCTAssertEqual(pack.state, MGLOfflinePackStateInvalid, @"Removed pack should be invalid in the completion handler."); + [[MLNOfflineStorage sharedOfflineStorage] removePack:pack withCompletionHandler:^(NSError * _Nullable error) { + XCTAssertEqual(pack.state, MLNOfflinePackStateInvalid, @"Removed pack should be invalid in the completion handler."); [completionHandlerExpectation fulfill]; }]; @@ -380,9 +380,9 @@ [[[NSThread currentThread] threadDictionary] setValue:oldHandler forKey:NSAssertionHandlerKey]; - XCTAssertEqual(pack.state, MGLOfflinePackStateInvalid, @"Removed pack should have been invalidated synchronously."); + XCTAssertEqual(pack.state, MLNOfflinePackStateInvalid, @"Removed pack should have been invalidated synchronously."); - XCTAssertEqual([MGLOfflineStorage sharedOfflineStorage].packs.count, countOfPacks - 1, @"Removed pack should have been removed from the canonical collection of packs owned by the shared offline storage object. This assertion can fail if this test is run before -testAAALoadPacks or -testAddPack."); + XCTAssertEqual([MLNOfflineStorage sharedOfflineStorage].packs.count, countOfPacks - 1, @"Removed pack should have been removed from the canonical collection of packs owned by the shared offline storage object. This assertion can fail if this test is run before -testAAALoadPacks or -testAddPack."); NSLog(@"Test `%@` complete", NSStringFromSelector(_cmd)); } @@ -399,30 +399,30 @@ [self addPacks:4]; - NSInteger countOfPacks = [MGLOfflineStorage sharedOfflineStorage].packs.count; + NSInteger countOfPacks = [MLNOfflineStorage sharedOfflineStorage].packs.count; XCTAssert(countOfPacks > 0); // Now delete packs one by one XCTestExpectation *expectation = [self expectationWithDescription:@"All packs removed"]; expectation.expectedFulfillmentCount = countOfPacks; - MGLOfflineStorage *storage = [MGLOfflineStorage sharedOfflineStorage]; + MLNOfflineStorage *storage = [MLNOfflineStorage sharedOfflineStorage]; NSArray *packs = [storage.packs copy]; // Simulate what happens the first time sharedOfflineStorage is accessed [storage reloadPacks]; NSArray *validPacks = [packs filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id _Nullable evaluatedObject, NSDictionary * _Nullable bindings) { - MGLOfflinePack *pack = (MGLOfflinePack*)evaluatedObject; - return pack.state != MGLOfflinePackStateInvalid; + MLNOfflinePack *pack = (MLNOfflinePack*)evaluatedObject; + return pack.state != MLNOfflinePackStateInvalid; }]]; NSAssertionHandler *oldHandler = [NSAssertionHandler currentHandler]; - MGLTestAssertionHandler *newHandler = [[MGLTestAssertionHandler alloc] initWithTestCase:self]; + MLNTestAssertionHandler *newHandler = [[MLNTestAssertionHandler alloc] initWithTestCase:self]; [[[NSThread currentThread] threadDictionary] setValue:newHandler forKey:NSAssertionHandlerKey]; - for (MGLOfflinePack *pack in validPacks) { + for (MLNOfflinePack *pack in validPacks) { [storage removePack:pack withCompletionHandler:^(NSError * _Nullable error) { [expectation fulfill]; }]; @@ -442,7 +442,7 @@ [self addPacks:4]; - NSInteger countOfPacks = [MGLOfflineStorage sharedOfflineStorage].packs.count; + NSInteger countOfPacks = [MLNOfflineStorage sharedOfflineStorage].packs.count; XCTAssert(countOfPacks > 0); // Now delete packs one by one @@ -451,7 +451,7 @@ XCTestExpectation *expectation = [self expectationWithDescription:@"all packs removed"]; expectation.expectedFulfillmentCount = countOfPacks; - MGLOfflineStorage *storage = [MGLOfflineStorage sharedOfflineStorage]; + MLNOfflineStorage *storage = [MLNOfflineStorage sharedOfflineStorage]; // Simulate what happens the first time sharedOfflineStorage is accessed [storage reloadPacks]; @@ -461,18 +461,18 @@ dispatch_async(queue, ^{ NSArray *packs = storage.packs; NSAssertionHandler *oldHandler = [NSAssertionHandler currentHandler]; - MGLTestAssertionHandler *newHandler = [[MGLTestAssertionHandler alloc] initWithTestCase:self]; + MLNTestAssertionHandler *newHandler = [[MLNTestAssertionHandler alloc] initWithTestCase:self]; [[[NSThread currentThread] threadDictionary] setValue:newHandler forKey:NSAssertionHandlerKey]; NSArray *validPacks = [packs filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id _Nullable evaluatedObject, NSDictionary * _Nullable bindings) { - MGLOfflinePack *pack = (MGLOfflinePack*)evaluatedObject; - return pack.state != MGLOfflinePackStateInvalid; + MLNOfflinePack *pack = (MLNOfflinePack*)evaluatedObject; + return pack.state != MLNOfflinePackStateInvalid; }]]; - for (MGLOfflinePack *pack in validPacks) { + for (MLNOfflinePack *pack in validPacks) { // NOTE: pack can be invalid, as we have two threads potentially - // modifying the same MGLOfflinePack. + // modifying the same MLNOfflinePack. dispatch_group_t group = dispatch_group_create(); dispatch_group_enter(group); @@ -495,11 +495,11 @@ } - (void)testCountOfBytesCompleted { - XCTAssertGreaterThan([MGLOfflineStorage sharedOfflineStorage].countOfBytesCompleted, 0UL); + XCTAssertGreaterThan([MLNOfflineStorage sharedOfflineStorage].countOfBytesCompleted, 0UL); } - (void)testResourceTransform { - MGLOfflineStorage *os = [MGLOfflineStorage sharedOfflineStorage]; + MLNOfflineStorage *os = [MLNOfflineStorage sharedOfflineStorage]; [os setDelegate:self]; auto fs = os.mbglOnlineFileSource; @@ -537,28 +537,28 @@ // Merging databases creates an empty file if the file does not exist at the given path. XCTAssertEqual(fileSize, databaseFileSize, @"The database file size must be:%lld actual size:%lld", databaseFileSize, fileSize); - NSUInteger countOfPacks = [MGLOfflineStorage sharedOfflineStorage].packs.count; + NSUInteger countOfPacks = [MLNOfflineStorage sharedOfflineStorage].packs.count; - [self keyValueObservingExpectationForObject:[MGLOfflineStorage sharedOfflineStorage] keyPath:@"packs" handler:^BOOL(id _Nonnull observedObject, NSDictionary * _Nonnull change) { + [self keyValueObservingExpectationForObject:[MLNOfflineStorage sharedOfflineStorage] keyPath:@"packs" handler:^BOOL(id _Nonnull observedObject, NSDictionary * _Nonnull change) { const auto changeKind = static_cast([change[NSKeyValueChangeKindKey] unsignedLongValue]); NSIndexSet *indices = change[NSKeyValueChangeIndexesKey]; return changeKind == NSKeyValueChangeInsertion && indices.count == 1; }]; XCTestExpectation *fileAdditionCompletionHandlerExpectation = [self expectationWithDescription:@"add database content completion handler"]; - MGLOfflineStorage *os = [MGLOfflineStorage sharedOfflineStorage]; - [os addContentsOfURL:resourceURL withCompletionHandler:^(NSURL *fileURL, NSArray * _Nullable packs, NSError * _Nullable error) { + MLNOfflineStorage *os = [MLNOfflineStorage sharedOfflineStorage]; + [os addContentsOfURL:resourceURL withCompletionHandler:^(NSURL *fileURL, NSArray * _Nullable packs, NSError * _Nullable error) { XCTAssertNotNil(fileURL, @"The fileURL should not be nil."); XCTAssertNotNil(packs, @"Adding the contents of the sideload_sat.db should update one pack."); XCTAssertNil(error, @"Adding contents to a file should not return an error."); - for (MGLOfflinePack *pack in [MGLOfflineStorage sharedOfflineStorage].packs) { + for (MLNOfflinePack *pack in [MLNOfflineStorage sharedOfflineStorage].packs) { NSLog(@"PACK:%@", pack); } [fileAdditionCompletionHandlerExpectation fulfill]; }]; [self waitForExpectationsWithTimeout:10 handler:nil]; // Depending on the database it may update or add a pack. For this case specifically the offline database adds one pack. - XCTAssertEqual([MGLOfflineStorage sharedOfflineStorage].packs.count, countOfPacks + 1, @"Adding contents of sideload_sat.db should add one pack."); + XCTAssertEqual([MLNOfflineStorage sharedOfflineStorage].packs.count, countOfPacks + 1, @"Adding contents of sideload_sat.db should add one pack."); }]; // Invalid database type @@ -566,8 +566,8 @@ NSURL *resourceURL = [NSURL fileURLWithPath:[[NSBundle bundleForClass:[self class]] pathForResource:@"one-liner" ofType:@"json"]]; XCTestExpectation *invalidFileCompletionHandlerExpectation = [self expectationWithDescription:@"invalid content database completion handler"]; - MGLOfflineStorage *os = [MGLOfflineStorage sharedOfflineStorage]; - [os addContentsOfFile:resourceURL.path withCompletionHandler:^(NSURL *fileURL, NSArray * _Nullable packs, NSError * _Nullable error) { + MLNOfflineStorage *os = [MLNOfflineStorage sharedOfflineStorage]; + [os addContentsOfFile:resourceURL.path withCompletionHandler:^(NSURL *fileURL, NSArray * _Nullable packs, NSError * _Nullable error) { XCTAssertNotNil(error, @"Passing an invalid offline database file should return an error."); XCTAssertNil(packs, @"Passing an invalid offline database file should not add packs to the offline database."); [invalidFileCompletionHandlerExpectation fulfill]; @@ -579,23 +579,23 @@ [XCTContext runActivityNamed:@"File does not exist" block:^(id activity) { NSURL *resourceURL = [NSURL URLWithString:@"nonexistent.db"]; - MGLOfflineStorage *os = [MGLOfflineStorage sharedOfflineStorage]; - XCTAssertThrowsSpecificNamed([os addContentsOfURL:resourceURL withCompletionHandler:nil], NSException, NSInvalidArgumentException, "MGLOfflineStorage should rise an exception if an invalid database file is passed."); + MLNOfflineStorage *os = [MLNOfflineStorage sharedOfflineStorage]; + XCTAssertThrowsSpecificNamed([os addContentsOfURL:resourceURL withCompletionHandler:nil], NSException, NSInvalidArgumentException, "MLNOfflineStorage should rise an exception if an invalid database file is passed."); }]; // URL to a non-file [XCTContext runActivityNamed:@"URL to a non-file" block:^(id activity) { NSURL *resourceURL = [NSURL URLWithString:@"https://www.mapbox.com"]; - MGLOfflineStorage *os = [MGLOfflineStorage sharedOfflineStorage]; - XCTAssertThrowsSpecificNamed([os addContentsOfURL:resourceURL withCompletionHandler:nil], NSException, NSInvalidArgumentException, "MGLOfflineStorage should rise an exception if an invalid URL file is passed."); + MLNOfflineStorage *os = [MLNOfflineStorage sharedOfflineStorage]; + XCTAssertThrowsSpecificNamed([os addContentsOfURL:resourceURL withCompletionHandler:nil], NSException, NSInvalidArgumentException, "MLNOfflineStorage should rise an exception if an invalid URL file is passed."); }]; } - (void)testPutResourceForURL { NSURL *styleURL = [NSURL URLWithString:@"https://api.mapbox.com/some/thing"]; - MGLOfflineStorage *os = [MGLOfflineStorage sharedOfflineStorage]; + MLNOfflineStorage *os = [MLNOfflineStorage sharedOfflineStorage]; std::string testData("test data"); NSData *data = [NSData dataWithBytes:testData.c_str() length:testData.length()]; __block std::unique_ptr req; @@ -623,7 +623,7 @@ - (void)testPutResourceForURLWithTimestamps { NSURL *styleURL = [NSURL URLWithString:@"https://api.mapbox.com/some/thing1"]; - MGLOfflineStorage *os = [MGLOfflineStorage sharedOfflineStorage]; + MLNOfflineStorage *os = [MLNOfflineStorage sharedOfflineStorage]; std::string testData("test data"); NSData *data = [NSData dataWithBytes:testData.c_str() length:testData.length()]; __block NSDate *now = [NSDate date]; @@ -639,9 +639,9 @@ XCTAssertFalse(res.error.get(), @"Request should not return an error"); XCTAssertTrue(res.data.get(), @"Request should return data"); XCTAssertTrue(res.modified, @"Request should have a modification timestamp"); - XCTAssertEqual(MGLTimeIntervalFromDuration(res.modified->time_since_epoch()), floor(tNow), @"Modification timestamp should roundtrip"); + XCTAssertEqual(MLNTimeIntervalFromDuration(res.modified->time_since_epoch()), floor(tNow), @"Modification timestamp should roundtrip"); XCTAssertTrue(res.expires, @"Request should have an expiration timestamp"); - XCTAssertEqual(MGLTimeIntervalFromDuration(res.expires->time_since_epoch()), floor(tFuture), @"Expiration timestamp should roundtrip"); + XCTAssertEqual(MLNTimeIntervalFromDuration(res.expires->time_since_epoch()), floor(tFuture), @"Expiration timestamp should roundtrip"); XCTAssertTrue(res.etag, @"Request should have an entity tag"); XCTAssertEqual(*res.etag, "some etag", @"Entity tag should roundtrip"); XCTAssertTrue(res.mustRevalidate, @"Request should require revalidation"); @@ -655,9 +655,9 @@ - (void)testSetMaximumAmbientCache { XCTestExpectation *expectation = [self expectationWithDescription:@"Expect maximum cache size to be raised without an error."]; - [[MGLOfflineStorage sharedOfflineStorage] setMaximumAmbientCacheSize:0 withCompletionHandler:^(NSError * _Nullable error) { + [[MLNOfflineStorage sharedOfflineStorage] setMaximumAmbientCacheSize:0 withCompletionHandler:^(NSError * _Nullable error) { XCTAssertNil(error); - [[MGLOfflineStorage sharedOfflineStorage] setMaximumAmbientCacheSize:50*1024*1024 withCompletionHandler:^(NSError * _Nullable error) { + [[MLNOfflineStorage sharedOfflineStorage] setMaximumAmbientCacheSize:50*1024*1024 withCompletionHandler:^(NSError * _Nullable error) { XCTAssertNil(error); [expectation fulfill]; }]; @@ -668,7 +668,7 @@ - (void)testInvalidateAmbientCache { XCTestExpectation *expectation = [self expectationWithDescription:@"Expect cache to be invalidated without an error."]; - [[MGLOfflineStorage sharedOfflineStorage] invalidateAmbientCacheWithCompletionHandler:^(NSError * _Nullable error) { + [[MLNOfflineStorage sharedOfflineStorage] invalidateAmbientCacheWithCompletionHandler:^(NSError * _Nullable error) { XCTAssertNil(error); [expectation fulfill]; }]; @@ -677,7 +677,7 @@ - (void)testClearCache { XCTestExpectation *expectation = [self expectationWithDescription:@"Expect cache to be cleared without an error."]; - [[MGLOfflineStorage sharedOfflineStorage] clearAmbientCacheWithCompletionHandler:^(NSError * _Nullable error) { + [[MLNOfflineStorage sharedOfflineStorage] clearAmbientCacheWithCompletionHandler:^(NSError * _Nullable error) { XCTAssertNil(error); [expectation fulfill]; }]; @@ -686,7 +686,7 @@ - (void)testResetDatabase { XCTestExpectation *expectation = [self expectationWithDescription:@"Expect database to be reset without an error."]; - [[MGLOfflineStorage sharedOfflineStorage] resetDatabaseWithCompletionHandler:^(NSError * _Nullable error) { + [[MLNOfflineStorage sharedOfflineStorage] resetDatabaseWithCompletionHandler:^(NSError * _Nullable error) { XCTAssertNil(error); [expectation fulfill]; }]; diff --git a/platform/ios/platform/darwin/test/MGLPredicateTests.mm b/platform/ios/platform/darwin/test/MLNPredicateTests.mm similarity index 89% rename from platform/ios/platform/darwin/test/MGLPredicateTests.mm rename to platform/ios/platform/darwin/test/MLNPredicateTests.mm index 51fc8b24c..60edd8b97 100644 --- a/platform/ios/platform/darwin/test/MGLPredicateTests.mm +++ b/platform/ios/platform/darwin/test/MLNPredicateTests.mm @@ -1,10 +1,10 @@ #import #import -#import "NSPredicate+MGLPrivateAdditions.h" -#import "MGLValueEvaluator.h" +#import "NSPredicate+MLNPrivateAdditions.h" +#import "MLNValueEvaluator.h" -@implementation NSString (MGLAdditions) +@implementation NSString (MLNAdditions) - (NSString *)stringByRemovingPointerAddresses { return [self stringByReplacingOccurrencesOfString:@"\\b0x[0-9a-f]+\\b" @@ -15,17 +15,17 @@ @end -@interface MGLPredicateTests : XCTestCase +@interface MLNPredicateTests : XCTestCase @end -@implementation MGLPredicateTests +@implementation MLNPredicateTests - (void)testUnsupportedFilterPredicates { XCTAssertThrowsSpecificNamed([NSPredicate predicateWithFormat:@"a BEGINSWITH 'L'"].mgl_filter, NSException, NSInvalidArgumentException); XCTAssertThrowsSpecificNamed([NSPredicate predicateWithFormat:@"a ENDSWITH 'itude'"].mgl_filter, NSException, NSInvalidArgumentException); XCTAssertThrowsSpecificNamed([NSPredicate predicateWithFormat:@"a LIKE 'glob?trotter'"].mgl_filter, NSException, NSInvalidArgumentException); XCTAssertThrowsSpecificNamed([NSPredicate predicateWithFormat:@"a MATCHES 'i\\w{18}n'"].mgl_filter, NSException, NSInvalidArgumentException); - NSPredicate *selectorPredicate = [NSPredicate predicateWithFormat:@"(SELF isKindOfClass: %@)", [MGLPolyline class]]; + NSPredicate *selectorPredicate = [NSPredicate predicateWithFormat:@"(SELF isKindOfClass: %@)", [MLNPolyline class]]; XCTAssertThrowsSpecificNamed(selectorPredicate.mgl_filter, NSException, NSInvalidArgumentException); XCTAssertThrowsSpecificNamed([NSPredicate predicateWithBlock:^BOOL(id _Nullable evaluatedObject, NSDictionary * _Nullable bindings) { @@ -39,48 +39,48 @@ NSPredicate *predicate = [NSPredicate predicateWithFormat:@"x == YES"]; NSArray *jsonExpression = @[@"==", @[@"get", @"x"], @YES]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:jsonExpression], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:jsonExpression] mustRoundTrip:NO]; } { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSNumber') < 5"]; NSArray *jsonExpression = @[@"<", @[@"to-number", @[@"get", @"x"]], @5]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:jsonExpression], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:jsonExpression] mustRoundTrip:NO]; } { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSNumber') > 5"]; NSArray *jsonExpression = @[@">", @[@"to-number", @[@"get", @"x"]], @5]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:jsonExpression], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:jsonExpression] mustRoundTrip:NO]; } { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSNumber') <= 5"]; NSArray *jsonExpression = @[@"<=", @[@"to-number", @[@"get", @"x"]], @5]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:jsonExpression], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:jsonExpression] mustRoundTrip:NO]; } { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSNumber') >= 5"]; NSArray *jsonExpression = @[@">=", @[@"to-number", @[@"get", @"x"]], @5]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:jsonExpression], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:jsonExpression] mustRoundTrip:NO]; } { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSString') > 'value'"]; NSArray *jsonExpression = @[@">", @[@"to-string", @[@"get", @"x"]], @"value"]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:jsonExpression], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:jsonExpression] mustRoundTrip:NO]; } { @@ -157,48 +157,48 @@ NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(a, 'NSString') < 'b'"]; NSArray *jsonExpression = @[@"<", @[@"to-string", @[@"get", @"a"]], @"b"]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:jsonExpression], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:jsonExpression] mustRoundTrip:NO]; } { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(a, 'NSString') <= 'b'"]; NSArray *jsonExpression = @[@"<=", @[@"to-string", @[@"get", @"a"]], @"b"]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:jsonExpression], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:jsonExpression] mustRoundTrip:NO]; } { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(a, 'NSString') > 'b'"]; NSArray *jsonExpression = @[@">", @[@"to-string", @[@"get", @"a"]], @"b"]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:jsonExpression], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:jsonExpression] mustRoundTrip:NO]; } { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(a, 'NSString') >= 'b'"]; NSArray *jsonExpression = @[@">=", @[@"to-string", @[@"get", @"a"]], @"b"]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:jsonExpression], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:jsonExpression] mustRoundTrip:NO]; } { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(a, 'NSString') BETWEEN {'b', 'z'}"]; NSArray *jsonExpression =@[@"all", @[@"<=", @"b", @[@"to-string", @[@"get", @"a"]]], @[@"<=", @[@"to-string", @[@"get", @"a"]], @"z"]]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:jsonExpression], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:jsonExpression] mustRoundTrip:NO]; } { NSExpression *limits = [NSExpression expressionForAggregate:@[[NSExpression expressionForConstantValue:@10], [NSExpression expressionForConstantValue:@100]]]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSNumber') BETWEEN %@", limits]; NSArray *jsonExpression = @[@"all", @[@">=", @[@"to-number", @[@"get", @"x"]], @10], @[@"<=", @[@"to-number", @[@"get", @"x"]], @100]]; - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:jsonExpression], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:jsonExpression] mustRoundTrip:NO]; } { @@ -206,56 +206,56 @@ NSExpression *limits = [NSExpression expressionForAggregate:@[[NSExpression expressionForConstantValue:@10], [NSExpression expressionForConstantValue:@100]]]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSNumber') BETWEEN %@", limits]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:NO]; } { NSArray *expected = @[@"all", @[@"<=", @10, @[@"to-number", @[@"get", @"x"]]], @[@">=", @100, @[@"to-number", @[@"get", @"x"]]]]; NSExpression *limits = [NSExpression expressionForAggregate:@[[NSExpression expressionForConstantValue:@10], [NSExpression expressionForConstantValue:@100]]]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSNumber') BETWEEN %@", limits]; - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:NO]; } { NSArray *expected = @[@"all", @[@">=", @[@"to-number", @[@"get", @"x"]], @10], @[@">=", @100, @[@"to-number", @[@"get", @"x"]]]]; NSExpression *limits = [NSExpression expressionForAggregate:@[[NSExpression expressionForConstantValue:@10], [NSExpression expressionForConstantValue:@100]]]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSNumber') BETWEEN %@", limits]; - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:NO]; } { NSArray *expected = @[@"in", @[@"id"], @[@"literal", @[@6, @5, @4, @3]]]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"$featureIdentifier IN { 6, 5, 4, 3}"]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:YES]; } { NSArray *expected = @[@"in", @[@"to-number", @[@"id"]], @[@"literal", @[@3002970001, @3004140052, @3002950027, @3002970033]]]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST($featureIdentifier, 'NSNumber') IN { 3002970001, 3004140052, 3002950027, 3002970033 }"]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:YES]; } { NSArray *expected = @[@"!", @[@"in", @[@"get", @"x"], @[@"literal", @[@6, @5, @4, @3]]]]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"NOT x IN { 6, 5, 4, 3}"]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:YES]; } { NSArray *expected = @[@"in", @[@"get", @"a"], @[@"literal", @[@"b", @"c"]]]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"a IN { 'b', 'c' }"]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:YES]; } { @@ -263,8 +263,8 @@ NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%@ IN %@", [NSExpression expressionForVariable:@"geometryType"], @[@"LineString", @"Polygon"]]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); NSPredicate *predicateAfter = [NSPredicate predicateWithFormat:@"%@ IN {'LineString', 'Polygon'}", [NSExpression expressionForVariable:@"geometryType"]]; - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicateAfter); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicateAfter); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:YES]; } { @@ -272,8 +272,8 @@ NSPredicate *predicate = [NSPredicate predicateWithFormat:@"{ 6, 5, 4, 3 } CONTAINS x"]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); NSPredicate *predicateAfter = [NSPredicate predicateWithFormat:@"x IN { 6, 5, 4, 3 }"]; - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicateAfter); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicateAfter); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:YES]; } { @@ -281,8 +281,8 @@ NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%@ CONTAINS %@", @[@"LineString", @"Polygon"], [NSExpression expressionForVariable:@"geometryType"]]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); NSPredicate *predicateAfter = [NSPredicate predicateWithFormat:@"%@ IN {'LineString', 'Polygon'}", [NSExpression expressionForVariable:@"geometryType"]]; - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicateAfter); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicateAfter); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:YES]; } { @@ -290,16 +290,16 @@ NSPredicate *predicate = [NSPredicate predicateWithFormat:@"{ 6, 5, 4, 3} CONTAINS $featureIdentifier"]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); NSPredicate *predicateAfter = [NSPredicate predicateWithFormat:@"$featureIdentifier IN {6, 5, 4, 3}"]; - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicateAfter); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicateAfter); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:YES]; } { NSArray *expected = @[@"in", @"📍", @[@"get", @"name"]]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"'📍' IN name"]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:YES]; } { @@ -307,8 +307,8 @@ NSPredicate *predicate = [NSPredicate predicateWithFormat:@"name CONTAINS '📍'"]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); NSPredicate *predicateAfter = [NSPredicate predicateWithFormat:@"'📍' IN name"]; - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicateAfter); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicateAfter); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:YES]; } { @@ -318,7 +318,7 @@ XCTExpectFailure(@"Awaiting unit test refactoring for https://github.com/maplibre/maplibre-gl-native/issues/331"); #endif XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicate); + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicate); XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:predicate.mgl_filter], [NSPredicate predicateWithValue:NO]); } { @@ -326,7 +326,7 @@ NSPredicate *predicate = [NSPredicate predicateWithFormat:@"'Pinole' CONTAINS '📍'"]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); NSPredicate *predicateAfter = [NSPredicate predicateWithFormat:@"'📍' IN 'Pinole'"]; - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicateAfter); + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicateAfter); XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:predicate.mgl_filter], [NSPredicate predicateWithValue:NO]); } { @@ -334,8 +334,8 @@ NSPredicate *predicate = [NSPredicate predicateWithFormat:@"ANY {6, 5, 4, 3} = $featureIdentifier"]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); NSPredicate *predicateAfter = [NSPredicate predicateWithFormat:@"$featureIdentifier IN {6, 5, 4, 3}"]; - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicateAfter); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicateAfter); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:YES]; } { @@ -343,8 +343,8 @@ NSPredicate *predicate = [NSPredicate predicateWithFormat:@"NONE {6, 5, 4, 3} = $featureIdentifier"]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); NSPredicate *predicateAfter = [NSPredicate predicateWithFormat:@"NOT $featureIdentifier IN {6, 5, 4, 3}"]; - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicateAfter); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicateAfter); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:YES]; } { @@ -352,8 +352,8 @@ NSPredicate *predicate = [NSPredicate predicateWithFormat:@"ALL {6, 5, 4, 3} != $featureIdentifier"]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); NSPredicate *predicateAfter = [NSPredicate predicateWithFormat:@"NOT $featureIdentifier IN {6, 5, 4, 3}"]; - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicateAfter); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicateAfter); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:YES]; } { @@ -397,11 +397,11 @@ { .latitude = 1, .longitude = 1 }, { .latitude = 0, .longitude = 1 }, }; - MGLPolygon *shape = [MGLPolygon polygonWithCoordinates:coordinates count:sizeof(coordinates) / sizeof(coordinates[0])]; + MLNPolygon *shape = [MLNPolygon polygonWithCoordinates:coordinates count:sizeof(coordinates) / sizeof(coordinates[0])]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF IN %@", shape]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:YES]; } { @@ -430,13 +430,13 @@ { .latitude = 1, .longitude = 1 }, { .latitude = 0, .longitude = 1 }, }; - MGLPolygonFeature *feature = [MGLPolygonFeature polygonWithCoordinates:coordinates count:sizeof(coordinates) / sizeof(coordinates[0])]; + MLNPolygonFeature *feature = [MLNPolygonFeature polygonWithCoordinates:coordinates count:sizeof(coordinates) / sizeof(coordinates[0])]; feature.identifier = @"unit"; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%@ CONTAINS SELF", feature]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected); NSPredicate *predicateAfter = [NSPredicate predicateWithFormat:@"SELF IN %@", feature]; - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicateAfter); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:expected], predicateAfter); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:expected] mustRoundTrip:YES]; } } @@ -503,7 +503,7 @@ mustRoundTrip:NO]; } { - NSPredicate *predicate = [NSPredicate predicateWithFormat:@"TRUE = MGL_FUNCTION('==', a, 'b', MGL_FUNCTION('collator', %@))", @{ + NSPredicate *predicate = [NSPredicate predicateWithFormat:@"TRUE = MLN_FUNCTION('==', a, 'b', MLN_FUNCTION('collator', %@))", @{ @"case-sensitive": @NO, @"diacritic-sensitive": @NO, @"locale": @"tlh", @@ -536,32 +536,32 @@ NSPredicate *predicate = [NSPredicate predicateWithFormat:@"a == 'b' AND c == 'd'"]; NSArray *jsonExpression = @[@"all", @[@"==", @[@"get", @"a"], @"b"], @[@"==", @[@"get", @"c"], @"d"]]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:jsonExpression], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:jsonExpression] mustRoundTrip:NO]; } { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"a == 'b' OR c == 'd'"]; NSArray *jsonExpression = @[@"any", @[@"==", @[@"get", @"a"], @"b"], @[@"==", @[@"get", @"c"], @"d"]]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:jsonExpression], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:jsonExpression] mustRoundTrip:NO]; } { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"NOT(a == 'b' AND c == 'd')"]; NSArray *jsonExpression = @[@"!", @[@"all", @[@"==", @[@"get", @"a"], @"b"], @[@"==", @[@"get", @"c"], @"d"]]]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:jsonExpression], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:jsonExpression] mustRoundTrip:NO]; } { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"NOT(a == 'b' OR c == 'd')"]; NSArray *jsonExpression = @[@"!", @[@"any", @[@"==", @[@"get", @"a"], @"b"], @[@"==", @[@"get", @"c"], @"d"]]]; XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression); - XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate); - [self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression] + XCTAssertEqualObjects([NSPredicate predicateWithMLNJSONObject:jsonExpression], predicate); + [self testSymmetryWithPredicate:[NSPredicate predicateWithMLNJSONObject:jsonExpression] mustRoundTrip:NO]; } { diff --git a/platform/ios/platform/darwin/test/MGLRendererConfigurationTests.m b/platform/ios/platform/darwin/test/MLNRendererConfigurationTests.m similarity index 72% rename from platform/ios/platform/darwin/test/MGLRendererConfigurationTests.m rename to platform/ios/platform/darwin/test/MLNRendererConfigurationTests.m index 6cc16c56a..ed84b0a10 100644 --- a/platform/ios/platform/darwin/test/MGLRendererConfigurationTests.m +++ b/platform/ios/platform/darwin/test/MLNRendererConfigurationTests.m @@ -1,25 +1,25 @@ #import #import -#import "MGLRendererConfiguration.h" +#import "MLNRendererConfiguration.h" -static NSString * const MGLRendererConfigurationTests_collisionBehaviorKey = @"MGLCollisionBehaviorPre4_0"; +static NSString * const MLNRendererConfigurationTests_collisionBehaviorKey = @"MLNCollisionBehaviorPre4_0"; -@interface MGLRendererConfigurationTests : XCTestCase +@interface MLNRendererConfigurationTests : XCTestCase @end -@implementation MGLRendererConfigurationTests +@implementation MLNRendererConfigurationTests - (void)setUp { - [[NSUserDefaults standardUserDefaults] removeObjectForKey:MGLRendererConfigurationTests_collisionBehaviorKey]; + [[NSUserDefaults standardUserDefaults] removeObjectForKey:MLNRendererConfigurationTests_collisionBehaviorKey]; } - (void)tearDown { - [[NSUserDefaults standardUserDefaults] removeObjectForKey:MGLRendererConfigurationTests_collisionBehaviorKey]; + [[NSUserDefaults standardUserDefaults] removeObjectForKey:MLNRendererConfigurationTests_collisionBehaviorKey]; } // Emulate what would happen with an Info.plist. -- (void)testSettingMGLCollisionBehaviorPre40 +- (void)testSettingMLNCollisionBehaviorPre40 { - MGLRendererConfiguration *config = [[MGLRendererConfiguration alloc] init]; + MLNRendererConfiguration *config = [[MLNRendererConfiguration alloc] init]; XCTAssertFalse([config perSourceCollisionsWithInfoDictionaryObject:nil]); XCTAssertFalse([config perSourceCollisionsWithInfoDictionaryObject:@(NO)]); XCTAssertTrue([config perSourceCollisionsWithInfoDictionaryObject:@(YES)]); @@ -27,51 +27,51 @@ static NSString * const MGLRendererConfigurationTests_collisionBehaviorKey = @"M XCTAssertTrue([config perSourceCollisionsWithInfoDictionaryObject:@"YES"]); } -- (void)testSettingMGLCollisionBehaviorPre40InNSUserDefaults { +- (void)testSettingMLNCollisionBehaviorPre40InNSUserDefaults { { - XCTAssertNil([[NSUserDefaults standardUserDefaults] objectForKey:MGLRendererConfigurationTests_collisionBehaviorKey]); - MGLRendererConfiguration *config = [MGLRendererConfiguration currentConfiguration]; + XCTAssertNil([[NSUserDefaults standardUserDefaults] objectForKey:MLNRendererConfigurationTests_collisionBehaviorKey]); + MLNRendererConfiguration *config = [MLNRendererConfiguration currentConfiguration]; XCTAssertFalse(config.perSourceCollisions); XCTAssertFalse([config perSourceCollisionsWithInfoDictionaryObject:nil]); } - [[NSUserDefaults standardUserDefaults] setObject:@(NO) forKey:MGLRendererConfigurationTests_collisionBehaviorKey]; + [[NSUserDefaults standardUserDefaults] setObject:@(NO) forKey:MLNRendererConfigurationTests_collisionBehaviorKey]; { - XCTAssertNotNil([[NSUserDefaults standardUserDefaults] objectForKey:MGLRendererConfigurationTests_collisionBehaviorKey]); - MGLRendererConfiguration *config = [MGLRendererConfiguration currentConfiguration]; + XCTAssertNotNil([[NSUserDefaults standardUserDefaults] objectForKey:MLNRendererConfigurationTests_collisionBehaviorKey]); + MLNRendererConfiguration *config = [MLNRendererConfiguration currentConfiguration]; XCTAssertFalse(config.perSourceCollisions); XCTAssertFalse([config perSourceCollisionsWithInfoDictionaryObject:@(NO)]); XCTAssertFalse([config perSourceCollisionsWithInfoDictionaryObject:@(YES)]); } - [[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:MGLRendererConfigurationTests_collisionBehaviorKey]; + [[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:MLNRendererConfigurationTests_collisionBehaviorKey]; { - XCTAssertNotNil([[NSUserDefaults standardUserDefaults] objectForKey:MGLRendererConfigurationTests_collisionBehaviorKey]); - MGLRendererConfiguration *config = [MGLRendererConfiguration currentConfiguration]; + XCTAssertNotNil([[NSUserDefaults standardUserDefaults] objectForKey:MLNRendererConfigurationTests_collisionBehaviorKey]); + MLNRendererConfiguration *config = [MLNRendererConfiguration currentConfiguration]; XCTAssert(config.perSourceCollisions); XCTAssertTrue([config perSourceCollisionsWithInfoDictionaryObject:@(NO)]); XCTAssertTrue([config perSourceCollisionsWithInfoDictionaryObject:@(YES)]); } } -- (void)testOverridingMGLCollisionBehaviorPre40 { +- (void)testOverridingMLNCollisionBehaviorPre40 { // Dictionary = NO, NSUserDefaults = YES { - [[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:MGLRendererConfigurationTests_collisionBehaviorKey]; - MGLRendererConfiguration *config = [[MGLRendererConfiguration alloc] init]; + [[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:MLNRendererConfigurationTests_collisionBehaviorKey]; + MLNRendererConfiguration *config = [[MLNRendererConfiguration alloc] init]; XCTAssert([config perSourceCollisionsWithInfoDictionaryObject:@(NO)]); } // Dictionary = YES, NSUserDefaults = NO { - [[NSUserDefaults standardUserDefaults] setObject:@(NO) forKey:MGLRendererConfigurationTests_collisionBehaviorKey]; - MGLRendererConfiguration *config = [[MGLRendererConfiguration alloc] init]; + [[NSUserDefaults standardUserDefaults] setObject:@(NO) forKey:MLNRendererConfigurationTests_collisionBehaviorKey]; + MLNRendererConfiguration *config = [[MLNRendererConfiguration alloc] init]; XCTAssertFalse([config perSourceCollisionsWithInfoDictionaryObject:@(YES)]); } } - (void)testDefaultLocalFontFamilyName { - MGLRendererConfiguration *config = [[MGLRendererConfiguration alloc] init]; + MLNRendererConfiguration *config = [[MLNRendererConfiguration alloc] init]; NSString *localFontFamilyName = config.localFontFamilyName; NSString *systemFontFamilyName; @@ -84,11 +84,11 @@ static NSString * const MGLRendererConfigurationTests_collisionBehaviorKey = @"M XCTAssertEqualObjects(localFontFamilyName, systemFontFamilyName, @"Default local font family name should match default system font"); } -- (void)testSettingMGLIdeographicFontFamilyNameWithPlistValue { +- (void)testSettingMLNIdeographicFontFamilyNameWithPlistValue { - MGLRendererConfiguration *config = [[MGLRendererConfiguration alloc] init]; + MLNRendererConfiguration *config = [[MLNRendererConfiguration alloc] init]; - // `MGLIdeographicFontFamilyName` set to bool value `YES` + // `MLNIdeographicFontFamilyName` set to bool value `YES` { NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@(YES)]; @@ -101,19 +101,19 @@ static NSString * const MGLRendererConfigurationTests_collisionBehaviorKey = @"M XCTAssertEqualObjects(localFontFamilyName, systemFontFamilyName, @"Local font family name should match default system font name when setting `YES`"); } - // `MGLIdeographicFontFamilyName` set to bool value `NO` + // `MLNIdeographicFontFamilyName` set to bool value `NO` { NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@(NO)]; XCTAssertNil(localFontFamilyName, @"Client rendering font should use remote font when setting `NO`"); } - // `MGLIdeographicFontFamilyName` set to a valid font string value + // `MLNIdeographicFontFamilyName` set to a valid font string value { NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@"PingFang TC"]; XCTAssertEqualObjects(localFontFamilyName, @"PingFang TC", @"Local font family name should match a custom valid font name"); } - // `MGLIdeographicFontFamilyName` set to an invalid font string value + // `MLNIdeographicFontFamilyName` set to an invalid font string value { NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@"test font"]; @@ -123,16 +123,16 @@ static NSString * const MGLRendererConfigurationTests_collisionBehaviorKey = @"M #else systemFontFamilyName = [NSFont systemFontOfSize:0 weight:NSFontWeightRegular].familyName; #endif - XCTAssertNotEqualObjects(localFontFamilyName, systemFontFamilyName, @"Local font family name should not be validated by MGLRenderConfiguration"); + XCTAssertNotEqualObjects(localFontFamilyName, systemFontFamilyName, @"Local font family name should not be validated by MLNRenderConfiguration"); } - // `MGLIdeographicFontFamilyName` set to a valid font family names array value + // `MLNIdeographicFontFamilyName` set to a valid font family names array value { NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@[@"test font 1", @"PingFang TC", @"test font 2"]]; XCTAssertEqualObjects(localFontFamilyName, @"test font 1\nPingFang TC\ntest font 2"); } - // `MGLIdeographicFontFamilyName` set to an invalid font family names array value + // `MLNIdeographicFontFamilyName` set to an invalid font family names array value { NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@[@"test font 1", @"test font 2", @"test font 3"]]; @@ -142,10 +142,10 @@ static NSString * const MGLRendererConfigurationTests_collisionBehaviorKey = @"M #else systemFontFamilyName = [NSFont systemFontOfSize:0 weight:NSFontWeightRegular].familyName; #endif - XCTAssertEqualObjects(localFontFamilyName, @"test font 1\ntest font 2\ntest font 3", @"Local font family name should not be validated by MGLRendererConfiguration"); + XCTAssertEqualObjects(localFontFamilyName, @"test font 1\ntest font 2\ntest font 3", @"Local font family name should not be validated by MLNRendererConfiguration"); } - // `MGLIdeographicFontFamilyName` set to an invalid value type: NSDictionary, NSNumber, NSData, etc. + // `MLNIdeographicFontFamilyName` set to an invalid value type: NSDictionary, NSNumber, NSData, etc. { NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:[@"test font 1" dataUsingEncoding:NSUTF8StringEncoding]]; diff --git a/platform/ios/platform/darwin/test/MGLResourceTests.mm b/platform/ios/platform/darwin/test/MLNResourceTests.mm similarity index 97% rename from platform/ios/platform/darwin/test/MGLResourceTests.mm rename to platform/ios/platform/darwin/test/MLNResourceTests.mm index 989eef8fe..c977325e3 100644 --- a/platform/ios/platform/darwin/test/MGLResourceTests.mm +++ b/platform/ios/platform/darwin/test/MLNResourceTests.mm @@ -7,10 +7,10 @@ namespace mbgl { extern BOOL isValidMapboxEndpoint(NSURL *url); } -@interface MGLResourceTests : XCTestCase +@interface MLNResourceTests : XCTestCase @end -@implementation MGLResourceTests +@implementation MLNResourceTests - (void)testValidEndpoints { using namespace mbgl; diff --git a/platform/ios/platform/darwin/test/MGLSDKTestHelpers.swift b/platform/ios/platform/darwin/test/MLNSDKTestHelpers.swift similarity index 96% rename from platform/ios/platform/darwin/test/MGLSDKTestHelpers.swift rename to platform/ios/platform/darwin/test/MLNSDKTestHelpers.swift index c836f7c2f..bf54dd827 100644 --- a/platform/ios/platform/darwin/test/MGLSDKTestHelpers.swift +++ b/platform/ios/platform/darwin/test/MLNSDKTestHelpers.swift @@ -1,6 +1,6 @@ import XCTest -class MGLSDKTestHelpers { +class MLNSDKTestHelpers { class func checkTestsContainAllMethods(testClass: Swift.AnyClass, in p: Protocol) { let testMethods = self.classMethodDescriptions(testClass) @@ -17,7 +17,7 @@ class MGLSDKTestHelpers { } -extension MGLSDKTestHelpers { +extension MLNSDKTestHelpers { class func protocolMethodDescriptions(_ p: Protocol) -> Set { var methods = Set() diff --git a/platform/ios/platform/darwin/test/MGLShapeSourceTests.mm b/platform/ios/platform/darwin/test/MLNShapeSourceTests.mm similarity index 66% rename from platform/ios/platform/darwin/test/MGLShapeSourceTests.mm rename to platform/ios/platform/darwin/test/MLNShapeSourceTests.mm index 904660701..b3226e740 100644 --- a/platform/ios/platform/darwin/test/MGLShapeSourceTests.mm +++ b/platform/ios/platform/darwin/test/MLNShapeSourceTests.mm @@ -1,31 +1,31 @@ #import #import -#import "MGLFeature_Private.h" -#import "MGLShapeSource_Private.h" -#import "MGLSource_Private.h" +#import "MLNFeature_Private.h" +#import "MLNShapeSource_Private.h" +#import "MLNSource_Private.h" #include -@interface MGLShapeSourceTests : XCTestCase +@interface MLNShapeSourceTests : XCTestCase @end -@implementation MGLShapeSourceTests +@implementation MLNShapeSourceTests - (void)testGeoJSONOptionsFromDictionary { NSExpression *reduceExpression = [NSExpression expressionForFunction:@"sum:" arguments:@[[NSExpression expressionForKeyPath:@"featureAccumulated"], [NSExpression expressionForKeyPath:@"sumValue"]]]; NSExpression *mapExpression = [NSExpression expressionForKeyPath:@"mag"]; NSArray *clusterPropertyArray = @[reduceExpression, mapExpression]; - NSDictionary *options = @{MGLShapeSourceOptionClustered: @YES, - MGLShapeSourceOptionClusterRadius: @42, - MGLShapeSourceOptionClusterProperties: @{@"sumValue": clusterPropertyArray}, - MGLShapeSourceOptionMaximumZoomLevelForClustering: @98, - MGLShapeSourceOptionMaximumZoomLevel: @99, - MGLShapeSourceOptionBuffer: @1976, - MGLShapeSourceOptionSimplificationTolerance: @0.42, - MGLShapeSourceOptionLineDistanceMetrics: @YES}; + NSDictionary *options = @{MLNShapeSourceOptionClustered: @YES, + MLNShapeSourceOptionClusterRadius: @42, + MLNShapeSourceOptionClusterProperties: @{@"sumValue": clusterPropertyArray}, + MLNShapeSourceOptionMaximumZoomLevelForClustering: @98, + MLNShapeSourceOptionMaximumZoomLevel: @99, + MLNShapeSourceOptionBuffer: @1976, + MLNShapeSourceOptionSimplificationTolerance: @0.42, + MLNShapeSourceOptionLineDistanceMetrics: @YES}; - auto mbglOptions = MGLGeoJSONOptionsFromDictionary(options); + auto mbglOptions = MLNGeoJSONOptionsFromDictionary(options); XCTAssertTrue(mbglOptions->cluster); XCTAssertEqual(mbglOptions->clusterRadius, 42); XCTAssertEqual(mbglOptions->clusterMaxZoom, 98); @@ -35,81 +35,81 @@ XCTAssertTrue(mbglOptions->lineMetrics); XCTAssertTrue(!mbglOptions->clusterProperties.empty()); - options = @{MGLShapeSourceOptionClustered: @"number 1"}; - XCTAssertThrows(MGLGeoJSONOptionsFromDictionary(options)); + options = @{MLNShapeSourceOptionClustered: @"number 1"}; + XCTAssertThrows(MLNGeoJSONOptionsFromDictionary(options)); } - (void)testNilShape { - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"id" shape:nil options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"id" shape:nil options:nil]; XCTAssertNil(source.shape); } - (void)testUnclusterableShape { NSDictionary *options = @{ - MGLShapeSourceOptionClustered: @YES, + MLNShapeSourceOptionClustered: @YES, }; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"id" shape:[[MGLPointFeature alloc] init] options:options]; - XCTAssertTrue([source.shape isKindOfClass:[MGLPointFeature class]]); + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"id" shape:[[MLNPointFeature alloc] init] options:options]; + XCTAssertTrue([source.shape isKindOfClass:[MLNPointFeature class]]); - MGLShapeCollectionFeature *feature = [MGLShapeCollectionFeature shapeCollectionWithShapes:@[]]; - source = [[MGLShapeSource alloc] initWithIdentifier:@"id" shape:feature options:options]; - XCTAssertTrue([source.shape isKindOfClass:[MGLShapeCollectionFeature class]]); + MLNShapeCollectionFeature *feature = [MLNShapeCollectionFeature shapeCollectionWithShapes:@[]]; + source = [[MLNShapeSource alloc] initWithIdentifier:@"id" shape:feature options:options]; + XCTAssertTrue([source.shape isKindOfClass:[MLNShapeCollectionFeature class]]); } -- (void)testMGLShapeSourceWithDataMultipleFeatures { +- (void)testMLNShapeSourceWithDataMultipleFeatures { NSString *geoJSON = @"{\"type\": \"FeatureCollection\",\"features\": [{\"type\": \"Feature\",\"properties\": {},\"geometry\": {\"type\": \"LineString\",\"coordinates\": [[-107.75390625,40.329795743702064],[-104.34814453125,37.64903402157866]]}}]}"; NSData *data = [geoJSON dataUsingEncoding:NSUTF8StringEncoding]; NSError *error; - MGLShape *shape = [MGLShape shapeWithData:data encoding:NSUTF8StringEncoding error:&error]; + MLNShape *shape = [MLNShape shapeWithData:data encoding:NSUTF8StringEncoding error:&error]; XCTAssertNil(error); XCTAssertNotNil(shape); - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"source-id" shape:shape options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"source-id" shape:shape options:nil]; - MGLShapeCollection *collection = (MGLShapeCollection *)source.shape; + MLNShapeCollection *collection = (MLNShapeCollection *)source.shape; XCTAssertNotNil(collection); XCTAssertEqual(collection.shapes.count, 1UL); - XCTAssertTrue([collection.shapes.firstObject isMemberOfClass:[MGLPolylineFeature class]]); + XCTAssertTrue([collection.shapes.firstObject isMemberOfClass:[MLNPolylineFeature class]]); } -- (void)testMGLShapeSourceWithSingleGeometry { +- (void)testMLNShapeSourceWithSingleGeometry { NSData *data = [@"{\"type\": \"Point\", \"coordinates\": [0, 0]}" dataUsingEncoding:NSUTF8StringEncoding]; NSError *error; - MGLShape *shape = [MGLShape shapeWithData:data encoding:NSUTF8StringEncoding error:&error]; + MLNShape *shape = [MLNShape shapeWithData:data encoding:NSUTF8StringEncoding error:&error]; XCTAssertNil(error); XCTAssertNotNil(shape); - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"geojson" shape:shape options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"geojson" shape:shape options:nil]; XCTAssertNotNil(source.shape); - XCTAssert([source.shape isKindOfClass:[MGLPointAnnotation class]]); + XCTAssert([source.shape isKindOfClass:[MLNPointAnnotation class]]); } -- (void)testMGLGeoJSONSourceWithSingleFeature { +- (void)testMLNGeoJSONSourceWithSingleFeature { NSString *geoJSON = @"{\"type\": \"Feature\", \"properties\": {\"color\": \"green\"}, \"geometry\": { \"type\": \"Point\", \"coordinates\": [ -114.06847000122069, 51.050459433092655 ] }}"; NSData *data = [geoJSON dataUsingEncoding:NSUTF8StringEncoding]; NSError *error; - MGLShape *shape = [MGLShape shapeWithData:data encoding:NSUTF8StringEncoding error:&error]; + MLNShape *shape = [MLNShape shapeWithData:data encoding:NSUTF8StringEncoding error:&error]; XCTAssertNil(error); XCTAssertNotNil(shape); - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"geojson" shape:shape options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"geojson" shape:shape options:nil]; XCTAssertNotNil(source.shape); - XCTAssert([source.shape isKindOfClass:[MGLPointFeature class]]); - MGLPointFeature *feature = (MGLPointFeature *)source.shape; + XCTAssert([source.shape isKindOfClass:[MLNPointFeature class]]); + MLNPointFeature *feature = (MLNPointFeature *)source.shape; XCTAssert([feature.attributes.allKeys containsObject:@"color"]); } -- (void)testMGLShapeSourceWithPolylineFeatures { +- (void)testMLNShapeSourceWithPolylineFeatures { CLLocationCoordinate2D coordinates[] = { CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(10, 10)}; - MGLPolylineFeature *polylineFeature = [MGLPolylineFeature polylineWithCoordinates:coordinates count:2]; + MLNPolylineFeature *polylineFeature = [MLNPolylineFeature polylineWithCoordinates:coordinates count:2]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"source-id" shape:polylineFeature options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"source-id" shape:polylineFeature options:nil]; XCTAssertNotNil(source.shape); - XCTAssertTrue([source.shape isMemberOfClass:[MGLPolylineFeature class]]); + XCTAssertTrue([source.shape isMemberOfClass:[MLNPolylineFeature class]]); } -- (void)testMGLShapeSourceWithPolygonFeatures { +- (void)testMLNShapeSourceWithPolygonFeatures { CLLocationCoordinate2D coordinates[] = { CLLocationCoordinate2DMake(0.0, 100.0), CLLocationCoordinate2DMake(0.0, 101.0), @@ -117,7 +117,7 @@ CLLocationCoordinate2DMake(1.0, 100.0), CLLocationCoordinate2DMake(0.0, 100.0)}; - MGLPolygonFeature *polygonFeature = [MGLPolygonFeature polygonWithCoordinates:coordinates count:5]; + MLNPolygonFeature *polygonFeature = [MLNPolygonFeature polygonWithCoordinates:coordinates count:5]; polygonFeature.identifier = @"feature-id"; NSString *stringAttribute = @"string"; NSNumber *boolAttribute = [NSNumber numberWithBool:YES]; @@ -139,12 +139,12 @@ @"array-of-array-attribute": arrayOfArrays, @"array-of-dictionary-attribute": arrayOfDictionaries}; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"source-id" shape:polygonFeature options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"source-id" shape:polygonFeature options:nil]; XCTAssertNotNil(source.shape); - MGLPolygonFeature *expectedPolygonFeature = (MGLPolygonFeature *)source.shape; + MLNPolygonFeature *expectedPolygonFeature = (MLNPolygonFeature *)source.shape; XCTAssertEqualObjects(expectedPolygonFeature.identifier, polygonFeature.identifier); - XCTAssertTrue([expectedPolygonFeature isMemberOfClass:[MGLPolygonFeature class]]); + XCTAssertTrue([expectedPolygonFeature isMemberOfClass:[MLNPolygonFeature class]]); XCTAssertEqualObjects(expectedPolygonFeature.identifier, polygonFeature.identifier); XCTAssertEqualObjects(expectedPolygonFeature.attributes[@"name"], stringAttribute); XCTAssertEqualObjects(expectedPolygonFeature.attributes[@"bool"], boolAttribute); @@ -155,7 +155,7 @@ XCTAssertEqualObjects(expectedPolygonFeature.attributes[@"array-of-dictionary-attribute"], arrayOfDictionaries); } -- (void)testMGLShapeSourceWithPolygonFeaturesInculdingInteriorPolygons { +- (void)testMLNShapeSourceWithPolygonFeaturesInculdingInteriorPolygons { CLLocationCoordinate2D coordinates[] = { CLLocationCoordinate2DMake(0.0, 100.0), CLLocationCoordinate2DMake(0.0, 101.0), @@ -170,30 +170,30 @@ CLLocationCoordinate2DMake(0.8, 100.2), CLLocationCoordinate2DMake(0.2, 100.2)}; - MGLPolygon *polygon = [MGLPolygon polygonWithCoordinates:interiorCoordinates count:5]; + MLNPolygon *polygon = [MLNPolygon polygonWithCoordinates:interiorCoordinates count:5]; - MGLPolygonFeature *polygonFeature = [MGLPolygonFeature polygonWithCoordinates:coordinates count:5 interiorPolygons:@[polygon]]; + MLNPolygonFeature *polygonFeature = [MLNPolygonFeature polygonWithCoordinates:coordinates count:5 interiorPolygons:@[polygon]]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"source-id" shape:polygonFeature options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"source-id" shape:polygonFeature options:nil]; XCTAssertNotNil(source.shape); - XCTAssertTrue([source.shape isMemberOfClass:[MGLPolygonFeature class]]); + XCTAssertTrue([source.shape isMemberOfClass:[MLNPolygonFeature class]]); } -- (void)testMGLShapeSourceWithMultiPolylineFeatures { +- (void)testMLNShapeSourceWithMultiPolylineFeatures { CLLocationCoordinate2D firstCoordinates[] = { CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(10, 10)}; - MGLPolylineFeature *firstPolylineFeature = [MGLPolylineFeature polylineWithCoordinates:firstCoordinates count:2]; + MLNPolylineFeature *firstPolylineFeature = [MLNPolylineFeature polylineWithCoordinates:firstCoordinates count:2]; CLLocationCoordinate2D secondCoordinates[] = { CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(10, 10)}; - MGLPolylineFeature *secondPolylineFeature = [MGLPolylineFeature polylineWithCoordinates:secondCoordinates count:2]; - MGLMultiPolylineFeature *multiPolylineFeature = [MGLMultiPolylineFeature multiPolylineWithPolylines:@[firstPolylineFeature, secondPolylineFeature]]; + MLNPolylineFeature *secondPolylineFeature = [MLNPolylineFeature polylineWithCoordinates:secondCoordinates count:2]; + MLNMultiPolylineFeature *multiPolylineFeature = [MLNMultiPolylineFeature multiPolylineWithPolylines:@[firstPolylineFeature, secondPolylineFeature]]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"source-id" shape:multiPolylineFeature options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"source-id" shape:multiPolylineFeature options:nil]; XCTAssertNotNil(source.shape); - XCTAssertTrue([source.shape isMemberOfClass:[MGLMultiPolylineFeature class]]); + XCTAssertTrue([source.shape isMemberOfClass:[MLNMultiPolylineFeature class]]); } -- (void)testMGLShapeSourceWithMultiPolygonFeatures { +- (void)testMLNShapeSourceWithMultiPolygonFeatures { CLLocationCoordinate2D coordinates[] = { CLLocationCoordinate2DMake(0.0, 100.0), CLLocationCoordinate2DMake(0.0, 101.0), @@ -208,44 +208,44 @@ CLLocationCoordinate2DMake(0.8, 100.2), CLLocationCoordinate2DMake(0.2, 100.2)}; - MGLPolygon *polygon = [MGLPolygon polygonWithCoordinates:interiorCoordinates count:5]; + MLNPolygon *polygon = [MLNPolygon polygonWithCoordinates:interiorCoordinates count:5]; - MGLPolygonFeature *firstPolygon = [MGLPolygonFeature polygonWithCoordinates:coordinates count:5 interiorPolygons:@[polygon]]; - MGLPolygonFeature *secondPolygon = [MGLPolygonFeature polygonWithCoordinates:coordinates count:5 interiorPolygons:@[polygon]]; + MLNPolygonFeature *firstPolygon = [MLNPolygonFeature polygonWithCoordinates:coordinates count:5 interiorPolygons:@[polygon]]; + MLNPolygonFeature *secondPolygon = [MLNPolygonFeature polygonWithCoordinates:coordinates count:5 interiorPolygons:@[polygon]]; - MGLMultiPolygonFeature *multiPolygonFeature = [MGLMultiPolygonFeature multiPolygonWithPolygons:@[firstPolygon, secondPolygon]]; + MLNMultiPolygonFeature *multiPolygonFeature = [MLNMultiPolygonFeature multiPolygonWithPolygons:@[firstPolygon, secondPolygon]]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"source-id" shape:multiPolygonFeature options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"source-id" shape:multiPolygonFeature options:nil]; XCTAssertNotNil(source.shape); - XCTAssertTrue([source.shape isMemberOfClass:[MGLMultiPolygonFeature class]]); + XCTAssertTrue([source.shape isMemberOfClass:[MLNMultiPolygonFeature class]]); } -- (void)testMGLShapeSourceWithPointFeature { - MGLPointFeature *pointFeature = [MGLPointFeature new]; +- (void)testMLNShapeSourceWithPointFeature { + MLNPointFeature *pointFeature = [MLNPointFeature new]; pointFeature.coordinate = CLLocationCoordinate2DMake(0.2, 100.2); - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"souce-id" shape:pointFeature options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"souce-id" shape:pointFeature options:nil]; XCTAssertNotNil(source.shape); - XCTAssertTrue([source.shape isMemberOfClass:[MGLPointFeature class]]); + XCTAssertTrue([source.shape isMemberOfClass:[MLNPointFeature class]]); } -- (void)testMGLShapeSourceWithPointCollectionFeature { +- (void)testMLNShapeSourceWithPointCollectionFeature { CLLocationCoordinate2D coordinates[] = { CLLocationCoordinate2DMake(0.0, 100.0), CLLocationCoordinate2DMake(0.0, 101.0), CLLocationCoordinate2DMake(1.0, 101.0), CLLocationCoordinate2DMake(1.0, 100.0), CLLocationCoordinate2DMake(0.0, 100.0)}; - MGLPointCollectionFeature *pointCollectionFeature = [MGLPointCollectionFeature pointCollectionWithCoordinates:coordinates count:5]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"souce-id" shape:pointCollectionFeature options:nil]; + MLNPointCollectionFeature *pointCollectionFeature = [MLNPointCollectionFeature pointCollectionWithCoordinates:coordinates count:5]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"souce-id" shape:pointCollectionFeature options:nil]; XCTAssertNotNil(source.shape); - XCTAssertTrue([source.shape isMemberOfClass:[MGLPointCollectionFeature class]]); + XCTAssertTrue([source.shape isMemberOfClass:[MLNPointCollectionFeature class]]); } -- (void)testMGLShapeSourceWithShapeCollectionFeatures { +- (void)testMLNShapeSourceWithShapeCollectionFeatures { CLLocationCoordinate2D coordinates[] = { CLLocationCoordinate2DMake(0.0, 100.0), CLLocationCoordinate2DMake(0.0, 101.0), @@ -260,32 +260,32 @@ CLLocationCoordinate2DMake(0.8, 100.2), CLLocationCoordinate2DMake(0.2, 100.2)}; - MGLPolygon *polygon = [MGLPolygon polygonWithCoordinates:interiorCoordinates count:5]; + MLNPolygon *polygon = [MLNPolygon polygonWithCoordinates:interiorCoordinates count:5]; - MGLPolygonFeature *polygonFeature = [MGLPolygonFeature polygonWithCoordinates:coordinates count:5 interiorPolygons:@[polygon]]; + MLNPolygonFeature *polygonFeature = [MLNPolygonFeature polygonWithCoordinates:coordinates count:5 interiorPolygons:@[polygon]]; CLLocationCoordinate2D coordinates_2[] = { CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(10, 10)}; - MGLPolylineFeature *polylineFeature = [MGLPolylineFeature polylineWithCoordinates:coordinates_2 count:2]; + MLNPolylineFeature *polylineFeature = [MLNPolylineFeature polylineWithCoordinates:coordinates_2 count:2]; - MGLMultiPolygonFeature *multiPolygonFeature = [MGLMultiPolygonFeature multiPolygonWithPolygons:@[polygonFeature, polygonFeature]]; + MLNMultiPolygonFeature *multiPolygonFeature = [MLNMultiPolygonFeature multiPolygonWithPolygons:@[polygonFeature, polygonFeature]]; - MGLMultiPolylineFeature *multiPolylineFeature = [MGLMultiPolylineFeature multiPolylineWithPolylines:@[polylineFeature, polylineFeature]]; + MLNMultiPolylineFeature *multiPolylineFeature = [MLNMultiPolylineFeature multiPolylineWithPolylines:@[polylineFeature, polylineFeature]]; - MGLPointCollectionFeature *pointCollectionFeature = [MGLPointCollectionFeature pointCollectionWithCoordinates:coordinates count:5]; + MLNPointCollectionFeature *pointCollectionFeature = [MLNPointCollectionFeature pointCollectionWithCoordinates:coordinates count:5]; - MGLPointFeature *pointFeature = [MGLPointFeature new]; + MLNPointFeature *pointFeature = [MLNPointFeature new]; pointFeature.coordinate = CLLocationCoordinate2DMake(0.2, 100.2); - MGLShapeCollectionFeature *shapeCollectionFeature = [MGLShapeCollectionFeature shapeCollectionWithShapes:@[polygonFeature, polylineFeature, multiPolygonFeature, multiPolylineFeature, pointCollectionFeature, pointFeature]]; + MLNShapeCollectionFeature *shapeCollectionFeature = [MLNShapeCollectionFeature shapeCollectionWithShapes:@[polygonFeature, polylineFeature, multiPolygonFeature, multiPolylineFeature, pointCollectionFeature, pointFeature]]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"source-id" shape:shapeCollectionFeature options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"source-id" shape:shapeCollectionFeature options:nil]; - MGLShapeCollectionFeature *shape = (MGLShapeCollectionFeature *)source.shape; + MLNShapeCollectionFeature *shape = (MLNShapeCollectionFeature *)source.shape; XCTAssertNotNil(shape); XCTAssert(shape.shapes.count == 6, @"Shape collection should contain 6 shapes"); } -- (void)testMGLShapeSourceWithFeaturesConvenienceInitializer { +- (void)testMLNShapeSourceWithFeaturesConvenienceInitializer { CLLocationCoordinate2D coordinates[] = { CLLocationCoordinate2DMake(0.0, 100.0), CLLocationCoordinate2DMake(0.0, 101.0), @@ -293,24 +293,24 @@ CLLocationCoordinate2DMake(1.0, 100.0), CLLocationCoordinate2DMake(0.0, 100.0)}; - MGLPolygonFeature *polygonFeature = [MGLPolygonFeature polygonWithCoordinates:coordinates count:sizeof(coordinates)/sizeof(coordinates[0]) interiorPolygons:nil]; + MLNPolygonFeature *polygonFeature = [MLNPolygonFeature polygonWithCoordinates:coordinates count:sizeof(coordinates)/sizeof(coordinates[0]) interiorPolygons:nil]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"source-id" features:@[polygonFeature] options:nil]; - MGLShapeCollectionFeature *shape = (MGLShapeCollectionFeature *)source.shape; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"source-id" features:@[polygonFeature] options:nil]; + MLNShapeCollectionFeature *shape = (MLNShapeCollectionFeature *)source.shape; - XCTAssertTrue([shape isKindOfClass:[MGLShapeCollectionFeature class]]); + XCTAssertTrue([shape isKindOfClass:[MLNShapeCollectionFeature class]]); XCTAssertEqual(shape.shapes.count, 1UL, @"Shape collection should contain 1 shape"); // when a shape is included in the features array - MGLPolygon *polygon = [MGLPolygon polygonWithCoordinates:coordinates count:sizeof(coordinates)/sizeof(coordinates[0]) interiorPolygons:nil]; + MLNPolygon *polygon = [MLNPolygon polygonWithCoordinates:coordinates count:sizeof(coordinates)/sizeof(coordinates[0]) interiorPolygons:nil]; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wobjc-literal-conversion" - XCTAssertThrowsSpecificNamed([[MGLShapeSource alloc] initWithIdentifier:@"source-id-invalid" features:@[polygon] options:nil], NSException, NSInvalidArgumentException, @"Shape source should raise an exception if a shape is sent to the features initializer"); + XCTAssertThrowsSpecificNamed([[MLNShapeSource alloc] initWithIdentifier:@"source-id-invalid" features:@[polygon] options:nil], NSException, NSInvalidArgumentException, @"Shape source should raise an exception if a shape is sent to the features initializer"); #pragma clang diagnostic pop } -- (void)testMGLShapeSourceWithShapesConvenienceInitializer { +- (void)testMLNShapeSourceWithShapesConvenienceInitializer { CLLocationCoordinate2D coordinates[] = { CLLocationCoordinate2DMake(0.0, 100.0), CLLocationCoordinate2DMake(0.0, 101.0), @@ -318,12 +318,12 @@ CLLocationCoordinate2DMake(1.0, 100.0), CLLocationCoordinate2DMake(0.0, 100.0)}; - MGLPolygon *polygon = [MGLPolygon polygonWithCoordinates:coordinates count:sizeof(coordinates)/sizeof(coordinates[0]) interiorPolygons:nil]; + MLNPolygon *polygon = [MLNPolygon polygonWithCoordinates:coordinates count:sizeof(coordinates)/sizeof(coordinates[0]) interiorPolygons:nil]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"source-id" shapes:@[polygon] options:nil]; - MGLShapeCollectionFeature *shape = (MGLShapeCollectionFeature *)source.shape; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"source-id" shapes:@[polygon] options:nil]; + MLNShapeCollectionFeature *shape = (MLNShapeCollectionFeature *)source.shape; - XCTAssertTrue([shape isKindOfClass:[MGLShapeCollection class]]); + XCTAssertTrue([shape isKindOfClass:[MLNShapeCollection class]]); XCTAssertEqual(shape.shapes.count, 1UL, @"Shape collection should contain 1 shape"); } diff --git a/platform/ios/platform/darwin/test/MGLSourceQueryTests.m b/platform/ios/platform/darwin/test/MLNSourceQueryTests.m similarity index 69% rename from platform/ios/platform/darwin/test/MGLSourceQueryTests.m rename to platform/ios/platform/darwin/test/MLNSourceQueryTests.m index b321da1ea..dac6f303b 100644 --- a/platform/ios/platform/darwin/test/MGLSourceQueryTests.m +++ b/platform/ios/platform/darwin/test/MLNSourceQueryTests.m @@ -1,14 +1,14 @@ #import #import -@interface MGLSourceQueryTests : XCTestCase +@interface MLNSourceQueryTests : XCTestCase @end -@implementation MGLSourceQueryTests +@implementation MLNSourceQueryTests - (void) testQueryVectorTileSource { - MGLVectorTileSource *source = [[MGLVectorTileSource alloc] initWithIdentifier:@"vector" tileURLTemplates:@[@"fake"] options:nil]; + MLNVectorTileSource *source = [[MLNVectorTileSource alloc] initWithIdentifier:@"vector" tileURLTemplates:@[@"fake"] options:nil]; NSSet *sourceLayers = [NSSet setWithObjects:@"buildings", @"water", nil]; NSArray* features = [source featuresInSourceLayersWithIdentifiers:sourceLayers predicate:nil]; // Source not added yet, so features is 0 @@ -16,7 +16,7 @@ } - (void) testQueryShapeSource { - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"shape" shape:[MGLShapeCollection shapeCollectionWithShapes:@[]] options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"shape" shape:[MLNShapeCollection shapeCollectionWithShapes:@[]] options:nil]; NSArray* features = [source featuresMatchingPredicate:nil]; // Source not added yet, so features is 0 XCTAssertEqual([features count], 0); diff --git a/platform/ios/platform/darwin/test/MGLStyleLayerTests.h b/platform/ios/platform/darwin/test/MLNStyleLayerTests.h similarity index 56% rename from platform/ios/platform/darwin/test/MGLStyleLayerTests.h rename to platform/ios/platform/darwin/test/MLNStyleLayerTests.h index c7577819b..536d67a47 100644 --- a/platform/ios/platform/darwin/test/MGLStyleLayerTests.h +++ b/platform/ios/platform/darwin/test/MLNStyleLayerTests.h @@ -1,10 +1,10 @@ #import #import -#define MGLConstantExpression(constant) \ +#define MLNConstantExpression(constant) \ [NSExpression expressionForConstantValue:constant] -@interface MGLStyleLayerTests : XCTestCase +@interface MLNStyleLayerTests : XCTestCase @property (nonatomic, copy, readonly, class) NSString *layerType; @@ -12,17 +12,17 @@ @end -@interface NSString (MGLStyleLayerTestAdditions) +@interface NSString (MLNStyleLayerTestAdditions) @property (nonatomic, readonly, copy) NSArray *lexicalClasses; @property (nonatomic, readonly, copy) NSString *lemma; @end -@interface NSValue (MGLStyleLayerTestAdditions) +@interface NSValue (MLNStyleLayerTestAdditions) -+ (instancetype)valueWithMGLVector:(CGVector)vector; ++ (instancetype)valueWithMLNVector:(CGVector)vector; -@property (readonly) CGVector MGLVectorValue; +@property (readonly) CGVector MLNVectorValue; @end diff --git a/platform/ios/platform/darwin/test/MGLStyleLayerTests.m b/platform/ios/platform/darwin/test/MLNStyleLayerTests.m similarity index 90% rename from platform/ios/platform/darwin/test/MGLStyleLayerTests.m rename to platform/ios/platform/darwin/test/MLNStyleLayerTests.m index 5dc97dc58..e343c56b7 100644 --- a/platform/ios/platform/darwin/test/MGLStyleLayerTests.m +++ b/platform/ios/platform/darwin/test/MLNStyleLayerTests.m @@ -1,18 +1,18 @@ -#import "MGLStyleLayerTests.h" +#import "MLNStyleLayerTests.h" -#import "NSString+MGLAdditions.h" +#import "NSString+MLNAdditions.h" #define TEST_STRICT_NAMING_CONVENTIONS 0 -@implementation MGLStyleLayerTests +@implementation MLNStyleLayerTests @dynamic layerType; - (void)testProperties { - MGLPointFeature *feature = [[MGLPointFeature alloc] init]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil]; + MLNPointFeature *feature = [[MLNPointFeature alloc] init]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil]; - MGLFillStyleLayer *layer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"layerID" source:source]; + MLNFillStyleLayer *layer = [[MLNFillStyleLayer alloc] initWithIdentifier:@"layerID" source:source]; XCTAssertEqualObjects(layer.identifier, @"layerID"); XCTAssertEqualObjects(layer.sourceIdentifier, source.identifier); @@ -72,7 +72,7 @@ @end -@implementation NSString (MGLStyleLayerTestAdditions) +@implementation NSString (MLNStyleLayerTestAdditions) - (NSArray *)lexicalClasses { NSOrthography *orthography = [NSOrthography orthographyWithDominantScript:@"Latn" @@ -102,9 +102,9 @@ @end -@implementation NSValue (MGLStyleLayerTestAdditions) +@implementation NSValue (MLNStyleLayerTestAdditions) -+ (instancetype)valueWithMGLVector:(CGVector)vector { ++ (instancetype)valueWithMLNVector:(CGVector)vector { #if TARGET_OS_IPHONE return [self valueWithCGVector:vector]; #else @@ -112,7 +112,7 @@ #endif } -- (CGVector)MGLVectorValue { +- (CGVector)MLNVectorValue { #if TARGET_OS_IPHONE return self.CGVectorValue; #else diff --git a/platform/ios/platform/darwin/test/MGLStyleLayerTests.mm.ejs b/platform/ios/platform/darwin/test/MLNStyleLayerTests.mm.ejs similarity index 88% rename from platform/ios/platform/darwin/test/MGLStyleLayerTests.mm.ejs rename to platform/ios/platform/darwin/test/MLNStyleLayerTests.mm.ejs index 67cbb96fe..cd57bd273 100644 --- a/platform/ios/platform/darwin/test/MGLStyleLayerTests.mm.ejs +++ b/platform/ios/platform/darwin/test/MLNStyleLayerTests.mm.ejs @@ -6,22 +6,22 @@ // This file is generated. // Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`. -#import "MGLStyleLayerTests.h" -#import "../../darwin/src/NSDate+MGLAdditions.h" +#import "MLNStyleLayerTests.h" +#import "../../darwin/src/NSDate+MLNAdditions.h" <% if (type === 'symbol') { -%> -#include "../../darwin/src/MGLAttributedExpression.h" +#include "../../darwin/src/MLNAttributedExpression.h" <% } -%> -#import "MGLStyleLayer_Private.h" +#import "MLNStyleLayer_Private.h" #include _layer.hpp> #include #include -@interface MGL<%- camelize(type) %>LayerTests : MGLStyleLayerTests +@interface MLN<%- camelize(type) %>LayerTests : MLNStyleLayerTests @end -@implementation MGL<%- camelize(type) %>LayerTests +@implementation MLN<%- camelize(type) %>LayerTests + (NSString *)layerType { return @"<%- type %>"; @@ -29,9 +29,9 @@ <% if (type !== 'background' && type !== 'raster' && type !== 'hillshade') { -%> - (void)testPredicates { - MGLPointFeature *feature = [[MGLPointFeature alloc] init]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil]; - MGL<%- camelize(type) %>StyleLayer *layer = [[MGL<%- camelize(type) %>StyleLayer alloc] initWithIdentifier:@"layerID" source:source]; + MLNPointFeature *feature = [[MLNPointFeature alloc] init]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil]; + MLN<%- camelize(type) %>StyleLayer *layer = [[MLN<%- camelize(type) %>StyleLayer alloc] initWithIdentifier:@"layerID" source:source]; XCTAssertNil(layer.sourceLayerIdentifier); layer.sourceLayerIdentifier = @"layerID"; @@ -49,18 +49,18 @@ <% } -%> - (void)testProperties { <% if (type === 'background') { -%> - MGL<%- camelize(type) %>StyleLayer *layer = [[MGL<%- camelize(type) %>StyleLayer alloc] initWithIdentifier:@"layerID"]; + MLN<%- camelize(type) %>StyleLayer *layer = [[MLN<%- camelize(type) %>StyleLayer alloc] initWithIdentifier:@"layerID"]; <% } else { -%> - MGLPointFeature *feature = [[MGLPointFeature alloc] init]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil]; + MLNPointFeature *feature = [[MLNPointFeature alloc] init]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil]; - MGL<%- camelize(type) %>StyleLayer *layer = [[MGL<%- camelize(type) %>StyleLayer alloc] initWithIdentifier:@"layerID" source:source]; + MLN<%- camelize(type) %>StyleLayer *layer = [[MLN<%- camelize(type) %>StyleLayer alloc] initWithIdentifier:@"layerID" source:source]; <% } -%> XCTAssertNotEqual(layer.rawLayer, nullptr); XCTAssertEqualObjects(@(layer.rawLayer->getTypeInfo()->type), @"<%- type %>"); auto rawLayer = static_castLayer*>(layer.rawLayer); - MGLTransition transitionTest = MGLTransitionMake(5, 4); + MLNTransition transitionTest = MLNTransitionMake(5, 4); <% for (const property of properties) { -%> <% if (property['property-type'] === 'color-ramp') continue; -%> @@ -88,7 +88,7 @@ <% if (property.type !== 'formatted') { -%> constantExpression = [NSExpression expressionWithFormat:<%- objCTestValue(property, type, false, 3) %>]; <% } else { -%> - MGLAttributedExpression *attributedConstantExpression = [[MGLAttributedExpression alloc] initWithExpression:[NSExpression expressionWithFormat:<%- objCTestValue(property, 'string', true, 3) %>] + MLNAttributedExpression *attributedConstantExpression = [[MLNAttributedExpression alloc] initWithExpression:[NSExpression expressionWithFormat:<%- objCTestValue(property, 'string', true, 3) %>] attributes:@{}]; constantExpression = [NSExpression mgl_expressionForAttributedExpressions:@[[NSExpression expressionForConstantValue:attributedConstantExpression]]]; <% } -%> @@ -158,19 +158,19 @@ <% if (!isDataDriven(property)) { -%> functionExpression = [NSExpression expressionForKeyPath:@"bogus"]; - XCTAssertThrowsSpecificNamed(layer.<%- objCName(property) %> = functionExpression, NSException, NSInvalidArgumentException, @"MGL<%- camelize(type) %>Layer should raise an exception if a camera-data expression is applied to a property that does not support key paths to feature attributes."); + XCTAssertThrowsSpecificNamed(layer.<%- objCName(property) %> = functionExpression, NSException, NSInvalidArgumentException, @"MLN<%- camelize(type) %>Layer should raise an exception if a camera-data expression is applied to a property that does not support key paths to feature attributes."); functionExpression = [NSExpression expressionWithFormat:@"mgl_step:from:stops:(bogus, %@, %@)", constantExpression, @{@18: constantExpression}]; functionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: functionExpression}]; - XCTAssertThrowsSpecificNamed(layer.<%- objCName(property) %> = functionExpression, NSException, NSInvalidArgumentException, @"MGL<%- camelize(type) %>Layer should raise an exception if a camera-data expression is applied to a property that does not support key paths to feature attributes."); + XCTAssertThrowsSpecificNamed(layer.<%- objCName(property) %> = functionExpression, NSException, NSInvalidArgumentException, @"MLN<%- camelize(type) %>Layer should raise an exception if a camera-data expression is applied to a property that does not support key paths to feature attributes."); <% } -%> <% if (property["transition"] && !property.original) { -%> // Transition property test layer.<%- camelizeWithLeadingLowercase(originalPropertyName(property)) %>Transition = transitionTest; auto toptions = rawLayer->get<%- camelize(originalPropertyName(property)) %>Transition(); - XCTAssert(toptions.delay && MGLTimeIntervalFromDuration(*toptions.delay) == transitionTest.delay); - XCTAssert(toptions.duration && MGLTimeIntervalFromDuration(*toptions.duration) == transitionTest.duration); + XCTAssert(toptions.delay && MLNTimeIntervalFromDuration(*toptions.delay) == transitionTest.delay); + XCTAssert(toptions.duration && MLNTimeIntervalFromDuration(*toptions.duration) == transitionTest.duration); - MGLTransition <%- camelizeWithLeadingLowercase(originalPropertyName(property)) %>Transition = layer.<%- camelizeWithLeadingLowercase(originalPropertyName(property)) %>Transition; + MLNTransition <%- camelizeWithLeadingLowercase(originalPropertyName(property)) %>Transition = layer.<%- camelizeWithLeadingLowercase(originalPropertyName(property)) %>Transition; XCTAssertEqual(<%- camelizeWithLeadingLowercase(originalPropertyName(property)) %>Transition.delay, transitionTest.delay); XCTAssertEqual(<%- camelizeWithLeadingLowercase(originalPropertyName(property)) %>Transition.duration, transitionTest.duration); <% } -%> @@ -196,11 +196,11 @@ @"Setting <%- objCName(property) %> to a constant string with tokens should convert to an expression."); <% if (property.type === 'formatted') { -%> - MGLAttributedExpression *tokenAttibutedExpression = [[MGLAttributedExpression alloc] initWithExpression:[NSExpression expressionWithFormat:@"CAST(token, 'NSString')"] + MLNAttributedExpression *tokenAttibutedExpression = [[MLNAttributedExpression alloc] initWithExpression:[NSExpression expressionWithFormat:@"CAST(token, 'NSString')"] attributes:@{}]; NSExpression* tokenExpression = [NSExpression mgl_expressionForAttributedExpressions:@[[NSExpression expressionForConstantValue:tokenAttibutedExpression]]]; <% } else if (property.type === 'resolvedImage') { -%> - NSExpression* tokenExpression = [NSExpression expressionWithFormat:@"MGL_FUNCTION('image', CAST(token, \"NSString\"))"]; + NSExpression* tokenExpression = [NSExpression expressionWithFormat:@"MLN_FUNCTION('image', CAST(token, \"NSString\"))"]; <% } else { -%> NSExpression* tokenExpression = [NSExpression expressionWithFormat:@"CAST(token, \"NSString\")"]; <% } -%> @@ -223,7 +223,7 @@ <% for (let property of enumProperties) { -%> <% for (let value in property.values) { -%> <% if (property.values.hasOwnProperty(value)) { -%> - XCTAssertEqual([NSValue valueWithMGL<%- camelize(enumName(property)) %>:MGL<%- camelize(enumName(property)) %><%- camelize(value) %>].MGL<%- camelize(enumName(property)) %>Value, MGL<%- camelize(enumName(property)) %><%- camelize(value) %>); + XCTAssertEqual([NSValue valueWithMLN<%- camelize(enumName(property)) %>:MLN<%- camelize(enumName(property)) %><%- camelize(value) %>].MLN<%- camelize(enumName(property)) %>Value, MLN<%- camelize(enumName(property)) %><%- camelize(value) %>); <% } -%> <% } -%> <% } -%> diff --git a/platform/ios/platform/darwin/test/MGLStyleTests.mm b/platform/ios/platform/darwin/test/MLNStyleTests.mm similarity index 71% rename from platform/ios/platform/darwin/test/MGLStyleTests.mm rename to platform/ios/platform/darwin/test/MLNStyleTests.mm index 09d390814..790142d05 100644 --- a/platform/ios/platform/darwin/test/MGLStyleTests.mm +++ b/platform/ios/platform/darwin/test/MLNStyleTests.mm @@ -1,7 +1,7 @@ #import -#import "NSBundle+MGLAdditions.h" -#import "MGLVectorTileSource_Private.h" +#import "NSBundle+MLNAdditions.h" +#import "MLNVectorTileSource_Private.h" #import #if TARGET_OS_IPHONE @@ -11,25 +11,25 @@ #endif #import -@interface MGLStyleTests : XCTestCase +@interface MLNStyleTests : XCTestCase -@property (nonatomic) MGLMapView *mapView; -@property (nonatomic) MGLStyle *style; +@property (nonatomic) MLNMapView *mapView; +@property (nonatomic) MLNStyle *style; @end -@implementation MGLStyleTests { +@implementation MLNStyleTests { XCTestExpectation *_styleLoadingExpectation; } - (void)setUp { [super setUp]; - [MGLSettings useWellKnownTileServer:MGLMapTiler]; - [MGLSettings setApiKey:@"pk.feedcafedeadbeefbadebede"]; + [MLNSettings useWellKnownTileServer:MLNMapTiler]; + [MLNSettings setApiKey:@"pk.feedcafedeadbeefbadebede"]; NSURL *styleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"one-liner" withExtension:@"json"]; - self.mapView = [[MGLMapView alloc] initWithFrame:CGRectMake(0, 0, 100, 100) styleURL:styleURL]; + self.mapView = [[MLNMapView alloc] initWithFrame:CGRectMake(0, 0, 100, 100) styleURL:styleURL]; self.mapView.delegate = self; if (!self.mapView.style) { _styleLoadingExpectation = [self expectationWithDescription:@"Map view should finish loading style."]; @@ -37,7 +37,7 @@ } } -- (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style { +- (void)mapView:(MLNMapView *)mapView didFinishLoadingStyle:(MLNStyle *)style { XCTAssertNotNil(mapView.style); XCTAssertEqual(mapView.style, style); @@ -51,7 +51,7 @@ [super tearDown]; } -- (MGLStyle *)style { +- (MLNStyle *)style { return self.mapView.style; } @@ -60,13 +60,13 @@ } - (void)testSources { - NSSet *initialSources = self.style.sources; + NSSet *initialSources = self.style.sources; if ([initialSources.anyObject.identifier isEqualToString:@"com.mapbox.annotations"]) { XCTAssertEqual(self.style.sources.count, 1UL); } else { XCTAssertEqual(self.style.sources.count, 0UL); } - MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"shapeSource" shape:nil options:nil]; + MLNShapeSource *shapeSource = [[MLNShapeSource alloc] initWithIdentifier:@"shapeSource" shape:nil options:nil]; [self.style addSource:shapeSource]; XCTAssertEqual(self.style.sources.count, initialSources.count + 1); XCTAssertEqual(shapeSource, [self.style sourceWithIdentifier:@"shapeSource"]); @@ -75,39 +75,39 @@ } - (void)testAddingSourcesTwice { - MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"shapeSource" shape:nil options:nil]; + MLNShapeSource *shapeSource = [[MLNShapeSource alloc] initWithIdentifier:@"shapeSource" shape:nil options:nil]; [self.style addSource:shapeSource]; - XCTAssertThrowsSpecificNamed([self.style addSource:shapeSource], NSException, MGLRedundantSourceException); + XCTAssertThrowsSpecificNamed([self.style addSource:shapeSource], NSException, MLNRedundantSourceException); - MGLRasterTileSource *rasterTileSource = [[MGLRasterTileSource alloc] initWithIdentifier:@"rasterTileSource" configurationURL:[NSURL URLWithString:@".json"] tileSize:42]; + MLNRasterTileSource *rasterTileSource = [[MLNRasterTileSource alloc] initWithIdentifier:@"rasterTileSource" configurationURL:[NSURL URLWithString:@".json"] tileSize:42]; [self.style addSource:rasterTileSource]; - XCTAssertThrowsSpecificNamed([self.style addSource:rasterTileSource], NSException, MGLRedundantSourceException); + XCTAssertThrowsSpecificNamed([self.style addSource:rasterTileSource], NSException, MLNRedundantSourceException); - MGLVectorTileSource *vectorTileSource = [[MGLVectorTileSource alloc] initWithIdentifier:@"vectorTileSource" configurationURL:[NSURL URLWithString:@".json"]]; + MLNVectorTileSource *vectorTileSource = [[MLNVectorTileSource alloc] initWithIdentifier:@"vectorTileSource" configurationURL:[NSURL URLWithString:@".json"]]; [self.style addSource:vectorTileSource]; - XCTAssertThrowsSpecificNamed([self.style addSource:vectorTileSource], NSException, MGLRedundantSourceException); + XCTAssertThrowsSpecificNamed([self.style addSource:vectorTileSource], NSException, MLNRedundantSourceException); } - (void)testAddingSourcesWithDuplicateIdentifiers { - MGLVectorTileSource *source1 = [[MGLVectorTileSource alloc] initWithIdentifier:@"my-source" configurationURL:[NSURL URLWithString:@"maptiler://sources/hillshades"]]; - MGLVectorTileSource *source2 = [[MGLVectorTileSource alloc] initWithIdentifier:@"my-source" configurationURL:[NSURL URLWithString:@"maptiler://sources/hillshades"]]; + MLNVectorTileSource *source1 = [[MLNVectorTileSource alloc] initWithIdentifier:@"my-source" configurationURL:[NSURL URLWithString:@"maptiler://sources/hillshades"]]; + MLNVectorTileSource *source2 = [[MLNVectorTileSource alloc] initWithIdentifier:@"my-source" configurationURL:[NSURL URLWithString:@"maptiler://sources/hillshades"]]; [self.style addSource: source1]; - XCTAssertThrowsSpecificNamed([self.style addSource: source2], NSException, MGLRedundantSourceIdentifierException); + XCTAssertThrowsSpecificNamed([self.style addSource: source2], NSException, MLNRedundantSourceIdentifierException); } - (void)testRemovingSourcesBeforeAddingThem { - MGLRasterTileSource *rasterTileSource = [[MGLRasterTileSource alloc] initWithIdentifier:@"raster-tile-source" tileURLTemplates:@[] options:nil]; + MLNRasterTileSource *rasterTileSource = [[MLNRasterTileSource alloc] initWithIdentifier:@"raster-tile-source" tileURLTemplates:@[] options:nil]; [self.style removeSource:rasterTileSource]; [self.style addSource:rasterTileSource]; XCTAssertNotNil([self.style sourceWithIdentifier:rasterTileSource.identifier]); - MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"shape-source" shape:nil options:nil]; + MLNShapeSource *shapeSource = [[MLNShapeSource alloc] initWithIdentifier:@"shape-source" shape:nil options:nil]; [self.style removeSource:shapeSource]; [self.style addSource:shapeSource]; XCTAssertNotNil([self.style sourceWithIdentifier:shapeSource.identifier]); - MGLVectorTileSource *vectorTileSource = [[MGLVectorTileSource alloc] initWithIdentifier:@"vector-tile-source" tileURLTemplates:@[] options:nil]; + MLNVectorTileSource *vectorTileSource = [[MLNVectorTileSource alloc] initWithIdentifier:@"vector-tile-source" tileURLTemplates:@[] options:nil]; [self.style removeSource:vectorTileSource]; [self.style addSource:vectorTileSource]; XCTAssertNotNil([self.style sourceWithIdentifier:vectorTileSource.identifier]); @@ -115,14 +115,14 @@ - (void)testAddingSourceOfTypeABeforeSourceOfTypeBWithSameIdentifier { // Add a raster tile source - MGLRasterTileSource *rasterTileSource = [[MGLRasterTileSource alloc] initWithIdentifier:@"some-identifier" tileURLTemplates:@[] options:nil]; + MLNRasterTileSource *rasterTileSource = [[MLNRasterTileSource alloc] initWithIdentifier:@"some-identifier" tileURLTemplates:@[] options:nil]; [self.style addSource:rasterTileSource]; // Attempt to remove an image source with the same identifier as the raster tile source - MGLImageSource *imageSource = [[MGLImageSource alloc] initWithIdentifier:@"some-identifier" coordinateQuad: { } URL:[NSURL URLWithString:@"http://host/image.png"]]; + MLNImageSource *imageSource = [[MLNImageSource alloc] initWithIdentifier:@"some-identifier" coordinateQuad: { } URL:[NSURL URLWithString:@"http://host/image.png"]]; [self.style removeSource:imageSource]; // The raster tile source should still be added - XCTAssertTrue([[self.style sourceWithIdentifier:rasterTileSource.identifier] isMemberOfClass:[MGLRasterTileSource class]]); + XCTAssertTrue([[self.style sourceWithIdentifier:rasterTileSource.identifier] isMemberOfClass:[MLNRasterTileSource class]]); // Remove the raster tile source [self.style removeSource:rasterTileSource]; @@ -131,10 +131,10 @@ [self.style addSource:imageSource]; // Attempt to remove a vector tile source with the same identifer as the shape source - MGLVectorTileSource *vectorTileSource = [[MGLVectorTileSource alloc] initWithIdentifier:@"some-identifier" tileURLTemplates:@[] options:nil]; + MLNVectorTileSource *vectorTileSource = [[MLNVectorTileSource alloc] initWithIdentifier:@"some-identifier" tileURLTemplates:@[] options:nil]; [self.style removeSource:vectorTileSource]; // The image source should still be added - XCTAssertTrue([[self.style sourceWithIdentifier:imageSource.identifier] isMemberOfClass:[MGLImageSource class]]); + XCTAssertTrue([[self.style sourceWithIdentifier:imageSource.identifier] isMemberOfClass:[MLNImageSource class]]); // Remove the image source [self.style removeSource:imageSource]; @@ -145,16 +145,16 @@ // Attempt to remove the previously created raster tile source that has the same identifer as the shape source [self.style removeSource:rasterTileSource]; // The vector tile source should still be added - XCTAssertTrue([[self.style sourceWithIdentifier:imageSource.identifier] isMemberOfClass:[MGLVectorTileSource class]]); + XCTAssertTrue([[self.style sourceWithIdentifier:imageSource.identifier] isMemberOfClass:[MLNVectorTileSource class]]); } - (void)testRemovingSourceInUse { // Add a raster tile source - MGLVectorTileSource *vectorTileSource = [[MGLVectorTileSource alloc] initWithIdentifier:@"some-identifier" tileURLTemplates:@[] options:nil]; + MLNVectorTileSource *vectorTileSource = [[MLNVectorTileSource alloc] initWithIdentifier:@"some-identifier" tileURLTemplates:@[] options:nil]; [self.style addSource:vectorTileSource]; // Add a layer using it - MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"fillLayer" source:vectorTileSource]; + MLNFillStyleLayer *fillLayer = [[MLNFillStyleLayer alloc] initWithIdentifier:@"fillLayer" source:vectorTileSource]; [self.style addLayer:fillLayer]; // Attempt to remove the raster tile source @@ -162,23 +162,23 @@ BOOL result = [self.style removeSource:vectorTileSource error:&error]; XCTAssertFalse(result); - XCTAssertEqualObjects(error.domain, MGLErrorDomain); - XCTAssertEqual(error.code, MGLErrorCodeSourceIsInUseCannotRemove); + XCTAssertEqualObjects(error.domain, MLNErrorDomain); + XCTAssertEqual(error.code, MLNErrorCodeSourceIsInUseCannotRemove); // Ensure it is still there - XCTAssertTrue([[self.style sourceWithIdentifier:vectorTileSource.identifier] isMemberOfClass:[MGLVectorTileSource class]]); + XCTAssertTrue([[self.style sourceWithIdentifier:vectorTileSource.identifier] isMemberOfClass:[MLNVectorTileSource class]]); } - (void)testLayers { - NSArray *initialLayers = self.style.layers; + NSArray *initialLayers = self.style.layers; if ([initialLayers.firstObject.identifier isEqualToString:@"com.mapbox.annotations.points"]) { XCTAssertEqual(self.style.layers.count, 1UL); } else { XCTAssertEqual(self.style.layers.count, 0UL); } - MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"shapeSource" shape:nil options:nil]; + MLNShapeSource *shapeSource = [[MLNShapeSource alloc] initWithIdentifier:@"shapeSource" shape:nil options:nil]; [self.style addSource:shapeSource]; - MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"fillLayer" source:shapeSource]; + MLNFillStyleLayer *fillLayer = [[MLNFillStyleLayer alloc] initWithIdentifier:@"fillLayer" source:shapeSource]; [self.style addLayer:fillLayer]; XCTAssertEqual(self.style.layers.count, initialLayers.count + 1); XCTAssertEqual(fillLayer, [self.style layerWithIdentifier:@"fillLayer"]); @@ -187,88 +187,88 @@ } - (void)testAddingLayersTwice { - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"shapeSource" shape:nil options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"shapeSource" shape:nil options:nil]; - MGLBackgroundStyleLayer *backgroundLayer = [[MGLBackgroundStyleLayer alloc] initWithIdentifier:@"backgroundLayer"]; + MLNBackgroundStyleLayer *backgroundLayer = [[MLNBackgroundStyleLayer alloc] initWithIdentifier:@"backgroundLayer"]; [self.style addLayer:backgroundLayer]; - XCTAssertThrowsSpecificNamed([self.style addLayer:backgroundLayer], NSException, MGLRedundantLayerException); + XCTAssertThrowsSpecificNamed([self.style addLayer:backgroundLayer], NSException, MLNRedundantLayerException); - MGLCircleStyleLayer *circleLayer = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"circleLayer" source:source]; + MLNCircleStyleLayer *circleLayer = [[MLNCircleStyleLayer alloc] initWithIdentifier:@"circleLayer" source:source]; [self.style addLayer:circleLayer]; - XCTAssertThrowsSpecificNamed([self.style addLayer:circleLayer], NSException, MGLRedundantLayerException); + XCTAssertThrowsSpecificNamed([self.style addLayer:circleLayer], NSException, MLNRedundantLayerException); - MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"fillLayer" source:source]; + MLNFillStyleLayer *fillLayer = [[MLNFillStyleLayer alloc] initWithIdentifier:@"fillLayer" source:source]; [self.style addLayer:fillLayer]; - XCTAssertThrowsSpecificNamed([self.style addLayer:fillLayer], NSException, MGLRedundantLayerException); + XCTAssertThrowsSpecificNamed([self.style addLayer:fillLayer], NSException, MLNRedundantLayerException); - MGLLineStyleLayer *lineLayer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"lineLayer" source:source]; + MLNLineStyleLayer *lineLayer = [[MLNLineStyleLayer alloc] initWithIdentifier:@"lineLayer" source:source]; [self.style addLayer:lineLayer]; - XCTAssertThrowsSpecificNamed([self.style addLayer:lineLayer], NSException, MGLRedundantLayerException); + XCTAssertThrowsSpecificNamed([self.style addLayer:lineLayer], NSException, MLNRedundantLayerException); - MGLRasterStyleLayer *rasterLayer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"rasterLayer" source:source]; + MLNRasterStyleLayer *rasterLayer = [[MLNRasterStyleLayer alloc] initWithIdentifier:@"rasterLayer" source:source]; [self.style addLayer:rasterLayer]; - XCTAssertThrowsSpecificNamed([self.style addLayer:rasterLayer], NSException, MGLRedundantLayerException); + XCTAssertThrowsSpecificNamed([self.style addLayer:rasterLayer], NSException, MLNRedundantLayerException); - MGLSymbolStyleLayer *symbolLayer = [[MGLSymbolStyleLayer alloc] initWithIdentifier:@"symbolLayer" source:source]; + MLNSymbolStyleLayer *symbolLayer = [[MLNSymbolStyleLayer alloc] initWithIdentifier:@"symbolLayer" source:source]; [self.style addLayer:symbolLayer]; - XCTAssertThrowsSpecificNamed([self.style addLayer:symbolLayer], NSException, MGLRedundantLayerException); + XCTAssertThrowsSpecificNamed([self.style addLayer:symbolLayer], NSException, MLNRedundantLayerException); } - (void)testAddingLayersWithDuplicateIdentifiers { // Just some source - MGLVectorTileSource *source = [[MGLVectorTileSource alloc] initWithIdentifier:@"my-source" configurationURL:[NSURL URLWithString:@"maptiler://sources/hillshades"]]; + MLNVectorTileSource *source = [[MLNVectorTileSource alloc] initWithIdentifier:@"my-source" configurationURL:[NSURL URLWithString:@"maptiler://sources/hillshades"]]; [self.style addSource: source]; // Add initial layer - MGLFillStyleLayer *initial = [[MGLFillStyleLayer alloc] initWithIdentifier:@"my-layer" source:source]; + MLNFillStyleLayer *initial = [[MLNFillStyleLayer alloc] initWithIdentifier:@"my-layer" source:source]; [self.style addLayer:initial]; // Try to add the duplicate - XCTAssertThrowsSpecificNamed([self.style addLayer:[[MGLFillStyleLayer alloc] initWithIdentifier:@"my-layer" source:source]], NSException, @"MGLRedundantLayerIdentifierException"); - XCTAssertThrowsSpecificNamed([self.style insertLayer:[[MGLFillStyleLayer alloc] initWithIdentifier:@"my-layer" source:source] belowLayer:initial],NSException, @"MGLRedundantLayerIdentifierException"); - XCTAssertThrowsSpecificNamed([self.style insertLayer:[[MGLFillStyleLayer alloc] initWithIdentifier:@"my-layer" source:source] aboveLayer:initial], NSException, @"MGLRedundantLayerIdentifierException"); - XCTAssertThrowsSpecificNamed([self.style insertLayer:[[MGLFillStyleLayer alloc] initWithIdentifier:@"my-layer" source:source] atIndex:0], NSException, @"MGLRedundantLayerIdentifierException"); - XCTAssertThrowsSpecificNamed([self.style insertLayer:[[MGLOpenGLStyleLayer alloc] initWithIdentifier:@"my-layer"] atIndex:0], NSException, @"MGLRedundantLayerIdentifierException"); + XCTAssertThrowsSpecificNamed([self.style addLayer:[[MLNFillStyleLayer alloc] initWithIdentifier:@"my-layer" source:source]], NSException, @"MLNRedundantLayerIdentifierException"); + XCTAssertThrowsSpecificNamed([self.style insertLayer:[[MLNFillStyleLayer alloc] initWithIdentifier:@"my-layer" source:source] belowLayer:initial],NSException, @"MLNRedundantLayerIdentifierException"); + XCTAssertThrowsSpecificNamed([self.style insertLayer:[[MLNFillStyleLayer alloc] initWithIdentifier:@"my-layer" source:source] aboveLayer:initial], NSException, @"MLNRedundantLayerIdentifierException"); + XCTAssertThrowsSpecificNamed([self.style insertLayer:[[MLNFillStyleLayer alloc] initWithIdentifier:@"my-layer" source:source] atIndex:0], NSException, @"MLNRedundantLayerIdentifierException"); + XCTAssertThrowsSpecificNamed([self.style insertLayer:[[MLNOpenGLStyleLayer alloc] initWithIdentifier:@"my-layer"] atIndex:0], NSException, @"MLNRedundantLayerIdentifierException"); } - (void)testRemovingLayerBeforeAddingSameLayer { { - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"shape-source-removing-before-adding" shape:nil options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"shape-source-removing-before-adding" shape:nil options:nil]; // Attempting to find a layer with identifier will trigger an exception if the source associated with the layer is not added [self.style addSource:source]; - MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"fill-layer" source:source]; + MLNFillStyleLayer *fillLayer = [[MLNFillStyleLayer alloc] initWithIdentifier:@"fill-layer" source:source]; [self.style removeLayer:fillLayer]; [self.style addLayer:fillLayer]; XCTAssertNotNil([self.style layerWithIdentifier:fillLayer.identifier]); - MGLSymbolStyleLayer *symbolLayer = [[MGLSymbolStyleLayer alloc] initWithIdentifier:@"symbol-layer" source:source]; + MLNSymbolStyleLayer *symbolLayer = [[MLNSymbolStyleLayer alloc] initWithIdentifier:@"symbol-layer" source:source]; [self.style removeLayer:symbolLayer]; [self.style addLayer:symbolLayer]; XCTAssertNotNil([self.style layerWithIdentifier:symbolLayer.identifier]); - MGLLineStyleLayer *lineLayer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"line-layer" source:source]; + MLNLineStyleLayer *lineLayer = [[MLNLineStyleLayer alloc] initWithIdentifier:@"line-layer" source:source]; [self.style removeLayer:lineLayer]; [self.style addLayer:lineLayer]; XCTAssertNotNil([self.style layerWithIdentifier:lineLayer.identifier]); - MGLCircleStyleLayer *circleLayer = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"circle-layer" source:source]; + MLNCircleStyleLayer *circleLayer = [[MLNCircleStyleLayer alloc] initWithIdentifier:@"circle-layer" source:source]; [self.style removeLayer:circleLayer]; [self.style addLayer:circleLayer]; XCTAssertNotNil([self.style layerWithIdentifier:circleLayer.identifier]); - MGLBackgroundStyleLayer *backgroundLayer = [[MGLBackgroundStyleLayer alloc] initWithIdentifier:@"background-layer"]; + MLNBackgroundStyleLayer *backgroundLayer = [[MLNBackgroundStyleLayer alloc] initWithIdentifier:@"background-layer"]; [self.style removeLayer:backgroundLayer]; [self.style addLayer:backgroundLayer]; XCTAssertNotNil([self.style layerWithIdentifier:backgroundLayer.identifier]); } { - MGLRasterTileSource *rasterSource = [[MGLRasterTileSource alloc] initWithIdentifier:@"raster-tile-source" tileURLTemplates:@[] options:nil]; + MLNRasterTileSource *rasterSource = [[MLNRasterTileSource alloc] initWithIdentifier:@"raster-tile-source" tileURLTemplates:@[] options:nil]; [self.style addSource:rasterSource]; - MGLRasterStyleLayer *rasterLayer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"raster-layer" source:rasterSource]; + MLNRasterStyleLayer *rasterLayer = [[MLNRasterStyleLayer alloc] initWithIdentifier:@"raster-layer" source:rasterSource]; [self.style removeLayer:rasterLayer]; [self.style addLayer:rasterLayer]; XCTAssertNotNil([self.style layerWithIdentifier:rasterLayer.identifier]); @@ -276,43 +276,43 @@ } - (void)testAddingLayerOfTypeABeforeRemovingLayerOfTypeBWithSameIdentifier { - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"shape-source-identifier" shape:nil options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"shape-source-identifier" shape:nil options:nil]; [self.style addSource:source]; // Add a fill layer - MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"some-identifier" source:source]; + MLNFillStyleLayer *fillLayer = [[MLNFillStyleLayer alloc] initWithIdentifier:@"some-identifier" source:source]; [self.style addLayer:fillLayer]; // Attempt to remove a line layer with the same identifier as the fill layer - MGLLineStyleLayer *lineLayer = [[MGLLineStyleLayer alloc] initWithIdentifier:fillLayer.identifier source:source]; + MLNLineStyleLayer *lineLayer = [[MLNLineStyleLayer alloc] initWithIdentifier:fillLayer.identifier source:source]; [self.style removeLayer:lineLayer]; - XCTAssertTrue([[self.style layerWithIdentifier:fillLayer.identifier] isMemberOfClass:[MGLFillStyleLayer class]]); + XCTAssertTrue([[self.style layerWithIdentifier:fillLayer.identifier] isMemberOfClass:[MLNFillStyleLayer class]]); } - (NSString *)stringWithContentsOfStyleHeader { NSURL *styleHeaderURL = [[[NSBundle mgl_frameworkBundle].bundleURL URLByAppendingPathComponent:@"Headers" isDirectory:YES] - URLByAppendingPathComponent:@"MGLStyle.h"]; + URLByAppendingPathComponent:@"MLNStyle.h"]; NSError *styleHeaderError; NSString *styleHeader = [NSString stringWithContentsOfURL:styleHeaderURL usedEncoding:nil error:&styleHeaderError]; - XCTAssertNil(styleHeaderError, @"Error getting contents of MGLStyle.h."); + XCTAssertNil(styleHeaderError, @"Error getting contents of MLNStyle.h."); return styleHeader; } - (void)testImages { NSString *imageName = @"TrackingLocationMask"; #if TARGET_OS_IPHONE - MGLImage *image = [MGLImage imageNamed:imageName + MLNImage *image = [MLNImage imageNamed:imageName inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; #else - MGLImage *image = [[NSBundle bundleForClass:[self class]] imageForResource:imageName]; + MLNImage *image = [[NSBundle bundleForClass:[self class]] imageForResource:imageName]; #endif XCTAssertNotNil(image); [self.style setImage:image forName:imageName]; - MGLImage *styleImage = [self.style imageForName:imageName]; + MLNImage *styleImage = [self.style imageForName:imageName]; XCTAssertNotNil(styleImage); XCTAssertEqual(image.size.width, styleImage.size.width); @@ -322,25 +322,25 @@ - (void)testLayersOrder { NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"]; NSURL *url = [NSURL fileURLWithPath:filePath]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil]; [self.style addSource:source]; - MGLCircleStyleLayer *layer1 = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"layer1" source:source]; + MLNCircleStyleLayer *layer1 = [[MLNCircleStyleLayer alloc] initWithIdentifier:@"layer1" source:source]; [self.style addLayer:layer1]; - MGLCircleStyleLayer *layer3 = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"layer3" source:source]; + MLNCircleStyleLayer *layer3 = [[MLNCircleStyleLayer alloc] initWithIdentifier:@"layer3" source:source]; [self.style addLayer:layer3]; - MGLCircleStyleLayer *layer2 = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"layer2" source:source]; + MLNCircleStyleLayer *layer2 = [[MLNCircleStyleLayer alloc] initWithIdentifier:@"layer2" source:source]; [self.style insertLayer:layer2 aboveLayer:layer1]; - MGLCircleStyleLayer *layer4 = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"layer4" source:source]; + MLNCircleStyleLayer *layer4 = [[MLNCircleStyleLayer alloc] initWithIdentifier:@"layer4" source:source]; [self.style insertLayer:layer4 aboveLayer:layer3]; - MGLCircleStyleLayer *layer0 = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"layer0" source:source]; + MLNCircleStyleLayer *layer0 = [[MLNCircleStyleLayer alloc] initWithIdentifier:@"layer0" source:source]; [self.style insertLayer:layer0 belowLayer:layer1]; - NSArray *layers = [self.style layers]; + NSArray *layers = [self.style layers]; NSUInteger startIndex = 0; if ([layers.firstObject.identifier isEqualToString:@"com.mapbox.annotations.points"]) { startIndex++; @@ -358,43 +358,43 @@ - (void)testLanguageMatching { { NSArray *preferences = @[@"en"]; - XCTAssertEqualObjects([MGLVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences], @"en"); + XCTAssertEqualObjects([MLNVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences], @"en"); } { NSArray *preferences = @[@"en-US"]; - XCTAssertEqualObjects([MGLVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences], @"en"); + XCTAssertEqualObjects([MLNVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences], @"en"); } { NSArray *preferences = @[@"fr"]; - XCTAssertEqualObjects([MGLVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences], @"fr"); + XCTAssertEqualObjects([MLNVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences], @"fr"); } { NSArray *preferences = @[@"zh-Hans"]; - XCTAssertEqualObjects([MGLVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences], @"zh-Hans"); + XCTAssertEqualObjects([MLNVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences], @"zh-Hans"); } { NSArray *preferences = @[@"zh-Hans", @"en"]; - XCTAssertEqualObjects([MGLVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences], @"zh-Hans"); + XCTAssertEqualObjects([MLNVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences], @"zh-Hans"); } { NSArray *preferences = @[@"zh-Hant"]; - XCTAssertEqualObjects([MGLVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences], @"zh-Hant"); + XCTAssertEqualObjects([MLNVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences], @"zh-Hant"); } { NSArray *preferences = @[@"en", @"fr", @"el"]; - XCTAssertEqualObjects([MGLVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences], @"en"); + XCTAssertEqualObjects([MLNVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences], @"en"); } { NSArray *preferences = @[@"tlh"]; - XCTAssertNil([MGLVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences]); + XCTAssertNil([MLNVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences]); } { NSArray *preferences = @[@"tlh", @"en"]; - XCTAssertEqualObjects([MGLVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences], @"en"); + XCTAssertEqualObjects([MLNVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences], @"en"); } { NSArray *preferences = @[@"mul"]; - XCTAssertNil([MGLVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences]); + XCTAssertNil([MLNVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences]); } } @@ -402,7 +402,7 @@ - (void)testTransition { - MGLTransition transitionTest = MGLTransitionMake(5, 4); + MLNTransition transitionTest = MLNTransitionMake(5, 4); self.style.transition = transitionTest; diff --git a/platform/ios/platform/darwin/test/MGLTestAssertionHandler.h b/platform/ios/platform/darwin/test/MLNTestAssertionHandler.h similarity index 89% rename from platform/ios/platform/darwin/test/MGLTestAssertionHandler.h rename to platform/ios/platform/darwin/test/MLNTestAssertionHandler.h index f1aa39921..e9f6f80d0 100644 --- a/platform/ios/platform/darwin/test/MGLTestAssertionHandler.h +++ b/platform/ios/platform/darwin/test/MLNTestAssertionHandler.h @@ -5,7 +5,7 @@ NS_ASSUME_NONNULL_BEGIN // Use to catch or log assertions that occur in dispatch blocks, timers or // other asynchronous operations. -@interface MGLTestAssertionHandler : NSAssertionHandler +@interface MLNTestAssertionHandler : NSAssertionHandler - (instancetype)initWithTestCase:(XCTestCase *)testCase; @property (nonatomic, weak) XCTestCase *testCase; diff --git a/platform/ios/platform/darwin/test/MGLTestAssertionHandler.m b/platform/ios/platform/darwin/test/MLNTestAssertionHandler.m similarity index 96% rename from platform/ios/platform/darwin/test/MGLTestAssertionHandler.m rename to platform/ios/platform/darwin/test/MLNTestAssertionHandler.m index 2112387e3..9e9324691 100644 --- a/platform/ios/platform/darwin/test/MGLTestAssertionHandler.m +++ b/platform/ios/platform/darwin/test/MLNTestAssertionHandler.m @@ -1,6 +1,6 @@ -#import "MGLTestAssertionHandler.h" +#import "MLNTestAssertionHandler.h" -@implementation MGLTestAssertionHandler +@implementation MLNTestAssertionHandler - (instancetype)initWithTestCase:(XCTestCase *)testCase { if ((self = [super init])) { diff --git a/platform/ios/platform/darwin/test/MGLTestUtility.h b/platform/ios/platform/darwin/test/MLNTestUtility.h similarity index 92% rename from platform/ios/platform/darwin/test/MGLTestUtility.h rename to platform/ios/platform/darwin/test/MLNTestUtility.h index 2e02e4f9d..289a3d5a2 100644 --- a/platform/ios/platform/darwin/test/MGLTestUtility.h +++ b/platform/ios/platform/darwin/test/MLNTestUtility.h @@ -1,6 +1,6 @@ /** - MGL_CHECK_IF_PENDING_TEST_SHOULD_RUN() + MLN_CHECK_IF_PENDING_TEST_SHOULD_RUN() Include this macro at the top of a "pending" test - one that would normally fail, but you want to include is as a compile-time test or as a reminder. @@ -15,7 +15,7 @@ will also be picked up by xcpretty. PENDING tests will be distinguished by a `⧖` and `[PENDING]` */ -#define MGL_CHECK_IF_PENDING_TEST_SHOULD_RUN() \ +#define MLN_CHECK_IF_PENDING_TEST_SHOULD_RUN() \ /* By default, skip pending tests. Otherwise check environment for MAPBOX_RUN_PENDING_TESTS */ \ { \ NSString *runPendingTests = [[NSProcessInfo processInfo] environment][@"MAPBOX_RUN_PENDING_TESTS"]; \ diff --git a/platform/ios/platform/darwin/test/MGLTileSetTests.mm b/platform/ios/platform/darwin/test/MLNTileSetTests.mm similarity index 71% rename from platform/ios/platform/darwin/test/MGLTileSetTests.mm rename to platform/ios/platform/darwin/test/MLNTileSetTests.mm index 68f27a8b0..6b293e291 100644 --- a/platform/ios/platform/darwin/test/MGLTileSetTests.mm +++ b/platform/ios/platform/darwin/test/MLNTileSetTests.mm @@ -1,21 +1,21 @@ #import #import -#import "MGLTileSource_Private.h" -#import "MGLGeometry_Private.h" +#import "MLNTileSource_Private.h" +#import "MLNGeometry_Private.h" #include -@interface MGLTileSetTests : XCTestCase +@interface MLNTileSetTests : XCTestCase @end -@implementation MGLTileSetTests +@implementation MLNTileSetTests - (void)testTileSetFromTileURLTemplates { // a tile set that provides an mbgl tile set NSArray *tileURLTemplates = @[@"tile.1", @"tile.2", @"tile.3"]; - mbgl::Tileset tileSet = MGLTileSetFromTileURLTemplates(tileURLTemplates, nil); + mbgl::Tileset tileSet = MLNTileSetFromTileURLTemplates(tileURLTemplates, nil); // has the correct URL templates XCTAssertEqual(tileSet.tiles.size(), 3UL); @@ -32,9 +32,9 @@ XCTAssertEqual(tileSet.zoomRange.max, 22); // when the tile set has min and/or max zoom level set - tileSet = MGLTileSetFromTileURLTemplates(@[@"tile.1"], @{ - MGLTileSourceOptionMinimumZoomLevel: @1, - MGLTileSourceOptionMaximumZoomLevel: @2, + tileSet = MLNTileSetFromTileURLTemplates(@[@"tile.1"], @{ + MLNTileSourceOptionMinimumZoomLevel: @1, + MLNTileSourceOptionMaximumZoomLevel: @2, }); // the mbgl object reflects the set values for min and max zoom level @@ -42,29 +42,29 @@ XCTAssertEqual(tileSet.zoomRange.max, 2); // when the tile set has a bounds set - MGLCoordinateBounds bounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(12, 34), CLLocationCoordinate2DMake(56, 78)); - tileSet = MGLTileSetFromTileURLTemplates(@[@"tile.1"], @{ - MGLTileSourceOptionCoordinateBounds: @(bounds), + MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(12, 34), CLLocationCoordinate2DMake(56, 78)); + tileSet = MLNTileSetFromTileURLTemplates(@[@"tile.1"], @{ + MLNTileSourceOptionCoordinateBounds: @(bounds), }); // the mbgl object reflects the set values for the bounds XCTAssert(!!tileSet.bounds, @"The bounds are set after setting the bounds"); if (tileSet.bounds) { - MGLCoordinateBounds actual = MGLCoordinateBoundsFromLatLngBounds(*tileSet.bounds); - XCTAssert(MGLCoordinateBoundsEqualToCoordinateBounds(bounds, actual), @"The bounds round-trip"); + MLNCoordinateBounds actual = MLNCoordinateBoundsFromLatLngBounds(*tileSet.bounds); + XCTAssert(MLNCoordinateBoundsEqualToCoordinateBounds(bounds, actual), @"The bounds round-trip"); } // when the tile set has an attribution NSString *attribution = @"my tileset © ©️🎈"; - tileSet = MGLTileSetFromTileURLTemplates(tileURLTemplates, @{ - MGLTileSourceOptionAttributionHTMLString: attribution, + tileSet = MLNTileSetFromTileURLTemplates(tileURLTemplates, @{ + MLNTileSourceOptionAttributionHTMLString: attribution, }); // the attribution is reflected by the mbgl tileset XCTAssertEqual(tileSet.attribution, attribution.UTF8String); // when the tile set has attribution infos - MGLAttributionInfo *mapboxInfo = [[MGLAttributionInfo alloc] initWithTitle:[[NSAttributedString alloc] initWithString:@"Mapbox"] + MLNAttributionInfo *mapboxInfo = [[MLNAttributionInfo alloc] initWithTitle:[[NSAttributedString alloc] initWithString:@"Mapbox"] URL:[NSURL URLWithString:@"https://www.mapbox.com/"]]; #if TARGET_OS_IPHONE UIColor *redColor = [UIColor redColor]; @@ -78,9 +78,9 @@ NSAttributedString *gl = [[NSAttributedString alloc] initWithString:@"GL" attributes:@{ NSBackgroundColorAttributeName: redColor, }]; - MGLAttributionInfo *glInfo = [[MGLAttributionInfo alloc] initWithTitle:gl URL:nil]; - tileSet = MGLTileSetFromTileURLTemplates(tileURLTemplates, @{ - MGLTileSourceOptionAttributionInfos: @[mapboxInfo, glInfo], + MLNAttributionInfo *glInfo = [[MLNAttributionInfo alloc] initWithTitle:gl URL:nil]; + tileSet = MLNTileSetFromTileURLTemplates(tileURLTemplates, @{ + MLNTileSourceOptionAttributionInfos: @[mapboxInfo, glInfo], }); // the attribution is reflected by the mbgl tileset @@ -105,34 +105,34 @@ XCTAssertEqualObjects(@(tileSet.attribution.c_str()), html); // when the tile coordinate system is changed using an NSNumber - tileSet = MGLTileSetFromTileURLTemplates(tileURLTemplates, @{ - MGLTileSourceOptionTileCoordinateSystem: @(MGLTileCoordinateSystemTMS), + tileSet = MLNTileSetFromTileURLTemplates(tileURLTemplates, @{ + MLNTileSourceOptionTileCoordinateSystem: @(MLNTileCoordinateSystemTMS), }); // the scheme is reflected by the mbgl tileset XCTAssertEqual(tileSet.scheme, mbgl::Tileset::Scheme::TMS); // when the tile coordinate system is changed using an NSValue - MGLTileCoordinateSystem tms = MGLTileCoordinateSystemTMS; - tileSet = MGLTileSetFromTileURLTemplates(tileURLTemplates, @{ - MGLTileSourceOptionTileCoordinateSystem: [NSValue value:&tms withObjCType:@encode(MGLTileCoordinateSystem)], + MLNTileCoordinateSystem tms = MLNTileCoordinateSystemTMS; + tileSet = MLNTileSetFromTileURLTemplates(tileURLTemplates, @{ + MLNTileSourceOptionTileCoordinateSystem: [NSValue value:&tms withObjCType:@encode(MLNTileCoordinateSystem)], }); // the scheme is reflected by the mbgl tileset XCTAssertEqual(tileSet.scheme, mbgl::Tileset::Scheme::TMS); // when the dem encoding is changed using an NSNumber - tileSet = MGLTileSetFromTileURLTemplates(tileURLTemplates, @{ - MGLTileSourceOptionDEMEncoding: @(MGLDEMEncodingTerrarium), + tileSet = MLNTileSetFromTileURLTemplates(tileURLTemplates, @{ + MLNTileSourceOptionDEMEncoding: @(MLNDEMEncodingTerrarium), }); // the encoding is reflected by the mbgl tileset XCTAssertEqual(tileSet.encoding, mbgl::Tileset::DEMEncoding::Terrarium); // when the dem encoding is changed using an NSValue - MGLDEMEncoding terrarium = MGLDEMEncodingTerrarium; - tileSet = MGLTileSetFromTileURLTemplates(tileURLTemplates, @{ - MGLTileSourceOptionDEMEncoding: [NSValue value:&terrarium withObjCType:@encode(MGLDEMEncoding)], + MLNDEMEncoding terrarium = MLNDEMEncodingTerrarium; + tileSet = MLNTileSetFromTileURLTemplates(tileURLTemplates, @{ + MLNTileSourceOptionDEMEncoding: [NSValue value:&terrarium withObjCType:@encode(MLNDEMEncoding)], }); // the encoding is reflected by the mbgl tileset @@ -141,9 +141,9 @@ - (void)testInvalidTileSet { // a tile set that provides an mbgl tile set and invalid (crossed) minimum and maximum zoom levels throws an exception - XCTAssertThrowsSpecificNamed(MGLTileSetFromTileURLTemplates(@[@"tile.1"], @{ - MGLTileSourceOptionMinimumZoomLevel: @10, - MGLTileSourceOptionMaximumZoomLevel: @9, + XCTAssertThrowsSpecificNamed(MLNTileSetFromTileURLTemplates(@[@"tile.1"], @{ + MLNTileSourceOptionMinimumZoomLevel: @10, + MLNTileSourceOptionMaximumZoomLevel: @9, }), NSException, NSInvalidArgumentException); } diff --git a/platform/ios/platform/darwin/test/MGLVersionNumber.m b/platform/ios/platform/darwin/test/MLNVersionNumber.m similarity index 68% rename from platform/ios/platform/darwin/test/MGLVersionNumber.m rename to platform/ios/platform/darwin/test/MLNVersionNumber.m index 722256b99..3245fa349 100644 --- a/platform/ios/platform/darwin/test/MGLVersionNumber.m +++ b/platform/ios/platform/darwin/test/MLNVersionNumber.m @@ -2,11 +2,11 @@ #import -@interface MGLVersionTests : XCTestCase +@interface MLNVersionTests : XCTestCase @end -@implementation MGLVersionTests +@implementation MLNVersionTests - (void)testVersionNumber { XCTAssertGreaterThanOrEqual(MapboxVersionNumber, 0); diff --git a/platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MGLMapSnapshotterTests/Contents.json b/platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MLNMapSnapshotterTests/Contents.json similarity index 100% rename from platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MGLMapSnapshotterTests/Contents.json rename to platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MLNMapSnapshotterTests/Contents.json diff --git a/platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MGLMapSnapshotterTests/PingFang.imageset/Contents.json b/platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MLNMapSnapshotterTests/PingFang.imageset/Contents.json similarity index 100% rename from platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MGLMapSnapshotterTests/PingFang.imageset/Contents.json rename to platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MLNMapSnapshotterTests/PingFang.imageset/Contents.json diff --git a/platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MGLMapSnapshotterTests/PingFang.imageset/actualImage.png b/platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MLNMapSnapshotterTests/PingFang.imageset/actualImage.png similarity index 100% rename from platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MGLMapSnapshotterTests/PingFang.imageset/actualImage.png rename to platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MLNMapSnapshotterTests/PingFang.imageset/actualImage.png diff --git a/platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MGLMapSnapshotterTests/PingFang.imageset/expected.png b/platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MLNMapSnapshotterTests/PingFang.imageset/expected.png similarity index 100% rename from platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MGLMapSnapshotterTests/PingFang.imageset/expected.png rename to platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MLNMapSnapshotterTests/PingFang.imageset/expected.png diff --git a/platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MGLMapSnapshotterTests/background.imageset/Contents.json b/platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MLNMapSnapshotterTests/background.imageset/Contents.json similarity index 100% rename from platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MGLMapSnapshotterTests/background.imageset/Contents.json rename to platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MLNMapSnapshotterTests/background.imageset/Contents.json diff --git a/platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MGLMapSnapshotterTests/background.imageset/background.png b/platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MLNMapSnapshotterTests/background.imageset/background.png similarity index 100% rename from platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MGLMapSnapshotterTests/background.imageset/background.png rename to platform/ios/platform/darwin/test/Media.xcassets/Fixtures/MLNMapSnapshotterTests/background.imageset/background.png diff --git a/platform/ios/platform/ios/CHANGELOG.md b/platform/ios/platform/ios/CHANGELOG.md index b327a21c6..d7d940cb9 100644 --- a/platform/ios/platform/ios/CHANGELOG.md +++ b/platform/ios/platform/ios/CHANGELOG.md @@ -4,6 +4,11 @@ MapLibre welcomes participation and contributions from everyone. Please read [`C ## main +* 💥 Breaking: Changed the prefix of files, classes, methods, variables and everything from `MGL` to `MLN`. ([#919](https://github.com/maplibre/maplibre-gl-native/pull/919)). + + > To migrate: + > Change all your `MGL` prefixes to `MLN`. If you are using `NSKeyedArchiver` or similar mechanishm to save the state, the app may crash after this change when trying to unarchive the state using old names of the classes. You need to clean the saved state of the app and save it using new classes. + ## 5.13.0 - January 05, 2023 * Fix missing attribution [#236](https://github.com/maplibre/maplibre-gl-native/pull/236) @@ -60,17 +65,17 @@ MapLibre welcomes participation and contributions from everyone. Please read [`C ### Features -* Added `MGLLocationManager.accuracyAuthorization` and `[MGLLocationManager requestTemporaryFullAccuracyAuthorizationWithPurposeKeyproperty:]` to support iOS 14 location accuracy privacy changes. (cherry pick from [#361](https://github.com/mapbox/mapbox-gl-native-ios/pull/361)) -* Added `[MGLLocationManager requestTemporaryFullAccuracyAuthorizationWithPurposeKeyproperty:]` to allow developers request just-in-time full-accuracy permissions. (cherry pick from [#361](https://github.com/mapbox/mapbox-gl-native-ios/pull/361)) -* Added `[MGLLocationManagerDelegate locationManagerDidChangeAuthorization:]` to let `MGLMapView` know about privacy changes. (cherry pick from [#376](https://github.com/mapbox/mapbox-gl-native-ios/pull/376)) -* Added `[MGLMapViewDelegate mapView:didChangeLocationManagerAuthorization:]` to allow developers adjust their apps to privacy settings changes. (cherry pick from [#376](https://github.com/mapbox/mapbox-gl-native-ios/pull/376)) -* Added an approximate user location halo when `MGLLocationManager.accuracyAuthorization` is set to `CLAccuracyAuthorizationReducedAccuracy`. (cherry pick from [#381](https://github.com/mapbox/mapbox-gl-native-ios/pull/381)) -* The `MGLAccuracyAuthorizationDescription` as element of `NSLocationTemporaryUsageDescriptionDictionary` Info.plist key can now be set to describe why you request accuracy authorization. (cherry pick from [#392](https://github.com/mapbox/mapbox-gl-native-ios/pull/392)) -* Added `[MGLMapViewDelegate mapViewStyleForDefaultUserLocationAnnotationView:]` and `MGLUserLocationAnnotationViewStyle` class to allow developers customize the default user location annotation view UI style. (cherry pick from [#403](https://github.com/mapbox/mapbox-gl-native-ios/pull/403)) +* Added `MLNLocationManager.accuracyAuthorization` and `[MLNLocationManager requestTemporaryFullAccuracyAuthorizationWithPurposeKeyproperty:]` to support iOS 14 location accuracy privacy changes. (cherry pick from [#361](https://github.com/mapbox/mapbox-gl-native-ios/pull/361)) +* Added `[MLNLocationManager requestTemporaryFullAccuracyAuthorizationWithPurposeKeyproperty:]` to allow developers request just-in-time full-accuracy permissions. (cherry pick from [#361](https://github.com/mapbox/mapbox-gl-native-ios/pull/361)) +* Added `[MLNLocationManagerDelegate locationManagerDidChangeAuthorization:]` to let `MLNMapView` know about privacy changes. (cherry pick from [#376](https://github.com/mapbox/mapbox-gl-native-ios/pull/376)) +* Added `[MLNMapViewDelegate mapView:didChangeLocationManagerAuthorization:]` to allow developers adjust their apps to privacy settings changes. (cherry pick from [#376](https://github.com/mapbox/mapbox-gl-native-ios/pull/376)) +* Added an approximate user location halo when `MLNLocationManager.accuracyAuthorization` is set to `CLAccuracyAuthorizationReducedAccuracy`. (cherry pick from [#381](https://github.com/mapbox/mapbox-gl-native-ios/pull/381)) +* The `MLNAccuracyAuthorizationDescription` as element of `NSLocationTemporaryUsageDescriptionDictionary` Info.plist key can now be set to describe why you request accuracy authorization. (cherry pick from [#392](https://github.com/mapbox/mapbox-gl-native-ios/pull/392)) +* Added `[MLNMapViewDelegate mapViewStyleForDefaultUserLocationAnnotationView:]` and `MLNUserLocationAnnotationViewStyle` class to allow developers customize the default user location annotation view UI style. (cherry pick from [#403](https://github.com/mapbox/mapbox-gl-native-ios/pull/403)) ### Bug Fixes -* Fixed an issue that caused a crash when custom location managers did not implement `MGLLocationManager.accuracyAuthorization`. (cherry pick from [#474](https://github.com/mapbox/mapbox-gl-native-ios/pull/474)) +* Fixed an issue that caused a crash when custom location managers did not implement `MLNLocationManager.accuracyAuthorization`. (cherry pick from [#474](https://github.com/mapbox/mapbox-gl-native-ios/pull/474)) * Fixed an issue where symbols flickered when zooming out. [#16](https://github.com/maplibre/maplibre-gl-native/issues/16) * Benchmark app updated and fixes to the latest xcode version * iOS performance improvements [#44](https://github.com/maplibre/maplibre-gl-native/pull/44) @@ -90,25 +95,25 @@ MapLibre welcomes participation and contributions from everyone. Please read [`C ### Styles and rendering -* Added the `mgl_distanceFrom:` expression function for calculating the shortest distance between the evaluated feature and an `MGLPointAnnotation`, `MGLPointCollection`, `MGLPolyline`, `MGLMultiPolyline`, `MGLPolygon`, or `MGLMultiPolygon` that you specify as part of an `NSExpression` format string. ([#295](https://github.com/mapbox/mapbox-gl-native-ios/pull/295)) -* Added the `MGLCircleStyleLayer.circleSortKey` property. ([mapbox/mapbox-gl-native#15875](https://github.com/mapbox/mapbox-gl-native/pull/15875)) -* Chinese, Japanese, and Korean characters are now set in the font specified in style JSON or by the `MGLSymbolLayer.textFontNames` property. If the named font is not installed on the device or bundled with the application, the characters are set in a fallback font listed in the `MGLIdeographicFontFamilyName` key in the Info.plist file. ([#189](https://github.com/mapbox/mapbox-gl-native-ios/pull/189)) -* The `MGLIdeographicFontFamilyName` key in the Info.plist file can now specify the fallback fonts for CJK characters by their PostScript names or display names in addition to font family names. For example, you can specify `NotoSansCJKjp-Bold` or `Noto Sans CJK JP Bold`, which ensures that the characters are set in bold. You can alternatively specify these font names in the `MGLIdeographicFontFamilyName` key of `NSUserDefaults.standardUserDefaults`. ([#189](https://github.com/mapbox/mapbox-gl-native-ios/pull/189)) +* Added the `mgl_distanceFrom:` expression function for calculating the shortest distance between the evaluated feature and an `MLNPointAnnotation`, `MLNPointCollection`, `MLNPolyline`, `MLNMultiPolyline`, `MLNPolygon`, or `MLNMultiPolygon` that you specify as part of an `NSExpression` format string. ([#295](https://github.com/mapbox/mapbox-gl-native-ios/pull/295)) +* Added the `MLNCircleStyleLayer.circleSortKey` property. ([mapbox/mapbox-gl-native#15875](https://github.com/mapbox/mapbox-gl-native/pull/15875)) +* Chinese, Japanese, and Korean characters are now set in the font specified in style JSON or by the `MLNSymbolLayer.textFontNames` property. If the named font is not installed on the device or bundled with the application, the characters are set in a fallback font listed in the `MLNIdeographicFontFamilyName` key in the Info.plist file. ([#189](https://github.com/mapbox/mapbox-gl-native-ios/pull/189)) +* The `MLNIdeographicFontFamilyName` key in the Info.plist file can now specify the fallback fonts for CJK characters by their PostScript names or display names in addition to font family names. For example, you can specify `NotoSansCJKjp-Bold` or `Noto Sans CJK JP Bold`, which ensures that the characters are set in bold. You can alternatively specify these font names in the `MLNIdeographicFontFamilyName` key of `NSUserDefaults.standardUserDefaults`. ([#189](https://github.com/mapbox/mapbox-gl-native-ios/pull/189)) * CJK characters are now laid out according to the font, so fonts with nonsquare glyphs have the correct kerning. ([#189](https://github.com/mapbox/mapbox-gl-native-ios/pull/189)) * Fixed an issue where the baseline for CJK characters was too low compared to non-CJK characters. ([#189](https://github.com/mapbox/mapbox-gl-native-ios/pull/189)) -* Fixed a crash when calling the `-[MGLStyle removeImageForName:]` method with the name of a nonexistent image. ([mapbox/mapbox-gl-native#16391](https://github.com/mapbox/mapbox-gl-native/pull/16391)) -* Fixed an issue where properties such as `MGLFillStyleLayer.fillColor` and `MGLLineStyleLayer.lineColor` misinterpreted non-opaque `UIColor`s. ([#266](https://github.com/mapbox/mapbox-gl-native-ios/pull/266)) +* Fixed a crash when calling the `-[MLNStyle removeImageForName:]` method with the name of a nonexistent image. ([mapbox/mapbox-gl-native#16391](https://github.com/mapbox/mapbox-gl-native/pull/16391)) +* Fixed an issue where properties such as `MLNFillStyleLayer.fillColor` and `MLNLineStyleLayer.lineColor` misinterpreted non-opaque `UIColor`s. ([#266](https://github.com/mapbox/mapbox-gl-native-ios/pull/266)) ### Offline maps -* Added the `-[MGLOfflinePack setContext:completionHandler:]` method for replacing the data associated with an offline pack, such as a name. ([#288](https://github.com/mapbox/mapbox-gl-native-ios/pull/288)) -* Added the `MGLOfflineStorage.databasePath` and `MGLOfflineStorage.databaseURL` properties to obtain the path of the database that contains offline packs and the ambient cache. To customize this path, set the `MGLOfflineStorageDatabasePath` in Info.plist. ([#298](https://github.com/mapbox/mapbox-gl-native-ios/pull/298)) -* Fixed an error that occurred if your implementation of the `-[MGLOfflineStorageDelegate offlineStorage:URLForResourceOfKind:]` method returned a local file URL. ([mapbox/mapbox-gl-native#16428](https://github.com/mapbox/mapbox-gl-native/pull/16428)) +* Added the `-[MLNOfflinePack setContext:completionHandler:]` method for replacing the data associated with an offline pack, such as a name. ([#288](https://github.com/mapbox/mapbox-gl-native-ios/pull/288)) +* Added the `MLNOfflineStorage.databasePath` and `MLNOfflineStorage.databaseURL` properties to obtain the path of the database that contains offline packs and the ambient cache. To customize this path, set the `MLNOfflineStorageDatabasePath` in Info.plist. ([#298](https://github.com/mapbox/mapbox-gl-native-ios/pull/298)) +* Fixed an error that occurred if your implementation of the `-[MLNOfflineStorageDelegate offlineStorage:URLForResourceOfKind:]` method returned a local file URL. ([mapbox/mapbox-gl-native#16428](https://github.com/mapbox/mapbox-gl-native/pull/16428)) ### Other changes * Fixed a crash when encountering an invalid polyline. ([mapbox/mapbox-gl-native#16409](https://github.com/mapbox/mapbox-gl-native/pull/16409)) -* Fixed an issue where an `MGLMapSnapshotOptions` with an invalid `MGLMapCamera.centerCoordinate`, negative `MGLMapCamera.heading`, negative `MGLMapCamera.pitch`, and negative `MGLMapSnapshotOptions.zoomLevel` resulted in a snapshot centered on Null Island at zoom level 0 even if the style specified a different initial center coordinate or zoom level. ([#280](https://github.com/mapbox/mapbox-gl-native-ios/pull/280)) +* Fixed an issue where an `MLNMapSnapshotOptions` with an invalid `MLNMapCamera.centerCoordinate`, negative `MLNMapCamera.heading`, negative `MLNMapCamera.pitch`, and negative `MLNMapSnapshotOptions.zoomLevel` resulted in a snapshot centered on Null Island at zoom level 0 even if the style specified a different initial center coordinate or zoom level. ([#280](https://github.com/mapbox/mapbox-gl-native-ios/pull/280)) * Certain logging statements no longer run on the main thread. ([mapbox/mapbox-gl-native#16325](https://github.com/mapbox/mapbox-gl-native/pull/16325)) * Fixed an issue that prevented the Maps SDK from warning about a misconfiguration that violated the Mapbox ToS. ([#288](https://github.com/mapbox/mapbox-gl-native-ios/pull/288)) @@ -116,51 +121,51 @@ MapLibre welcomes participation and contributions from everyone. Please read [`C ### Styles and rendering -* The `IN` and `CONTAINS` predicate operators can now test whether a string is a substring of another string or whether the evaluated feature (`SELF`) lies within a given `MGLShape` or `MGLFeature`. ([#183](https://github.com/mapbox/mapbox-gl-native-ios/pull/183), [#184](https://github.com/mapbox/mapbox-gl-native-ios/pull/184)) -* Added the `MGLLineStyleLayer.lineSortKey` and `MGLFillStyleLayer.fillSortKey` properties. ([#179](https://github.com/mapbox/mapbox-gl-native-ios/pull/179), [#16194](https://github.com/mapbox/mapbox-gl-native/pull/16194), [#16220](https://github.com/mapbox/mapbox-gl-native/pull/16220)) -* The `MGLSymbolStyleLayer.iconTextFit` property now respects the cap insets of any [nine-part stretchable image](https://developer.apple.com/documentation/uikit/uiimage#1658362) passed into the `-[MGLStyle setImage:forName:]` method. You can define the stretchable area in Xcode’s asset catalog or by calling the `-[UIImage resizableImageWithCapInsets:]` method. ([#182](https://github.com/mapbox/mapbox-gl-native-ios/pull/182)) -* Fixed an issue where an `MGLSymbolStyleLayer.lineDashPattern` value of `{1, 0}` resulted in hairline gaps. ([#16202](https://github.com/mapbox/mapbox-gl-native/pull/16202)) +* The `IN` and `CONTAINS` predicate operators can now test whether a string is a substring of another string or whether the evaluated feature (`SELF`) lies within a given `MLNShape` or `MLNFeature`. ([#183](https://github.com/mapbox/mapbox-gl-native-ios/pull/183), [#184](https://github.com/mapbox/mapbox-gl-native-ios/pull/184)) +* Added the `MLNLineStyleLayer.lineSortKey` and `MLNFillStyleLayer.fillSortKey` properties. ([#179](https://github.com/mapbox/mapbox-gl-native-ios/pull/179), [#16194](https://github.com/mapbox/mapbox-gl-native/pull/16194), [#16220](https://github.com/mapbox/mapbox-gl-native/pull/16220)) +* The `MLNSymbolStyleLayer.iconTextFit` property now respects the cap insets of any [nine-part stretchable image](https://developer.apple.com/documentation/uikit/uiimage#1658362) passed into the `-[MLNStyle setImage:forName:]` method. You can define the stretchable area in Xcode’s asset catalog or by calling the `-[UIImage resizableImageWithCapInsets:]` method. ([#182](https://github.com/mapbox/mapbox-gl-native-ios/pull/182)) +* Fixed an issue where an `MLNSymbolStyleLayer.lineDashPattern` value of `{1, 0}` resulted in hairline gaps. ([#16202](https://github.com/mapbox/mapbox-gl-native/pull/16202)) * Improved the performance of loading a style that has many style images. ([#16187](https://github.com/mapbox/mapbox-gl-native/pull/16187)) ### Snapshots -* Added the `MGLMapSnapshotter.delegate` property and `MGLMapSnapshotterDelegate` protocol for customizing the style before taking a snapshot. ([#235](https://github.com/mapbox/mapbox-gl-native-ios/pull/235)) -* You no longer need to explicitly capture the `MGLMapSnapshotter` object in the completion handler that you specify in `-[MGLMapSnapshotter startWithCompletionHandler:]`. Even if you declare the snapshotter locally without holding a strong reference to it, the snapshotter is only deallocated after the completion handler finishes, and the completion handler generally receives a valid snapshot. ([#210](https://github.com/mapbox/mapbox-gl-native-ios/pull/210)) -* The `-[MGLMapSnapshotter cancel]` method no longer calls the completion handler passed into `-[MGLMapSnapshotter startWithCompletionHandler:]`. ([#210](https://github.com/mapbox/mapbox-gl-native-ios/pull/210)) -* Fixed an issue where the `MGLMapSnapshotter.loading` property always returned `NO`, even while loading a snapshot. ([#210](https://github.com/mapbox/mapbox-gl-native-ios/pull/210)) +* Added the `MLNMapSnapshotter.delegate` property and `MLNMapSnapshotterDelegate` protocol for customizing the style before taking a snapshot. ([#235](https://github.com/mapbox/mapbox-gl-native-ios/pull/235)) +* You no longer need to explicitly capture the `MLNMapSnapshotter` object in the completion handler that you specify in `-[MLNMapSnapshotter startWithCompletionHandler:]`. Even if you declare the snapshotter locally without holding a strong reference to it, the snapshotter is only deallocated after the completion handler finishes, and the completion handler generally receives a valid snapshot. ([#210](https://github.com/mapbox/mapbox-gl-native-ios/pull/210)) +* The `-[MLNMapSnapshotter cancel]` method no longer calls the completion handler passed into `-[MLNMapSnapshotter startWithCompletionHandler:]`. ([#210](https://github.com/mapbox/mapbox-gl-native-ios/pull/210)) +* Fixed an issue where the `MLNMapSnapshotter.loading` property always returned `NO`, even while loading a snapshot. ([#210](https://github.com/mapbox/mapbox-gl-native-ios/pull/210)) ### Localization and internationalization -* The `MGLIdeographicFontFamilyName` Info.plist key can now be set to the display names or PostScript names of individual fonts. ([#189](https://github.com/mapbox/mapbox-gl-native-ios/pull/189)) -* The `-[MGLStyle localizeLabelsIntoLocale:]` and `-[NSExpression mgl_expressionLocalizedIntoLocale:]` methods can now localize text into Traditional Chinese and Vietnamese. ([#173](https://github.com/mapbox/mapbox-gl-native-ios/pull/173)) +* The `MLNIdeographicFontFamilyName` Info.plist key can now be set to the display names or PostScript names of individual fonts. ([#189](https://github.com/mapbox/mapbox-gl-native-ios/pull/189)) +* The `-[MLNStyle localizeLabelsIntoLocale:]` and `-[NSExpression mgl_expressionLocalizedIntoLocale:]` methods can now localize text into Traditional Chinese and Vietnamese. ([#173](https://github.com/mapbox/mapbox-gl-native-ios/pull/173)) ### Networking and storage * Downloaded offline packs no longer reduce the storage space available for ambient caching of tiles and other resources. ([#15622](https://github.com/mapbox/mapbox-gl-native/pull/15622)) -* Added the `-[MGLOfflineStorage preloadData:forURL:modificationDate:expirationDate:eTag:mustRevalidate:completionHandler:]` method for determining when the data is ready to retrieve from the cache. ([#188](https://github.com/mapbox/mapbox-gl-native-ios/pull/188)) +* Added the `-[MLNOfflineStorage preloadData:forURL:modificationDate:expirationDate:eTag:mustRevalidate:completionHandler:]` method for determining when the data is ready to retrieve from the cache. ([#188](https://github.com/mapbox/mapbox-gl-native-ios/pull/188)) * Fixed issues where an offline pack would stop downloading before completion. ([#16230](https://github.com/mapbox/mapbox-gl-native/pull/16230), [#16240](https://github.com/mapbox/mapbox-gl-native/pull/16240)) -* When an offline pack encounters an HTTP 404 error, the `MGLOfflinePackUserInfoKeyError` user info key of the `MGLOfflinePackErrorNotification` now indicates the resource that could not be downloaded. ([#16240](https://github.com/mapbox/mapbox-gl-native/pull/16240)) +* When an offline pack encounters an HTTP 404 error, the `MLNOfflinePackUserInfoKeyError` user info key of the `MLNOfflinePackErrorNotification` now indicates the resource that could not be downloaded. ([#16240](https://github.com/mapbox/mapbox-gl-native/pull/16240)) ### Other changes -* Added the `MGLMapView.minimumPitch` and `MGLMapView.maximumPitch` properties to further limit how much the user or your code can tilt the map. ([#208](https://github.com/mapbox/mapbox-gl-native-ios/pull/208)) -* Fixed a crash while quitting the application after adding an annotation to `MGLMapView`. ([#252](https://github.com/mapbox/mapbox-gl-native-ios/pull/252)) +* Added the `MLNMapView.minimumPitch` and `MLNMapView.maximumPitch` properties to further limit how much the user or your code can tilt the map. ([#208](https://github.com/mapbox/mapbox-gl-native-ios/pull/208)) +* Fixed a crash while quitting the application after adding an annotation to `MLNMapView`. ([#252](https://github.com/mapbox/mapbox-gl-native-ios/pull/252)) * Fixed an issue where the user location annotation view’s heading indicator did not rotate if Compass Calibration was disabled in the device’s Location Services settings. ([#247](https://github.com/mapbox/mapbox-gl-native-ios/pull/247)) * Improved performance when continuously animating a tilted map. ([#16287](https://github.com/mapbox/mapbox-gl-native/pull/16287)) -* Fixed a memory leak when zooming with any options enabled in the `MGLMapView.debugMask` property. ([#15179](https://github.com/mapbox/mapbox-gl-native/issues/15179)) +* Fixed a memory leak when zooming with any options enabled in the `MLNMapView.debugMask` property. ([#15179](https://github.com/mapbox/mapbox-gl-native/issues/15179)) ## 5.7.0 - February 13, 2020 ### Bug fixes -* Fixed an issue where `MGLSymbolStyleLayer.symbolSortKey` could sort text and icons incorrectly. ([#16023](https://github.com/mapbox/mapbox-gl-native/pull/16023)) +* Fixed an issue where `MLNSymbolStyleLayer.symbolSortKey` could sort text and icons incorrectly. ([#16023](https://github.com/mapbox/mapbox-gl-native/pull/16023)) * Fixed a crash when parsing GeoJSON sources. ([#16106](https://github.com/mapbox/mapbox-gl-native/pull/16106)) ### Other changes -* Added new property `MGLMapView.panScrollingMode`, which allows you to limit the horizontal or vertical direction a user may pan on the map view. ([#108](https://github.com/mapbox/mapbox-gl-native-ios/pull/108)) -* Added the `image` expression function for converting an image name into a style image. Use this function in expressions in style JSON or with the `MGL_FUNCTION()` syntax in an `NSExpression` format string. Image expressions are compatible with the `mgl_attributed:` expression function and `MGLAttributedExpression` classes for embedding icons inline in text labels. ([#15877](https://github.com/mapbox/mapbox-gl-native/pull/15877), [#15937](https://github.com/mapbox/mapbox-gl-native/pull/15937)) +* Added new property `MLNMapView.panScrollingMode`, which allows you to limit the horizontal or vertical direction a user may pan on the map view. ([#108](https://github.com/mapbox/mapbox-gl-native-ios/pull/108)) +* Added the `image` expression function for converting an image name into a style image. Use this function in expressions in style JSON or with the `MLN_FUNCTION()` syntax in an `NSExpression` format string. Image expressions are compatible with the `mgl_attributed:` expression function and `MLNAttributedExpression` classes for embedding icons inline in text labels. ([#15877](https://github.com/mapbox/mapbox-gl-native/pull/15877), [#15937](https://github.com/mapbox/mapbox-gl-native/pull/15937)) ## 5.6.1 - January 9, 2020 -* Fixed a crash that could occur when `MGLShapeSource` destroys its underlying data. ([#16106](https://github.com/mapbox/mapbox-gl-native/pull/16106)) +* Fixed a crash that could occur when `MLNShapeSource` destroys its underlying data. ([#16106](https://github.com/mapbox/mapbox-gl-native/pull/16106)) ## 5.6.0 - December 19, 2019 This release includes a known issue where the binary size has increased. ([#63](https://github.com/mapbox/mapbox-gl-native-ios/issues/63)) @@ -179,14 +184,14 @@ This release includes a known issue where the binary size has increased. ([#63]( * Enable incremental vacuum for the offline database in order to make data removal requests faster and to avoid the excessive disk space usage (creating a backup file on VACUUM call). ([#15837](https://github.com/mapbox/mapbox-gl-native/pull/15837)) * Fix ornaments' view constraints bug when devices change to bold-text mode. ([#57](https://github.com/mapbox/mapbox-gl-native-ios/pull/57)) * Fixed an issue where style layers backed by a shape source could flicker when transitioning between styles. ([#15907](https://github.com/mapbox/mapbox-gl-native/pull/15907), [#15941](https://github.com/mapbox/mapbox-gl-native/pull/15941)) -* Fixed a crash when `MGLSymbolStyleLayer.textFontSize` is set to an expression that evaluates to `0`. ([#16080](https://github.com/mapbox/mapbox-gl-native/pull/16080)) +* Fixed a crash when `MLNSymbolStyleLayer.textFontSize` is set to an expression that evaluates to `0`. ([#16080](https://github.com/mapbox/mapbox-gl-native/pull/16080)) ### Other changes * Convert GeoJSON features to tiles for the loaded source description in a background thread and thus unblock the UI thread ([#15885](https://github.com/mapbox/mapbox-gl-native/pull/15885)) ## 5.5.1 - February 20, 2020 -* Fixed an issue where `MGLSymbolStyleLayer.symbolSortKey` could sort text and icons incorrectly. ([#16023](https://github.com/mapbox/mapbox-gl-native/pull/16023)) +* Fixed an issue where `MLNSymbolStyleLayer.symbolSortKey` could sort text and icons incorrectly. ([#16023](https://github.com/mapbox/mapbox-gl-native/pull/16023)) * Fixed an issue where style layers backed by a shape source could flicker when transitioning between styles. ([#15907](https://github.com/mapbox/mapbox-gl-native/pull/15907), [#15941](https://github.com/mapbox/mapbox-gl-native/pull/15941)) ## 5.5.0 - November 5, 2019 @@ -197,16 +202,16 @@ This release includes a known issue where the binary size has increased. ([#63]( ### Styles and rendering -* Added an `MGLShapeSourceOptionClusterProperties` option that allows styling individual clusters based on aggregated feature data. ([#15515](https://github.com/mapbox/mapbox-gl-native/pull/15515)) +* Added an `MLNShapeSourceOptionClusterProperties` option that allows styling individual clusters based on aggregated feature data. ([#15515](https://github.com/mapbox/mapbox-gl-native/pull/15515)) ### Other changes -* Added `-[MGLMapSnapshotOverlay coordinateForPoint:]` and `-[MGLMapSnapshotOverlay pointForCoordinate:]` to convert between context and map coordinates, mirroring those of `MGLMapSnapshot`. ([#15746](https://github.com/mapbox/mapbox-gl-native/pull/15746)) +* Added `-[MLNMapSnapshotOverlay coordinateForPoint:]` and `-[MLNMapSnapshotOverlay pointForCoordinate:]` to convert between context and map coordinates, mirroring those of `MLNMapSnapshot`. ([#15746](https://github.com/mapbox/mapbox-gl-native/pull/15746)) * Suppress network requests for expired tiles update, if these tiles are invisible. ([#15741](https://github.com/mapbox/mapbox-gl-native/pull/15741)) -* Fixed an issue that cause the ornaments to ignore `MGLMapView.contentInset` property. ([#15584](https://github.com/mapbox/mapbox-gl-native/pull/15584)) -* Fixed an issue that cause `-[MGLMapView setCamera:withDuration:animationTimingFunction:edgePadding:completionHandler:]` persist the value of `edgePadding`. ([#15584](https://github.com/mapbox/mapbox-gl-native/pull/15584)) -* Added `MGLMapView.automaticallyAdjustsContentInset` property that indicates if wether the map view should automatically adjust its content insets. ([#15584](https://github.com/mapbox/mapbox-gl-native/pull/15584)) -* Fixed an issue that caused `MGLScaleBar` to have an incorrect size when resizing or rotating. ([#15703](https://github.com/mapbox/mapbox-gl-native/pull/15703)) +* Fixed an issue that cause the ornaments to ignore `MLNMapView.contentInset` property. ([#15584](https://github.com/mapbox/mapbox-gl-native/pull/15584)) +* Fixed an issue that cause `-[MLNMapView setCamera:withDuration:animationTimingFunction:edgePadding:completionHandler:]` persist the value of `edgePadding`. ([#15584](https://github.com/mapbox/mapbox-gl-native/pull/15584)) +* Added `MLNMapView.automaticallyAdjustsContentInset` property that indicates if wether the map view should automatically adjust its content insets. ([#15584](https://github.com/mapbox/mapbox-gl-native/pull/15584)) +* Fixed an issue that caused `MLNScaleBar` to have an incorrect size when resizing or rotating. ([#15703](https://github.com/mapbox/mapbox-gl-native/pull/15703)) * Fixed crash at launch seen on iOS 9 simulator. ([#15771](https://github.com/mapbox/mapbox-gl-native/pull/15771)) * Coalesce requests to the client for the same missing image ([#15778](https://github.com/mapbox/mapbox-gl-native/pull/15778)) @@ -214,12 +219,12 @@ This release includes a known issue where the binary size has increased. ([#63]( ### Styles and rendering -* Added an `-[MGLMapSnapshotter startWithOverlayHandler:completionHandler:]` method to provide the snapshot's current `CGContext` in order to perform custom drawing on `MGLMapSnapshot` objects. ([#15530](https://github.com/mapbox/mapbox-gl-native/pull/15530)) -* Fixed an issue that caused `MGLTileSourceOptionMaximumZoomLevel` to be ignored when setting `MGLTileSource.configurationURL`. ([#15581](https://github.com/mapbox/mapbox-gl-native/pull/15581)) +* Added an `-[MLNMapSnapshotter startWithOverlayHandler:completionHandler:]` method to provide the snapshot's current `CGContext` in order to perform custom drawing on `MLNMapSnapshot` objects. ([#15530](https://github.com/mapbox/mapbox-gl-native/pull/15530)) +* Fixed an issue that caused `MLNTileSourceOptionMaximumZoomLevel` to be ignored when setting `MLNTileSource.configurationURL`. ([#15581](https://github.com/mapbox/mapbox-gl-native/pull/15581)) * Fixed an assertion hit caused by possibility of adding a layer to an incompatible source. ([#15644](https://github.com/mapbox/mapbox-gl-native/pull/15644)) -* Fixed crashes triggered when `MGLSource` and `MGLStyleLayer` objects are accessed after having been invalidated after a style change. ([#15539](https://github.com/mapbox/mapbox-gl-native/pull/15539)) -* Fixed an issue where the collision boxes for symbols would not be updated when `MGLSymbolStyleLayer.textTranslation` or `MGLSymbolStyleLayer.iconTranslation` were used. ([#15467](https://github.com/mapbox/mapbox-gl-native/pull/15467)) -* Enabled use of `MGLSymbolStyleLayer.textOffset` option together with `MGLSymbolStyleLayer.textVariableAnchor` (if `MGLSymbolStyleLayer.textRadialOffset` option is not provided). ([#15542](https://github.com/mapbox/mapbox-gl-native/pull/15542)) +* Fixed crashes triggered when `MLNSource` and `MLNStyleLayer` objects are accessed after having been invalidated after a style change. ([#15539](https://github.com/mapbox/mapbox-gl-native/pull/15539)) +* Fixed an issue where the collision boxes for symbols would not be updated when `MLNSymbolStyleLayer.textTranslation` or `MLNSymbolStyleLayer.iconTranslation` were used. ([#15467](https://github.com/mapbox/mapbox-gl-native/pull/15467)) +* Enabled use of `MLNSymbolStyleLayer.textOffset` option together with `MLNSymbolStyleLayer.textVariableAnchor` (if `MLNSymbolStyleLayer.textRadialOffset` option is not provided). ([#15542](https://github.com/mapbox/mapbox-gl-native/pull/15542)) * Fixed an issue that caused constant repainting for sources with invisible layers. ([#15600](https://github.com/mapbox/mapbox-gl-native/pull/15600)) ### User interaction @@ -234,14 +239,14 @@ This release includes a known issue where the binary size has increased. ([#63]( ### Other changes -* Fixed a bug where the completion block passed to `-[MGLMapView flyToCamera:completionHandler:]` (and related methods) wouldn't be called. ([#15473](https://github.com/mapbox/mapbox-gl-native/pull/15473)) -* Fixed a crash when `-[MGLOfflinePack invalidate]` is called on different threads. ([#15582](https://github.com/mapbox/mapbox-gl-native/pull/15582)) +* Fixed a bug where the completion block passed to `-[MLNMapView flyToCamera:completionHandler:]` (and related methods) wouldn't be called. ([#15473](https://github.com/mapbox/mapbox-gl-native/pull/15473)) +* Fixed a crash when `-[MLNOfflinePack invalidate]` is called on different threads. ([#15582](https://github.com/mapbox/mapbox-gl-native/pull/15582)) * Fixed a potential integer overflow at high zoom levels. ([#15560](https://github.com/mapbox/mapbox-gl-native/pull/15560)) * Fixed a bug with annotation view positions after camera transitions. ([#15122](https://github.com/mapbox/mapbox-gl-native/pull/15122/)) ## 5.3.2 - September 18, 2019 -* Fixed an issue where `-[MGLMapView visibleFeaturesInRect:]` and `-[MGLShapeSource featuresMatchingPredicate:]` could return incorrect coordinates at zoom levels 20 and higher. ([#15560](https://github.com/mapbox/mapbox-gl-native/pull/15560)) +* Fixed an issue where `-[MLNMapView visibleFeaturesInRect:]` and `-[MLNShapeSource featuresMatchingPredicate:]` could return incorrect coordinates at zoom levels 20 and higher. ([#15560](https://github.com/mapbox/mapbox-gl-native/pull/15560)) ## 5.3.1 - September 18, 2019 @@ -263,9 +268,9 @@ This release changes how offline tile requests are billed — they are now bill * Fixed flickering on style change for the same tile set. ([#15127](https://github.com/mapbox/mapbox-gl-native/pull/15127)) * Fixed performance issues when tilting a map with custom content insets. ([#15195](https://github.com/mapbox/mapbox-gl-native/pull/15195)) * Fixed an issue where animated camera transitions zoomed in or out too dramatically. ([#15281](https://github.com/mapbox/mapbox-gl-native/pull/15281)) -* Enabled variable label placement when `MGLSymbolStyleLayer.textAllowsOverlap` is set to true. ([#15354](https://github.com/mapbox/mapbox-gl-native/pull/15354)) -* Added the `MGLSymbolStyleLayer.textWritingModes` layout property. This property can be set to `MGLTextWritingModeHorizontal` or `MGLTextWritingModeVertical`. ([#14932](https://github.com/mapbox/mapbox-gl-native/pull/14932)) -* Fixed rendering and collision detection issues with using `MGLSymbolStyleLayer.textVariableAnchor` and `MGLSymbolStyleLayer.iconTextFit` properties on the same layer. ([#15367](https://github.com/mapbox/mapbox-gl-native/pull/15367)) +* Enabled variable label placement when `MLNSymbolStyleLayer.textAllowsOverlap` is set to true. ([#15354](https://github.com/mapbox/mapbox-gl-native/pull/15354)) +* Added the `MLNSymbolStyleLayer.textWritingModes` layout property. This property can be set to `MLNTextWritingModeHorizontal` or `MLNTextWritingModeVertical`. ([#14932](https://github.com/mapbox/mapbox-gl-native/pull/14932)) +* Fixed rendering and collision detection issues with using `MLNSymbolStyleLayer.textVariableAnchor` and `MLNSymbolStyleLayer.iconTextFit` properties on the same layer. ([#15367](https://github.com/mapbox/mapbox-gl-native/pull/15367)) * Fixed symbol overlap when zooming out quickly. ([#15416](https://github.com/mapbox/mapbox-gl-native/pull/15416)) * Fixed an issue where non-template images would draw as template images when used in the same style layer. ([#15456](https://github.com/mapbox/mapbox-gl-native/pull/15456)) @@ -275,7 +280,7 @@ This release changes how offline tile requests are billed — they are now bill * Fixed use of objects after moving, potentially causing crashes. ([#15408](https://github.com/mapbox/mapbox-gl-native/pull/15408)) * Fixed a possible crash that could be caused by invoking the wrong layer implementation casting function. ([#15398](https://github.com/mapbox/mapbox-gl-native/pull/15398)) * Fixed a rare crash when tile download requests returned “404 Not Found” errors. ([#15313](https://github.com/mapbox/mapbox-gl-native/pull/15313)) -* `MGLLoggingLevel` has been updated to better match core log levels. You can now use `MGLLoggingConfiguration.loggingLevel` to filter logs from core. ([#15120](https://github.com/mapbox/mapbox-gl-native/pull/15120)) +* `MLNLoggingLevel` has been updated to better match core log levels. You can now use `MLNLoggingConfiguration.loggingLevel` to filter logs from core. ([#15120](https://github.com/mapbox/mapbox-gl-native/pull/15120)) * Fixed an issue where the scale bar could show `0 mm` instead of `0`. ([#15381](https://github.com/mapbox/mapbox-gl-native/pull/15381)) ## 4.11.2 - July 30, 2019 @@ -298,18 +303,18 @@ This release changes how offline tile requests are billed — they are now bill ### Networking * Added methods to clear the ambient cache, change the size of the ambient cache, and to delete and revalidate the database that contains the ambient cache and offline packs ([#14978](https://github.com/mapbox/mapbox-gl-native/pull/14978)): - * `-[MGLOfflineStorage clearAmbientCacheWithCompletionHandler:]` - * `-[MGLOfflineStorage invalidateAmbientCacheWithCompletionHandler:]` - * `-[MGLOfflineStorage setMaximumAmbientCacheSize:withCompletionHandler:]` - * `-[MGLOfflineStorage resetDatabaseWithCompletionHandler:]` - * `-[MGLOfflineStorage invalidatePack:withCompletionHandler:]` + * `-[MLNOfflineStorage clearAmbientCacheWithCompletionHandler:]` + * `-[MLNOfflineStorage invalidateAmbientCacheWithCompletionHandler:]` + * `-[MLNOfflineStorage setMaximumAmbientCacheSize:withCompletionHandler:]` + * `-[MLNOfflineStorage resetDatabaseWithCompletionHandler:]` + * `-[MLNOfflineStorage invalidatePack:withCompletionHandler:]` ### Styles and rendering -* The `MGLIdeographicFontFamilyName` Info.plist key now also accepts an array of font family names, to customize font fallback behavior. It can also be set to a Boolean value of `NO` to force the SDK to typeset CJK characters in a remote font specified by `MGLSymbolStyleLayer.textFontNames`. ([#14862](https://github.com/mapbox/mapbox-gl-native/pull/14862)) +* The `MLNIdeographicFontFamilyName` Info.plist key now also accepts an array of font family names, to customize font fallback behavior. It can also be set to a Boolean value of `NO` to force the SDK to typeset CJK characters in a remote font specified by `MLNSymbolStyleLayer.textFontNames`. ([#14862](https://github.com/mapbox/mapbox-gl-native/pull/14862)) * Hiragana and katakana are now included in the range of CJK glyphs that are rendered locally by default. ([#15009](https://github.com/mapbox/mapbox-gl-native/pull/15009)) * Fixed a map update bug caused by the render tiles and the render passes becoming unsynchronized. ([#15092](https://github.com/mapbox/mapbox-gl-native/pull/15092)) -* Added the `-[MGLMapViewDelegate mapView:shouldRemoveStyleImage:]` method for optimizing style image caching. ([#14769](https://github.com/mapbox/mapbox-gl-native/pull/14769)) +* Added the `-[MLNMapViewDelegate mapView:shouldRemoveStyleImage:]` method for optimizing style image caching. ([#14769](https://github.com/mapbox/mapbox-gl-native/pull/14769)) * Fixed style change transition regression caused by delayed setting of the updated layer properties. ([#15016](https://github.com/mapbox/mapbox-gl-native/pull/15016)) * Fixed an issue where layers with fill extrusions would be incorrectly rendered above other layers. ([#15065](https://github.com/mapbox/mapbox-gl-native/pull/15065)) * Improved feature querying performance. ([#14930](https://github.com/mapbox/mapbox-gl-native/pull/14930)) @@ -333,15 +338,15 @@ This release changes how offline tile requests are billed — they are now bill ### Other changes -* Added variants of several animated `MGLMapView` methods that accept completion handlers ([#14381](https://github.com/mapbox/mapbox-gl-native/pull/14381)): - * `-[MGLMapView setVisibleCoordinateBounds:edgePadding:animated:completionHandler:]` - * `-[MGLMapView setContentInset:animated:completionHandler:]` - * `-[MGLMapView setUserTrackingMode:animated:completionHandler:]` - * `-[MGLMapView setTargetCoordinate:animated:completionHandler:]` - * `-[MGLMapView showAnnotations:edgePadding:animated:completionHandler:]` - * `-[MGLMapView selectAnnotation:animated:completionHandler:]` +* Added variants of several animated `MLNMapView` methods that accept completion handlers ([#14381](https://github.com/mapbox/mapbox-gl-native/pull/14381)): + * `-[MLNMapView setVisibleCoordinateBounds:edgePadding:animated:completionHandler:]` + * `-[MLNMapView setContentInset:animated:completionHandler:]` + * `-[MLNMapView setUserTrackingMode:animated:completionHandler:]` + * `-[MLNMapView setTargetCoordinate:animated:completionHandler:]` + * `-[MLNMapView showAnnotations:edgePadding:animated:completionHandler:]` + * `-[MLNMapView selectAnnotation:animated:completionHandler:]` * Deprecated variants of the above methods without completion handlers. ([#14959](https://github.com/mapbox/mapbox-gl-native/pull/14959)) -* Added `MGLMapView.compassView.compassVisibility` and `MGLOrnamentVisibility` to allow configuration of compass visibility behavior. ([#15055](https://github.com/mapbox/mapbox-gl-native/pull/15055)) +* Added `MLNMapView.compassView.compassVisibility` and `MLNOrnamentVisibility` to allow configuration of compass visibility behavior. ([#15055](https://github.com/mapbox/mapbox-gl-native/pull/15055)) * Fixed a crash during network access. ([#15113](https://github.com/mapbox/mapbox-gl-native/pull/15113)) * Updated "map ID" to the more accurate term "tileset ID" in documentation; updated "style's Map ID" to the more accurate term "style URL". ([#15116](https://github.com/mapbox/mapbox-gl-native/pull/15116)) @@ -369,13 +374,13 @@ This release changes how offline tile requests are billed — they are now bill * Fixed a rendering performance regression when rendering polylines. ([#14851](https://github.com/mapbox/mapbox-gl-native/pull/14851)) * Fixed a rendering performance regression introduced in 4.11.0. ([#14907](https://github.com/mapbox/mapbox-gl-native/pull/14907)) * Fixed an issue where symbols underneath opaque fill layers could be incorrectly drawn above such layers. ([#14839](https://github.com/mapbox/mapbox-gl-native/pull/14839)) -* Fixed an issue where `MGLFillExtrusionStyleLayer` vertical gradients might not be rendered. ([#14808](https://github.com/mapbox/mapbox-gl-native/pull/14808)) +* Fixed an issue where `MLNFillExtrusionStyleLayer` vertical gradients might not be rendered. ([#14808](https://github.com/mapbox/mapbox-gl-native/pull/14808)) ### Other changes -* The `-[MGLMapView setCamera:withDuration:animationTimingFunction:edgePadding:completionHandler:]` method now adds the current value of the `MGLMapView.contentInset` property to the `edgePadding` parameter. ([#14813](https://github.com/mapbox/mapbox-gl-native/pull/14813)) -* Setting `MGLMapView.contentInset` now moves the map’s focal point to the center of the content frame after insetting. ([#14664](https://github.com/mapbox/mapbox-gl-native/pull/14664)) -* Fixed an issue where `-[MGLMapView visibleFeaturesInRect:]` and `-[MGLShapeSource featuresMatchingPredicate:]` omitted some features from the return value. ([#14884](https://github.com/mapbox/mapbox-gl-native/pull/14884)) +* The `-[MLNMapView setCamera:withDuration:animationTimingFunction:edgePadding:completionHandler:]` method now adds the current value of the `MLNMapView.contentInset` property to the `edgePadding` parameter. ([#14813](https://github.com/mapbox/mapbox-gl-native/pull/14813)) +* Setting `MLNMapView.contentInset` now moves the map’s focal point to the center of the content frame after insetting. ([#14664](https://github.com/mapbox/mapbox-gl-native/pull/14664)) +* Fixed an issue where `-[MLNMapView visibleFeaturesInRect:]` and `-[MLNShapeSource featuresMatchingPredicate:]` omitted some features from the return value. ([#14884](https://github.com/mapbox/mapbox-gl-native/pull/14884)) ## 5.0.0 - May 22, 2019 @@ -385,12 +390,12 @@ There are no breaking API changes in this release. ### Styles and rendering -* Changed placement order of `MGLSymbolStyleLayer` to match the viewport-y order when `MGLSymbolStyleLayer.symbolZOrder` is set to `MGLSymbolZOrderViewportY`, allowing icons to overlap but not text. ([#14486](https://github.com/mapbox/mapbox-gl-native/pull/14486)) -* Added `MGLSymbolStyleLayer.symbolSortKey` and `MGLSymbolZOrderAuto` to allow customization of symbol z-ordering. ([#14386](https://github.com/mapbox/mapbox-gl-native/pull/14386)) +* Changed placement order of `MLNSymbolStyleLayer` to match the viewport-y order when `MLNSymbolStyleLayer.symbolZOrder` is set to `MLNSymbolZOrderViewportY`, allowing icons to overlap but not text. ([#14486](https://github.com/mapbox/mapbox-gl-native/pull/14486)) +* Added `MLNSymbolStyleLayer.symbolSortKey` and `MLNSymbolZOrderAuto` to allow customization of symbol z-ordering. ([#14386](https://github.com/mapbox/mapbox-gl-native/pull/14386)) ### Other changes -* Fixed an issue where `-[MGLMapView setVisibleCoordinates:count:edgePadding:direction:duration:animationTimingFunction:completionHandler:]` interpreted a negative `direction` as due north instead of maintaining the current direction. ([#14575](https://github.com/mapbox/mapbox-gl-native/pull/14575)) +* Fixed an issue where `-[MLNMapView setVisibleCoordinates:count:edgePadding:direction:duration:animationTimingFunction:completionHandler:]` interpreted a negative `direction` as due north instead of maintaining the current direction. ([#14575](https://github.com/mapbox/mapbox-gl-native/pull/14575)) ## 4.11.0 - May 15, 2019 @@ -405,9 +410,9 @@ There are no breaking API changes in this release. ### Other changes -* Fixed an Interface Builder crash when using an `MGLMapView` in a storyboard. ([#14379](https://github.com/mapbox/mapbox-gl-native/pull/14379)) +* Fixed an Interface Builder crash when using an `MLNMapView` in a storyboard. ([#14379](https://github.com/mapbox/mapbox-gl-native/pull/14379)) * Fixed a bug that caused incorrect positioning of the attribution dialog after rotation. ([#14185](https://github.com/mapbox/mapbox-gl-native/pull/14185)) -* Improved `MGLLocationManager` optional protocol properties bridging to Swift. ([#14477](https://github.com/mapbox/mapbox-gl-native/pull/14477)) +* Improved `MLNLocationManager` optional protocol properties bridging to Swift. ([#14477](https://github.com/mapbox/mapbox-gl-native/pull/14477)) * Fixed a layout constraints crash on iOS 9 when a view is removed from its superview. ([#14529](https://github.com/mapbox/mapbox-gl-native/pull/14529)) ## 4.10.0 - April 17, 2019 @@ -415,10 +420,10 @@ There are no breaking API changes in this release. ### Styles and rendering * Client-side text rendering of CJK ideographs is now enabled by default. ([#13988](https://github.com/mapbox/mapbox-gl-native/pull/13988)) -* Fixed an issue that caused `MGL_FUNCTION` to ignore multiple formatting parameters when passed a `format` function as parameter. ([#14064](https://github.com/mapbox/mapbox-gl-native/pull/14064)) -* Added `mgl_attributed:` expression operator, which concatenates `MGLAttributedExpression` objects for specifying rich text in the `MGLSymbolStyleLayer.text` property. ([#14094](https://github.com/mapbox/mapbox-gl-native/pull/14094)) +* Fixed an issue that caused `MLN_FUNCTION` to ignore multiple formatting parameters when passed a `format` function as parameter. ([#14064](https://github.com/mapbox/mapbox-gl-native/pull/14064)) +* Added `mgl_attributed:` expression operator, which concatenates `MLNAttributedExpression` objects for specifying rich text in the `MLNSymbolStyleLayer.text` property. ([#14094](https://github.com/mapbox/mapbox-gl-native/pull/14094)) * Fixed an issue that caused conditional expressions to crash when passed nested conditional expressions as parameters. ([#14181](https://github.com/mapbox/mapbox-gl-native/pull/14181)) -* Added `-[MGLMapViewDelegate mapView:didFailToLoadImage:]` to load missing symbol icons in the style if they are not found. ([#14302](https://github.com/mapbox/mapbox-gl-native/pull/14302)) +* Added `-[MLNMapViewDelegate mapView:didFailToLoadImage:]` to load missing symbol icons in the style if they are not found. ([#14302](https://github.com/mapbox/mapbox-gl-native/pull/14302)) * Fixed a possible crash with certain expressions containing arguments that evaluate to a dictionary containing `NSArray` or `NSNumber` values. ([#14352](https://github.com/mapbox/mapbox-gl-native/pull/14352)) * Fixed a bug where non-opaque `UIColor` values were ignored when assigned to a style layer color property. ([#14406](https://github.com/mapbox/mapbox-gl-native/pull/14406)) * Speculatively fixed a bug where GL rendering could occur in the background. ([#14439](https://github.com/mapbox/mapbox-gl-native/pull/14439)) @@ -430,32 +435,32 @@ There are no breaking API changes in this release. ### Offline maps -* Fixed a bug that caused offline packs created prior to v4.0.0 to be marked as `MGLOfflinePackStateInactive`. ([#14188](https://github.com/mapbox/mapbox-gl-native/pull/14188)) +* Fixed a bug that caused offline packs created prior to v4.0.0 to be marked as `MLNOfflinePackStateInactive`. ([#14188](https://github.com/mapbox/mapbox-gl-native/pull/14188)) ### Other changes -* Added `MGLOrnamentPosition` enum and margin properties to customize scale bar, compass, logo, and attribution position within the map view. ([#13911](https://github.com/mapbox/mapbox-gl-native/pull/13911)) -* Added an `MGLMapView.prefetchesTiles` property to configure lower-resolution tile prefetching behavior. ([#14031](https://github.com/mapbox/mapbox-gl-native/pull/14031)) -* Speculatively fixed a performance issue seen on iOS 12.2, when an `MGLMapView` is repeatedly removed and re-added in a view hierarchy. ([#14264](https://github.com/mapbox/mapbox-gl-native/pull/14264)) +* Added `MLNOrnamentPosition` enum and margin properties to customize scale bar, compass, logo, and attribution position within the map view. ([#13911](https://github.com/mapbox/mapbox-gl-native/pull/13911)) +* Added an `MLNMapView.prefetchesTiles` property to configure lower-resolution tile prefetching behavior. ([#14031](https://github.com/mapbox/mapbox-gl-native/pull/14031)) +* Speculatively fixed a performance issue seen on iOS 12.2, when an `MLNMapView` is repeatedly removed and re-added in a view hierarchy. ([#14264](https://github.com/mapbox/mapbox-gl-native/pull/14264)) ## 4.9.0 - February 27, 2019 -* Fixed a bug where setting `MGLMapView.userTrackingMode` to `MGLUserTrackingModeFollowWithHeading` or `MGLUserTrackingModeFollowWithCourse` would be ignored if the user’s location was not already available. ([#13849](https://github.com/mapbox/mapbox-gl-native/pull/13849)) +* Fixed a bug where setting `MLNMapView.userTrackingMode` to `MLNUserTrackingModeFollowWithHeading` or `MLNUserTrackingModeFollowWithCourse` would be ignored if the user’s location was not already available. ([#13849](https://github.com/mapbox/mapbox-gl-native/pull/13849)) * Improved tilt gesture performance. ([#13902](https://github.com/mapbox/mapbox-gl-native/pull/13902)) * Fixed a bug where `layoutSubviews` was always called on device rotation, regardless of the application's or top-most view controller's supported orientations. ([#13900](https://github.com/mapbox/mapbox-gl-native/pull/13900)) -* Added `MGLNetworkConfiguration` class to customize the SDK's `NSURLSessionConfiguration` object. ([#13886](https://github.com/mapbox/mapbox-gl-native/pull/13886)) +* Added `MLNNetworkConfiguration` class to customize the SDK's `NSURLSessionConfiguration` object. ([#13886](https://github.com/mapbox/mapbox-gl-native/pull/13886)) ## 4.8.0 - January 30, 2019 ### Styles and rendering -* Added an `MGLStyle.performsPlacementTransitions` property to control how long it takes for colliding labels to fade out. ([#13565](https://github.com/mapbox/mapbox-gl-native/pull/13565)) +* Added an `MLNStyle.performsPlacementTransitions` property to control how long it takes for colliding labels to fade out. ([#13565](https://github.com/mapbox/mapbox-gl-native/pull/13565)) * Fixed a crash when casting large numbers in `NSExpression`. ([#13580](https://github.com/mapbox/mapbox-gl-native/pull/13580)) -* Added the `-[MGLShapeSource leavesOfCluster:offset:limit:]`, `-[MGLShapeSource childrenOfCluster:]`, `-[MGLShapeSource zoomLevelForExpandingCluster:]` methods for inspecting a cluster in an `MGLShapeSource`s created with the `MGLShapeSourceOptionClustered` option. Feature querying now returns clusters represented by `MGLPointFeatureCluster` objects (that conform to the `MGLCluster` protocol). ([#12952](https://github.com/mapbox/mapbox-gl-native/pull/12952) +* Added the `-[MLNShapeSource leavesOfCluster:offset:limit:]`, `-[MLNShapeSource childrenOfCluster:]`, `-[MLNShapeSource zoomLevelForExpandingCluster:]` methods for inspecting a cluster in an `MLNShapeSource`s created with the `MLNShapeSourceOptionClustered` option. Feature querying now returns clusters represented by `MLNPointFeatureCluster` objects (that conform to the `MLNCluster` protocol). ([#12952](https://github.com/mapbox/mapbox-gl-native/pull/12952) ### Annotations -* Fixed a bug where the `animated` parameter to `-[MGLMapView selectAnnotation:animated:]` was being ignored. ([#13689](https://github.com/mapbox/mapbox-gl-native/pull/13689)) +* Fixed a bug where the `animated` parameter to `-[MLNMapView selectAnnotation:animated:]` was being ignored. ([#13689](https://github.com/mapbox/mapbox-gl-native/pull/13689)) * Fixed a bug where selecting partially on-screen annotations (without a callout) would move the map. ([#13727](https://github.com/mapbox/mapbox-gl-native/pull/13727)) ### Packaging @@ -465,15 +470,15 @@ There are no breaking API changes in this release. ### Other changes * Reinstates version 11 as the default Mapbox Streets style (as introduced in 4.7.0). ([#13690](https://github.com/mapbox/mapbox-gl-native/pull/13690)) -* `MGLMapView` no longer freezes on external displays connected through AirPlay or CarPlay when the main device’s screen goes to sleep or the user manually locks the screen. ([#13701](https://github.com/mapbox/mapbox-gl-native/pull/13701)) +* `MLNMapView` no longer freezes on external displays connected through AirPlay or CarPlay when the main device’s screen goes to sleep or the user manually locks the screen. ([#13701](https://github.com/mapbox/mapbox-gl-native/pull/13701)) * Fixed an issue calculating the viewport when setting visible coordinates with a `direction`. ([#13761](https://github.com/mapbox/mapbox-gl-native/pull/13761)) ## 4.7.1 - December 21, 2018 ### Styles and rendering -* Reverts the ability for `MGLMapView`, `MGLShapeOfflineRegion`, and `MGLTilePyramidOfflineRegion` to use version 11 of the Mapbox Streets style. ([#13650](https://github.com/mapbox/mapbox-gl-native/pull/13650)) -* Reverts the ability for convenience methods on `MGLStyle` such as `MGLStyle.lightStyleURL`, to use version 11 of the Mapbox Streets style. ([#13650](https://github.com/mapbox/mapbox-gl-native/pull/13650)) +* Reverts the ability for `MLNMapView`, `MLNShapeOfflineRegion`, and `MLNTilePyramidOfflineRegion` to use version 11 of the Mapbox Streets style. ([#13650](https://github.com/mapbox/mapbox-gl-native/pull/13650)) +* Reverts the ability for convenience methods on `MLNStyle` such as `MLNStyle.lightStyleURL`, to use version 11 of the Mapbox Streets style. ([#13650](https://github.com/mapbox/mapbox-gl-native/pull/13650)) ## 4.7.0 - December 18, 2018 @@ -481,85 +486,85 @@ There are no breaking API changes in this release. * Added the `Mapbox-iOS-SDK-stripped` build flavor, featuring fewer debug symbols. Regular framework binaries are no longer stripped of debug symbols and the `Mapbox-iOS-SDK-symbols` build has been retired. ([#13504](https://github.com/mapbox/mapbox-gl-native/pull/13504)) * This SDK’s dynamic framework now has a bundle identifier of `com.mapbox.Mapbox`. ([#12857](https://github.com/mapbox/mapbox-gl-native/pull/12857)) -* `MGLMapView`, `MGLShapeOfflineRegion`, and `MGLTilePyramidOfflineRegion` now default to version 11 of the Mapbox Streets style. Similarly, several class properties of `MGLStyle`, such as `MGLStyle.lightStyleURL`, have been updated to return URLs to new versions of their respective styles. ([#13585](https://github.com/mapbox/mapbox-gl-native/pull/13585)) +* `MLNMapView`, `MLNShapeOfflineRegion`, and `MLNTilePyramidOfflineRegion` now default to version 11 of the Mapbox Streets style. Similarly, several class properties of `MLNStyle`, such as `MLNStyle.lightStyleURL`, have been updated to return URLs to new versions of their respective styles. ([#13585](https://github.com/mapbox/mapbox-gl-native/pull/13585)) ### Styles and rendering * Fixed an issue where the `{prefix}` token in tile URL templates was evaluated incorrectly when requesting a source’s tiles. ([#13429](https://github.com/mapbox/mapbox-gl-native/pull/13429)) -* Added an `-[MGLStyle removeSource:error:]` method that returns a descriptive error if the style fails to remove the source, whereas `-[MGLStyle removeSource:]` fails silently. ([#13399](https://github.com/mapbox/mapbox-gl-native/pull/13399)) -* Added the `MGLFillExtrusionStyleLayer.fillExtrusionHasVerticalGradient` property. ([#13463](https://github.com/mapbox/mapbox-gl-native/pull/13463)) -* Added support for setting `MGLCollisionBehaviorPre4_0` in `NSUserDefaults`. ([#13426](https://github.com/mapbox/mapbox-gl-native/pull/13426)) -* `-[MGLStyle localizeLabelsIntoLocale:]` and `-[NSExpression(MGLAdditions) mgl_expressionLocalizedIntoLocale:]` can automatically localize styles that use version 8 of the Mapbox Streets source. ([#13481](https://github.com/mapbox/mapbox-gl-native/pull/13481)) +* Added an `-[MLNStyle removeSource:error:]` method that returns a descriptive error if the style fails to remove the source, whereas `-[MLNStyle removeSource:]` fails silently. ([#13399](https://github.com/mapbox/mapbox-gl-native/pull/13399)) +* Added the `MLNFillExtrusionStyleLayer.fillExtrusionHasVerticalGradient` property. ([#13463](https://github.com/mapbox/mapbox-gl-native/pull/13463)) +* Added support for setting `MLNCollisionBehaviorPre4_0` in `NSUserDefaults`. ([#13426](https://github.com/mapbox/mapbox-gl-native/pull/13426)) +* `-[MLNStyle localizeLabelsIntoLocale:]` and `-[NSExpression(MLNAdditions) mgl_expressionLocalizedIntoLocale:]` can automatically localize styles that use version 8 of the Mapbox Streets source. ([#13481](https://github.com/mapbox/mapbox-gl-native/pull/13481)) * Fixed symbol flickering during instantaneous transitions. ([#13535](https://github.com/mapbox/mapbox-gl-native/pull/13535)) -* Fixed a crash when specifying `MGLShapeSourceOptionLineDistanceMetrics` when creating an `MGLShapeSource`. ([#13543](https://github.com/mapbox/mapbox-gl-native/pull/13543)) +* Fixed a crash when specifying `MLNShapeSourceOptionLineDistanceMetrics` when creating an `MLNShapeSource`. ([#13543](https://github.com/mapbox/mapbox-gl-native/pull/13543)) ### Map snapshots -* `MGLMapSnapshotter` now respects the `MGLIdeographicFontFamilyName` key in Info.plist, which reduces bandwidth consumption when snapshotting regions that contain Chinese or Japanese characters. ([#13427](https://github.com/mapbox/mapbox-gl-native/pull/13427)) -* Fixed a sporadic crash when using `MGLMapSnapshotter`. ([#13300](https://github.com/mapbox/mapbox-gl-native/pull/13300)) +* `MLNMapSnapshotter` now respects the `MLNIdeographicFontFamilyName` key in Info.plist, which reduces bandwidth consumption when snapshotting regions that contain Chinese or Japanese characters. ([#13427](https://github.com/mapbox/mapbox-gl-native/pull/13427)) +* Fixed a sporadic crash when using `MLNMapSnapshotter`. ([#13300](https://github.com/mapbox/mapbox-gl-native/pull/13300)) ### Other changes -* Modified the behavior of the map view so that programmatic camera transitions can no longer be interrupted by user interaction when `MGLMapView.zoomEnabled`, `MGLMapView.rotateEnabled`, `MGLMapView.scrollEnabled`, and `MGLMapView.pitchEnabled` are set to false. ([#13362](https://github.com/mapbox/mapbox-gl-native/pull/13362)) -* Renamed `-[MGLOfflineStorage putResourceWithUrl:data:modified:expires:etag:mustRevalidate:]` to `-[MGLOfflineStorage preloadData:forURL:modificationDate:expirationDate:eTag:mustRevalidate:]`. ([#13318](https://github.com/mapbox/mapbox-gl-native/pull/13318)) +* Modified the behavior of the map view so that programmatic camera transitions can no longer be interrupted by user interaction when `MLNMapView.zoomEnabled`, `MLNMapView.rotateEnabled`, `MLNMapView.scrollEnabled`, and `MLNMapView.pitchEnabled` are set to false. ([#13362](https://github.com/mapbox/mapbox-gl-native/pull/13362)) +* Renamed `-[MLNOfflineStorage putResourceWithUrl:data:modified:expires:etag:mustRevalidate:]` to `-[MLNOfflineStorage preloadData:forURL:modificationDate:expirationDate:eTag:mustRevalidate:]`. ([#13318](https://github.com/mapbox/mapbox-gl-native/pull/13318)) * Points of interest have clearer, localized VoiceOver hints in styles that use version 8 of the Mapbox Streets source. ([#13525](https://github.com/mapbox/mapbox-gl-native/pull/13525)) -* Added `MGLLoggingConfiguration` and `MGLLoggingBlockHandler` that handle error and fault events produced by the SDK. ([#13235](https://github.com/mapbox/mapbox-gl-native/pull/13235)) +* Added `MLNLoggingConfiguration` and `MLNLoggingBlockHandler` that handle error and fault events produced by the SDK. ([#13235](https://github.com/mapbox/mapbox-gl-native/pull/13235)) * Fixed random crashes during app termination. ([#13367](https://github.com/mapbox/mapbox-gl-native/pull/13367)) ## 4.6.0 - November 7, 2018 ### Styles and rendering -* `MGLSymbolStyleLayer.text` can now be set to rich text with varying fonts and text sizes. ([#12624](https://github.com/mapbox/mapbox-gl-native/pull/12624)) -* Fixed a crash when using the `MGL_LET`, `MGL_MATCH`, `MGL_IF`, or `MGL_FUNCTION` functions without a colon inside an `NSExpression` or `NSPredicate` format string. ([#13189](https://github.com/mapbox/mapbox-gl-native/pull/13189)) -* Fixed a crash setting the `MGLLineStyleLayer.lineGradient` property to an expression containing the `$lineProgress` variable. Added an `NSExpression.lineProgressVariableExpression` class property that returns an expression for the `$lineProgress` variable. ([#13192](https://github.com/mapbox/mapbox-gl-native/pull/13192)) -* Feature querying can now return point features represented by icons that have both the `MGLSymbolStyleLayer.iconRotation` and `MGLSymbolStyleLayer.iconOffset` properties applied. ([#13105](https://github.com/mapbox/mapbox-gl-native/pull/13105)) +* `MLNSymbolStyleLayer.text` can now be set to rich text with varying fonts and text sizes. ([#12624](https://github.com/mapbox/mapbox-gl-native/pull/12624)) +* Fixed a crash when using the `MLN_LET`, `MLN_MATCH`, `MLN_IF`, or `MLN_FUNCTION` functions without a colon inside an `NSExpression` or `NSPredicate` format string. ([#13189](https://github.com/mapbox/mapbox-gl-native/pull/13189)) +* Fixed a crash setting the `MLNLineStyleLayer.lineGradient` property to an expression containing the `$lineProgress` variable. Added an `NSExpression.lineProgressVariableExpression` class property that returns an expression for the `$lineProgress` variable. ([#13192](https://github.com/mapbox/mapbox-gl-native/pull/13192)) +* Feature querying can now return point features represented by icons that have both the `MLNSymbolStyleLayer.iconRotation` and `MLNSymbolStyleLayer.iconOffset` properties applied. ([#13105](https://github.com/mapbox/mapbox-gl-native/pull/13105)) * Fixed an issue where polygons crossing tile boundaries could be improperly clipped. ([#13231](https://github.com/mapbox/mapbox-gl-native/pull/13231)) ### Offline maps -* Network requests by `MGLMapView` are now prioritized over offline pack downloads. ([#13019](https://github.com/mapbox/mapbox-gl-native/pull/13019)) -* Added the `-[MGLOfflineStorage putResourceWithUrl:data:modified:expires:etag:mustRevalidate:]` method to allow pre-warming of the ambient cache. ([#13119](https://github.com/mapbox/mapbox-gl-native/pull/13119)) +* Network requests by `MLNMapView` are now prioritized over offline pack downloads. ([#13019](https://github.com/mapbox/mapbox-gl-native/pull/13019)) +* Added the `-[MLNOfflineStorage putResourceWithUrl:data:modified:expires:etag:mustRevalidate:]` method to allow pre-warming of the ambient cache. ([#13119](https://github.com/mapbox/mapbox-gl-native/pull/13119)) ### Other changes -* Fixed an issue where the map view could not be panned after setting `MGLMapView.visibleCoordinateBounds` to a coordinate bounds that spanned exactly the longitudes −180° and 180°. ([#13006](https://github.com/mapbox/mapbox-gl-native/pull/13006)) +* Fixed an issue where the map view could not be panned after setting `MLNMapView.visibleCoordinateBounds` to a coordinate bounds that spanned exactly the longitudes −180° and 180°. ([#13006](https://github.com/mapbox/mapbox-gl-native/pull/13006)) * Fixed an issue where snapshots had the wrong heading and pitch. ([#13123](https://github.com/mapbox/mapbox-gl-native/pull/13123)) -* Fixed an issue where `-[MGLMapViewDelegate mapView:shouldChangeFromCamera:toCamera:]` was called with an incorrectly rotated `newCamera` when the user rotated the map. ([#13123](https://github.com/mapbox/mapbox-gl-native/pull/13123)) +* Fixed an issue where `-[MLNMapViewDelegate mapView:shouldChangeFromCamera:toCamera:]` was called with an incorrectly rotated `newCamera` when the user rotated the map. ([#13123](https://github.com/mapbox/mapbox-gl-native/pull/13123)) ## 4.5.0 - October 10, 2018 ### Styles and rendering * Added support for 120 frames per second on capable devices. ([#12979](https://github.com/mapbox/mapbox-gl-native/pull/12979)) -* Added an `MGLSymbolStyleLayer.symbolZOrder` property for forcing point features in a symbol layer to be layered in the same order that they are specified in the layer’s associated source. ([#12783](https://github.com/mapbox/mapbox-gl-native/pull/12783)) -* Fixed a crash when the `MGLBackgroundStyleLayer.backgroundPattern`, `MGLFillExtrusionStyleLayer.fillExtrusionPattern`, `MGLFillStyleLayer.fillPattern`, or `MGLLineStyleLayer.linePattern` property evaluates to `nil` for a particular feature. ([#12896](https://github.com/mapbox/mapbox-gl-native/pull/12896)) +* Added an `MLNSymbolStyleLayer.symbolZOrder` property for forcing point features in a symbol layer to be layered in the same order that they are specified in the layer’s associated source. ([#12783](https://github.com/mapbox/mapbox-gl-native/pull/12783)) +* Fixed a crash when the `MLNBackgroundStyleLayer.backgroundPattern`, `MLNFillExtrusionStyleLayer.fillExtrusionPattern`, `MLNFillStyleLayer.fillPattern`, or `MLNLineStyleLayer.linePattern` property evaluates to `nil` for a particular feature. ([#12896](https://github.com/mapbox/mapbox-gl-native/pull/12896)) * Fixed an issue with view annotations (including the user location annotation) and the GL map lagging relative to each other. ([#12895](https://github.com/mapbox/mapbox-gl-native/pull/12895)) -* Fixed an issue where features in `MGLFillStyleLayer` and `MGLLineStyleLayer` would occasionally flicker when zooming in and out. ([#12982](https://github.com/mapbox/mapbox-gl-native/pull/12982)) +* Fixed an issue where features in `MLNFillStyleLayer` and `MLNLineStyleLayer` would occasionally flicker when zooming in and out. ([#12982](https://github.com/mapbox/mapbox-gl-native/pull/12982)) * Fixed a crash when casting a `UIColor` to a `UIColor` inside an `NSExpression`. ([#12864](https://github.com/mapbox/mapbox-gl-native/pull/12864)) * `NIL` cast to an `NSNumber` now evaluates to 0 inside an `NSExpression`. ([#12864](https://github.com/mapbox/mapbox-gl-native/pull/12864)) * Fixed a crash when applying the `to-array` operator to an empty array inside a JSON expression. ([#12864](https://github.com/mapbox/mapbox-gl-native/pull/12864)) -* Added the `MGLCollisionBehaviorPre4_0` Info.plist key to restore the collision detection behavior in version 3.7 of the SDK. ([#12941](https://github.com/mapbox/mapbox-gl-native/pull/12941)) +* Added the `MLNCollisionBehaviorPre4_0` Info.plist key to restore the collision detection behavior in version 3.7 of the SDK. ([#12941](https://github.com/mapbox/mapbox-gl-native/pull/12941)) ### User location -* Added `-[MGLMapViewDelegate mapViewUserLocationAnchorPoint:]` to customize the position of the user location annotation. ([#12907](https://github.com/mapbox/mapbox-gl-native/pull/12907)) -* Marked `MGLMapView.userLocationVerticalAlignment` as deprecated. Use `-[MGLMapViewDelegate mapViewUserLocationAnchorPoint:]` instead. ([#12907](https://github.com/mapbox/mapbox-gl-native/pull/12907)) -* Added the `-[MGLMapView updateUserLocationAnnotationView]` and `-[MGLMapView updateUserLocationAnnotationViewAnimatedWithDuration:]` methods to update the position of the user location annotation between location updates. ([#12907](https://github.com/mapbox/mapbox-gl-native/pull/12907)) +* Added `-[MLNMapViewDelegate mapViewUserLocationAnchorPoint:]` to customize the position of the user location annotation. ([#12907](https://github.com/mapbox/mapbox-gl-native/pull/12907)) +* Marked `MLNMapView.userLocationVerticalAlignment` as deprecated. Use `-[MLNMapViewDelegate mapViewUserLocationAnchorPoint:]` instead. ([#12907](https://github.com/mapbox/mapbox-gl-native/pull/12907)) +* Added the `-[MLNMapView updateUserLocationAnnotationView]` and `-[MLNMapView updateUserLocationAnnotationViewAnimatedWithDuration:]` methods to update the position of the user location annotation between location updates. ([#12907](https://github.com/mapbox/mapbox-gl-native/pull/12907)) * Fixed an issue where the user location annotation was positioned incorrectly when the map view had a left or right content inset. ([#12907](https://github.com/mapbox/mapbox-gl-native/pull/12907)) ### Offline maps -* Added `-[MGLOfflineStorage addContentsOfFile:withCompletionHandler:]` and `-[MGLOfflineStorage addContentsOfURL:withCompletionHandler:]` methods to add pregenerated offline packs to offline storage. ([#12791](https://github.com/mapbox/mapbox-gl-native/pull/12791)) +* Added `-[MLNOfflineStorage addContentsOfFile:withCompletionHandler:]` and `-[MLNOfflineStorage addContentsOfURL:withCompletionHandler:]` methods to add pregenerated offline packs to offline storage. ([#12791](https://github.com/mapbox/mapbox-gl-native/pull/12791)) * Fixed an issue where some tiles were rendered incorrectly when the device was unable to connect to the Internet. ([#12931](https://github.com/mapbox/mapbox-gl-native/pull/12931)) ### Other changes -* Added `MGLAltitudeForZoomLevel()` and `MGLZoomLevelForAltitude()` methods for converting between zoom levels used by `MGLMapView` and altitudes used by `MGLMapCamera`. ([#12986](https://github.com/mapbox/mapbox-gl-native/pull/12986)) -* Deprecated the `+[MGLMapCamera cameraLookingAtCenterCoordinate:fromDistance:pitch:heading:]` method in favor of `+[MGLMapCamera cameraLookingAtCenterCoordinate:altitude:pitch:heading:]` and `+[MGLMapCamera cameraLookingAtCenterCoordinate:acrossDistance:pitch:heading:]`. ([#12966](https://github.com/mapbox/mapbox-gl-native/pull/12966)) -* Fixed an issue where `+[MGLMapCamera cameraLookingAtCenterCoordinate:fromEyeCoordinate:eyeAltitude:]` created a camera looking from the wrong eye coordinate. ([#12966](https://github.com/mapbox/mapbox-gl-native/pull/12966)) -* Added an `MGLMapCamera.viewingDistance` property based on the existing `MGLMapCamera.altitude` property. ([#12966](https://github.com/mapbox/mapbox-gl-native/pull/12966)) -* Fixed an issue where `-[MGLMapSnapshotter startWithQueue:completionHandler:]` failed to call its completion handler in some cases. ([#12355](https://github.com/mapbox/mapbox-gl-native/pull/12355)) +* Added `MLNAltitudeForZoomLevel()` and `MLNZoomLevelForAltitude()` methods for converting between zoom levels used by `MLNMapView` and altitudes used by `MLNMapCamera`. ([#12986](https://github.com/mapbox/mapbox-gl-native/pull/12986)) +* Deprecated the `+[MLNMapCamera cameraLookingAtCenterCoordinate:fromDistance:pitch:heading:]` method in favor of `+[MLNMapCamera cameraLookingAtCenterCoordinate:altitude:pitch:heading:]` and `+[MLNMapCamera cameraLookingAtCenterCoordinate:acrossDistance:pitch:heading:]`. ([#12966](https://github.com/mapbox/mapbox-gl-native/pull/12966)) +* Fixed an issue where `+[MLNMapCamera cameraLookingAtCenterCoordinate:fromEyeCoordinate:eyeAltitude:]` created a camera looking from the wrong eye coordinate. ([#12966](https://github.com/mapbox/mapbox-gl-native/pull/12966)) +* Added an `MLNMapCamera.viewingDistance` property based on the existing `MLNMapCamera.altitude` property. ([#12966](https://github.com/mapbox/mapbox-gl-native/pull/12966)) +* Fixed an issue where `-[MLNMapSnapshotter startWithQueue:completionHandler:]` failed to call its completion handler in some cases. ([#12355](https://github.com/mapbox/mapbox-gl-native/pull/12355)) * Fixed an issue where symbols from the events library could be duplicated when the maps SDK was used in conjunction with another Mapbox framework. ([#13008](https://github.com/mapbox/mapbox-gl-native/pull/13008)) ## 4.4.1 - September 13, 2018 @@ -571,48 +576,48 @@ There are no breaking API changes in this release. ### Styles and rendering -* When a symbol in an `MGLSymbolStyleLayer` has both an icon and text, both are shown or hidden together based on available space. ([#12521](https://github.com/mapbox/mapbox-gl-native/pull/12521)) -* Invalid values of `MGLSymbolStyleLayer.textFontNames` are treated as warnings instead of errors. ([#12414](https://github.com/mapbox/mapbox-gl-native/pull/12414)) -* Added an `MGLLineStyleLayer.lineGradient` property that can be used to define a gradient with which to color a line feature. ([#12575](https://github.com/mapbox/mapbox-gl-native/pull/12575)) -* The `MGLLineStyleLayer.linePattern`, `MGLFillStyleLayer.fillPattern`, and `MGLFillExtrusionStyleLayer.fillExtrusionPattern` properties can now be set to expressions that refer to feature attributes. ([#12284](https://github.com/mapbox/mapbox-gl-native/pull/12284)) +* When a symbol in an `MLNSymbolStyleLayer` has both an icon and text, both are shown or hidden together based on available space. ([#12521](https://github.com/mapbox/mapbox-gl-native/pull/12521)) +* Invalid values of `MLNSymbolStyleLayer.textFontNames` are treated as warnings instead of errors. ([#12414](https://github.com/mapbox/mapbox-gl-native/pull/12414)) +* Added an `MLNLineStyleLayer.lineGradient` property that can be used to define a gradient with which to color a line feature. ([#12575](https://github.com/mapbox/mapbox-gl-native/pull/12575)) +* The `MLNLineStyleLayer.linePattern`, `MLNFillStyleLayer.fillPattern`, and `MLNFillExtrusionStyleLayer.fillExtrusionPattern` properties can now be set to expressions that refer to feature attributes. ([#12284](https://github.com/mapbox/mapbox-gl-native/pull/12284)) * Reduced the amount of memory consumed by font data after changing the style. ([#12414](https://github.com/mapbox/mapbox-gl-native/pull/12414)) -* `-[MGLShapeSource initWithIdentifier:shape:options:]` warns about possible attribute loss when passing in an `MGLShapeCollection` object. ([#12625](https://github.com/mapbox/mapbox-gl-native/pull/12625)) -* Added an `MGLShapeSourceOptionLineDistanceMetrics` option that enables or disables calculating line distance metrics. ([#12604](https://github.com/mapbox/mapbox-gl-native/pull/12604)) +* `-[MLNShapeSource initWithIdentifier:shape:options:]` warns about possible attribute loss when passing in an `MLNShapeCollection` object. ([#12625](https://github.com/mapbox/mapbox-gl-native/pull/12625)) +* Added an `MLNShapeSourceOptionLineDistanceMetrics` option that enables or disables calculating line distance metrics. ([#12604](https://github.com/mapbox/mapbox-gl-native/pull/12604)) * Fixed an issue where the `cubic-bezier` curve type for `mgl_interpolate:withCurveType:parameters:stops:` expressions was misinterpreted for some style layer properties. ([#12826](https://github.com/mapbox/mapbox-gl-native/pull/12826)) -* Fixed an issue that could cause symbols to fade in during pan operations instead of always showing when using `MGLSymbolStyleLayer.iconAllowsOverlap` or `MGLSymbolStyleLayer.textAllowsOverlap` properties. ([#12698](https://github.com/mapbox/mapbox-gl-native/pull/12698)) +* Fixed an issue that could cause symbols to fade in during pan operations instead of always showing when using `MLNSymbolStyleLayer.iconAllowsOverlap` or `MLNSymbolStyleLayer.textAllowsOverlap` properties. ([#12698](https://github.com/mapbox/mapbox-gl-native/pull/12698)) ### Offline maps -* Added the `MGLShapeOfflineRegion` class for creating an offline pack that covers an arbitrary shape. ([#11447](https://github.com/mapbox/mapbox-gl-native/pull/11447)) +* Added the `MLNShapeOfflineRegion` class for creating an offline pack that covers an arbitrary shape. ([#11447](https://github.com/mapbox/mapbox-gl-native/pull/11447)) * Fixed crashes when offline storage encountered certain SQLite errors. ([#12224](https://github.com/mapbox/mapbox-gl-native/pull/12224)) ### Other changes -* The predefined values of `MGLMapView.decelerationRate` are now typed as `MGLMapViewDecelerationRate`s for improved bridging to Swift. ([#12584](https://github.com/mapbox/mapbox-gl-native/pull/12584)) -* Added an `-[MGLMapViewDelegate mapView:shapeAnnotationIsEnabled:]` method to specify whether an annotation is selectable. ([#12352](https://github.com/mapbox/mapbox-gl-native/pull/12352)) -* The `-[MGLMapView visibleFeaturesAtPoint:]` method can now return features near tile boundaries at high zoom levels. ([#12570](https://github.com/mapbox/mapbox-gl-native/pull/12570)) +* The predefined values of `MLNMapView.decelerationRate` are now typed as `MLNMapViewDecelerationRate`s for improved bridging to Swift. ([#12584](https://github.com/mapbox/mapbox-gl-native/pull/12584)) +* Added an `-[MLNMapViewDelegate mapView:shapeAnnotationIsEnabled:]` method to specify whether an annotation is selectable. ([#12352](https://github.com/mapbox/mapbox-gl-native/pull/12352)) +* The `-[MLNMapView visibleFeaturesAtPoint:]` method can now return features near tile boundaries at high zoom levels. ([#12570](https://github.com/mapbox/mapbox-gl-native/pull/12570)) * Fixed inconsistencies in exception naming. ([#12583](https://github.com/mapbox/mapbox-gl-native/issues/12583)) -* Fixed an issue where `-[MGLMapView convertCoordinateBounds:toRectToView:]` would return an empty CGRect if the bounds crossed the antimeridian. ([#12758](https://github.com/mapbox/mapbox-gl-native/pull/12758)) +* Fixed an issue where `-[MLNMapView convertCoordinateBounds:toRectToView:]` would return an empty CGRect if the bounds crossed the antimeridian. ([#12758](https://github.com/mapbox/mapbox-gl-native/pull/12758)) ## 4.3.0 - August 15, 2018 ### Styles and rendering -* Added an `MGLMapView.preferredFramesPerSecond` property that controls the rate at which the map view is rendered. The default rate now adapts to device capabilities to provide a smoother experience. ([#12501](https://github.com/mapbox/mapbox-gl-native/issues/12501)) -* Token string syntax (`"{token}"`) in `MGLSymbolStyleLayer` `text` and `iconImageName` properties is now correctly converted to the appropriate `NSExpression` equivalent. ([#11659](https://github.com/mapbox/mapbox-gl-native/issues/11659)) +* Added an `MLNMapView.preferredFramesPerSecond` property that controls the rate at which the map view is rendered. The default rate now adapts to device capabilities to provide a smoother experience. ([#12501](https://github.com/mapbox/mapbox-gl-native/issues/12501)) +* Token string syntax (`"{token}"`) in `MLNSymbolStyleLayer` `text` and `iconImageName` properties is now correctly converted to the appropriate `NSExpression` equivalent. ([#11659](https://github.com/mapbox/mapbox-gl-native/issues/11659)) * Fixed a crash when switching between two styles having layers with the same identifier but different layer types. ([#12432](https://github.com/mapbox/mapbox-gl-native/issues/12432)) -* Added a new option to `MGLSymbolPlacement`, `MGLSymbolPlacementLineCenter`, that places the label relative to the center of the geometry. ([#12337](https://github.com/mapbox/mapbox-gl-native/pull/12337)) +* Added a new option to `MLNSymbolPlacement`, `MLNSymbolPlacementLineCenter`, that places the label relative to the center of the geometry. ([#12337](https://github.com/mapbox/mapbox-gl-native/pull/12337)) ### User location -* Added an `MGLMapView.locationManager` property and `MGLLocationManager` protocol for tracking user location using a custom alternative to `CLLocationManager`. ([#12013](https://github.com/mapbox/mapbox-gl-native/pull/12013)) +* Added an `MLNMapView.locationManager` property and `MLNLocationManager` protocol for tracking user location using a custom alternative to `CLLocationManager`. ([#12013](https://github.com/mapbox/mapbox-gl-native/pull/12013)) * Fixed a crash that occurred when `MMELocationManager` was deallocated and the delegate was reporting updates. ([#12542](https://github.com/mapbox/mapbox-gl-native/pull/12542)) ### Other changes * Fixed a crash that occurred when the user started a gesture before the drift animation for a previous gesture was complete. ([#12148](https://github.com/mapbox/mapbox-gl-native/pull/12148)) -* Fixed an issue where the symbols for `MGLMapPointForCoordinate` could not be found. ([#12445](https://github.com/mapbox/mapbox-gl-native/issues/12445)) -* Fixed an issue causing country and ocean labels to disappear after calling `-[MGLStyle localizeLabelsIntoLocale:]` when the system language is set to Simplified Chinese. ([#12164](https://github.com/mapbox/mapbox-gl-native/issues/12164)) +* Fixed an issue where the symbols for `MLNMapPointForCoordinate` could not be found. ([#12445](https://github.com/mapbox/mapbox-gl-native/issues/12445)) +* Fixed an issue causing country and ocean labels to disappear after calling `-[MLNStyle localizeLabelsIntoLocale:]` when the system language is set to Simplified Chinese. ([#12164](https://github.com/mapbox/mapbox-gl-native/issues/12164)) * Closed a security vulnerability introduced in 4.1.0 that would potentially allow the owner of a style to compromise apps loading that style. ([#12571](https://github.com/mapbox/mapbox-gl-native/pull/12571)) * Reduced binary size and improved performance by enabling LTO. ([#12502](https://github.com/mapbox/mapbox-gl-native/pull/12502)) @@ -624,7 +629,7 @@ There are no breaking API changes in this release. ### Other changes -* Added an `MGLMapView.locationManager` property and `MGLLocationManager` protocol for tracking user location using a custom alternative to `CLLocationManager`. ([#12013](https://github.com/mapbox/mapbox-gl-native/pull/12013)) +* Added an `MLNMapView.locationManager` property and `MLNLocationManager` protocol for tracking user location using a custom alternative to `CLLocationManager`. ([#12013](https://github.com/mapbox/mapbox-gl-native/pull/12013)) ## 4.2.0 - July 18, 2018 @@ -634,12 +639,12 @@ There are no breaking API changes in this release. ### Styles and rendering -* Added an `MGLRasterStyleLayer.rasterResamplingMode` property for configuring how raster style layers are overscaled. ([#12176](https://github.com/mapbox/mapbox-gl-native/pull/12176)) -* `-[MGLStyle localizeLabelsIntoLocale:]` and `-[NSExpression mgl_expressionLocalizedIntoLocale:]` can automatically localize labels into Japanese or Korean based on the system’s language settings. ([#12286](https://github.com/mapbox/mapbox-gl-native/pull/12286)) +* Added an `MLNRasterStyleLayer.rasterResamplingMode` property for configuring how raster style layers are overscaled. ([#12176](https://github.com/mapbox/mapbox-gl-native/pull/12176)) +* `-[MLNStyle localizeLabelsIntoLocale:]` and `-[NSExpression mgl_expressionLocalizedIntoLocale:]` can automatically localize labels into Japanese or Korean based on the system’s language settings. ([#12286](https://github.com/mapbox/mapbox-gl-native/pull/12286)) * The `c` and `d` options are supported within comparison predicates for case and diacritic insensitivity, respectively. ([#12329](https://github.com/mapbox/mapbox-gl-native/pull/12329)) * Added the `collator` and `resolved-locale` expression operators to more precisely compare strings in style JSON. A subset of this functionality is available through predicate options when creating an `NSPredicate`. ([#11869](https://github.com/mapbox/mapbox-gl-native/pull/11869)) * Fixed a crash when trying to parse expressions containing legacy filters. ([#12263](https://github.com/mapbox/mapbox-gl-native/pull/12263)) -* Fixed a crash that occurred when creating an `MGL_MATCH` expression using non-expressions as arguments. ([#12332](https://github.com/mapbox/mapbox-gl-native/pull/12332)) +* Fixed a crash that occurred when creating an `MLN_MATCH` expression using non-expressions as arguments. ([#12332](https://github.com/mapbox/mapbox-gl-native/pull/12332)) ### Networking and storage @@ -647,8 +652,8 @@ There are no breaking API changes in this release. ### Other changes -* Added `-[MGLMapView camera:fittingShape:edgePadding:]` and `-[MGLMapView camera:fittingCoordinateBounds:edgePadding:]` allowing you specify the pitch and direction for the calculated camera. ([#12213](https://github.com/mapbox/mapbox-gl-native/pull/12213)) -* Added `-[MGLMapSnapshot coordinateForPoint:]` that returns a map coordinate for a specified snapshot image point. ([#12221](https://github.com/mapbox/mapbox-gl-native/pull/12221)) +* Added `-[MLNMapView camera:fittingShape:edgePadding:]` and `-[MLNMapView camera:fittingCoordinateBounds:edgePadding:]` allowing you specify the pitch and direction for the calculated camera. ([#12213](https://github.com/mapbox/mapbox-gl-native/pull/12213)) +* Added `-[MLNMapSnapshot coordinateForPoint:]` that returns a map coordinate for a specified snapshot image point. ([#12221](https://github.com/mapbox/mapbox-gl-native/pull/12221)) * Reduced memory usage when collision debug mode is disabled. ([#12294](https://github.com/mapbox/mapbox-gl-native/issues/12294)) * Fixed a bug with annotation view touch handling when a non-zero `centerOffset` is specified. ([#12234](https://github.com/mapbox/mapbox-gl-native/pull/12234)) @@ -658,7 +663,7 @@ There are no breaking API changes in this release. ## 4.0.3 - June 22, 2018 -* Fixed a crash in `-[MGLStyle localizeLabelsIntoLocale:]` on iOS 9._x_. ([#12123](https://github.com/mapbox/mapbox-gl-native/pull/12123)) +* Fixed a crash in `-[MLNStyle localizeLabelsIntoLocale:]` on iOS 9._x_. ([#12123](https://github.com/mapbox/mapbox-gl-native/pull/12123)) * Improved compatibility with Mapbox China APIs. ([#11845](https://github.com/mapbox/mapbox-gl-native/pull/11845)) ## 4.1.0 - June 20, 2018 @@ -671,23 +676,23 @@ There are no breaking API changes in this release. ### Styles and rendering -* Added support for aggregate expressions as input values to `MGL_MATCH` expressions. ([#11866](https://github.com/mapbox/mapbox-gl-native/pull/11866)) +* Added support for aggregate expressions as input values to `MLN_MATCH` expressions. ([#11866](https://github.com/mapbox/mapbox-gl-native/pull/11866)) * Fixed a crash that occurred when style JSON contained an invalid filter containing an expression. ([#12065](https://github.com/mapbox/mapbox-gl-native/pull/12065)) -* Fixed a crash in `-[MGLStyle localizeLabelsIntoLocale:]` on iOS 9._x_. ([#12123](https://github.com/mapbox/mapbox-gl-native/pull/12123)) +* Fixed a crash in `-[MLNStyle localizeLabelsIntoLocale:]` on iOS 9._x_. ([#12123](https://github.com/mapbox/mapbox-gl-native/pull/12123)) * Unknown tokens in URLs are now preserved, rather than replaced with an empty string. ([#11787](https://github.com/mapbox/mapbox-gl-native/issues/11787)) * Fixed an issue preventing nested key path expressions from accessing the correct feature attributes. ([#11959](https://github.com/mapbox/mapbox-gl-native/pull/11959)) -* Fixed an issue where `MGLSymbolStyleLayer` flickered when straddling the antimeridian. ([#11938](https://github.com/mapbox/mapbox-gl-native/pull/11938)) -* Fixed an issue where certain `MGLLineStyleLayer.lineDashPattern` values produced unexpected rendering. ([#12114](https://github.com/mapbox/mapbox-gl-native/pull/12114)) +* Fixed an issue where `MLNSymbolStyleLayer` flickered when straddling the antimeridian. ([#11938](https://github.com/mapbox/mapbox-gl-native/pull/11938)) +* Fixed an issue where certain `MLNLineStyleLayer.lineDashPattern` values produced unexpected rendering. ([#12114](https://github.com/mapbox/mapbox-gl-native/pull/12114)) ### Other changes * Adjusted when and how the camera transition update and finish callbacks are called, fixing recursion bugs. ([#11614](https://github.com/mapbox/mapbox-gl-native/pull/11614)) -* Fixed an issue where `-[MGLMapViewDelegate mapView:tapOnCalloutForAnnotation:]` was called when the user tapped on transparent areas beneath the standard callout view. ([#11939](https://github.com/mapbox/mapbox-gl-native/pull/11939)) -* Improved `MGLMapView`’s performance when the scale bar is shown. ([#11921](https://github.com/mapbox/mapbox-gl-native/pull/11921)) -* Fixed a crash that could occur when reusing `MGLMapSnapshotter` or using multiple snapshotters at the same time. ([#11831](https://github.com/mapbox/mapbox-gl-native/pull/11831)) -* Fixed an issue where an empty `MGLFeature` array caused high CPU utilization. ([#11985](https://github.com/mapbox/mapbox-gl-native/pull/11985)) +* Fixed an issue where `-[MLNMapViewDelegate mapView:tapOnCalloutForAnnotation:]` was called when the user tapped on transparent areas beneath the standard callout view. ([#11939](https://github.com/mapbox/mapbox-gl-native/pull/11939)) +* Improved `MLNMapView`’s performance when the scale bar is shown. ([#11921](https://github.com/mapbox/mapbox-gl-native/pull/11921)) +* Fixed a crash that could occur when reusing `MLNMapSnapshotter` or using multiple snapshotters at the same time. ([#11831](https://github.com/mapbox/mapbox-gl-native/pull/11831)) +* Fixed an issue where an empty `MLNFeature` array caused high CPU utilization. ([#11985](https://github.com/mapbox/mapbox-gl-native/pull/11985)) * Improved offline download performance. ([#11284](https://github.com/mapbox/mapbox-gl-native/pull/11284)) -* Fixed an issue that caused `-[MGLMapView visibleFeaturesAtPoint:]` to return an empty array when adding or removing features. ([#12076](https://github.com/mapbox/mapbox-gl-native/pull/12076)) +* Fixed an issue that caused `-[MLNMapView visibleFeaturesAtPoint:]` to return an empty array when adding or removing features. ([#12076](https://github.com/mapbox/mapbox-gl-native/pull/12076)) * Improved application launch performance. ([#11784](https://github.com/mapbox/mapbox-gl-native/pull/11784)) ## 4.0.2 - May 29, 2018 @@ -705,22 +710,22 @@ There are no breaking API changes in this release. ### Style layers * Deprecated `+[NSExpression featurePropertiesVariableExpression]`; use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748)) -* Added an `-[NSPredicate(MGLAdditions) predicateWithMGLJSONObject:]` method and `NSPredicate.mgl_jsonExpressionObject` property. ([#11810](https://github.com/mapbox/mapbox-gl-native/pull/11810)) +* Added an `-[NSPredicate(MLNAdditions) predicateWithMLNJSONObject:]` method and `NSPredicate.mgl_jsonExpressionObject` property. ([#11810](https://github.com/mapbox/mapbox-gl-native/pull/11810)) * Added `FIRST`, `LAST`, and `SIZE` symbolic array subscripting support to expressions. ([#11770](https://github.com/mapbox/mapbox-gl-native/pull/11770)) * Inside an expression, casting `nil` to a string turns it into the empty string instead of the string `"null"`. ([#11904](https://github.com/mapbox/mapbox-gl-native/pull/11904)) -* Fixed an issue where certain colors were being misrepresented in `NSExpression` obtained from `MGLStyleLayer` getters. ([#11725](https://github.com/mapbox/mapbox-gl-native/pull/11725)) +* Fixed an issue where certain colors were being misrepresented in `NSExpression` obtained from `MLNStyleLayer` getters. ([#11725](https://github.com/mapbox/mapbox-gl-native/pull/11725)) ### Annotations * Fixed an issue where selecting an onscreen annotation could move the map unintentionally. ([#11731](https://github.com/mapbox/mapbox-gl-native/pull/11731)) * Fixed an issue where annotation views could become distorted if `rotatesToMatchCamera` was enabled. ([#11817](https://github.com/mapbox/mapbox-gl-native/pull/11817)) -* Fixed `MGLAnnotationView.rotatesToMatchCamera` overriding other transforms that might be applied to annotation views that had this property enabled. ([#11842](https://github.com/mapbox/mapbox-gl-native/pull/11842)) -* Fixed an issue where an `MGLOverlay` object straddling the antimeridian had an empty `MGLOverlay.overlayBounds` value. ([#11783](https://github.com/mapbox/mapbox-gl-native/pull/11783)) +* Fixed `MLNAnnotationView.rotatesToMatchCamera` overriding other transforms that might be applied to annotation views that had this property enabled. ([#11842](https://github.com/mapbox/mapbox-gl-native/pull/11842)) +* Fixed an issue where an `MLNOverlay` object straddling the antimeridian had an empty `MLNOverlay.overlayBounds` value. ([#11783](https://github.com/mapbox/mapbox-gl-native/pull/11783)) ### Other changes -* If English is the first language listed in the user’s Preferred Languages setting, `-[MGLStyle localizeLabelsIntoLocale:]` no longer prioritizes other languages over English. ([#11907](https://github.com/mapbox/mapbox-gl-native/pull/11907)) -* Fixed an issue where `-[MGLMapView metersPerPixelAtLatitude:]` was removed, but not marked as unavailable. ([#11765](https://github.com/mapbox/mapbox-gl-native/pull/11765)) +* If English is the first language listed in the user’s Preferred Languages setting, `-[MLNStyle localizeLabelsIntoLocale:]` no longer prioritizes other languages over English. ([#11907](https://github.com/mapbox/mapbox-gl-native/pull/11907)) +* Fixed an issue where `-[MLNMapView metersPerPixelAtLatitude:]` was removed, but not marked as unavailable. ([#11765](https://github.com/mapbox/mapbox-gl-native/pull/11765)) * Reduced per-frame render CPU time. ([#11811](https://github.com/mapbox/mapbox-gl-native/issues/11811)) ## 3.7.8 - May 7, 2018 @@ -729,7 +734,7 @@ There are no breaking API changes in this release. ## 3.7.7 - May 3, 2018 -* Fixed a crash when removing an `MGLOfflinePack`. ([#11821](https://github.com/mapbox/mapbox-gl-native/issues/11821)) +* Fixed a crash when removing an `MLNOfflinePack`. ([#11821](https://github.com/mapbox/mapbox-gl-native/issues/11821)) ## 4.0.0 - April 19, 2018 @@ -745,26 +750,26 @@ The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iO ### Style layers -* The layout and paint properties on subclasses of `MGLStyleLayer` are now of type `NSExpression` instead of `MGLStyleValue`. A new “Predicates and Expressions” guide provides an overview of the supported operators, which include arithmetic and conditional operators. ([#10726](https://github.com/mapbox/mapbox-gl-native/pull/10726)) -* A style can now display a heatmap layer that visualizes a point data distribution. You can customize the appearance at runtime using the `MGLHeatmapStyleLayer` class. ([#11046](https://github.com/mapbox/mapbox-gl-native/pull/11046)) -* A style can now display a smooth hillshading layer and customize its appearance at runtime using the `MGLHillshadeStyleLayer` class. Hillshading is based on a rasterized digital elevation model supplied by the `MGLRasterDEMSource` class. ([#10642](https://github.com/mapbox/mapbox-gl-native/pull/10642)) -* You can now set the `MGLVectorStyleLayer.predicate` property to a predicate that contains arithmetic and calls to built-in `NSExpression` functions. You may need to cast a feature attribute key to `NSString` or `NSNumber` before comparing it to a string or number. ([#11587](https://github.com/mapbox/mapbox-gl-native/pull/11587)) -* Replaced the `MGLStyle.localizesLabels` property with an `-[MGLStyle localizeLabelsIntoLocale:]` method that allows you to specify the language to localize into. Also added an `-[NSExpression(MGLAdditions) mgl_expressionLocalizedIntoLocale:]` method for localizing an individual value used with `MGLSymbolStyleLayer.text`. ([#11651](https://github.com/mapbox/mapbox-gl-native/pull/11651)) -* The `MGLSymbolStyleLayer.textFontNames` property can now depend on a feature’s attributes. ([#10850](https://github.com/mapbox/mapbox-gl-native/pull/10850)) -* Changes to the `MGLStyleLayer.minimumZoomLevel` and `MGLStyleLayer.maximumZoomLevel` properties take effect immediately. ([#11399](https://github.com/mapbox/mapbox-gl-native/pull/11399)) +* The layout and paint properties on subclasses of `MLNStyleLayer` are now of type `NSExpression` instead of `MLNStyleValue`. A new “Predicates and Expressions” guide provides an overview of the supported operators, which include arithmetic and conditional operators. ([#10726](https://github.com/mapbox/mapbox-gl-native/pull/10726)) +* A style can now display a heatmap layer that visualizes a point data distribution. You can customize the appearance at runtime using the `MLNHeatmapStyleLayer` class. ([#11046](https://github.com/mapbox/mapbox-gl-native/pull/11046)) +* A style can now display a smooth hillshading layer and customize its appearance at runtime using the `MLNHillshadeStyleLayer` class. Hillshading is based on a rasterized digital elevation model supplied by the `MLNRasterDEMSource` class. ([#10642](https://github.com/mapbox/mapbox-gl-native/pull/10642)) +* You can now set the `MLNVectorStyleLayer.predicate` property to a predicate that contains arithmetic and calls to built-in `NSExpression` functions. You may need to cast a feature attribute key to `NSString` or `NSNumber` before comparing it to a string or number. ([#11587](https://github.com/mapbox/mapbox-gl-native/pull/11587)) +* Replaced the `MLNStyle.localizesLabels` property with an `-[MLNStyle localizeLabelsIntoLocale:]` method that allows you to specify the language to localize into. Also added an `-[NSExpression(MLNAdditions) mgl_expressionLocalizedIntoLocale:]` method for localizing an individual value used with `MLNSymbolStyleLayer.text`. ([#11651](https://github.com/mapbox/mapbox-gl-native/pull/11651)) +* The `MLNSymbolStyleLayer.textFontNames` property can now depend on a feature’s attributes. ([#10850](https://github.com/mapbox/mapbox-gl-native/pull/10850)) +* Changes to the `MLNStyleLayer.minimumZoomLevel` and `MLNStyleLayer.maximumZoomLevel` properties take effect immediately. ([#11399](https://github.com/mapbox/mapbox-gl-native/pull/11399)) ### Content sources -* Renamed `MGLRasterSource` to `MGLRasterTileSource` and `MGLVectorSource` to `MGLVectorTileSource`. ([#11568](https://github.com/mapbox/mapbox-gl-native/pull/11568)) -* Added an `MGLComputedShapeSource` class that allows applications to supply vector data to a style layer on a per-tile basis. ([#9983](https://github.com/mapbox/mapbox-gl-native/pull/9983)) -* Properties such as `MGLSymbolStyleLayer.iconAllowsOverlap` and `MGLSymbolStyleLayer.iconIgnoresPlacement` now account for symbols in other sources. ([#10436](https://github.com/mapbox/mapbox-gl-native/pull/10436)) +* Renamed `MLNRasterSource` to `MLNRasterTileSource` and `MLNVectorSource` to `MLNVectorTileSource`. ([#11568](https://github.com/mapbox/mapbox-gl-native/pull/11568)) +* Added an `MLNComputedShapeSource` class that allows applications to supply vector data to a style layer on a per-tile basis. ([#9983](https://github.com/mapbox/mapbox-gl-native/pull/9983)) +* Properties such as `MLNSymbolStyleLayer.iconAllowsOverlap` and `MLNSymbolStyleLayer.iconIgnoresPlacement` now account for symbols in other sources. ([#10436](https://github.com/mapbox/mapbox-gl-native/pull/10436)) ### Map rendering -* Improved the reliability of collision detection between symbols near the edges of tiles, as well as between symbols when the map is tilted. It is no longer necessary to enable `MGLSymbolStyleLayer.symbolAvoidsEdges` to prevent symbols in adjacent tiles from overlapping with each other. ([#10436](https://github.com/mapbox/mapbox-gl-native/pull/10436)) +* Improved the reliability of collision detection between symbols near the edges of tiles, as well as between symbols when the map is tilted. It is no longer necessary to enable `MLNSymbolStyleLayer.symbolAvoidsEdges` to prevent symbols in adjacent tiles from overlapping with each other. ([#10436](https://github.com/mapbox/mapbox-gl-native/pull/10436)) * Symbols can fade in and out as the map pans, rotates, or tilts. ([#10436](https://github.com/mapbox/mapbox-gl-native/pull/10436)) -* Fixed an issue preventing a dynamically-added `MGLRasterStyleLayer` from drawing until the map pans. ([#10270](https://github.com/mapbox/mapbox-gl-native/pull/10270)) -* Fixed an issue preventing `MGLImageSource`s from drawing on the map when the map is zoomed in and tilted. ([#10677](https://github.com/mapbox/mapbox-gl-native/pull/10677)) +* Fixed an issue preventing a dynamically-added `MLNRasterStyleLayer` from drawing until the map pans. ([#10270](https://github.com/mapbox/mapbox-gl-native/pull/10270)) +* Fixed an issue preventing `MLNImageSource`s from drawing on the map when the map is zoomed in and tilted. ([#10677](https://github.com/mapbox/mapbox-gl-native/pull/10677)) * Improved the sharpness of raster tiles on Retina displays. ([#10984](https://github.com/mapbox/mapbox-gl-native/pull/10984)) * Fixed a crash parsing a malformed style. ([#11001](https://github.com/mapbox/mapbox-gl-native/pull/11001)) * Reduced memory usage by clearing in-memory tile cache before entering background. ([#11197](https://github.com/mapbox/mapbox-gl-native/pull/11197)) @@ -774,14 +779,14 @@ The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iO ### Annotations -* Changed the default value of `MGLAnnotationView.scalesWithViewingDistance` to `NO`, to improve performance. If your use case involves many annotation views, consider keeping this property disabled. ([#11636](https://github.com/mapbox/mapbox-gl-native/pull/11636)) -* Fixed an issue preventing `MGLAnnotationImage.image` from being updated. ([#10372](https://github.com/mapbox/mapbox-gl-native/pull/10372)) -* Improved performance of `MGLAnnotationView`-backed annotations that have `scalesWithViewingDistance` enabled. ([#10951](https://github.com/mapbox/mapbox-gl-native/pull/10951)) +* Changed the default value of `MLNAnnotationView.scalesWithViewingDistance` to `NO`, to improve performance. If your use case involves many annotation views, consider keeping this property disabled. ([#11636](https://github.com/mapbox/mapbox-gl-native/pull/11636)) +* Fixed an issue preventing `MLNAnnotationImage.image` from being updated. ([#10372](https://github.com/mapbox/mapbox-gl-native/pull/10372)) +* Improved performance of `MLNAnnotationView`-backed annotations that have `scalesWithViewingDistance` enabled. ([#10951](https://github.com/mapbox/mapbox-gl-native/pull/10951)) * Fixed an issue where tapping a group of annotations may not have selected the nearest annotation. ([#11438](https://github.com/mapbox/mapbox-gl-native/pull/11438)) -* The `MGLMapView.selectedAnnotations` property (backed by `-[MGLMapView setSelectedAnnotations:]`) now selects annotations that are off-screen. ([#9790](https://github.com/mapbox/mapbox-gl-native/issues/9790)) -* The `animated` parameter to `-[MGLMapView selectAnnotation:animated:]` now controls whether the annotation and its callout are brought on-screen. If `animated` is `NO` then the annotation is selected if offscreen, but the map is not panned. Currently only point annotations are supported. Setting the `MGLMapView.selectedAnnotations` property now animates. ([#3249](https://github.com/mapbox/mapbox-gl-native/issues/3249)) +* The `MLNMapView.selectedAnnotations` property (backed by `-[MLNMapView setSelectedAnnotations:]`) now selects annotations that are off-screen. ([#9790](https://github.com/mapbox/mapbox-gl-native/issues/9790)) +* The `animated` parameter to `-[MLNMapView selectAnnotation:animated:]` now controls whether the annotation and its callout are brought on-screen. If `animated` is `NO` then the annotation is selected if offscreen, but the map is not panned. Currently only point annotations are supported. Setting the `MLNMapView.selectedAnnotations` property now animates. ([#3249](https://github.com/mapbox/mapbox-gl-native/issues/3249)) * Fixed a crash when rapidly adding and removing annotations. ([#11551](https://github.com/mapbox/mapbox-gl-native/issues/11551), [#11575](https://github.com/mapbox/mapbox-gl-native/issues/11575)) -* Marked protocol method `-[MGLCalloutView presentCalloutFromRect:inView:constrainedToView:animated:]` as unavailable. Use `-[MGLCalloutView presentCalloutFromRect:inView:constrainedToRect:animated:]` instead. ([#11738](https://github.com/mapbox/mapbox-gl-native/pull/11738)) +* Marked protocol method `-[MLNCalloutView presentCalloutFromRect:inView:constrainedToView:animated:]` as unavailable. Use `-[MLNCalloutView presentCalloutFromRect:inView:constrainedToRect:animated:]` instead. ([#11738](https://github.com/mapbox/mapbox-gl-native/pull/11738)) ### Map snapshots @@ -789,22 +794,22 @@ The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iO ### Other changes -* The `-[MGLMapView convertRect:toCoordinateBoundsFromView:]` method and the `MGLMapView.visibleCoordinateBounds` property’s getter now indicate that the coordinate bounds straddles the antimeridian by extending one side beyond ±180 degrees longitude. ([#11265](https://github.com/mapbox/mapbox-gl-native/pull/11265)) -* Feature querying results now account for the `MGLSymbolStyleLayer.circleStrokeWidth` property. ([#10897](https://github.com/mapbox/mapbox-gl-native/pull/10897)) +* The `-[MLNMapView convertRect:toCoordinateBoundsFromView:]` method and the `MLNMapView.visibleCoordinateBounds` property’s getter now indicate that the coordinate bounds straddles the antimeridian by extending one side beyond ±180 degrees longitude. ([#11265](https://github.com/mapbox/mapbox-gl-native/pull/11265)) +* Feature querying results now account for the `MLNSymbolStyleLayer.circleStrokeWidth` property. ([#10897](https://github.com/mapbox/mapbox-gl-native/pull/10897)) * Fixed an issue preventing labels from being transliterated when VoiceOver was enabled on iOS 10._x_ and below. ([#10881](https://github.com/mapbox/mapbox-gl-native/pull/10881)) * Labels are now transliterated from more languages when VoiceOver is enabled. ([#10881](https://github.com/mapbox/mapbox-gl-native/pull/10881)) * Long-pressing the attribution button causes the SDK’s version number to be displayed in the action sheet that appears. ([#10650](https://github.com/mapbox/mapbox-gl-native/pull/10650)) * Reduced offline download sizes for styles with symbol layers that render only icons, and no text. ([#11055](https://github.com/mapbox/mapbox-gl-native/pull/11055)) -* Added haptic feedback that occurs when the user rotates the map to due north, configurable via `MGLMapView.hapticFeedbackEnabled`. ([#10847](https://github.com/mapbox/mapbox-gl-native/pull/10847)) -* Added `MGLMapView.showsScale` as the recommended way to show the scale bar. This property can be set directly in Interface Builder. ([#11335](https://github.com/mapbox/mapbox-gl-native/pull/11335)) +* Added haptic feedback that occurs when the user rotates the map to due north, configurable via `MLNMapView.hapticFeedbackEnabled`. ([#10847](https://github.com/mapbox/mapbox-gl-native/pull/10847)) +* Added `MLNMapView.showsScale` as the recommended way to show the scale bar. This property can be set directly in Interface Builder. ([#11335](https://github.com/mapbox/mapbox-gl-native/pull/11335)) * Fixed an issue where the scale bar would not appear until the map had moved. ([#11335](https://github.com/mapbox/mapbox-gl-native/pull/11335)) ## 3.7.6 - March 12, 2018 * Fixed an issue where full-resolution tiles could fail to replace lower-resolution placeholders. ([#11227](https://github.com/mapbox/mapbox-gl-native/pull/11227)) * Fixed an issue where tilesets with bounds that cover the entire world would fail to render. ([#11425](https://github.com/mapbox/mapbox-gl-native/pull/11425)) -* Fixed a memory leak in `MGLMapSnapshotter`. ([#11193](https://github.com/mapbox/mapbox-gl-native/pull/11193)) -* Fixed an issue where the pinch gesture could drift beyond bounds imposed by `-[MGLMapViewDelegate mapView:shouldChangeFromCamera:toCamera:]`. ([#11423](https://github.com/mapbox/mapbox-gl-native/pull/11423)) +* Fixed a memory leak in `MLNMapSnapshotter`. ([#11193](https://github.com/mapbox/mapbox-gl-native/pull/11193)) +* Fixed an issue where the pinch gesture could drift beyond bounds imposed by `-[MLNMapViewDelegate mapView:shouldChangeFromCamera:toCamera:]`. ([#11423](https://github.com/mapbox/mapbox-gl-native/pull/11423)) * Improved the visibility of the heading indicator arrow. ([#11337](https://github.com/mapbox/mapbox-gl-native/pull/11337)) ## 3.7.5 - February 16, 2018 @@ -813,13 +818,13 @@ The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iO ## 3.7.4 - February 12, 2018 -* Added the `MGLTileSourceOptionTileCoordinateBounds` option to create an `MGLTileSource` that only supplies tiles within a specific geographic bounding box. ([#11141](https://github.com/mapbox/mapbox-gl-native/pull/11141)) -* Fixed an issue that caused `-[MGLMapSnapshotter pointForCoordinate:]` to return the wrong point. ([#11035](https://github.com/mapbox/mapbox-gl-native/pull/11035)) +* Added the `MLNTileSourceOptionTileCoordinateBounds` option to create an `MLNTileSource` that only supplies tiles within a specific geographic bounding box. ([#11141](https://github.com/mapbox/mapbox-gl-native/pull/11141)) +* Fixed an issue that caused `-[MLNMapSnapshotter pointForCoordinate:]` to return the wrong point. ([#11035](https://github.com/mapbox/mapbox-gl-native/pull/11035)) ## 3.7.3 - January 10, 2018 * Fixed a crash while zooming while annotations are present on the map. ([#10791](https://github.com/mapbox/mapbox-gl-native/pull/10791)) -* CJK characters can be displayed in a locally installed font or a custom font bundled with the application, reducing map download times. Specify the font name using the `MGLIdeographicFontFamilyName` key in the application’s Info.plist file. ([#10522](https://github.com/mapbox/mapbox-gl-native/pull/10522)) +* CJK characters can be displayed in a locally installed font or a custom font bundled with the application, reducing map download times. Specify the font name using the `MLNIdeographicFontFamilyName` key in the application’s Info.plist file. ([#10522](https://github.com/mapbox/mapbox-gl-native/pull/10522)) * Fixed a hang that could occur if the application makes many changes to user defaults immediately after launching. ([#10803](https://github.com/mapbox/mapbox-gl-native/pull/10803)) ## 3.7.2 - December 21, 2017 @@ -830,9 +835,9 @@ The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iO ### Other changes -* Fixed an issue where removing a `MGLOpenGLStyleLayer` from a map might result in a crash. ([#10765](https://github.com/mapbox/mapbox-gl-native/pull/10765)) +* Fixed an issue where removing a `MLNOpenGLStyleLayer` from a map might result in a crash. ([#10765](https://github.com/mapbox/mapbox-gl-native/pull/10765)) * Added documentation for usage of coordinate bounds that cross the anti-meridian. ([#9804](https://github.com/mapbox/mapbox-gl-native/issues/9804)) -* Removed duplicated variables in `MGLMapSnapshotter`. ([#10702](https://github.com/mapbox/mapbox-gl-native/pull/10702)) +* Removed duplicated variables in `MLNMapSnapshotter`. ([#10702](https://github.com/mapbox/mapbox-gl-native/pull/10702)) ## 3.7.1 - December 6, 2017 @@ -842,29 +847,29 @@ The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iO ### Annotations -* Fixed incorrect hit targets for `MGLAnnotationImage`-backed annotations that caused `-[MGLMapViewDelegate mapView:didSelectAnnotation:]` to be called unnecessarily. ([#10538](https://github.com/mapbox/mapbox-gl-native/pull/10538)) +* Fixed incorrect hit targets for `MLNAnnotationImage`-backed annotations that caused `-[MLNMapViewDelegate mapView:didSelectAnnotation:]` to be called unnecessarily. ([#10538](https://github.com/mapbox/mapbox-gl-native/pull/10538)) ### Other changes -* Fixed an issue that caused `MGLMapView.minimumZoomLevel` to not be set. ([#10596](https://github.com/mapbox/mapbox-gl-native/pull/10596)) +* Fixed an issue that caused `MLNMapView.minimumZoomLevel` to not be set. ([#10596](https://github.com/mapbox/mapbox-gl-native/pull/10596)) ## 3.7.0 - Novemeber 13, 2017 ### Networking and storage -* Added a new `MGLMapSnapshotter` class for capturing rendered map images from an `MGLMapView`’s camera. ([#9891](https://github.com/mapbox/mapbox-gl-native/pull/9891)) -* Reduced the time it takes to create new `MGLMapView` instances in some cases. ([#9864](https://github.com/mapbox/mapbox-gl-native/pull/9864)) +* Added a new `MLNMapSnapshotter` class for capturing rendered map images from an `MLNMapView`’s camera. ([#9891](https://github.com/mapbox/mapbox-gl-native/pull/9891)) +* Reduced the time it takes to create new `MLNMapView` instances in some cases. ([#9864](https://github.com/mapbox/mapbox-gl-native/pull/9864)) * Added support for forced cache revalidation that will eliminate flickering that was sometimes visible for certain types of tiles (e.g., traffic tiles). ([#9670](https://github.com/mapbox/mapbox-gl-native/pull/9670), [#9103](https://github.com/mapbox/mapbox-gl-native/issues/9103)) * Improved the performance of the SDK when parsing vector tile data used to render the map. ([#9312](https://github.com/mapbox/mapbox-gl-native/pull/9312)) ### Styles -* Added a new type of source, represented by the `MGLImageSource` class at runtime, that displays a georeferenced image. ([#9110](https://github.com/mapbox/mapbox-gl-native/pull/9110)) -* Setting a style using `MGLMapView`'s `styleURL` property now smoothly transitions from the previous style to the new style and maintains equivalent layers and sources along with their identifiers. ([#9256](https://github.com/mapbox/mapbox-gl-native/pull/9256)) -* Added `MGLCircleStyleLayer.circlePitchAlignment` and `MGLSymbolStyleLayer.iconPitchAlignment` properties to control whether circles and symbols lie flat against a tilted map. ([#9426](https://github.com/mapbox/mapbox-gl-native/pull/9426), [#9479](https://github.com/mapbox/mapbox-gl-native/pull/9479)) -* Added an `MGLSymbolStyleLayer.iconAnchor` property to control where an icon is anchored. ([#9849](https://github.com/mapbox/mapbox-gl-native/pull/9849)) -* The `maximumTextWidth` and `textLetterSpacing` properties of `MGLSymbolStyleLayer` are now compatible with `MGLSourceStyleFunction`s and `MGLCompositeStyleFunction`s, allowing data-driven styling of these properties. ([#9870](https://github.com/mapbox/mapbox-gl-native/pull/9870)) -* The `MGLSymbolStyleLayer.textAnchor`, `MGLSymbolStyleLayer.textJustification` and `MGLLineStyleLayer.lineJoin` properties are now compatible with `MGLSourceStyleFunction`s and `MGLCompositeStyleFunction`s, allowing data-driven styling of these properties. ([#9583](https://github.com/mapbox/mapbox-gl-native/pull/9583)) +* Added a new type of source, represented by the `MLNImageSource` class at runtime, that displays a georeferenced image. ([#9110](https://github.com/mapbox/mapbox-gl-native/pull/9110)) +* Setting a style using `MLNMapView`'s `styleURL` property now smoothly transitions from the previous style to the new style and maintains equivalent layers and sources along with their identifiers. ([#9256](https://github.com/mapbox/mapbox-gl-native/pull/9256)) +* Added `MLNCircleStyleLayer.circlePitchAlignment` and `MLNSymbolStyleLayer.iconPitchAlignment` properties to control whether circles and symbols lie flat against a tilted map. ([#9426](https://github.com/mapbox/mapbox-gl-native/pull/9426), [#9479](https://github.com/mapbox/mapbox-gl-native/pull/9479)) +* Added an `MLNSymbolStyleLayer.iconAnchor` property to control where an icon is anchored. ([#9849](https://github.com/mapbox/mapbox-gl-native/pull/9849)) +* The `maximumTextWidth` and `textLetterSpacing` properties of `MLNSymbolStyleLayer` are now compatible with `MLNSourceStyleFunction`s and `MLNCompositeStyleFunction`s, allowing data-driven styling of these properties. ([#9870](https://github.com/mapbox/mapbox-gl-native/pull/9870)) +* The `MLNSymbolStyleLayer.textAnchor`, `MLNSymbolStyleLayer.textJustification` and `MLNLineStyleLayer.lineJoin` properties are now compatible with `MLNSourceStyleFunction`s and `MLNCompositeStyleFunction`s, allowing data-driven styling of these properties. ([#9583](https://github.com/mapbox/mapbox-gl-native/pull/9583)) * Improved the legibility of labels that follow lines when the map is tilted. ([#9009](https://github.com/mapbox/mapbox-gl-native/pull/9009)) * Fixed an issue that could cause flickering when a translucent raster style layer was present. ([#9468](https://github.com/mapbox/mapbox-gl-native/pull/9468)) * Fixed an issue that could cause antialiasing between polygons on the same layer to fail if the fill layers used data-driven styling for the fill color. ([#9699](https://github.com/mapbox/mapbox-gl-native/pull/9699)) @@ -872,10 +877,10 @@ The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iO ### Annotations -* Fixed several bugs and performance issues related to the use of annotations backed by `MGLAnnotationImage`. The limits on the number and size of images and glyphs has been effectively eliminated and should now depend on hardware constraints. These fixes also apply to images used to represent icons in `MGLSymbolStyleLayer`. ([#9213](https://github.com/mapbox/mapbox-gl-native/pull/9213)) -* Added an `overlays` property to `MGLMapView`. ([#8617](https://github.com/mapbox/mapbox-gl-native/pull/8617)) -* Selecting an annotation no longer sets the user tracking mode to `MGLUserTrackingModeNone`. ([#10094](https://github.com/mapbox/mapbox-gl-native/pull/10094)) -* Added `-[MGLMapView cameraThatFitsShape:direction:edgePadding:]` to get a camera with zoom level and center coordinate computed to fit a shape. ([#10107](https://github.com/mapbox/mapbox-gl-native/pull/10107)) +* Fixed several bugs and performance issues related to the use of annotations backed by `MLNAnnotationImage`. The limits on the number and size of images and glyphs has been effectively eliminated and should now depend on hardware constraints. These fixes also apply to images used to represent icons in `MLNSymbolStyleLayer`. ([#9213](https://github.com/mapbox/mapbox-gl-native/pull/9213)) +* Added an `overlays` property to `MLNMapView`. ([#8617](https://github.com/mapbox/mapbox-gl-native/pull/8617)) +* Selecting an annotation no longer sets the user tracking mode to `MLNUserTrackingModeNone`. ([#10094](https://github.com/mapbox/mapbox-gl-native/pull/10094)) +* Added `-[MLNMapView cameraThatFitsShape:direction:edgePadding:]` to get a camera with zoom level and center coordinate computed to fit a shape. ([#10107](https://github.com/mapbox/mapbox-gl-native/pull/10107)) * Added support selection of shape and polyline annotations.([#9984](https://github.com/mapbox/mapbox-gl-native/pull/9984)) * Fixed an issue where view annotations could be slightly misaligned. View annotation placement is now rounded to the nearest pixel. ([#10219](https://github.com/mapbox/mapbox-gl-native/pull/10219)) * Fixed an issue where a shape annotation callout was not displayed if the centroid was not visible. ([#10255](https://github.com/mapbox/mapbox-gl-native/pull/10255)) @@ -884,14 +889,14 @@ The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iO * Users of VoiceOver can now swipe left and right to navigate among visible places, points of interest, and roads. ([#9950](https://github.com/mapbox/mapbox-gl-native/pull/9950)) * Increased the default maximum zoom level from 20 to 22. ([#9835](https://github.com/mapbox/mapbox-gl-native/pull/9835)) -* Fixed an issue where the same value was passed in as the `oldCamera` and `newCamera` parameters to the `-[MGLMapViewDelegate mapView:shouldChangeFromCamera:toCamera:]` method. ([#10433](https://github.com/mapbox/mapbox-gl-native/pull/10433)) +* Fixed an issue where the same value was passed in as the `oldCamera` and `newCamera` parameters to the `-[MLNMapViewDelegate mapView:shouldChangeFromCamera:toCamera:]` method. ([#10433](https://github.com/mapbox/mapbox-gl-native/pull/10433)) ### Other changes * Added a Bulgarian localization. ([#10309](https://github.com/mapbox/mapbox-gl-native/pull/10309)) * Fixed an issue that could cause line label rendering glitches when the line geometry is projected to a point behind the plane of the camera. ([#9865](https://github.com/mapbox/mapbox-gl-native/pull/9865)) -* Fixed an issue that could cause a crash when using `-[MGLMapView flyToCamera:completionHandler:]` and related methods with zoom levels at or near the maximum value. ([#9381](https://github.com/mapbox/mapbox-gl-native/pull/9381)) -* Added `-[MGLMapView showAttribution:]` to allow custom attribution buttons to show the default attribution interface. ([#10085](https://github.com/mapbox/mapbox-gl-native/pull/10085)) +* Fixed an issue that could cause a crash when using `-[MLNMapView flyToCamera:completionHandler:]` and related methods with zoom levels at or near the maximum value. ([#9381](https://github.com/mapbox/mapbox-gl-native/pull/9381)) +* Added `-[MLNMapView showAttribution:]` to allow custom attribution buttons to show the default attribution interface. ([#10085](https://github.com/mapbox/mapbox-gl-native/pull/10085)) * Fixed a conflict between multiple copies of SMCalloutView in a project. ([#10183](https://github.com/mapbox/mapbox-gl-native/pull/10183)) * Fixed a crash when enabling the scale bar in iOS 8. ([#10241](https://github.com/mapbox/mapbox-gl-native/pull/10241)) @@ -901,20 +906,20 @@ The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iO ## 3.6.3 - September 15, 2017 -* Added the option to display an always-on heading indicator with the default user location annotation, controlled via the `MGLMapView.showsUserHeadingIndicator` property. ([#9886](https://github.com/mapbox/mapbox-gl-native/pull/9886)) +* Added the option to display an always-on heading indicator with the default user location annotation, controlled via the `MLNMapView.showsUserHeadingIndicator` property. ([#9886](https://github.com/mapbox/mapbox-gl-native/pull/9886)) * Fixed an issue where user heading tracking mode would update too frequently. ([#9845](https://github.com/mapbox/mapbox-gl-native/pull/9845)) * Added support for iOS 11 location usage descriptions. ([#9869](https://github.com/mapbox/mapbox-gl-native/pull/9869)) -* Fixed an issue where `MGLUserLocation.location` did not follow its documented initialization behavior. This property will now properly return `nil` until the user’s location has been determined. ([#9639](https://github.com/mapbox/mapbox-gl-native/pull/9639)) -* `MGLMapView`’s `minimumZoomLevel` and `maximumZoomLevel` properties are now available in Interface Builder’s Attributes inspector. ([#9729](https://github.com/mapbox/mapbox-gl-native/pull/9729)) -* Deprecated `+[MGLStyle trafficDayStyleURL]` and `+[MGLStyle trafficNightStyleURL]` with no replacement method. To use the Traffic Day and Traffic Night styles going forward, we recommend that you use the underlying URL. ([#9918](https://github.com/mapbox/mapbox-gl-native/pull/9918)) +* Fixed an issue where `MLNUserLocation.location` did not follow its documented initialization behavior. This property will now properly return `nil` until the user’s location has been determined. ([#9639](https://github.com/mapbox/mapbox-gl-native/pull/9639)) +* `MLNMapView`’s `minimumZoomLevel` and `maximumZoomLevel` properties are now available in Interface Builder’s Attributes inspector. ([#9729](https://github.com/mapbox/mapbox-gl-native/pull/9729)) +* Deprecated `+[MLNStyle trafficDayStyleURL]` and `+[MLNStyle trafficNightStyleURL]` with no replacement method. To use the Traffic Day and Traffic Night styles going forward, we recommend that you use the underlying URL. ([#9918](https://github.com/mapbox/mapbox-gl-native/pull/9918)) * Fixed a crash that sometimes occurred when a map view's view controller was deallocated. ([#9995](https://github.com/mapbox/mapbox-gl-native/pull/9995)) ## 3.6.2 - August 18, 2017 -* Added an `MGLStyle.localizesLabels` property, off by default, that localizes any Mapbox Streets–sourced symbol layer into the user’s preferred language. ([#9582](https://github.com/mapbox/mapbox-gl-native/pull/9582)) -* Added an additional camera method to MGLMapView that accepts an edge padding parameter. ([#9651](https://github.com/mapbox/mapbox-gl-native/pull/9651)) +* Added an `MLNStyle.localizesLabels` property, off by default, that localizes any Mapbox Streets–sourced symbol layer into the user’s preferred language. ([#9582](https://github.com/mapbox/mapbox-gl-native/pull/9582)) +* Added an additional camera method to MLNMapView that accepts an edge padding parameter. ([#9651](https://github.com/mapbox/mapbox-gl-native/pull/9651)) * Fixed an issue with the scaling of the user location annotation’s horizontal accuracy indicator. ([#9721](https://github.com/mapbox/mapbox-gl-native/pull/9721)) -* Fixed an issue that caused `-[MGLShapeSource featuresMatchingPredicate:]` and `-[MGLVectorSource featuresInSourceLayersWithIdentifiers:predicate:]` to always return an empty array. ([#9784](https://github.com/mapbox/mapbox-gl-native/pull/9784)) +* Fixed an issue that caused `-[MLNShapeSource featuresMatchingPredicate:]` and `-[MLNVectorSource featuresInSourceLayersWithIdentifiers:predicate:]` to always return an empty array. ([#9784](https://github.com/mapbox/mapbox-gl-native/pull/9784)) ## 3.6.1 - July 28, 2017 @@ -930,19 +935,19 @@ The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iO * Xcode 8.0 or higher is now recommended for using this SDK. ([#8775](https://github.com/mapbox/mapbox-gl-native/pull/8775)) * Fixed an issue in the static framework where localizations would never load. ([#9074](https://github.com/mapbox/mapbox-gl-native/pull/9074)) -* Updated MGLMapView’s logo view to display [the new Mapbox logo](https://www.mapbox.com/blog/new-mapbox-logo/). ([#8771](https://github.com/mapbox/mapbox-gl-native/pull/8771), [#8773](https://github.com/mapbox/mapbox-gl-native/pull/8773)) +* Updated MLNMapView’s logo view to display [the new Mapbox logo](https://www.mapbox.com/blog/new-mapbox-logo/). ([#8771](https://github.com/mapbox/mapbox-gl-native/pull/8771), [#8773](https://github.com/mapbox/mapbox-gl-native/pull/8773)) * Added a Hungarian localization. ([#9347](https://github.com/mapbox/mapbox-gl-native/pull/9347)) ### Styles -* Added support for 3D extrusion of buildings and other polygonal features via the `MGLFillExtrusionStyleLayer` class and the `fill-extrusion` layer type in style JSON. ([#8431](https://github.com/mapbox/mapbox-gl-native/pull/8431)) -* MGLMapView and MGLTilePyramidOfflineRegion now default to version 10 of the Mapbox Streets style. Similarly, several style URL class methods of MGLStyle return URLs to version 10 styles. Unversioned variations of these methods are no longer deprecated. `MGLStyleDefaultVersion` should no longer be used with any style other than Streets. ([#6301](https://github.com/mapbox/mapbox-gl-native/pull/6301)) -* Added class methods to MGLStyle that correspond to the new [Traffic Day and Traffic Night](https://www.mapbox.com/blog/live-traffic-maps/) styles. ([#6301](https://github.com/mapbox/mapbox-gl-native/pull/6301)) -* MGLSymbolStyleLayer’s `iconImageName`, `iconScale`, `textFontSize`, `textOffset`, and `textRotation` properties can now be set to a source or composite function. ([#8544](https://github.com/mapbox/mapbox-gl-native/pull/8544), [#8590](https://github.com/mapbox/mapbox-gl-native/pull/8590), [#8592](https://github.com/mapbox/mapbox-gl-native/pull/8592), [#8593](https://github.com/mapbox/mapbox-gl-native/pull/8593)) -* Fixed an issue where setting the `MGLVectorStyleLayer.predicate` property failed to take effect if the relevant source was not in use by a visible layer at the time. ([#8653](https://github.com/mapbox/mapbox-gl-native/pull/8653)) +* Added support for 3D extrusion of buildings and other polygonal features via the `MLNFillExtrusionStyleLayer` class and the `fill-extrusion` layer type in style JSON. ([#8431](https://github.com/mapbox/mapbox-gl-native/pull/8431)) +* MLNMapView and MLNTilePyramidOfflineRegion now default to version 10 of the Mapbox Streets style. Similarly, several style URL class methods of MLNStyle return URLs to version 10 styles. Unversioned variations of these methods are no longer deprecated. `MLNStyleDefaultVersion` should no longer be used with any style other than Streets. ([#6301](https://github.com/mapbox/mapbox-gl-native/pull/6301)) +* Added class methods to MLNStyle that correspond to the new [Traffic Day and Traffic Night](https://www.mapbox.com/blog/live-traffic-maps/) styles. ([#6301](https://github.com/mapbox/mapbox-gl-native/pull/6301)) +* MLNSymbolStyleLayer’s `iconImageName`, `iconScale`, `textFontSize`, `textOffset`, and `textRotation` properties can now be set to a source or composite function. ([#8544](https://github.com/mapbox/mapbox-gl-native/pull/8544), [#8590](https://github.com/mapbox/mapbox-gl-native/pull/8590), [#8592](https://github.com/mapbox/mapbox-gl-native/pull/8592), [#8593](https://github.com/mapbox/mapbox-gl-native/pull/8593)) +* Fixed an issue where setting the `MLNVectorStyleLayer.predicate` property failed to take effect if the relevant source was not in use by a visible layer at the time. ([#8653](https://github.com/mapbox/mapbox-gl-native/pull/8653)) * Fixed an issue preventing programmatically added style layers from appearing in already cached tiles. ([#8954](https://github.com/mapbox/mapbox-gl-native/pull/8954)) * Fixed an issue causing a composite function’s highest zoom level stop to be misinterpreted. ([#8613](https://github.com/mapbox/mapbox-gl-native/pull/8613), [#8790](https://github.com/mapbox/mapbox-gl-native/pull/8790)) -* Fixed an issue where re-adding a layer that had been previously removed from a style would reset its paint properties. Moved initializers for `MGLTileSource`, `MGLStyleLayer`, and `MGLForegroundStyleLayer` to their concrete subclasses; because these classes were already intended for initialization only via concrete subclasses, this should have no developer impact. ([#8626](https://github.com/mapbox/mapbox-gl-native/pull/8626)) +* Fixed an issue where re-adding a layer that had been previously removed from a style would reset its paint properties. Moved initializers for `MLNTileSource`, `MLNStyleLayer`, and `MLNForegroundStyleLayer` to their concrete subclasses; because these classes were already intended for initialization only via concrete subclasses, this should have no developer impact. ([#8626](https://github.com/mapbox/mapbox-gl-native/pull/8626)) * Fixed a crash that occurred when removing a source that was still being used by one or more style layers. Since this is a programming error, a warning is logged to the console instead. ([#9129](https://github.com/mapbox/mapbox-gl-native/pull/9129)) * Feature querying results now account for any changes to a feature’s size caused by a source or composite style function. ([#8665](https://github.com/mapbox/mapbox-gl-native/pull/8665)) * Fixed the behavior of composite functions that specify fractional zoom level stops. ([#9289](https://github.com/mapbox/mapbox-gl-native/pull/9289)) @@ -951,34 +956,34 @@ The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iO ### Annotations -* Added a new initializer to `MGLAnnotationView` so that it is possible to create a new instance with an associated annotation object. ([#9029](https://github.com/mapbox/mapbox-gl-native/pull/9029)) -* Added a new `rotatesToMatchCamera` property to `MGLAnnotationView` that, when set to true, causes the annotation view to rotate along with the map's rotation angle giving the appearance that the annoation view is pinned to the map. ([#9147](https://github.com/mapbox/mapbox-gl-native/pull/9147)) +* Added a new initializer to `MLNAnnotationView` so that it is possible to create a new instance with an associated annotation object. ([#9029](https://github.com/mapbox/mapbox-gl-native/pull/9029)) +* Added a new `rotatesToMatchCamera` property to `MLNAnnotationView` that, when set to true, causes the annotation view to rotate along with the map's rotation angle giving the appearance that the annoation view is pinned to the map. ([#9147](https://github.com/mapbox/mapbox-gl-native/pull/9147)) * Fixed an issue causing a view-backed annotation to disappear immediately instead of animating when the annotation’s `coordinate` property is set to a value outside the current viewport. ([#8565](https://github.com/mapbox/mapbox-gl-native/pull/8565)) -* Fixed an issue in which `MGLMapView` overrode the tint colors of its annotation views. ([#8789](https://github.com/mapbox/mapbox-gl-native/pull/8789)) +* Fixed an issue in which `MLNMapView` overrode the tint colors of its annotation views. ([#8789](https://github.com/mapbox/mapbox-gl-native/pull/8789)) * Fixed an issue causing annotation views to persist in the map’s annotation container view even after their associated annotations were removed. ([#9025](https://github.com/mapbox/mapbox-gl-native/pull/9025)) -* The `MGLPolyline.coordinate` and `MGLPolygon.coordinate` properties now return the midpoint and centroid, respectively, instead of the first coordinate. ([#8713](https://github.com/mapbox/mapbox-gl-native/pull/8713)) +* The `MLNPolyline.coordinate` and `MLNPolygon.coordinate` properties now return the midpoint and centroid, respectively, instead of the first coordinate. ([#8713](https://github.com/mapbox/mapbox-gl-native/pull/8713)) ### User interaction -* Added a scale bar to `MGLMapView` that indicates the scale of the map. ([#7631](https://github.com/mapbox/mapbox-gl-native/pull/7631)) +* Added a scale bar to `MLNMapView` that indicates the scale of the map. ([#7631](https://github.com/mapbox/mapbox-gl-native/pull/7631)) * Fixed an issue causing the map to go blank during a flight animation that travels a very short distance. ([#9199](https://github.com/mapbox/mapbox-gl-native/pull/9199)) * Fixed an issue where gesture recognizers associated with map view interactivity were not disabled when their related interactions were disabled. ([#8304](https://github.com/mapbox/mapbox-gl-native/pull/8304)) * Fixed an issue preventing the Mapbox Telemetry confirmation dialog from appearing when opened from within a map view in a modal view controller. ([#9027](https://github.com/mapbox/mapbox-gl-native/pull/9027)) -* Corrected the size of MGLMapView’s compass. ([#9060](https://github.com/mapbox/mapbox-gl-native/pull/9060)) -* The Improve This Map button in the attribution action sheet now leads to a feedback tool that matches MGLMapView’s rotation and pitch. `-[MGLAttributionInfo feedbackURLAtCenterCoordinate:zoomLevel:]` no longer respects the feedback URL specified in TileJSON. ([#9078](https://github.com/mapbox/mapbox-gl-native/pull/9078)) -* `-[MGLMapViewDelegate mapView:shouldChangeFromCamera:toCamera:]` can now block any panning caused by a pinch gesture. ([#9344](https://github.com/mapbox/mapbox-gl-native/pull/9344)) +* Corrected the size of MLNMapView’s compass. ([#9060](https://github.com/mapbox/mapbox-gl-native/pull/9060)) +* The Improve This Map button in the attribution action sheet now leads to a feedback tool that matches MLNMapView’s rotation and pitch. `-[MLNAttributionInfo feedbackURLAtCenterCoordinate:zoomLevel:]` no longer respects the feedback URL specified in TileJSON. ([#9078](https://github.com/mapbox/mapbox-gl-native/pull/9078)) +* `-[MLNMapViewDelegate mapView:shouldChangeFromCamera:toCamera:]` can now block any panning caused by a pinch gesture. ([#9344](https://github.com/mapbox/mapbox-gl-native/pull/9344)) * If the user taps on the map while it is flying to the user’s location, the user dot no longer appears in the incorrect location. ([#7916](https://github.com/mapbox/mapbox-gl-native/pull/7916)) * Improved the responsiveness of the tilt gesture by reducing the initial recognition delay. ([#9386](https://github.com/mapbox/mapbox-gl-native/pull/9386)) ### Other changes -* Fixed a crash that occurred when accessing the `MGLMultiPolygon.coordinate` property. ([#8713](https://github.com/mapbox/mapbox-gl-native/pull/8713)) -* Fixed a crash or console spew when MGLMapView is initialized with a frame smaller than 64 points wide by 64 points tall. ([#8562](https://github.com/mapbox/mapbox-gl-native/pull/8562)) +* Fixed a crash that occurred when accessing the `MLNMultiPolygon.coordinate` property. ([#8713](https://github.com/mapbox/mapbox-gl-native/pull/8713)) +* Fixed a crash or console spew when MLNMapView is initialized with a frame smaller than 64 points wide by 64 points tall. ([#8562](https://github.com/mapbox/mapbox-gl-native/pull/8562)) * Fixed an issue that caused the compass and scale bar to underlap navigation and tab bars. ([#7716](https://github.com/mapbox/mapbox-gl-native/pull/7716)) -* The error passed into `-[MGLMapViewDelegate mapViewDidFailLoadingMap:withError:]` now includes a more specific description and failure reason. ([#8418](https://github.com/mapbox/mapbox-gl-native/pull/8418)) +* The error passed into `-[MLNMapViewDelegate mapViewDidFailLoadingMap:withError:]` now includes a more specific description and failure reason. ([#8418](https://github.com/mapbox/mapbox-gl-native/pull/8418)) * Improved CPU and battery performance while animating a tilted map’s camera in an area with many labels. ([#9031](https://github.com/mapbox/mapbox-gl-native/pull/9031)) * Fixed an issue rendering polylines that contain duplicate vertices. ([#8808](https://github.com/mapbox/mapbox-gl-native/pull/8808)) -* Added struct boxing to `MGLCoordinateSpan`, `MGLCoordinateBounds`, `MGLOfflinePackProgress`, and `MGLTransition`. ([#9343](https://github.com/mapbox/mapbox-gl-native/pull/9343)) +* Added struct boxing to `MLNCoordinateSpan`, `MLNCoordinateBounds`, `MLNOfflinePackProgress`, and `MLNTransition`. ([#9343](https://github.com/mapbox/mapbox-gl-native/pull/9343)) ## 3.5.4 - May 9, 2017 @@ -996,7 +1001,7 @@ The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iO ## 3.5.1 - April 5, 2017 * Fixed an issue that caused the return type of a map view delegate method to bridge incorrectly to applications written in Swift. ([#8541](https://github.com/mapbox/mapbox-gl-native/pull/8541)) -* Fixed a crash that could occur when calling `-[MGLShapeSource featuresMatchingPredicate:]` or `-[MGLVectorSource featuresInSourceLayersWithIdentifiers:predicate:]`. ([#8553](https://github.com/mapbox/mapbox-gl-native/pull/8553)) +* Fixed a crash that could occur when calling `-[MLNShapeSource featuresMatchingPredicate:]` or `-[MLNVectorSource featuresInSourceLayersWithIdentifiers:predicate:]`. ([#8553](https://github.com/mapbox/mapbox-gl-native/pull/8553)) * Fixed a crash that could occur after adding view-backed annotations to the map. ([#8513](https://github.com/mapbox/mapbox-gl-native/pull/8513)) * Renamed the “Data-Driven Styling” guide to “Using Style Functions at Runtime” and clarified the meaning of data-driven styling in the guide’s discussion of runtime style functions. ([#8627](https://github.com/mapbox/mapbox-gl-native/pull/8627)) @@ -1017,13 +1022,13 @@ The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iO ### Styles -* Added support for data-driven styling in the form of source and composite style functions. `MGLStyleFunction` is now an abstract class, with `MGLCameraStyleFunction` providing the behavior of `MGLStyleFunction` in previous releases. New `MGLStyleFunction` subclasses allow you to vary a style attribute by the values of attributes of features in the source. ([#7596](https://github.com/mapbox/mapbox-gl-native/pull/7596)) -* Added `circleStrokeColor`, `circleStrokeWidth`, and `circleStrokeOpacity` properties to MGLCircleStyleLayer and support for corresponding properties in style JSON files. ([#7356](https://github.com/mapbox/mapbox-gl-native/pull/7356)) +* Added support for data-driven styling in the form of source and composite style functions. `MLNStyleFunction` is now an abstract class, with `MLNCameraStyleFunction` providing the behavior of `MLNStyleFunction` in previous releases. New `MLNStyleFunction` subclasses allow you to vary a style attribute by the values of attributes of features in the source. ([#7596](https://github.com/mapbox/mapbox-gl-native/pull/7596)) +* Added `circleStrokeColor`, `circleStrokeWidth`, and `circleStrokeOpacity` properties to MLNCircleStyleLayer and support for corresponding properties in style JSON files. ([#7356](https://github.com/mapbox/mapbox-gl-native/pull/7356)) * Point-placed labels in symbol style layers are now placed at more optimal locations within polygons. ([#7465](https://github.com/mapbox/mapbox-gl-native/pull/7465)) * Fixed flickering that occurred when manipulating a style layer. ([#7616](https://github.com/mapbox/mapbox-gl-native/pull/7616)) * Symbol style layers can now render point collections (known as multipoints in GeoJSON). ([#7445](https://github.com/mapbox/mapbox-gl-native/pull/7445)) -* Added a `transition` property to MGLStyle to customize the timing of changes to style layers. ([#7711](https://github.com/mapbox/mapbox-gl-native/pull/7711)) -* Added properties to MGLStyleLayer subclasses to customize the timing of transitions between values of individual attributes. ([#8225](https://github.com/mapbox/mapbox-gl-native/pull/8225)) +* Added a `transition` property to MLNStyle to customize the timing of changes to style layers. ([#7711](https://github.com/mapbox/mapbox-gl-native/pull/7711)) +* Added properties to MLNStyleLayer subclasses to customize the timing of transitions between values of individual attributes. ([#8225](https://github.com/mapbox/mapbox-gl-native/pull/8225)) * Fixed an issue causing lines and text labels toward the top of the map view to appear blurry when the map is tilted. ([#7444](https://github.com/mapbox/mapbox-gl-native/pull/7444)) * Fixed incorrect interpolation of style functions in Boolean-typed style attributes. ([#7526](https://github.com/mapbox/mapbox-gl-native/pull/7526)) * Removed support for the `ref` property in layers in style JSON files. ([#7586](https://github.com/mapbox/mapbox-gl-native/pull/7586)) @@ -1031,38 +1036,38 @@ The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iO * Fixed artifacts when drawing particularly acute line joins. ([#7786](https://github.com/mapbox/mapbox-gl-native/pull/7786)) * Fixed an issue in which a vector style layer predicate involving the `$id` key path would exclude all features from the layer. ([#7989](https://github.com/mapbox/mapbox-gl-native/pull/7989), [#7971](https://github.com/mapbox/mapbox-gl-native/pull/7971)) * Fixed an issue causing vector style layer predicates to be evaluated as if each feature had a `$type` attribute of 1, 2, or 3. The `$type` key path can now be compared to `Point`, `LineString`, or `Polygon`, as described in the documentation. ([#7971](https://github.com/mapbox/mapbox-gl-native/pull/7971)) -* When setting an `MGLShapeSource`’s shape to an `MGLFeature` instance, any `UIColor` attribute value is now converted to the equivalent CSS string representation for use with `MGLInterpolationModeIdentity` in style functions. ([#8025](https://github.com/mapbox/mapbox-gl-native/pull/8025)) +* When setting an `MLNShapeSource`’s shape to an `MLNFeature` instance, any `UIColor` attribute value is now converted to the equivalent CSS string representation for use with `MLNInterpolationModeIdentity` in style functions. ([#8025](https://github.com/mapbox/mapbox-gl-native/pull/8025)) * An exception is no longer thrown if layers or sources are removed from a style before they are added. ([#7962](https://github.com/mapbox/mapbox-gl-native/pull/7962)) -* Renamed MGLStyleConstantValue to MGLConstantStyleValue. For compatibility with previous releases, MGLStyleConstantValue is now an alias of MGLConstantStyleValue. ([#8090](https://github.com/mapbox/mapbox-gl-native/pull/8090)) -* Fixed a crash that could occur when switching styles after adding an MGLSource to the style. ([#8298](https://github.com/mapbox/mapbox-gl-native/pull/8298)) +* Renamed MLNStyleConstantValue to MLNConstantStyleValue. For compatibility with previous releases, MLNStyleConstantValue is now an alias of MLNConstantStyleValue. ([#8090](https://github.com/mapbox/mapbox-gl-native/pull/8090)) +* Fixed a crash that could occur when switching styles after adding an MLNSource to the style. ([#8298](https://github.com/mapbox/mapbox-gl-native/pull/8298)) ### Annotations and user interaction -* Added a method to MGLMapViewDelegate, `-mapView:shouldChangeFromCamera:toCamera:`, that you can implement to restrict which parts the user can navigate to using gestures. ([#5584](https://github.com/mapbox/mapbox-gl-native/pull/5584)) +* Added a method to MLNMapViewDelegate, `-mapView:shouldChangeFromCamera:toCamera:`, that you can implement to restrict which parts the user can navigate to using gestures. ([#5584](https://github.com/mapbox/mapbox-gl-native/pull/5584)) * Annotations are no longer deselected when the map is panned or zoomed, even if the annotation moves out of the visible bounds. ([#8022](https://github.com/mapbox/mapbox-gl-native/pull/8022)) * Changing the coordinates of a point annotation no longer deselects the annotation. ([#8269](https://github.com/mapbox/mapbox-gl-native/pull/8269)) * Fixed an issue that could cause a crash when point annotations were added and removed while simultaneously querying source features. ([#8374](https://github.com/mapbox/mapbox-gl-native/pull/8374)) -* Fixed an issue preventing MGLMapView from adding a polyline annotation with the same coordinates as a polygon annotation. ([#8355](https://github.com/mapbox/mapbox-gl-native/pull/8355)) +* Fixed an issue preventing MLNMapView from adding a polyline annotation with the same coordinates as a polygon annotation. ([#8355](https://github.com/mapbox/mapbox-gl-native/pull/8355)) * Fixed an issue where translucent, non-view-backed point annotations along tile boundaries would be drawn darker than expected. ([#6832](https://github.com/mapbox/mapbox-gl-native/pull/6832)) * Double-tap and two-finger tap gestures now zoom to the nearest integer zoom level. ([#8027](https://github.com/mapbox/mapbox-gl-native/pull/8027)) -* The `MGLAnnotationView.annotation` property is now read-write. ([#8139](https://github.com/mapbox/mapbox-gl-native/pull/8139)) +* The `MLNAnnotationView.annotation` property is now read-write. ([#8139](https://github.com/mapbox/mapbox-gl-native/pull/8139)) * Enabled the one-finger zoom gesture on iPad. To execute this gesture, tap twice; on second tap, hold your finger on the map and pan up to zoom in, or down to zoom out. ([#8379](https://github.com/mapbox/mapbox-gl-native/pull/8379)) ### Networking and offline maps -* Offline pack notifications are now posted by `MGLOfflinePack` instances instead of the shared `MGLOfflineStorage` object. For backwards compatibility, the `userInfo` dictionary still indicates the pack’s state and progress. ([#7952](https://github.com/mapbox/mapbox-gl-native/pull/7952)) -* Fixed a memory leak in MGLMapView. ([#7956](https://github.com/mapbox/mapbox-gl-native/pull/7956)) +* Offline pack notifications are now posted by `MLNOfflinePack` instances instead of the shared `MLNOfflineStorage` object. For backwards compatibility, the `userInfo` dictionary still indicates the pack’s state and progress. ([#7952](https://github.com/mapbox/mapbox-gl-native/pull/7952)) +* Fixed a memory leak in MLNMapView. ([#7956](https://github.com/mapbox/mapbox-gl-native/pull/7956)) * Fixed an issue that could prevent a cached style from appearing while the device is offline. ([#7770](https://github.com/mapbox/mapbox-gl-native/pull/7770)) * Fixed an issue that could prevent a style from loading when reestablishing a network connection. ([#7902](https://github.com/mapbox/mapbox-gl-native/pull/7902)) -* `MGLOfflineStorage` instances now support a delegate conforming to `MGLOfflineStorageDelegate`, which allows altering URLs before they are requested from the Internet. ([#8084](https://github.com/mapbox/mapbox-gl-native/pull/8084)) +* `MLNOfflineStorage` instances now support a delegate conforming to `MLNOfflineStorageDelegate`, which allows altering URLs before they are requested from the Internet. ([#8084](https://github.com/mapbox/mapbox-gl-native/pull/8084)) ### Other changes * Fixed an issue that, among other things, caused various islands to disappear at certain zoom levels. ([#7621](https://github.com/mapbox/mapbox-gl-native/pull/7621)) -* Added a method to MGLMapView that allows you to specify a predicate when querying for visible features. ([#8256](https://github.com/mapbox/mapbox-gl-native/pull/8246)) +* Added a method to MLNMapView that allows you to specify a predicate when querying for visible features. ([#8256](https://github.com/mapbox/mapbox-gl-native/pull/8246)) * Fixed flickering that occurred when panning past the antimeridian. ([#7574](https://github.com/mapbox/mapbox-gl-native/pull/7574)) * Fixed an issue that sometimes caused crashes when the SDK interacted with the file system in the background. ([#8125](https://github.com/mapbox/mapbox-gl-native/pull/8125)) -* Added a `MGLDistanceFormatter` class for formatting geographic distances. ([#7888](https://github.com/mapbox/mapbox-gl-native/pull/7888)) +* Added a `MLNDistanceFormatter` class for formatting geographic distances. ([#7888](https://github.com/mapbox/mapbox-gl-native/pull/7888)) * Fixed an issue that was causing the system location indicator to stay on in background after telemetry was disabled. ([#7833](https://github.com/mapbox/mapbox-gl-native/pull/7833)) * Added support for predicates in rendered feature querying [8256](https://github.com/mapbox/mapbox-gl-native/pull/8246) * Added a nightly build of the dynamic framework. ([#8337](https://github.com/mapbox/mapbox-gl-native/pull/8337)) @@ -1071,16 +1076,16 @@ The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iO This is the final scheduled version of the Mapbox iOS SDK that supports iOS 7. ([#8129](https://github.com/mapbox/mapbox-gl-native/pull/8129)) -* A programmatic change to an MGLMapView’s camera no longer resets the user tracking mode. ([#7856](https://github.com/mapbox/mapbox-gl-native/pull/7856)) +* A programmatic change to an MLNMapView’s camera no longer resets the user tracking mode. ([#7856](https://github.com/mapbox/mapbox-gl-native/pull/7856)) * Improved the performance of trivial camera animations. ([#7125](https://github.com/mapbox/mapbox-gl-native/pull/7125)) * Added a guide detailing the built-in gesture recognizers and various ways to configure them. ([#7937](https://github.com/mapbox/mapbox-gl-native/pull/7937)) ## 3.4.1 - January 25, 2017 * Fixed a build error in the static framework flavor of this SDK caused by a missing header. ([#7844](https://github.com/mapbox/mapbox-gl-native/pull/7844)) -* Fixed an issue causing MGLMapView’s `camera`’s `heading` to be set to a negative value, indicating an undefined heading, when the map view faces northwest. The heading is now wrapped to between zero and 360 degrees, for consistency with MGLMapView’s `direction` property. ([#7724](https://github.com/mapbox/mapbox-gl-native/pull/7724)) -* Fixed an issue where MGLMapView could initially flash black before loading. ([#7859](https://github.com/mapbox/mapbox-gl-native/pull/7859)) -* Deprecated the style class methods in MGLStyle. ([#7785](https://github.com/mapbox/mapbox-gl-native/pull/7785)) +* Fixed an issue causing MLNMapView’s `camera`’s `heading` to be set to a negative value, indicating an undefined heading, when the map view faces northwest. The heading is now wrapped to between zero and 360 degrees, for consistency with MLNMapView’s `direction` property. ([#7724](https://github.com/mapbox/mapbox-gl-native/pull/7724)) +* Fixed an issue where MLNMapView could initially flash black before loading. ([#7859](https://github.com/mapbox/mapbox-gl-native/pull/7859)) +* Deprecated the style class methods in MLNStyle. ([#7785](https://github.com/mapbox/mapbox-gl-native/pull/7785)) ## 3.4.0 - January 20, 2017 @@ -1093,23 +1098,23 @@ This is the final scheduled version of the Mapbox iOS SDK that supports iOS 7. ( ### Styles and data -* A new runtime styling API allows you to adjust the style and content of the base map dynamically. All the options available in [Mapbox Studio](https://www.mapbox.com/studio/) are now exposed via MGLStyle and subclasses of MGLStyleLayer and MGLSource. ([#5727](https://github.com/mapbox/mapbox-gl-native/pull/5727)) -* MGLMapView’s `styleURL` property can now be set to an absolute file URL. ([#6026](https://github.com/mapbox/mapbox-gl-native/pull/6026)) -* When creating an MGLShapeSource, you can now specify options for clustering point features within the shape source. Similarly, GeoJSON sources specified by the stylesheet at design time can specify the `cluster`, `clusterMaxZoom`, and `clusterRadius` attributes. ([#5724](https://github.com/mapbox/mapbox-gl-native/pull/5724)) +* A new runtime styling API allows you to adjust the style and content of the base map dynamically. All the options available in [Mapbox Studio](https://www.mapbox.com/studio/) are now exposed via MLNStyle and subclasses of MLNStyleLayer and MLNSource. ([#5727](https://github.com/mapbox/mapbox-gl-native/pull/5727)) +* MLNMapView’s `styleURL` property can now be set to an absolute file URL. ([#6026](https://github.com/mapbox/mapbox-gl-native/pull/6026)) +* When creating an MLNShapeSource, you can now specify options for clustering point features within the shape source. Similarly, GeoJSON sources specified by the stylesheet at design time can specify the `cluster`, `clusterMaxZoom`, and `clusterRadius` attributes. ([#5724](https://github.com/mapbox/mapbox-gl-native/pull/5724)) * Added [quadkey](https://msdn.microsoft.com/en-us/library/bb259689.aspx) support and limited WMS support in raster tile URL templates. ([#5628](https://github.com/mapbox/mapbox-gl-native/pull/5628)) -* When creating an MGLTileSource, you can now specify that the tile URLs use [TMS](https://en.wikipedia.org/wiki/Tile_Map_Service) coordinates by setting `MGLTileSourceOptionTileCoordinateSystem` to `MGLTileCoordinateSystemTMS`. TileJSON files can specify `"scheme": "tms"`. ([#2270](https://github.com/mapbox/mapbox-gl-native/pull/2270)) -* Fixed an issue causing abstract MGLMultiPointFeature objects to be returned in feature query results. Now concrete MGLPointCollectionFeature objects are returned. MGLMultiPointFeature is now an alias of MGLPointCollectionFeature. ([#6742](https://github.com/mapbox/mapbox-gl-native/pull/6742)) +* When creating an MLNTileSource, you can now specify that the tile URLs use [TMS](https://en.wikipedia.org/wiki/Tile_Map_Service) coordinates by setting `MLNTileSourceOptionTileCoordinateSystem` to `MLNTileCoordinateSystemTMS`. TileJSON files can specify `"scheme": "tms"`. ([#2270](https://github.com/mapbox/mapbox-gl-native/pull/2270)) +* Fixed an issue causing abstract MLNMultiPointFeature objects to be returned in feature query results. Now concrete MLNPointCollectionFeature objects are returned. MLNMultiPointFeature is now an alias of MLNPointCollectionFeature. ([#6742](https://github.com/mapbox/mapbox-gl-native/pull/6742)) * Fixed rendering artifacts and missing glyphs that occurred after viewing a large number of CJK characters on the map. ([#5908](https://github.com/mapbox/mapbox-gl-native/pull/5908)) -* `-[MGLMapView resetPosition]` now resets to the current style’s default center coordinates, zoom level, direction, and pitch, if specified. ([#6127](https://github.com/mapbox/mapbox-gl-native/pull/6127)) +* `-[MLNMapView resetPosition]` now resets to the current style’s default center coordinates, zoom level, direction, and pitch, if specified. ([#6127](https://github.com/mapbox/mapbox-gl-native/pull/6127)) * Fixed an issue where feature querying sometimes failed to return the expected features when the map was tilted. ([#6773](https://github.com/mapbox/mapbox-gl-native/pull/6773)) -* MGLFeature’s `attributes` and `identifier` properties are now writable. ([#6728](https://github.com/mapbox/mapbox-gl-native/pull/6728)) +* MLNFeature’s `attributes` and `identifier` properties are now writable. ([#6728](https://github.com/mapbox/mapbox-gl-native/pull/6728)) * The action sheet that appears when tapping the information button in the bottom-right corner now lists the correct attribution for the current style. ([#5999](https://github.com/mapbox/mapbox-gl-native/pull/5999)) -* Added support for MGLSymbolStyleLayer’s `textPitchAlignment` property and the corresponding style JSON property for improved street label legibility on a tilted map. ([#5288](https://github.com/mapbox/mapbox-gl-native/pull/5288)) -* Added support for MGLSymbolStyleLayer’s `iconTextFit` and `iconTextFitPadding` properties and the corresponding style JSON properties, allowing the background of a shield to automatically resize to fit the shield’s text. ([#5334](https://github.com/mapbox/mapbox-gl-native/pull/5334)) -* Added support for MGLSymbolStyleLayer’s `circlePitchScale` property and the corresponding style JSON property, allowing circle features in a tilted base map to scale or remain the same size as the viewing distance changes. ([#5576](https://github.com/mapbox/mapbox-gl-native/pull/5576)) -* The `identifier` property of an MGLFeature may now be either a number or string. ([#5514](https://github.com/mapbox/mapbox-gl-native/pull/5514)) -* If MGLMapView is unable to obtain or parse a style, it now calls its delegate’s `-mapViewDidFailLoadingMap:withError:` method. ([#6145](https://github.com/mapbox/mapbox-gl-native/pull/6145)) -* Added the `-[MGLMapViewDelegate mapView:didFinishLoadingStyle:]` delegate method, which offers the earliest opportunity to modify the layout or appearance of the current style before the map view is displayed to the user. ([#6636](https://github.com/mapbox/mapbox-gl-native/pull/6636)) +* Added support for MLNSymbolStyleLayer’s `textPitchAlignment` property and the corresponding style JSON property for improved street label legibility on a tilted map. ([#5288](https://github.com/mapbox/mapbox-gl-native/pull/5288)) +* Added support for MLNSymbolStyleLayer’s `iconTextFit` and `iconTextFitPadding` properties and the corresponding style JSON properties, allowing the background of a shield to automatically resize to fit the shield’s text. ([#5334](https://github.com/mapbox/mapbox-gl-native/pull/5334)) +* Added support for MLNSymbolStyleLayer’s `circlePitchScale` property and the corresponding style JSON property, allowing circle features in a tilted base map to scale or remain the same size as the viewing distance changes. ([#5576](https://github.com/mapbox/mapbox-gl-native/pull/5576)) +* The `identifier` property of an MLNFeature may now be either a number or string. ([#5514](https://github.com/mapbox/mapbox-gl-native/pull/5514)) +* If MLNMapView is unable to obtain or parse a style, it now calls its delegate’s `-mapViewDidFailLoadingMap:withError:` method. ([#6145](https://github.com/mapbox/mapbox-gl-native/pull/6145)) +* Added the `-[MLNMapViewDelegate mapView:didFinishLoadingStyle:]` delegate method, which offers the earliest opportunity to modify the layout or appearance of the current style before the map view is displayed to the user. ([#6636](https://github.com/mapbox/mapbox-gl-native/pull/6636)) * Fixed crashes that could occur when loading a malformed stylesheet. ([#5736](https://github.com/mapbox/mapbox-gl-native/pull/5736)) * Fixed an issue causing stepwise zoom functions to be misinterpreted. ([#6328](https://github.com/mapbox/mapbox-gl-native/pull/6328)) * A source’s tiles are no longer rendered when the map is outside the source’s supported zoom levels. ([#6345](https://github.com/mapbox/mapbox-gl-native/pull/6345)) @@ -1120,39 +1125,39 @@ This is the final scheduled version of the Mapbox iOS SDK that supports iOS 7. ( ### User location * The user dot now animates between user locations when user tracking is disabled. ([#6215](https://github.com/mapbox/mapbox-gl-native/pull/6215)) -* To customize the appearance of the user location annotation, subclass the newly added MGLUserLocationAnnotationView class and implement `-[MGLMapViewDelegate mapView:viewForAnnotation:]`. ([#5882](https://github.com/mapbox/mapbox-gl-native/pull/5882)) -* `-[MGLMapView viewForAnnotation:]` now returns the user location annotation view when given the user location annotation. ([#6957](https://github.com/mapbox/mapbox-gl-native/pull/6957)) +* To customize the appearance of the user location annotation, subclass the newly added MLNUserLocationAnnotationView class and implement `-[MLNMapViewDelegate mapView:viewForAnnotation:]`. ([#5882](https://github.com/mapbox/mapbox-gl-native/pull/5882)) +* `-[MLNMapView viewForAnnotation:]` now returns the user location annotation view when given the user location annotation. ([#6957](https://github.com/mapbox/mapbox-gl-native/pull/6957)) * Fixed an issue causing the user dot’s accuracy ring to wobble while zooming in and out. ([#6019](https://github.com/mapbox/mapbox-gl-native/pull/6019)) * Heading accuracy indicator sizing has been changed to appear more precise. ([#6120](https://github.com/mapbox/mapbox-gl-native/pull/6120)) * Fixed an issue that caused the map to not update to reflect the centerOffset when the user location was tracked. ([#6216](https://github.com/mapbox/mapbox-gl-native/pull/6216)) ### Annotations -* Added new methods to MGLMultiPoint for changing the vertices along a polyline annotation or the exterior of a polygon annotation. ([#6565](https://github.com/mapbox/mapbox-gl-native/pull/6565)) -* Added new APIs to MGLMapView to query for visible annotations. Combined with `-[MGLMapView viewForAnnotation:]`, these APIs can be used to access all visible annotation views. ([#6061](https://github.com/mapbox/mapbox-gl-native/pull/6061)) +* Added new methods to MLNMultiPoint for changing the vertices along a polyline annotation or the exterior of a polygon annotation. ([#6565](https://github.com/mapbox/mapbox-gl-native/pull/6565)) +* Added new APIs to MLNMapView to query for visible annotations. Combined with `-[MLNMapView viewForAnnotation:]`, these APIs can be used to access all visible annotation views. ([#6061](https://github.com/mapbox/mapbox-gl-native/pull/6061)) * Shape, feature, and annotation classes now conform to NSSecureCoding. ([#6559](https://github.com/mapbox/mapbox-gl-native/pull/6559)) * Fixed an issue causing offscreen annotation views to be updated even when they were in the reuse queue. ([#5987](https://github.com/mapbox/mapbox-gl-native/pull/5987)) -* Fixed an issue preventing MGLAnnotationView from animating when its coordinate changes. ([#6215](https://github.com/mapbox/mapbox-gl-native/pull/6215)) +* Fixed an issue preventing MLNAnnotationView from animating when its coordinate changes. ([#6215](https://github.com/mapbox/mapbox-gl-native/pull/6215)) * Fixed an issue causing the wrong annotation view to be selected when tapping an annotation view with a center offset applied. ([#5931](https://github.com/mapbox/mapbox-gl-native/pull/5931)) * Fixed an issue that assigned annotation views to polyline and polygon annotations. ([#5770](https://github.com/mapbox/mapbox-gl-native/pull/5770)) * Fixed an issue causing the callout view to be dismissed when panning around. ([#6676](https://github.com/mapbox/mapbox-gl-native/pull/6676)) -* Per documentation, the first and last coordinates in an MGLPolygon must be identical in order for the polygon to draw correctly. The same is true for an MGLPolygon’s interior polygon. ([#5514](https://github.com/mapbox/mapbox-gl-native/pull/5514)) -* To make an MGLPolyline or MGLPolygon span the antimeridian, specify coordinates with longitudes greater than 180° or less than −180°. ([#6088](https://github.com/mapbox/mapbox-gl-native/pull/6088)) +* Per documentation, the first and last coordinates in an MLNPolygon must be identical in order for the polygon to draw correctly. The same is true for an MLNPolygon’s interior polygon. ([#5514](https://github.com/mapbox/mapbox-gl-native/pull/5514)) +* To make an MLNPolyline or MLNPolygon span the antimeridian, specify coordinates with longitudes greater than 180° or less than −180°. ([#6088](https://github.com/mapbox/mapbox-gl-native/pull/6088)) * Various method arguments that are represented as C arrays of `CLLocationCoordinate2D` instances have been marked `const` to streamline bridging to Swift. ([#7215](https://github.com/mapbox/mapbox-gl-native/pull/7215)) * Fixed an issue that caused an annotation view to disappear if it isn’t created using the annotation view reuse queue. ([#6485](https://github.com/mapbox/mapbox-gl-native/pull/6485)) * Fixed an issue that could reset user-added transformations on annotation views. ([#6166](https://github.com/mapbox/mapbox-gl-native/pull/6166)) * Improved the performance of relocating a non-view-backed point annotation by changing its `coordinate` property. ([#5385](https://github.com/mapbox/mapbox-gl-native/pull/5385)) -* Fixed an issue that caused an assertion failure if a `MGLShapeCollection` (a GeoJSON GeometryCollection) was created with an empty array of shapes. ([#7632](https://github.com/mapbox/mapbox-gl-native/pull/7632)) +* Fixed an issue that caused an assertion failure if a `MLNShapeCollection` (a GeoJSON GeometryCollection) was created with an empty array of shapes. ([#7632](https://github.com/mapbox/mapbox-gl-native/pull/7632)) * Improved the precision of annotations at zoom levels greater than 18. ([#5517](https://github.com/mapbox/mapbox-gl-native/pull/5517)) ### Networking and offline maps -* Fixed an issue preventing an MGLMapView from loading tiles while an offline pack is downloading. ([#6446](https://github.com/mapbox/mapbox-gl-native/pull/6446)) +* Fixed an issue preventing an MLNMapView from loading tiles while an offline pack is downloading. ([#6446](https://github.com/mapbox/mapbox-gl-native/pull/6446)) * Fixed a crash that could occur when the device is disconnected while downloading an offline pack. ([#6293](https://github.com/mapbox/mapbox-gl-native/pull/6293)) * Fixed a crash that occurred when encountering a rate-limit error in response to a network request. ([#6223](https://github.com/mapbox/mapbox-gl-native/pull/6223)) -* Fixed an issue causing an MGLOfflinePack’s progress to continue to update after calling `-suspend`. ([#6186](https://github.com/mapbox/mapbox-gl-native/pull/6186)) +* Fixed an issue causing an MLNOfflinePack’s progress to continue to update after calling `-suspend`. ([#6186](https://github.com/mapbox/mapbox-gl-native/pull/6186)) * Fixed an issue preventing cached annotation images from displaying while the device is offline. ([#6358](https://github.com/mapbox/mapbox-gl-native/pull/6358)) -* Added support for an `MGLMapboxAPIBaseURL` key in an app's `Info.plist` in order to customize the base URL used for retrieving map data, styles, and other resources. ([#6709](https://github.com/mapbox/mapbox-gl-native/pull/6709)) +* Added support for an `MLNMapboxAPIBaseURL` key in an app's `Info.plist` in order to customize the base URL used for retrieving map data, styles, and other resources. ([#6709](https://github.com/mapbox/mapbox-gl-native/pull/6709)) * Query parameters are no longer stripped from mapbox: URLs used as resource URLs. ([#6182](https://github.com/mapbox/mapbox-gl-native/pull/6182), [#6432](https://github.com/mapbox/mapbox-gl-native/pull/6432)) * Database errors are now logged to the console. ([#6291](https://github.com/mapbox/mapbox-gl-native/pull/6291)) @@ -1162,9 +1167,9 @@ This is the final scheduled version of the Mapbox iOS SDK that supports iOS 7. ( * Improved the performance of symbol style layers. ([#7025](https://github.com/mapbox/mapbox-gl-native/pull/7025)) * As the user zooms in, tiles from lower zoom levels are scaled up until tiles for higher zoom levels are loaded. ([#5143](https://github.com/mapbox/mapbox-gl-native/pull/5143)) * Notification names and user info keys are now string enumeration values for ease of use in Swift. ([#6794](https://github.com/mapbox/mapbox-gl-native/pull/6794)) -* MGLMapDebugOverdrawVisualizationMask no longer has any effect in Release builds of the SDK. This debug mask has been disabled for performance reasons. ([#5555](https://github.com/mapbox/mapbox-gl-native/pull/5555)) -* Fixed a typo in the documentation for the MGLCompassDirectionFormatter class. ([#5879](https://github.com/mapbox/mapbox-gl-native/pull/5879)) -* The UITapGestureRecognizer on MGLMapView that is used for selecting annotations now fails if a tap does not select an annotation. ([#7246](https://github.com/mapbox/mapbox-gl-native/pull/7246)) +* MLNMapDebugOverdrawVisualizationMask no longer has any effect in Release builds of the SDK. This debug mask has been disabled for performance reasons. ([#5555](https://github.com/mapbox/mapbox-gl-native/pull/5555)) +* Fixed a typo in the documentation for the MLNCompassDirectionFormatter class. ([#5879](https://github.com/mapbox/mapbox-gl-native/pull/5879)) +* The UITapGestureRecognizer on MLNMapView that is used for selecting annotations now fails if a tap does not select an annotation. ([#7246](https://github.com/mapbox/mapbox-gl-native/pull/7246)) * Fixed issues related to the visibility of sources in viewports less than 512 pixels wide or tall. ([#7438](https://github.com/mapbox/mapbox-gl-native/pull/7438)) ## 3.3.7 - November 17, 2016 @@ -1173,14 +1178,14 @@ This is the final scheduled version of the Mapbox iOS SDK that supports iOS 7. ( ## 3.3.6 - November 9, 2016 -* Fixed a crash that occurred during low-memory situations when multiple instances of MGLMapView were in the view hierarchy. The speculative fix in v3.3.5 has been reverted. ([#6972](https://github.com/mapbox/mapbox-gl-native/pull/6972)) +* Fixed a crash that occurred during low-memory situations when multiple instances of MLNMapView were in the view hierarchy. The speculative fix in v3.3.5 has been reverted. ([#6972](https://github.com/mapbox/mapbox-gl-native/pull/6972)) ## 3.3.5 - November 2, 2016 * Speculatively fixed an OpenGL rendering crash. ([#6844](https://github.com/mapbox/mapbox-gl-native/pull/6844)) * Fixed an issue with symbols not being properly stripped from the dynamic framework. The dSYM file included with the standard dynamic framework in previous releases (e.g., `mapbox-ios-sdk-3.3.4-dynamic.zip` or the `Mapbox-iOS-SDK` pod) could not be used to symbolicate crashes. ([#6531](https://github.com/mapbox/mapbox-gl-native/pull/6531)) * Simulator architecture slices are included in the included dSYM file, allowing you to symbolicate crashes that occur in the Simulator. ([#5740](https://github.com/mapbox/mapbox-gl-native/pull/5740)) -* Fixed a crash that sometimes occurred when initializing an MGLMapView. ([#5932](https://github.com/mapbox/mapbox-gl-native/pull/5932)) +* Fixed a crash that sometimes occurred when initializing an MLNMapView. ([#5932](https://github.com/mapbox/mapbox-gl-native/pull/5932)) ## 3.3.4 - August 8, 2016 @@ -1192,7 +1197,7 @@ This is the final scheduled version of the Mapbox iOS SDK that supports iOS 7. ( ## 3.3.2 - July 28, 2016 -* Speculatively fixed a crash that occurred when initializing an MGLMapView on iOS 7.x. ([#5791](https://github.com/mapbox/mapbox-gl-native/pull/5791)) +* Speculatively fixed a crash that occurred when initializing an MLNMapView on iOS 7.x. ([#5791](https://github.com/mapbox/mapbox-gl-native/pull/5791)) * View-backed annotations no longer prevent the user from starting to pan the map. ([#5813](https://github.com/mapbox/mapbox-gl-native/pull/5813)) * Fixed an issue that caused the user dot to be selected when tapping an annotation that lies within the user dot’s accuracy circle. ([#5816](https://github.com/mapbox/mapbox-gl-native/pull/5816)) @@ -1200,53 +1205,53 @@ This is the final scheduled version of the Mapbox iOS SDK that supports iOS 7. ( * Fixed a crash that occurred when a sprite URL lacks a file extension. See [this comment](https://github.com/mapbox/mapbox-gl-native/issues/5722#issuecomment-233701251) to determine who may be affected by this bug. ([#5723](https://github.com/mapbox/mapbox-gl-native/pull/5723)) * Fixed an issue causing overlapping polylines and polygons to be drawn in undefined z-order. Shapes are always drawn in the order they are added to the map, from the oldest on the bottom to the newest on the top. ([#5710](https://github.com/mapbox/mapbox-gl-native/pull/5710)) -* Fixed an issue preventing MGLMapView from changing its viewport when a single annotation was passed into `-[MGLMapView showAnnotations:animated:]`. ([#5693](https://github.com/mapbox/mapbox-gl-native/pull/5693)) +* Fixed an issue preventing MLNMapView from changing its viewport when a single annotation was passed into `-[MLNMapView showAnnotations:animated:]`. ([#5693](https://github.com/mapbox/mapbox-gl-native/pull/5693)) * Fixed an issue causing polyline and polygon annotations to disappear when the zoom level is one less than the maximum zoom level. ([#5418](https://github.com/mapbox/mapbox-gl-native/pull/5418)) * Fixed a crash that occurred when a style or other resource URL has a query string. ([#5554](https://github.com/mapbox/mapbox-gl-native/pull/5554)) -* If you subclass MGLAnnotationView, your implementation of `-setSelected:animated:` is now called with the correct value in the `animated` parameter, making it possible to animate a deselection. ([#5677](https://github.com/mapbox/mapbox-gl-native/pull/5677)) +* If you subclass MLNAnnotationView, your implementation of `-setSelected:animated:` is now called with the correct value in the `animated` parameter, making it possible to animate a deselection. ([#5677](https://github.com/mapbox/mapbox-gl-native/pull/5677)) * The compass, Mapbox logo, and attribution button now accommodate the containing map view’s content insets. If your interface elements partially overlap the map view but do not affect the top and bottom layout guides, set the `automaticallyAdjustsScrollViewInsets` property to `NO` and set the `contentInset` property to a suitable value. ([#5671](https://github.com/mapbox/mapbox-gl-native/pull/5671)) -* Added a property to MGLOfflineStorage, `countOfBytesCompleted`, that indicates the disk space occupied by all cached and offline resources. ([#5585](https://github.com/mapbox/mapbox-gl-native/pull/5585)) +* Added a property to MLNOfflineStorage, `countOfBytesCompleted`, that indicates the disk space occupied by all cached and offline resources. ([#5585](https://github.com/mapbox/mapbox-gl-native/pull/5585)) ## 3.3.0 - July 14, 2016 ### Styles and data -- Added methods to MGLMapView for obtaining the underlying map data rendered by the current style, along with additional classes to represent complex geometry in that data. ([#5110](https://github.com/mapbox/mapbox-gl-native/pull/5110)) +- Added methods to MLNMapView for obtaining the underlying map data rendered by the current style, along with additional classes to represent complex geometry in that data. ([#5110](https://github.com/mapbox/mapbox-gl-native/pull/5110)) - Improved performance viewing regions with large landcover polygons when viewing a style that uses the Mapbox Streets source. ([#2444](https://github.com/mapbox/mapbox-gl-native/pull/2444)) - Fixed a memory leak when using raster resources. ([#5141](https://github.com/mapbox/mapbox-gl-native/pull/5141)) -- Rendering now occurs on the main thread, fixing a hang when calling `-[MGLMapView styleURL]` before the map view has fully loaded or while the application is in the background. ([#2909](https://github.com/mapbox/mapbox-gl-native/pull/2909)) -- Added a `-reloadStyle:` action to MGLMapView to force a reload of the current style. ([#4728](https://github.com/mapbox/mapbox-gl-native/pull/4728)) +- Rendering now occurs on the main thread, fixing a hang when calling `-[MLNMapView styleURL]` before the map view has fully loaded or while the application is in the background. ([#2909](https://github.com/mapbox/mapbox-gl-native/pull/2909)) +- Added a `-reloadStyle:` action to MLNMapView to force a reload of the current style. ([#4728](https://github.com/mapbox/mapbox-gl-native/pull/4728)) - A more specific user agent string is now sent with style and tile requests. ([#4012](https://github.com/mapbox/mapbox-gl-native/pull/4012)) -- Added a new option to `MGLMapDebugMaskOptions`, `MGLMapDebugOverdrawVisualizationMask`, that highlights overlapping drawing operations instead of the usual rendered output. ([#5403](https://github.com/mapbox/mapbox-gl-native/pull/5403)) +- Added a new option to `MLNMapDebugMaskOptions`, `MLNMapDebugOverdrawVisualizationMask`, that highlights overlapping drawing operations instead of the usual rendered output. ([#5403](https://github.com/mapbox/mapbox-gl-native/pull/5403)) ### Interactivity - The compass, user dot, and visible annotations are now accessible to VoiceOver users. ([#1496](https://github.com/mapbox/mapbox-gl-native/pull/1496)) -- Added a method to MGLMapView, `-anchorPointForGesture:`, that you can override to anchor gestures at a point other than the user location. ([#5302](https://github.com/mapbox/mapbox-gl-native/pull/5302)) -- Added a property to MGLMapView, `decelerationRate`, that allows you to speed up or slow down the drift animation at the end of a user gesture. You can also use this property to disable the drift animation entirely. ([#5504](https://github.com/mapbox/mapbox-gl-native/pull/5504)) +- Added a method to MLNMapView, `-anchorPointForGesture:`, that you can override to anchor gestures at a point other than the user location. ([#5302](https://github.com/mapbox/mapbox-gl-native/pull/5302)) +- Added a property to MLNMapView, `decelerationRate`, that allows you to speed up or slow down the drift animation at the end of a user gesture. You can also use this property to disable the drift animation entirely. ([#5504](https://github.com/mapbox/mapbox-gl-native/pull/5504)) - Improved responsiveness when zooming in then immediately panning around. ([#4595](https://github.com/mapbox/mapbox-gl-native/pull/4595)) -- Added a new method, `-[MGLMapView cameraThatFitsCoordinateBounds:]`, to get a camera that you can pass into `-setCamera:` that fits the given coordinate bounds. ([#4790](https://github.com/mapbox/mapbox-gl-native/pull/4790)) +- Added a new method, `-[MLNMapView cameraThatFitsCoordinateBounds:]`, to get a camera that you can pass into `-setCamera:` that fits the given coordinate bounds. ([#4790](https://github.com/mapbox/mapbox-gl-native/pull/4790)) ### Annotations -- MGLPointAnnotation and custom MGLAnnotation implementations (but not MGLMultiPoint) can be backed by an MGLAnnotationView instead of an MGLAnnotationImage. MGLAnnotationView is a subclass of UIView, so you can use Core Animation and other familiar technologies with it. To associate an MGLAnnotation with an MGLAnnotationView, implement `-mapView:viewForAnnotation:` in your MGLMapViewDelegate class. ([#4801](https://github.com/mapbox/mapbox-gl-native/pull/4801)) -- An MGLAnnotation can be relocated by changing its `coordinate` property in a KVO-compliant way. An MGLMultiPoint cannot be relocated. ([#3835](https://github.com/mapbox/mapbox-gl-native/pull/3835)) -- Setting the `image` property of an MGLAnnotationImage to `nil` resets it to the default red pin image and reclaims resources that can be used to customize additional annotations. ([#3835](https://github.com/mapbox/mapbox-gl-native/pull/3835)) -- An MGLPolygon can now have interior polygons, representing holes knocked out of the overall shape. ([#5110](https://github.com/mapbox/mapbox-gl-native/pull/5110)) +- MLNPointAnnotation and custom MLNAnnotation implementations (but not MLNMultiPoint) can be backed by an MLNAnnotationView instead of an MLNAnnotationImage. MLNAnnotationView is a subclass of UIView, so you can use Core Animation and other familiar technologies with it. To associate an MLNAnnotation with an MLNAnnotationView, implement `-mapView:viewForAnnotation:` in your MLNMapViewDelegate class. ([#4801](https://github.com/mapbox/mapbox-gl-native/pull/4801)) +- An MLNAnnotation can be relocated by changing its `coordinate` property in a KVO-compliant way. An MLNMultiPoint cannot be relocated. ([#3835](https://github.com/mapbox/mapbox-gl-native/pull/3835)) +- Setting the `image` property of an MLNAnnotationImage to `nil` resets it to the default red pin image and reclaims resources that can be used to customize additional annotations. ([#3835](https://github.com/mapbox/mapbox-gl-native/pull/3835)) +- An MLNPolygon can now have interior polygons, representing holes knocked out of the overall shape. ([#5110](https://github.com/mapbox/mapbox-gl-native/pull/5110)) ### User location - The user dot now moves smoothly between user location updates while user location tracking is disabled. ([#1582](https://github.com/mapbox/mapbox-gl-native/pull/1582)) -- Fixed an issue preventing KVO change notifications from being generated on MGLMapView’s `userTrackingMode` key path when `-setUserTrackingMode:animated:` is called. ([#4724](https://github.com/mapbox/mapbox-gl-native/pull/4724)) -- Fixed a crash setting MGLMapView’s `userLocationVerticalAlignment` property before a user location update has occurred. ([#5278](https://github.com/mapbox/mapbox-gl-native/pull/5278)) +- Fixed an issue preventing KVO change notifications from being generated on MLNMapView’s `userTrackingMode` key path when `-setUserTrackingMode:animated:` is called. ([#4724](https://github.com/mapbox/mapbox-gl-native/pull/4724)) +- Fixed a crash setting MLNMapView’s `userLocationVerticalAlignment` property before a user location update has occurred. ([#5278](https://github.com/mapbox/mapbox-gl-native/pull/5278)) - Mapbox Telemetry is automatically disabled while the host application is running in the iOS Simulator. ([#4726](https://github.com/mapbox/mapbox-gl-native/pull/4726)) ### Offline maps -- `MGLOfflinePackProgress` now indicates how many tiles have been downloaded and how much space they take up. ([#4874](https://github.com/mapbox/mapbox-gl-native/pull/4874)) +- `MLNOfflinePackProgress` now indicates how many tiles have been downloaded and how much space they take up. ([#4874](https://github.com/mapbox/mapbox-gl-native/pull/4874)) - Fixed an issue where the tile cache could be included in iCloud backups on the first launch. ([#5124](https://github.com/mapbox/mapbox-gl-native/pull/5124), [#5601](https://github.com/mapbox/mapbox-gl-native/pull/5601)) - Suppressed “Unable to make space for entry” console spew. ([#4708](https://github.com/mapbox/mapbox-gl-native/pull/4708)) -- Deprecated `-[MGLMapView emptyMemoryCache]`. ([#4725](https://github.com/mapbox/mapbox-gl-native/pull/4725)) +- Deprecated `-[MLNMapView emptyMemoryCache]`. ([#4725](https://github.com/mapbox/mapbox-gl-native/pull/4725)) ### Packaging @@ -1258,20 +1263,20 @@ This is the final scheduled version of the Mapbox iOS SDK that supports iOS 7. ( ### Other changes -- Added category methods on NSValue for converting to and from the structure types defined in MGLGeometry.h. ([#4802](https://github.com/mapbox/mapbox-gl-native/pull/4802)) +- Added category methods on NSValue for converting to and from the structure types defined in MLNGeometry.h. ([#4802](https://github.com/mapbox/mapbox-gl-native/pull/4802)) - Added NSFormatter subclasses for converting geographic coordinates and directions into display strings. ([#4802](https://github.com/mapbox/mapbox-gl-native/pull/4802)) -- Added `MGLCoordinateInCoordinateBounds()`, a function that tests whether or not a coordinate is in a given bounds. ([#5053](https://github.com/mapbox/mapbox-gl-native/pull/5053)) +- Added `MLNCoordinateInCoordinateBounds()`, a function that tests whether or not a coordinate is in a given bounds. ([#5053](https://github.com/mapbox/mapbox-gl-native/pull/5053)) ## 3.2.3 - June 7, 2016 -- Fixed an issue preventing `-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]` from being called when returning to the view controller containing the map view from another view controller. ([#5164](https://github.com/mapbox/mapbox-gl-native/pull/5164)) +- Fixed an issue preventing `-[MLNMapViewDelegate mapViewDidFinishLoadingMap:]` from being called when returning to the view controller containing the map view from another view controller. ([#5164](https://github.com/mapbox/mapbox-gl-native/pull/5164)) - Declarations in the API documentation are shown in both Objective-C and Swift. ([realm/jazzy#530](https://github.com/realm/jazzy/pull/530)) ## 3.2.2 - May 10, 2016 -- Existing MGLStyle class methods that return default style URLs have been deprecated in favor of new methods that require an explicit style version parameter. The deprecated, unversioned methods continue to return version 8 of the respective styles and will not be updated as new versions of the styles are released. ([#4759](https://github.com/mapbox/mapbox-gl-native/pull/4759)) -- Deprecated `+[MGLStyle emeraldStyleURL]` with no replacement method. To use the Emerald style going forward, we recommend that you use the underlying URL. ([#4759](https://github.com/mapbox/mapbox-gl-native/pull/4759)) -- Added `+[MGLStyle outdoorsStyleURLWithVersion:]` for the new Outdoors style. ([#4759](https://github.com/mapbox/mapbox-gl-native/pull/4759)) +- Existing MLNStyle class methods that return default style URLs have been deprecated in favor of new methods that require an explicit style version parameter. The deprecated, unversioned methods continue to return version 8 of the respective styles and will not be updated as new versions of the styles are released. ([#4759](https://github.com/mapbox/mapbox-gl-native/pull/4759)) +- Deprecated `+[MLNStyle emeraldStyleURL]` with no replacement method. To use the Emerald style going forward, we recommend that you use the underlying URL. ([#4759](https://github.com/mapbox/mapbox-gl-native/pull/4759)) +- Added `+[MLNStyle outdoorsStyleURLWithVersion:]` for the new Outdoors style. ([#4759](https://github.com/mapbox/mapbox-gl-native/pull/4759)) - The Hybrid style is now called Satellite Streets. ([#4759](https://github.com/mapbox/mapbox-gl-native/pull/4759)) ## 3.2.1 - April 20, 2016 @@ -1283,7 +1288,7 @@ This is the final scheduled version of the Mapbox iOS SDK that supports iOS 7. ( ## 3.2.0 - April 5, 2016 - If you’ve previously installed the SDK as a static framework, the installation workflow has changed to address issues when submitting your application to the App Store or installing it on a device. Upon upgrading to this version of the SDK, you’ll need to add Mapbox.bundle to the Copy Bundle Resources build phase and remove Mapbox.framework from the Embed Frameworks build phase. ([#4455](https://github.com/mapbox/mapbox-gl-native/pull/4455)) -- Offline packs can now be downloaded to allow users to view specific regions of the map offline. A new MGLOfflineStorage class provides APIs for managing MGLOfflinePacks. ([#4221](https://github.com/mapbox/mapbox-gl-native/pull/4221)) +- Offline packs can now be downloaded to allow users to view specific regions of the map offline. A new MLNOfflineStorage class provides APIs for managing MLNOfflinePacks. ([#4221](https://github.com/mapbox/mapbox-gl-native/pull/4221)) - Tiles and other resources are cached in the same file that holds offline resources. The combined cache file is located in a subdirectory of the user’s Application Support directory, which means iOS will not delete the file when disk space runs low. ([#4377](https://github.com/mapbox/mapbox-gl-native/pull/4377)) - Fixed an issue where the map view’s center would always be calculated as if the view occupied the entire screen. ([#4504](https://github.com/mapbox/mapbox-gl-native/issues/4504)) - The user dot no longer disappears after panning the map across the antimeridian at low zoom levels. ([#4275](https://github.com/mapbox/mapbox-gl-native/pull/4275)) @@ -1299,12 +1304,12 @@ This is the final scheduled version of the Mapbox iOS SDK that supports iOS 7. ( - Polygons and polylines now default to using the map view’s tint color. ([#4028](https://github.com/mapbox/mapbox-gl-native/pull/4028)) - The user dot no longer lags when panning the map. ([#3683](https://github.com/mapbox/mapbox-gl-native/pull/3683)) - The Improve This Map tool now uses the same zoom level that is currently being shown in the map view. ([#4068](https://github.com/mapbox/mapbox-gl-native/pull/4068)) -- Fixed a formatting issue in the documentation for `MGLCoordinateBoundsIsEmpty()`. ([#3958](https://github.com/mapbox/mapbox-gl-native/pull/3958)) +- Fixed a formatting issue in the documentation for `MLNCoordinateBoundsIsEmpty()`. ([#3958](https://github.com/mapbox/mapbox-gl-native/pull/3958)) ## 3.1.2 - February 22, 2016 - You can once again install the static framework without manually linking several framework and library dependencies. ([#4029](https://github.com/mapbox/mapbox-gl-native/pull/4029)) -- The location manager used by MGLMapView to show the user’s location is now paused when the application is sent to the background. ([#4034](https://github.com/mapbox/mapbox-gl-native/pull/4034)) +- The location manager used by MLNMapView to show the user’s location is now paused when the application is sent to the background. ([#4034](https://github.com/mapbox/mapbox-gl-native/pull/4034)) ## 3.1.1 - February 15, 2016 @@ -1313,36 +1318,36 @@ This is the final scheduled version of the Mapbox iOS SDK that supports iOS 7. ( - Fixed a crash that can occur when reselecting an annotation. ([#3881](https://github.com/mapbox/mapbox-gl-native/pull/3881)) - Fixed an issue preventing the Latitude inspectable from working when it is set before setting the Zoom Level inspectable in Interface Builder. ([#3886](https://github.com/mapbox/mapbox-gl-native/pull/3886)) - Fixed an issue that incorrectly expanded the tappable area of an annotation and prevented the annotation’s alignment rect insets from having any effect on the tappable area. ([#3898](https://github.com/mapbox/mapbox-gl-native/pull/3898)) -- Fixed an issue preventing `-[MGLMapViewDelegate mapView:tapOnCalloutForAnnotation:]` from being called when a non-custom callout view is tapped. ([#3875](https://github.com/mapbox/mapbox-gl-native/pull/3875)) +- Fixed an issue preventing `-[MLNMapViewDelegate mapView:tapOnCalloutForAnnotation:]` from being called when a non-custom callout view is tapped. ([#3875](https://github.com/mapbox/mapbox-gl-native/pull/3875)) ## 3.1.0 - February 5, 2016 - The SDK is now distributed as a dynamic framework instead of a static library, resulting in a simpler installation workflow and significantly reduced download size. The framework contains both simulator and device content. If you install the dynamic framework manually, you’ll need to strip out the simulator content before submitting your application to the App Store due to [an Xcode bug](http://www.openradar.me/radar?id=6409498411401216); see the installation instructions included with the framework for details. ([#3183](https://github.com/mapbox/mapbox-gl-native/pull/3183)) -- Fixed an issue causing the entire MGLMapView to leak. ([#3448](https://github.com/mapbox/mapbox-gl-native/pull/3448)) -- `MGLMapView` methods that alter the viewport now accept optional completion handlers. ([#3090](https://github.com/mapbox/mapbox-gl-native/pull/3090)) +- Fixed an issue causing the entire MLNMapView to leak. ([#3448](https://github.com/mapbox/mapbox-gl-native/pull/3448)) +- `MLNMapView` methods that alter the viewport now accept optional completion handlers. ([#3090](https://github.com/mapbox/mapbox-gl-native/pull/3090)) - You can now modify an annotation’s image after adding the annotation to the map. ([#3146](https://github.com/mapbox/mapbox-gl-native/pull/3146)) - Tapping now selects annotations more reliably. Tapping near the top of a large annotation image now selects that annotation. An annotation image’s alignment insets influence how far away the user can tap and still select the annotation. For example, if your annotation image has a large shadow, you can keep that shadow from being tappable by excluding it from the image’s alignment rect. ([#3261](https://github.com/mapbox/mapbox-gl-native/pull/3261)) - Annotations remain visible after switching to a different style. ([#3049](https://github.com/mapbox/mapbox-gl-native/pull/3049)) - The minimum and maximum zoom levels can now be configured using the `minimumZoomLevel` and `maximumZoomLevel` properties, respectively. The map is no longer limited to zoom level 18: by default, the maximum zoom level is now 20, allowing for a more detailed map in urban areas. ([#3712](https://github.com/mapbox/mapbox-gl-native/pull/3712)) -- A new method on MGLMapView, `-flyToCamera:withDuration:completionHandler:`, lets you transition between viewpoints along an arc as if by aircraft. ([#3171](https://github.com/mapbox/mapbox-gl-native/pull/3171), [#3301](https://github.com/mapbox/mapbox-gl-native/pull/3301)) -- MGLMapCamera’s `altitude` values now match those of MKMapCamera. ([#3362](https://github.com/mapbox/mapbox-gl-native/pull/3362)) -- MGLMapView properties like `centerCoordinate` and `camera` now offset the center to account for any translucent top or bottom bar. As a result, when user tracking is enabled and the map view is an immediate child of a view controller, the user dot is centered in the unobscured portion of the map view. To override this offset, modify the `contentInset` property; you may also need to set the containing view controller’s `automaticallyAdjustsScrollViewInsets` property to `NO`. ([#3583](https://github.com/mapbox/mapbox-gl-native/pull/3583)) -- In user tracking mode, the user dot stays in a fixed position within MGLMapView while the map pans smoothly. A new property, `userLocationVerticalAlignment`, determines the user dot’s fixed position. ([#3589](https://github.com/mapbox/mapbox-gl-native/pull/3589)) -- When the user tracking mode is set to `MGLUserTrackingModeFollowWithCourse`, an optional `targetCoordinate` is kept within sight at all times as the user changes location. This property, in conjunction with the `userLocationVerticalAlignment` property, may be useful for displaying the user’s progress toward a waypoint. ([#3680](https://github.com/mapbox/mapbox-gl-native/pull/3680)) -- Heading or course tracking mode can now be enabled as soon as an MGLMapView is initialized. ([#3680](https://github.com/mapbox/mapbox-gl-native/pull/3680)) +- A new method on MLNMapView, `-flyToCamera:withDuration:completionHandler:`, lets you transition between viewpoints along an arc as if by aircraft. ([#3171](https://github.com/mapbox/mapbox-gl-native/pull/3171), [#3301](https://github.com/mapbox/mapbox-gl-native/pull/3301)) +- MLNMapCamera’s `altitude` values now match those of MKMapCamera. ([#3362](https://github.com/mapbox/mapbox-gl-native/pull/3362)) +- MLNMapView properties like `centerCoordinate` and `camera` now offset the center to account for any translucent top or bottom bar. As a result, when user tracking is enabled and the map view is an immediate child of a view controller, the user dot is centered in the unobscured portion of the map view. To override this offset, modify the `contentInset` property; you may also need to set the containing view controller’s `automaticallyAdjustsScrollViewInsets` property to `NO`. ([#3583](https://github.com/mapbox/mapbox-gl-native/pull/3583)) +- In user tracking mode, the user dot stays in a fixed position within MLNMapView while the map pans smoothly. A new property, `userLocationVerticalAlignment`, determines the user dot’s fixed position. ([#3589](https://github.com/mapbox/mapbox-gl-native/pull/3589)) +- When the user tracking mode is set to `MLNUserTrackingModeFollowWithCourse`, an optional `targetCoordinate` is kept within sight at all times as the user changes location. This property, in conjunction with the `userLocationVerticalAlignment` property, may be useful for displaying the user’s progress toward a waypoint. ([#3680](https://github.com/mapbox/mapbox-gl-native/pull/3680)) +- Heading or course tracking mode can now be enabled as soon as an MLNMapView is initialized. ([#3680](https://github.com/mapbox/mapbox-gl-native/pull/3680)) - Zooming and rotation gestures no longer disable user tracking mode. ([#3589](https://github.com/mapbox/mapbox-gl-native/pull/3589)) - User tracking mode starts out at a lower zoom level by default. ([#3589](https://github.com/mapbox/mapbox-gl-native/pull/3589)) - Fixed an issue with small map views not properly fitting annotations within bounds. ([#3407](https://github.com/mapbox/mapbox-gl-native/pull/3407)) - When the user rotates the map to within 7° of true north, the map view now snaps to true north. ([#3403](https://github.com/mapbox/mapbox-gl-native/pull/3403)) -- The map view’s background can now be transparent or translucent, as long as the style’s background layer is transparent or translucent and `MGLMapView.opaque` is set to `NO`. ([#3096](https://github.com/mapbox/mapbox-gl-native/pull/3096)) +- The map view’s background can now be transparent or translucent, as long as the style’s background layer is transparent or translucent and `MLNMapView.opaque` is set to `NO`. ([#3096](https://github.com/mapbox/mapbox-gl-native/pull/3096)) - Documentation is now generated by [jazzy](https://github.com/realm/jazzy) instead of appledoc. ♪♫ ([#3203](https://github.com/mapbox/mapbox-gl-native/pull/3203)) - New API to provide a custom callout view to the map for annotations. ([#3456](https://github.com/mapbox/mapbox-gl-native/pull/3456)) - Made telemetry on/off setting available in-app. ([#3445](https://github.com/mapbox/mapbox-gl-native/pull/3445)) - Fixed an issue with users not being counted by Mapbox if they had disabled telemetry. ([#3495](https://github.com/mapbox/mapbox-gl-native/pull/3495)) -- Fixed crash caused by MGLAnnotationImage with non-integer width or height ([#2198](https://github.com/mapbox/mapbox-gl-native/issues/2198)) +- Fixed crash caused by MLNAnnotationImage with non-integer width or height ([#2198](https://github.com/mapbox/mapbox-gl-native/issues/2198)) - Fixed “include of non-modular header” errors in Swift projects managed by CocoaPods. ([#3679](https://github.com/mapbox/mapbox-gl-native/pull/3679)) - Avoids triggering the blue background location status bar when user has granted "when in use" permission. ([#3671](https://github.com/mapbox/mapbox-gl-native/issues/3671)) -- Deprecated the `debugActive` property and `-toggleDebug` method on MGLMapView in favor of a new `debugMask` property that exposes individual style debugging options. ([#3742](https://github.com/mapbox/mapbox-gl-native/pull/3742)) +- Deprecated the `debugActive` property and `-toggleDebug` method on MLNMapView in favor of a new `debugMask` property that exposes individual style debugging options. ([#3742](https://github.com/mapbox/mapbox-gl-native/pull/3742)) ## 3.0.1 - December 7, 2015 @@ -1353,18 +1358,18 @@ This is the final scheduled version of the Mapbox iOS SDK that supports iOS 7. ( ## 3.0.0 - November 23, 2015 - If you install this SDK via CocoaPods, CocoaPods version 0.38.0 or above is required. ([#2132](https://github.com/mapbox/mapbox-gl-native/pull/2132)) -- The `styleID` property has been removed from MGLMapView. Instead, set the `styleURL` property to an NSURL in the form `mapbox://styles/STYLE_ID`. If you previously set the style ID in Interface Builder’s Attributes inspector, delete the `styleID` entry from the User Defined Runtime Attributes section of the Identity inspector, then set the new “Style URL” inspectable to a value in the form `mapbox://styles/STYLE_ID`. ([#2632](https://github.com/mapbox/mapbox-gl-native/pull/2632)) -- Default styles such as Streets are no longer bundled with the SDK; instead, they are loaded at runtime from the style API on mapbox.com. As always, you can use these default styles with any valid access token, and Streets continues to be `MGLMapView`’s initial style. The `bundledStyleURLs` property on `MGLMapView` has been deprecated in favor of several class methods on `MGLStyle` that provide direct access to the default styles. ([#2746](https://github.com/mapbox/mapbox-gl-native/pull/2746)) +- The `styleID` property has been removed from MLNMapView. Instead, set the `styleURL` property to an NSURL in the form `mapbox://styles/STYLE_ID`. If you previously set the style ID in Interface Builder’s Attributes inspector, delete the `styleID` entry from the User Defined Runtime Attributes section of the Identity inspector, then set the new “Style URL” inspectable to a value in the form `mapbox://styles/STYLE_ID`. ([#2632](https://github.com/mapbox/mapbox-gl-native/pull/2632)) +- Default styles such as Streets are no longer bundled with the SDK; instead, they are loaded at runtime from the style API on mapbox.com. As always, you can use these default styles with any valid access token, and Streets continues to be `MLNMapView`’s initial style. The `bundledStyleURLs` property on `MLNMapView` has been deprecated in favor of several class methods on `MLNStyle` that provide direct access to the default styles. ([#2746](https://github.com/mapbox/mapbox-gl-native/pull/2746)) - The SDK now builds with Bitcode enabled. A version of libMapbox.a with Bitcode disabled is also available. ([#2332](https://github.com/mapbox/mapbox-gl-native/issues/2332), [#3003](https://github.com/mapbox/mapbox-gl-native/pull/3003)) - The style URL can be set to a local resource: `asset://local-color.json` and `local-color.json` both resolve to a file named `local-color.json` in the application’s root folder. ([#3087](https://github.com/mapbox/mapbox-gl-native/pull/3087)) - The double-tap-drag gesture for zooming in and out is now consistent with the Google Maps SDK. ([#2153](https://github.com/mapbox/mapbox-gl-native/pull/2153)) -- A new `MGLAnnotationImage.enabled` property allows you to disable touch events on individual annotations. ([#2501](https://github.com/mapbox/mapbox-gl-native/pull/2501)) +- A new `MLNAnnotationImage.enabled` property allows you to disable touch events on individual annotations. ([#2501](https://github.com/mapbox/mapbox-gl-native/pull/2501)) - Fixed a rendering issue that caused one-way arrows along tile boundaries to point due east instead of in the direction of travel. ([#2530](https://github.com/mapbox/mapbox-gl-native/pull/2530)) - Fixed an issue that prevented zoom level–dependent style properties from updating after zooming programmatically with animation. ([#2951](https://github.com/mapbox/mapbox-gl-native/pull/2951)) - Performance and appearance improvements during annotation adds & removes. ([#1688](https://github.com/mapbox/mapbox-gl-native/issues/1688)) - Overall improved performance during renders by not rendering faster than necessary. ([#1975](https://github.com/mapbox/mapbox-gl-native/issues/1975)) - Fixed a rendering issue with styles that use the `background-pattern` property. ([#2531](https://github.com/mapbox/mapbox-gl-native/pull/2531)) -- Fixed a crash when reusing a single `MGLMapView` across multiple `UIViewController`s. ([#2969](https://github.com/mapbox/mapbox-gl-native/pull/2969)) +- Fixed a crash when reusing a single `MLNMapView` across multiple `UIViewController`s. ([#2969](https://github.com/mapbox/mapbox-gl-native/pull/2969)) - Fixed a crash on iPod touch and other devices or simulators without a cell carrier. ([#2687](https://github.com/mapbox/mapbox-gl-native/issues/2687)) - Eliminated flickering when opening and closing an overlay, such as an alert or action sheet. ([#2309](https://github.com/mapbox/mapbox-gl-native/pull/2309)) - Labels can now line wrap on hyphens and other punctuation. ([#2598](https://github.com/mapbox/mapbox-gl-native/pull/2598)) @@ -1386,17 +1391,17 @@ This is the final scheduled version of the Mapbox iOS SDK that supports iOS 7. ( ## 2.1.0 - September 14, 2015 - A two-finger vertical swipe now tilts the map into perspective mode. ([#2116](https://github.com/mapbox/mapbox-gl-native/pull/2116)) -- A new `MGLMapCamera` API allows you to transition multiple viewpoint properties, including rotation and pitch, simultaneously with an optional custom duration and timing function. ([#2193](https://github.com/mapbox/mapbox-gl-native/pull/2193)) -- A new user tracking mode, `MGLUserTrackingModeFollowWithCourse`, has been added for indicating the current direction of travel. ([#2068](https://github.com/mapbox/mapbox-gl-native/pull/2068)) +- A new `MLNMapCamera` API allows you to transition multiple viewpoint properties, including rotation and pitch, simultaneously with an optional custom duration and timing function. ([#2193](https://github.com/mapbox/mapbox-gl-native/pull/2193)) +- A new user tracking mode, `MLNUserTrackingModeFollowWithCourse`, has been added for indicating the current direction of travel. ([#2068](https://github.com/mapbox/mapbox-gl-native/pull/2068)) - Version 8 (`v8`) of the [Mapbox GL style spec](https://www.mapbox.com/mapbox-gl-style-spec/) is now required. If you are using a custom `v7` style, it needs to be upgraded using [this migrator script](https://github.com/mapbox/mapbox-gl-style-spec/blob/mb-pages/migrations/v7.js). ([#2052](https://github.com/mapbox/mapbox-gl-native/pull/2052)) - Applications built with Mapbox GL no longer crash when Location Services launches them in background mode. ([#1821](https://github.com/mapbox/mapbox-gl-native/pull/1821), [#1869](https://github.com/mapbox/mapbox-gl-native/pull/1869)) -- Fixed a crash when adding annotations to an `MGLMapView` inside `-viewDidLoad`. ([#1874](https://github.com/mapbox/mapbox-gl-native/pull/1874)) +- Fixed a crash when adding annotations to an `MLNMapView` inside `-viewDidLoad`. ([#1874](https://github.com/mapbox/mapbox-gl-native/pull/1874)) - The user location annotation view now indicates the location reading’s accuracy and the device’s heading. ([#2010](https://github.com/mapbox/mapbox-gl-native/pull/2010)) - Eliminated linker warnings and errors when building against the iOS 9.0 SDK in Xcode 7. ([#1962](https://github.com/mapbox/mapbox-gl-native/pull/1962)) - Worked around a bug in the iOS 9.0 SDK that caused a crash on launch. ([#1958](https://github.com/mapbox/mapbox-gl-native/pull/1958)) -- User location tracking no longer sends `MGLMapView` into an invalid region on iOS 9. ([#1925](https://github.com/mapbox/mapbox-gl-native/pull/1925)) +- User location tracking no longer sends `MLNMapView` into an invalid region on iOS 9. ([#1925](https://github.com/mapbox/mapbox-gl-native/pull/1925)) - Eliminated console spew in the iOS demo application that was related to Mapbox Metrics HTTP requests. ([#1937](https://github.com/mapbox/mapbox-gl-native/issues/1937)) -- Implemented `-[MGLMapView showAnnotations:animated:]`. ([#2050](https://github.com/mapbox/mapbox-gl-native/pull/2050)) +- Implemented `-[MLNMapView showAnnotations:animated:]`. ([#2050](https://github.com/mapbox/mapbox-gl-native/pull/2050)) - Fixed a crash adding a shape annotation with zero points. ([#2098](https://github.com/mapbox/mapbox-gl-native/pull/2098)) - Debug mode now displays information useful for debugging the label collision algorithm. ([#1808](https://github.com/mapbox/mapbox-gl-native/pull/1808)) - Minor style updates. ([#1910](https://github.com/mapbox/mapbox-gl-native/pull/1910)) @@ -1432,17 +1437,17 @@ Repackaging 0.5.1 as the Mapbox iOS SDK 2.0.0 series. ### iOS - **Breaking:** Headers now make use of lightweight generics, eliminating many unnecessary casts when working with annotations in Swift 2.0 in Xcode 7. ([#1711](https://github.com/mapbox/mapbox-gl-native/pull/1711)) -- **Breaking:** `-mapView:symbolNameForAnnotation:` has been removed from the `MGLMapViewDelegate` protocol. Implement `-mapView:imageForAnnotation:` instead, which accepts images at runtime. ([#941](https://github.com/mapbox/mapbox-gl-native/pull/941)) -- **Breaking:** `MGLMapView.direction` is now expressed in terms of degrees clockwise from true north, as indicated in the documentation, rather than counterclockwise. ([#1789](https://github.com/mapbox/mapbox-gl-native/pull/1789)) +- **Breaking:** `-mapView:symbolNameForAnnotation:` has been removed from the `MLNMapViewDelegate` protocol. Implement `-mapView:imageForAnnotation:` instead, which accepts images at runtime. ([#941](https://github.com/mapbox/mapbox-gl-native/pull/941)) +- **Breaking:** `MLNMapView.direction` is now expressed in terms of degrees clockwise from true north, as indicated in the documentation, rather than counterclockwise. ([#1789](https://github.com/mapbox/mapbox-gl-native/pull/1789)) - A Satellite style showing Mapbox Satellite imagery is now bundled with Mapbox GL. ([#1845](https://github.com/mapbox/mapbox-gl-native/pull/1845)) - Improved `UIView` tracking to the map. ([#1813](https://github.com/mapbox/mapbox-gl-native/pull/1813)) -- Delegate method `-[MGLMapViewDelegate mapView:didFailToLocateUserWithError:]` now works. ([#1608](https://github.com/mapbox/mapbox-gl-native/pull/1608)) -- It is now possible to fit the map’s viewport to a coordinate bounding box via `-[MGLMapView setVisibleCoordinateBounds:animated:]` or to a specific set of coordinates via `-[MGLMapView setVisibleCoordinates:count:edgePadding:animated:]`. ([#1783](https://github.com/mapbox/mapbox-gl-native/pull/1783), [#1795](https://github.com/mapbox/mapbox-gl-native/pull/1795)) -- The logo and ℹ️ no longer disappear or get distorted after embedding MGLMapView in a different view, and you can now access these subviews directly via properties on MGLMapView. ([#1779](https://github.com/mapbox/mapbox-gl-native/pull/1779), [#1815](https://github.com/mapbox/mapbox-gl-native/pull/1815)) +- Delegate method `-[MLNMapViewDelegate mapView:didFailToLocateUserWithError:]` now works. ([#1608](https://github.com/mapbox/mapbox-gl-native/pull/1608)) +- It is now possible to fit the map’s viewport to a coordinate bounding box via `-[MLNMapView setVisibleCoordinateBounds:animated:]` or to a specific set of coordinates via `-[MLNMapView setVisibleCoordinates:count:edgePadding:animated:]`. ([#1783](https://github.com/mapbox/mapbox-gl-native/pull/1783), [#1795](https://github.com/mapbox/mapbox-gl-native/pull/1795)) +- The logo and ℹ️ no longer disappear or get distorted after embedding MLNMapView in a different view, and you can now access these subviews directly via properties on MLNMapView. ([#1779](https://github.com/mapbox/mapbox-gl-native/pull/1779), [#1815](https://github.com/mapbox/mapbox-gl-native/pull/1815)) - Raster tiles now look sharper midway between two zoom levels. ([#1843](https://github.com/mapbox/mapbox-gl-native/pull/1843)) - Resetting the map rotation to north no longer also resets the user location tracking mode. ([#1809](https://github.com/mapbox/mapbox-gl-native/pull/1809)) -- `-[MGLMapView convertPoint:toCoordinateFromView:]` now returns accurate coordinates on iPhone 6. ([#1827](https://github.com/mapbox/mapbox-gl-native/pull/1827)) -- Fixed an issue in which `-[MGLMapView direction]` would sometimes return 360 instead of 0. ([#1829](https://github.com/mapbox/mapbox-gl-native/pull/1829)) +- `-[MLNMapView convertPoint:toCoordinateFromView:]` now returns accurate coordinates on iPhone 6. ([#1827](https://github.com/mapbox/mapbox-gl-native/pull/1827)) +- Fixed an issue in which `-[MLNMapView direction]` would sometimes return 360 instead of 0. ([#1829](https://github.com/mapbox/mapbox-gl-native/pull/1829)) - Build against iOS 8.4. ([#1868](https://github.com/mapbox/mapbox-gl-native/pull/1868)) ## 0.4.0 - June 19, 2015 @@ -1458,13 +1463,13 @@ Repackaging 0.5.1 as the Mapbox iOS SDK 2.0.0 series. ### iOS -- **Breaking:** `MGLMapView` no longer manages Mapbox access tokens directly; an access token cannot be passed in when initializing the map view. Instead, set `MGLMapboxAccessToken` to your access token in your app’s `Info.plist` file, or call `+[MGLAccountManager setAccessToken:]` before initializing the map view. If you were setting the access token inside an Interface Builder inspectable, also remove it from the User Defined Runtime Attributes section of the Identity inspector. ([#1553](https://github.com/mapbox/mapbox-gl-native/issues/1553)) -- **Breaking:** `MGLAccountManager`'s `-setMapboxMetricsEnabledSettingShownInApp:` has been removed. If you implement a Mapbox Metrics switch inside your app, instead of inside a Settings bundle, set `MGLMapboxMetricsEnabledSettingShownInApp` to `YES` in the `Info.plist` file. ([#1553](https://github.com/mapbox/mapbox-gl-native/issues/1553)) -- **Breaking:** `MGLMapView`'s `-mapID` has been renamed to `-styleID`. ([#1561](https://github.com/mapbox/mapbox-gl-native/issues/1561)) +- **Breaking:** `MLNMapView` no longer manages Mapbox access tokens directly; an access token cannot be passed in when initializing the map view. Instead, set `MLNMapboxAccessToken` to your access token in your app’s `Info.plist` file, or call `+[MLNAccountManager setAccessToken:]` before initializing the map view. If you were setting the access token inside an Interface Builder inspectable, also remove it from the User Defined Runtime Attributes section of the Identity inspector. ([#1553](https://github.com/mapbox/mapbox-gl-native/issues/1553)) +- **Breaking:** `MLNAccountManager`'s `-setMapboxMetricsEnabledSettingShownInApp:` has been removed. If you implement a Mapbox Metrics switch inside your app, instead of inside a Settings bundle, set `MLNMapboxMetricsEnabledSettingShownInApp` to `YES` in the `Info.plist` file. ([#1553](https://github.com/mapbox/mapbox-gl-native/issues/1553)) +- **Breaking:** `MLNMapView`'s `-mapID` has been renamed to `-styleID`. ([#1561](https://github.com/mapbox/mapbox-gl-native/issues/1561)) - Headers have been audited for nullability, improving type safety in both Objective-C and Swift 1.2 when compiling with Xcode 6.3 or above. ([#1578](https://github.com/mapbox/mapbox-gl-native/issues/1578)) - Fixed an issue in which the map would sometimes spin 180° while rotating the map with two fingers. ([#1453](https://github.com/mapbox/mapbox-gl-native/issues/1453)) -- Added a shortcut to the Mapbox Metrics switch in `MGLMapView`'s action sheet that is attached to the ℹ️ button. ([#1611](https://github.com/mapbox/mapbox-gl-native/issues/1611)) -- `MGLMapView` now supports Interface Builder designables. When you add an `MGLMapView` to a storyboard, it displays instructions for getting set up directly on the storyboard canvas. ([#1573](https://github.com/mapbox/mapbox-gl-native/issues/1573)) +- Added a shortcut to the Mapbox Metrics switch in `MLNMapView`'s action sheet that is attached to the ℹ️ button. ([#1611](https://github.com/mapbox/mapbox-gl-native/issues/1611)) +- `MLNMapView` now supports Interface Builder designables. When you add an `MLNMapView` to a storyboard, it displays instructions for getting set up directly on the storyboard canvas. ([#1573](https://github.com/mapbox/mapbox-gl-native/issues/1573)) - The default title for the user location annotation is now “You Are Here”. You can customize the title by setting `mapView.userAnnotation.title`. ([#1559](https://github.com/mapbox/mapbox-gl-native/issues/1559)) - Internal use of the Reachability library has been cleaned up so that your app can include its own copy of Reachability. ([#1718](https://github.com/mapbox/mapbox-gl-native/issues/1718)) - Now distribute a binary stripped of debugging symbols by default with an optional, secondary symbols build. ([#1650](https://github.com/mapbox/mapbox-gl-native/issues/1650)) diff --git a/platform/ios/platform/ios/CONTRIBUTING.md b/platform/ios/platform/ios/CONTRIBUTING.md index e7406ee2d..90d637332 100644 --- a/platform/ios/platform/ios/CONTRIBUTING.md +++ b/platform/ios/platform/ios/CONTRIBUTING.md @@ -73,11 +73,11 @@ The most convenient way to generate the DocC based documentation locally is usin The code samples in the header files & [iOS API Documentation](https://maplibre.org/maplibre-gl-native/ios/api/) are generated by a unit test. An example of auto generated documentation is the unit test -[MGLDocumentationExampleTests.swift](../darwin/test/MGLDocumentationExampleTests.swift) +[MLNDocumentationExampleTests.swift](../darwin/test/MLNDocumentationExampleTests.swift) which generates styling examples in the `.h` file for styling either a -[Circle](https://maplibre.org/maplibre-gl-native/ios/api/Classes/MGLCircleStyleLayer.html), -[Heatmap](https://maplibre.org/maplibre-gl-native/ios/api/Classes/MGLHeatmapStyleLayer.html), or -[Line](https://maplibre.org/maplibre-gl-native/ios/api/Classes/MGLLineStyleLayer.html). For more details see [Adding a code example](DEVELOPING.md#adding-a-code-example). +[Circle](https://maplibre.org/maplibre-gl-native/ios/api/Classes/MLNCircleStyleLayer.html), +[Heatmap](https://maplibre.org/maplibre-gl-native/ios/api/Classes/MLNHeatmapStyleLayer.html), or +[Line](https://maplibre.org/maplibre-gl-native/ios/api/Classes/MLNLineStyleLayer.html). For more details see [Adding a code example](DEVELOPING.md#adding-a-code-example). Use `make` to update API documentation: @@ -100,14 +100,14 @@ open documentation/ To add any Objective-C type, constant, or member to the iOS SDK’s public interface: 1. Ensure that the symbol is pure Objective-C and does not rely on any language features specific to Objective-C++ or the C11 dialect of C – so no namespaced types or classes named with emoji! 🙃 Most projects that depend on this SDK are either written in pure Objective-C (GNU99 dialect) or Swift, which cannot yet bridge C++ types. -1. Name the symbol according to [Cocoa naming conventions](https://developer.apple.com/library/prerelease/content/documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html#//apple_ref/doc/uid/10000146i). Use the `MGL` class prefix to avoid conflicts with client code. If the symbol has an analogue in MapKit, name the symbol according to MapKit. +1. Name the symbol according to [Cocoa naming conventions](https://developer.apple.com/library/prerelease/content/documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html#//apple_ref/doc/uid/10000146i). Use the `MLN` class prefix to avoid conflicts with client code. If the symbol has an analogue in MapKit, name the symbol according to MapKit. 1. Provide full documentation comments. We use [jazzy](https://github.com/realm/jazzy/) to produce the documentation found in the SDK distribution and [on the website for this SDK](https://maplibre.org/maplibre-gl-native/ios/api/). We also recognize that many developers rely on Xcode’s Quick Help feature. jazzy supports Markdown formatting; however, Quick Help supports only [HeaderDoc](https://developer.apple.com/legacy/library/documentation/DeveloperTools/Conceptual/HeaderDoc/intro/intro.html) syntax and a subset of Doxygen syntax. For hyperlinks, use HTML syntax, which is recognized by both tools. ### Making a type or constant public To add an Objective-C class, protocol, category, typedef, enumeration, or global constant to the iOS maps SDK’s public interface: -1. _(Optional.)_ Add the macro `MGL_EXPORT` prior to the declaration for classes and global constants when adding them in shared headers located in `platform/darwin`. To use this macro, include `MGLFoundation.h`. You can check whether all public symbols are exported correctly by running `make darwin-check-public-symbols`. +1. _(Optional.)_ Add the macro `MLN_EXPORT` prior to the declaration for classes and global constants when adding them in shared headers located in `platform/darwin`. To use this macro, include `MLNFoundation.h`. You can check whether all public symbols are exported correctly by running `make darwin-check-public-symbols`. 1. _(Optional.)_ Add the type or constant’s name to the relevant category in the `custom_categories` section of [the jazzy configuration file](./jazzy.yml). This is required for classes and protocols and also recommended for any other type that is strongly associated with a particular class or protocol. If you leave out this step, the symbol will appear in an “Other” section in the generated HTML documentation’s table of contents. 1. _(Optional.)_ If the symbol would also be publicly exposed in the macOS maps SDK, consult [the companion macOS document](../macos/DEVELOPING.md#making-a-type-or-constant-public) for further instructions. @@ -132,7 +132,7 @@ To add a resource (such as an image, SSL certificate, property list, or strings To add or update text that the user may see in the iOS maps SDK: -1. Make sure the implementation file imports [NSBundle+MGLAdditions.h](../darwin/src/NSBundle+MGLAdditions.h). +1. Make sure the implementation file imports [NSBundle+MLNAdditions.h](../darwin/src/NSBundle+MLNAdditions.h). 1. Use the `NSLocalizedStringWithDefaultValue()` macro: * `key` is a unique identifier that won’t change if the user-facing text ever needs to change. * `tbl` is `Foundation` in code shared between the iOS and macOS maps SDKs, or `nil` otherwise. @@ -170,7 +170,7 @@ find platform/{darwin,ios}/resources platform/macos/sdk -path '*/MYLANG.lproj/*. To add an example code listing to the documentation for a class or class member: - 1. Add a test case named in the form `testMGLClass` or `testMGLClass$method` to [MGLDocumentationExamplesTests](../darwin/test/MGLDocumentationExampleTests.swift). + 1. Add a test case named in the form `testMLNClass` or `testMLNClass$method` to [MLNDocumentationExamplesTests](../darwin/test/MLNDocumentationExampleTests.swift). 2. Wrap the code you'd like to appear in the documentation within the following comment blocks: ``` @@ -204,9 +204,9 @@ You can review test results in `$(IOS_OUTPUT_PATH)/Logs/Test`. These commands are run by default on a single Simulator. To enable legacy iOS versions and more device types, add `MORE_SIMULATORS=YES`. Use `IOS_LATEST=YES`, `IOS_11=YES`, etc. to test on specific iOS versions. -To only run a specific test or class of tests, add `ONLY_TESTING=test/MGLNameOfTestClass/testNameOfTest`. +To only run a specific test or class of tests, add `ONLY_TESTING=test/MLNNameOfTestClass/testNameOfTest`. -To skip a specific test or class of tests, add `SKIP_TESTING=test/MGLNameOfTestClass/testNameOfTest`. +To skip a specific test or class of tests, add `SKIP_TESTING=test/MLNNameOfTestClass/testNameOfTest`. To run the cross-platform tests in Xcode instead of on the command line: diff --git a/platform/ios/platform/ios/INSTALL.md b/platform/ios/platform/ios/INSTALL.md index ee1a8c03b..20753619f 100644 --- a/platform/ios/platform/ios/INSTALL.md +++ b/platform/ios/platform/ios/INSTALL.md @@ -206,11 +206,11 @@ If you require a build with debug symbols pre-stripped, use [this feed URL](http ### Configuration -1. Some vector tiles servers require a API key. In the project editor, select the application target, then go to the Info tab. Under the “Custom iOS Target Properties” section, set `MGLApiKey` to your api key.. +1. Some vector tiles servers require a API key. In the project editor, select the application target, then go to the Info tab. Under the “Custom iOS Target Properties” section, set `MLNApiKey` to your api key.. ### Usage -In a storyboard or XIB, add a view to your view controller. (Drag View from the Object library to the View Controller scene on the Interface Builder canvas.) In the Identity inspector, set the view’s custom class to `MGLMapView`. If you need to manipulate the map view programmatically: +In a storyboard or XIB, add a view to your view controller. (Drag View from the Object library to the View Controller scene on the Interface Builder canvas.) In the Identity inspector, set the view’s custom class to `MLNMapView`. If you need to manipulate the map view programmatically: 1. Switch to the Assistant Editor. 1. Import the `Mapbox` module. @@ -222,7 +222,7 @@ In a storyboard or XIB, add a view to your view controller. (Drag View from the @interface ViewController : UIViewController -@property (strong) IBOutlet MGLMapView *mapView; +@property (strong) IBOutlet MLNMapView *mapView; @end ``` @@ -232,6 +232,6 @@ In a storyboard or XIB, add a view to your view controller. (Drag View from the import Mapbox class ViewController: UIViewController { - @IBOutlet var mapView: MGLMapView! + @IBOutlet var mapView: MLNMapView! } ``` diff --git a/platform/ios/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.mm b/platform/ios/platform/ios/Integration Tests/Annotation Tests/MLNAnnotationViewIntegrationTests.mm similarity index 90% rename from platform/ios/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.mm rename to platform/ios/platform/ios/Integration Tests/Annotation Tests/MLNAnnotationViewIntegrationTests.mm index cf89e275b..0cbc1da14 100644 --- a/platform/ios/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.mm +++ b/platform/ios/platform/ios/Integration Tests/Annotation Tests/MLNAnnotationViewIntegrationTests.mm @@ -1,21 +1,21 @@ -#import "MGLMapViewIntegrationTest.h" -#import "MGLTestUtility.h" -#import "MGLMapAccessibilityElement.h" -#import "MGLTestLocationManager.h" -#import "MGLCompactCalloutView.h" +#import "MLNMapViewIntegrationTest.h" +#import "MLNTestUtility.h" +#import "MLNMapAccessibilityElement.h" +#import "MLNTestLocationManager.h" +#import "MLNCompactCalloutView.h" -#import "MGLGeometry_Private.h" -#import "MGLMapView_Private.h" +#import "MLNGeometry_Private.h" +#import "MLNMapView_Private.h" #include #include #include -@interface MGLTestCalloutView : MGLCompactCalloutView +@interface MLNTestCalloutView : MLNCompactCalloutView @property (nonatomic) BOOL implementsMarginHints; @end -@implementation MGLTestCalloutView +@implementation MLNTestCalloutView - (BOOL)respondsToSelector:(SEL)aSelector { if (!self.implementsMarginHints && (aSelector == @selector(marginInsetsHintForPresentationFromRect:))) { @@ -26,19 +26,19 @@ @end -@interface MGLMapView (Tests) -- (MGLAnnotationTag)annotationTagAtPoint:(CGPoint)point persistingResults:(BOOL)persist; -- (id )annotationWithTag:(MGLAnnotationTag)tag; -- (MGLMapCamera *)cameraByRotatingToDirection:(CLLocationDirection)degrees aroundAnchorPoint:(CGPoint)anchorPoint; -- (MGLMapCamera *)cameraByZoomingToZoomLevel:(double)zoom aroundAnchorPoint:(CGPoint)anchorPoint; -- (MGLMapCamera *)cameraForCameraOptions:(const mbgl::CameraOptions &)cameraOptions; -@property (nonatomic) UIView *calloutViewForSelectedAnnotation; +@interface MLNMapView (Tests) +- (MLNAnnotationTag)annotationTagAtPoint:(CGPoint)point persistingResults:(BOOL)persist; +- (id )annotationWithTag:(MLNAnnotationTag)tag; +- (MLNMapCamera *)cameraByRotatingToDirection:(CLLocationDirection)degrees aroundAnchorPoint:(CGPoint)anchorPoint; +- (MLNMapCamera *)cameraByZoomingToZoomLevel:(double)zoom aroundAnchorPoint:(CGPoint)anchorPoint; +- (MLNMapCamera *)cameraForCameraOptions:(const mbgl::CameraOptions &)cameraOptions; +@property (nonatomic) UIView *calloutViewForSelectedAnnotation; @end -@interface MGLAnnotationViewIntegrationTests : MGLMapViewIntegrationTest +@interface MLNAnnotationViewIntegrationTests : MLNMapViewIntegrationTest @end -@implementation MGLAnnotationViewIntegrationTests +@implementation MLNAnnotationViewIntegrationTests // MARK: - Offscreen/panning selection tests @@ -70,18 +70,18 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; XCTAssert(self.mapView.annotations.count == 0); - NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReuseIdentifer"; + NSString * const MLNTestAnnotationReuseIdentifer = @"MLNTestAnnotationReuseIdentifer"; CGSize size = self.mapView.bounds.size; CGSize annotationSize = CGSizeMake(floor(size.width*kAnnotationRelativeScale.x), floor(size.height*kAnnotationRelativeScale.y)); - self.viewForAnnotation = ^MGLAnnotationView*(MGLMapView *view, id annotation) { + self.viewForAnnotation = ^MLNAnnotationView*(MLNMapView *view, id annotation) { - if (![annotation isKindOfClass:[MGLPointAnnotation class]]) { + if (![annotation isKindOfClass:[MLNPointAnnotation class]]) { return nil; } // No dequeue - MGLAnnotationView *annotationView = [[MGLAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:MGLTestAnnotationReuseIdentifer]; + MLNAnnotationView *annotationView = [[MLNAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:MLNTestAnnotationReuseIdentifer]; annotationView.bounds = (CGRect){ .origin = CGPointZero, .size = annotationSize }; annotationView.backgroundColor = UIColor.redColor; annotationView.enabled = YES; @@ -93,19 +93,19 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; CGPoint annotationPoint = CGPointMake(floor(relativeCoordinate.x * size.width), floor(relativeCoordinate.y * size.height) ); CLLocationCoordinate2D coordinate = [self.mapView convertPoint:annotationPoint toCoordinateFromView:self.mapView]; - MGLPointAnnotation *point = [[MGLPointAnnotation alloc] init]; + MLNPointAnnotation *point = [[MLNPointAnnotation alloc] init]; point.title = title; point.coordinate = coordinate; - self.mapViewAnnotationCanShowCalloutForAnnotation = ^BOOL(MGLMapView *mapView, id annotation) { + self.mapViewAnnotationCanShowCalloutForAnnotation = ^BOOL(MLNMapView *mapView, id annotation) { return showsCallout; }; - self.mapViewCalloutViewForAnnotation = ^id(MGLMapView *mapView, id annotation) { + self.mapViewCalloutViewForAnnotation = ^id(MLNMapView *mapView, id annotation) { if (!showsCallout) return nil; - MGLTestCalloutView *calloutView = [[MGLTestCalloutView alloc] init]; + MLNTestCalloutView *calloutView = [[MLNTestCalloutView alloc] init]; calloutView.representedObject = annotation; calloutView.implementsMarginHints = calloutImplementsMarginHints; return calloutView; @@ -129,7 +129,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; [selectionCompleted fulfill]; }]; - // Animated selection takes MGLAnimationDuration (0.3 seconds), so wait a little + // Animated selection takes MLNAnimationDuration (0.3 seconds), so wait a little // longer. We don't need to wait as long if we're not animated (but we do // want the runloop to tick over) @@ -174,7 +174,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; XCTAssertNotNil(calloutView); // This can fail if the callout view's width is < the annotations. This is really a warning, so - // if you need this NOT to fail the tests, consider replacing with MGLTestWarning + // if you need this NOT to fail the tests, consider replacing with MLNTestWarning XCTAssert(expectCalloutToBeFullyOnscreen == CGRectContainsRectWithAccuracy(self.mapView.bounds, calloutView.frame, 0.25), @"Expect contains:%d, Mapview:%@ annotation:%@ callout:%@", expectCalloutToBeFullyOnscreen, @@ -203,7 +203,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; // If kAnnotationScale == 0.25, then the following assert can fail. // This is really a warning (see https://github.com/mapbox/mapbox-gl-native/issues/13744 ) - // If you need this NOT to fail the tests, consider replacing with MGLTestWarning + // If you need this NOT to fail the tests, consider replacing with MLNTestWarning XCTAssert((expectCalloutToBeFullyOnscreen == CGRectContainsRectWithAccuracy(self.mapView.bounds, calloutView.frame, 0.25)), @"Mapview:%@ annotation:%@ callout:%@", NSStringFromCGRect(self.mapView.bounds), @@ -428,21 +428,21 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; - (void)internalTestSelectingAnnotationWithCenterOffsetWithOffset:(CGVector)offset edgeInsets:(UIEdgeInsets)edgeInsets { - NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReuseIdentifer"; + NSString * const MLNTestAnnotationReuseIdentifer = @"MLNTestAnnotationReuseIdentifer"; self.mapView.contentInset = edgeInsets; CGSize size = self.mapView.bounds.size; CGSize annotationSize = CGSizeMake(40.0, 40.0); - self.viewForAnnotation = ^MGLAnnotationView*(MGLMapView *view, id annotation) { + self.viewForAnnotation = ^MLNAnnotationView*(MLNMapView *view, id annotation) { - if (![annotation isKindOfClass:[MGLPointAnnotation class]]) { + if (![annotation isKindOfClass:[MLNPointAnnotation class]]) { return nil; } // No dequeue - MGLAnnotationView *annotationView = [[MGLAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:MGLTestAnnotationReuseIdentifer]; + MLNAnnotationView *annotationView = [[MLNAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:MLNTestAnnotationReuseIdentifer]; annotationView.bounds = (CGRect){ .origin = CGPointZero, .size = annotationSize }; annotationView.backgroundColor = UIColor.redColor; annotationView.enabled = YES; @@ -451,7 +451,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; return annotationView; }; - MGLPointAnnotation *point = [[MGLPointAnnotation alloc] init]; + MLNPointAnnotation *point = [[MLNPointAnnotation alloc] init]; point.title = NSStringFromSelector(_cmd); point.coordinate = CLLocationCoordinate2DMake(0.0, 0.0); [self.mapView addAnnotation:point]; @@ -476,7 +476,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; // Now test taps around the annotation CGPoint tapPoint = CGPointMake(annotationPoint.x + offset.dx, annotationPoint.y + offset.dy); - MGLAnnotationTag tagAtPoint = [self.mapView annotationTagAtPoint:tapPoint persistingResults:YES]; + MLNAnnotationTag tagAtPoint = [self.mapView annotationTagAtPoint:tapPoint persistingResults:YES]; XCTAssert(tagAtPoint != UINT32_MAX, @"Should have tapped on annotation"); CGPoint testPoints[] = { @@ -498,23 +498,23 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; - (void)testUserLocationWithOffsetAnchorPoint { [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(37.787357, -122.39899)]; - MGLTestLocationManager *locationManager = [[MGLTestLocationManager alloc] init]; + MLNTestLocationManager *locationManager = [[MLNTestLocationManager alloc] init]; self.mapView.locationManager = locationManager; - [self.mapView setUserTrackingMode:MGLUserTrackingModeFollow animated:NO completionHandler:nil]; + [self.mapView setUserTrackingMode:MLNUserTrackingModeFollow animated:NO completionHandler:nil]; CGRect originalFrame = [self.mapView viewForAnnotation:self.mapView.userLocation].frame; // Temporarily disable location tracking so we can save the value of // the originalFrame in memory - [self.mapView setUserTrackingMode:MGLUserTrackingModeNone animated:NO completionHandler:nil]; + [self.mapView setUserTrackingMode:MLNUserTrackingModeNone animated:NO completionHandler:nil]; CGPoint offset = CGPointMake(20, 20); - self.mapViewUserLocationAnchorPoint = ^CGPoint (MGLMapView *mapView) { + self.mapViewUserLocationAnchorPoint = ^CGPoint (MLNMapView *mapView) { return offset;; }; - [self.mapView setUserTrackingMode:MGLUserTrackingModeFollow animated:NO completionHandler:nil]; + [self.mapView setUserTrackingMode:MLNUserTrackingModeFollow animated:NO completionHandler:nil]; CGRect offsetFrame = [self.mapView viewForAnnotation:self.mapView.userLocation].frame; XCTAssertEqual(originalFrame.origin.x + offset.x, offsetFrame.origin.x); @@ -531,7 +531,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; }; NSArray *annotations = [self internalAddAnnotationsAtCoordinates:coordinates]; - MGLPointAnnotation *annotation = annotations.firstObject; + MLNPointAnnotation *annotation = annotations.firstObject; // Rotate CLLocationDirection lastAngle = 0.0; @@ -547,7 +547,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; [XCTContext runActivityNamed:activityTitle block:^(id _Nonnull activity) { - MGLMapCamera *toCamera = [self.mapView cameraByRotatingToDirection:angle aroundAnchorPoint:anchor]; + MLNMapCamera *toCamera = [self.mapView cameraByRotatingToDirection:angle aroundAnchorPoint:anchor]; [self internalTestSelecting:annotation withCamera:toCamera]; }]; @@ -563,7 +563,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; }; NSArray *annotations = [self internalAddAnnotationsAtCoordinates:coordinates]; - MGLPointAnnotation *annotation = annotations.firstObject; + MLNPointAnnotation *annotation = annotations.firstObject; CGPoint anchor = CGPointMake(CGRectGetMidX(self.mapView.bounds), CGRectGetMidY(self.mapView.bounds)); @@ -575,7 +575,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; NSString *activityTitle = [NSString stringWithFormat:@"Zoom to %0.1f", zoom]; [XCTContext runActivityNamed:activityTitle block:^(id _Nonnull activity) { - MGLMapCamera *toCamera = [self.mapView cameraByZoomingToZoomLevel:zoom aroundAnchorPoint:anchor]; + MLNMapCamera *toCamera = [self.mapView cameraByZoomingToZoomLevel:zoom aroundAnchorPoint:anchor]; [self internalTestSelecting:annotation withCamera:toCamera]; }]; } @@ -589,7 +589,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; }; NSArray *annotations = [self internalAddAnnotationsAtCoordinates:coordinates]; - MGLPointAnnotation *annotation = annotations.firstObject; + MLNPointAnnotation *annotation = annotations.firstObject; srand48(0); for (NSInteger iter = 0; iter < 10; iter++ ) { @@ -608,7 +608,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; currentCameraOptions.bearing = angle; currentCameraOptions.anchor = mbgl::ScreenCoordinate { anchor.x, anchor.y }; currentCameraOptions.zoom = zoom; - MGLMapCamera *toCamera = [self.mapView cameraForCameraOptions:currentCameraOptions]; + MLNMapCamera *toCamera = [self.mapView cameraForCameraOptions:currentCameraOptions]; [self internalTestSelecting:annotation withCamera:toCamera]; }]; @@ -675,7 +675,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; // seeing in https://github.com/mapbox/mapbox-gl-native/issues/15106 [self waitForCollisionDetectionToRun]; - for (MGLPointAnnotation *point in annotations) { + for (MLNPointAnnotation *point in annotations) { [self internalSelectDeselectAnnotation:point]; } @@ -692,18 +692,18 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; block:^(id _Nonnull activity) { - NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReuseIdentifer"; + NSString * const MLNTestAnnotationReuseIdentifer = @"MLNTestAnnotationReuseIdentifer"; CGSize annotationSize = CGSizeMake(40.0, 40.0); - self.viewForAnnotation = ^MGLAnnotationView*(MGLMapView *view, id annotation2) { + self.viewForAnnotation = ^MLNAnnotationView*(MLNMapView *view, id annotation2) { - if (![annotation2 isKindOfClass:[MGLPointAnnotation class]]) { + if (![annotation2 isKindOfClass:[MLNPointAnnotation class]]) { return nil; } // No dequeue - MGLAnnotationView *annotationView = [[MGLAnnotationView alloc] initWithAnnotation:annotation2 reuseIdentifier:MGLTestAnnotationReuseIdentifer]; + MLNAnnotationView *annotationView = [[MLNAnnotationView alloc] initWithAnnotation:annotation2 reuseIdentifier:MLNTestAnnotationReuseIdentifer]; annotationView.bounds = (CGRect){ .origin = CGPointZero, .size = annotationSize }; annotationView.backgroundColor = UIColor.redColor; annotationView.enabled = YES; @@ -715,7 +715,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; while (!isnan(coordinatePtr->latitude)) { CLLocationCoordinate2D coordinate = *coordinatePtr++; - MGLPointAnnotation *annotation = [[MGLPointAnnotation alloc] init]; + MLNPointAnnotation *annotation = [[MLNPointAnnotation alloc] init]; annotation.title = NSStringFromSelector(_cmd); annotation.coordinate = coordinate; [annotations addObject:annotation]; @@ -731,7 +731,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; return copiedAnnotations; } -- (void)internalTestSelecting:(MGLPointAnnotation*)point withCamera:(MGLMapCamera*)camera { +- (void)internalTestSelecting:(MLNPointAnnotation*)point withCamera:(MLNMapCamera*)camera { // Rotate XCTestExpectation *rotationCompleted = [self expectationWithDescription:@"rotationCompleted"]; @@ -748,16 +748,16 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; [self internalSelectDeselectAnnotation:point]; } -- (void)internalSelectDeselectAnnotation:(MGLPointAnnotation*)point { +- (void)internalSelectDeselectAnnotation:(MLNPointAnnotation*)point { [XCTContext runActivityNamed:[NSString stringWithFormat:@"Select annotation: %@", point] block:^(id _Nonnull activity) { CGPoint annotationPoint = [self.mapView convertCoordinate:point.coordinate toPointToView:self.mapView]; - MGLAnnotationTag tagAtPoint = [self.mapView annotationTagAtPoint:annotationPoint persistingResults:YES]; + MLNAnnotationTag tagAtPoint = [self.mapView annotationTagAtPoint:annotationPoint persistingResults:YES]; if (tagAtPoint != UINT32_MAX) { - id annotation = [self.mapView annotationWithTag:tagAtPoint]; + id annotation = [self.mapView annotationWithTag:tagAtPoint]; XCTAssertNotNil(annotation); // Select diff --git a/platform/ios/platform/ios/Integration Tests/Camera Tests/MGLCameraTransitionFinishTests.mm b/platform/ios/platform/ios/Integration Tests/Camera Tests/MLNCameraTransitionFinishTests.mm similarity index 66% rename from platform/ios/platform/ios/Integration Tests/Camera Tests/MGLCameraTransitionFinishTests.mm rename to platform/ios/platform/ios/Integration Tests/Camera Tests/MLNCameraTransitionFinishTests.mm index 883aa3b8c..864360e6a 100644 --- a/platform/ios/platform/ios/Integration Tests/Camera Tests/MGLCameraTransitionFinishTests.mm +++ b/platform/ios/platform/ios/Integration Tests/Camera Tests/MLNCameraTransitionFinishTests.mm @@ -1,19 +1,19 @@ -#import "MGLMapViewIntegrationTest.h" -#import "MGLTestUtility.h" -#import "../../../darwin/src/MGLGeometry_Private.h" +#import "MLNMapViewIntegrationTest.h" +#import "MLNTestUtility.h" +#import "../../../darwin/src/MLNGeometry_Private.h" #include -@interface MGLCameraTransitionFinishTests : MGLMapViewIntegrationTest +@interface MLNCameraTransitionFinishTests : MLNMapViewIntegrationTest @end -@implementation MGLCameraTransitionFinishTests +@implementation MLNCameraTransitionFinishTests - (void)testEaseToCompletionHandler { - MGLCoordinateBounds bounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0.0, 0.0), + MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0.0, 0.0), CLLocationCoordinate2DMake(1.0, 1.0)); - MGLMapCamera *camera = [self.mapView cameraThatFitsCoordinateBounds:bounds]; + MLNMapCamera *camera = [self.mapView cameraThatFitsCoordinateBounds:bounds]; XCTestExpectation *expectation = [self expectationWithDescription:@"Completion block should be called"]; @@ -29,9 +29,9 @@ - (void)testEaseToCompletionHandlerAnimated { - MGLCoordinateBounds bounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0.0, 0.0), + MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0.0, 0.0), CLLocationCoordinate2DMake(1.0, 1.0)); - MGLMapCamera *camera = [self.mapView cameraThatFitsCoordinateBounds:bounds]; + MLNMapCamera *camera = [self.mapView cameraThatFitsCoordinateBounds:bounds]; XCTestExpectation *expectation = [self expectationWithDescription:@"Completion block should be called"]; @@ -47,9 +47,9 @@ - (void)testFlyToCompletionHandler { - MGLCoordinateBounds bounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0.0, 0.0), + MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0.0, 0.0), CLLocationCoordinate2DMake(1.0, 1.0)); - MGLMapCamera *camera = [self.mapView cameraThatFitsCoordinateBounds:bounds]; + MLNMapCamera *camera = [self.mapView cameraThatFitsCoordinateBounds:bounds]; XCTestExpectation *expectation = [self expectationWithDescription:@"Completion block should be called"]; @@ -64,9 +64,9 @@ - (void)testFlyToCompletionHandlerAnimated { - MGLCoordinateBounds bounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0.0, 0.0), + MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0.0, 0.0), CLLocationCoordinate2DMake(1.0, 1.0)); - MGLMapCamera *camera = [self.mapView cameraThatFitsCoordinateBounds:bounds]; + MLNMapCamera *camera = [self.mapView cameraThatFitsCoordinateBounds:bounds]; XCTestExpectation *expectation = [self expectationWithDescription:@"Completion block should be called"]; @@ -82,28 +82,28 @@ // MARK: - camera transitions with NaN values -@interface MGLMapView (MGLCameraTransitionFinishNaNTests) -- (mbgl::CameraOptions)cameraOptionsObjectForAnimatingToCamera:(MGLMapCamera *)camera edgePadding:(UIEdgeInsets)insets; +@interface MLNMapView (MLNCameraTransitionFinishNaNTests) +- (mbgl::CameraOptions)cameraOptionsObjectForAnimatingToCamera:(MLNMapCamera *)camera edgePadding:(UIEdgeInsets)insets; @end -@interface MGLCameraTransitionNaNZoomMapView: MGLMapView +@interface MLNCameraTransitionNaNZoomMapView: MLNMapView @end -@implementation MGLCameraTransitionNaNZoomMapView -- (mbgl::CameraOptions)cameraOptionsObjectForAnimatingToCamera:(MGLMapCamera *)camera edgePadding:(UIEdgeInsets)insets { +@implementation MLNCameraTransitionNaNZoomMapView +- (mbgl::CameraOptions)cameraOptionsObjectForAnimatingToCamera:(MLNMapCamera *)camera edgePadding:(UIEdgeInsets)insets { mbgl::CameraOptions options = [super cameraOptionsObjectForAnimatingToCamera:camera edgePadding:insets]; options.zoom = NAN; return options; } @end -// Subclass the entire test suite, but with a different MGLMapView subclass -@interface MGLCameraTransitionFinishNaNTests : MGLCameraTransitionFinishTests +// Subclass the entire test suite, but with a different MLNMapView subclass +@interface MLNCameraTransitionFinishNaNTests : MLNCameraTransitionFinishTests @end -@implementation MGLCameraTransitionFinishNaNTests -- (MGLMapView *)mapViewForTestWithFrame:(CGRect)rect styleURL:(NSURL *)styleURL { - return [[MGLCameraTransitionNaNZoomMapView alloc] initWithFrame:rect styleURL:styleURL]; +@implementation MLNCameraTransitionFinishNaNTests +- (MLNMapView *)mapViewForTestWithFrame:(CGRect)rect styleURL:(NSURL *)styleURL { + return [[MLNCameraTransitionNaNZoomMapView alloc] initWithFrame:rect styleURL:styleURL]; } @end diff --git a/platform/ios/platform/ios/Integration Tests/Camera Tests/MGLCameraTransitionTests.mm b/platform/ios/platform/ios/Integration Tests/Camera Tests/MLNCameraTransitionTests.mm similarity index 81% rename from platform/ios/platform/ios/Integration Tests/Camera Tests/MGLCameraTransitionTests.mm rename to platform/ios/platform/ios/Integration Tests/Camera Tests/MLNCameraTransitionTests.mm index 4a5e473b7..b9d5d7f55 100644 --- a/platform/ios/platform/ios/Integration Tests/Camera Tests/MGLCameraTransitionTests.mm +++ b/platform/ios/platform/ios/Integration Tests/Camera Tests/MLNCameraTransitionTests.mm @@ -1,11 +1,11 @@ -#import "MGLMapViewIntegrationTest.h" -#import "MGLTestUtility.h" -#import "../../../darwin/src/MGLGeometry_Private.h" +#import "MLNMapViewIntegrationTest.h" +#import "MLNTestUtility.h" +#import "../../../darwin/src/MLNGeometry_Private.h" -@interface MGLCameraTransitionTests : MGLMapViewIntegrationTest +@interface MLNCameraTransitionTests : MLNMapViewIntegrationTest @end -@implementation MGLCameraTransitionTests +@implementation MLNCameraTransitionTests - (void)testSetAndResetNorthWithDispatchAsyncInDelegateMethod { @@ -15,15 +15,15 @@ __weak typeof(self) weakself = self; - self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + self.regionDidChange = ^(MLNMapView *mapView, MLNCameraChangeReason reason, BOOL animated) { - MGLCameraTransitionTests *strongSelf = weakself; + MLNCameraTransitionTests *strongSelf = weakself; if (!strongSelf) return; [expectation fulfill]; - MGLTestAssert(strongSelf, mapView.userTrackingMode != MGLUserTrackingModeFollowWithHeading); + MLNTestAssert(strongSelf, mapView.userTrackingMode != MLNUserTrackingModeFollowWithHeading); if (mapView.direction != 0.0) { dispatch_async(dispatch_get_main_queue(), ^{ [mapView resetNorth]; @@ -46,15 +46,15 @@ __weak typeof(self) weakself = self; - self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + self.regionDidChange = ^(MLNMapView *mapView, MLNCameraChangeReason reason, BOOL animated) { - MGLCameraTransitionTests *strongSelf = weakself; + MLNCameraTransitionTests *strongSelf = weakself; if (!strongSelf) return; [expectation fulfill]; - MGLTestAssert(strongSelf, mapView.userTrackingMode != MGLUserTrackingModeFollowWithHeading); + MLNTestAssert(strongSelf, mapView.userTrackingMode != MLNUserTrackingModeFollowWithHeading); if (mapView.direction != 0.0) { NSLog(@"Reset to north"); [mapView resetNorth]; @@ -78,8 +78,8 @@ __block BOOL startedReset = NO; __block BOOL finishedReset = NO; - self.regionIsChanging = ^(MGLMapView *mapView) { - MGLCameraTransitionTests *strongSelf = weakself; + self.regionIsChanging = ^(MLNMapView *mapView) { + MLNCameraTransitionTests *strongSelf = weakself; if (!strongSelf) return; if (!startedReset) { @@ -90,18 +90,18 @@ } }; - self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { - MGLCameraTransitionTests *strongSelf = weakself; + self.regionDidChange = ^(MLNMapView *mapView, MLNCameraChangeReason reason, BOOL animated) { + MLNCameraTransitionTests *strongSelf = weakself; if (!strongSelf) return; - MGLTestAssert(strongSelf, startedReset); + MLNTestAssert(strongSelf, startedReset); if (finishedReset) { - MGLTestAssert(strongSelf, !(reason & MGLCameraChangeReasonTransitionCancelled)); + MLNTestAssert(strongSelf, !(reason & MLNCameraChangeReasonTransitionCancelled)); [expectation fulfill]; } else { - MGLTestAssert(strongSelf, reason & MGLCameraChangeReasonTransitionCancelled); + MLNTestAssert(strongSelf, reason & MLNCameraChangeReasonTransitionCancelled); } }; @@ -127,15 +127,15 @@ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.15 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ - MGLCameraTransitionTests *strongSelf = weakself; + MLNCameraTransitionTests *strongSelf = weakself; [strongSelf.mapView setCenterCoordinate:dc zoomLevel:zoomLevel animated:NO]; - MGLTestAssertEqualWithAccuracy(strongSelf, + MLNTestAssertEqualWithAccuracy(strongSelf, dc.latitude, strongSelf.mapView.centerCoordinate.latitude, 0.0005, @"setting center coordinate should cancel transitions"); - MGLTestAssertEqualWithAccuracy(strongSelf, + MLNTestAssertEqualWithAccuracy(strongSelf, dc.longitude, strongSelf.mapView.centerCoordinate.longitude, 0.0005, @@ -158,13 +158,13 @@ CLLocationCoordinate2D target = CLLocationCoordinate2DMake(40.0, 40.0); CLLocationCoordinate2D target2 = CLLocationCoordinate2DMake(-40.0, -40.0); - self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + self.regionDidChange = ^(MLNMapView *mapView, MLNCameraChangeReason reason, BOOL animated) { - MGLCameraTransitionTests *strongSelf = weakself; + MLNCameraTransitionTests *strongSelf = weakself; if (!strongSelf) return; - MGLTestAssert(strongSelf, mapView.userTrackingMode != MGLUserTrackingModeFollowWithHeading); + MLNTestAssert(strongSelf, mapView.userTrackingMode != MLNUserTrackingModeFollowWithHeading); CLLocationCoordinate2D center = mapView.centerCoordinate; @@ -173,20 +173,20 @@ { // Our center coordinate should match our target (assuming we're not // constrained by zoom level) - MGLTestAssertEqualWithAccuracy(strongSelf, + MLNTestAssertEqualWithAccuracy(strongSelf, target.longitude, center.longitude, 0.0005, @"center coordinate longitude should be at target"); - MGLTestAssertEqualWithAccuracy(strongSelf, + MLNTestAssertEqualWithAccuracy(strongSelf, target.latitude, center.latitude, 0.0005, @"center coordinate latitude should be at target"); // Now set another coordinate. - // Should take MGLAnimationDuration seconds (0.3s) + // Should take MLNAnimationDuration seconds (0.3s) [mapView setCenterCoordinate:target2 animated:YES]; break; } @@ -195,13 +195,13 @@ { // Our center coordinate should match our target (assuming we're not // constrained by zoom level) - MGLTestAssertEqualWithAccuracy(strongSelf, + MLNTestAssertEqualWithAccuracy(strongSelf, target2.longitude, center.longitude, 0.0005, @"center coordinate longitude should be at target2"); - MGLTestAssertEqualWithAccuracy(strongSelf, + MLNTestAssertEqualWithAccuracy(strongSelf, target2.latitude, center.latitude, 0.0005, @@ -211,7 +211,7 @@ } default: - MGLTestFail(strongSelf); + MLNTestFail(strongSelf); break; } @@ -220,7 +220,7 @@ [expectation fulfill]; }; - // Should take MGLAnimationDuration seconds (0.3) + // Should take MLNAnimationDuration seconds (0.3) [self.mapView setCenterCoordinate:target zoomLevel:15.0 animated:YES]; [self waitForExpectations:@[expectation] timeout:10]; } @@ -244,15 +244,15 @@ __block NSTimeInterval stop2 = 0.0; double zoomLevel = 5.0; - double altitude = MGLAltitudeForZoomLevel(zoomLevel, 0.0, target.latitude, self.mapView.frame.size); + double altitude = MLNAltitudeForZoomLevel(zoomLevel, 0.0, target.latitude, self.mapView.frame.size); - self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + self.regionDidChange = ^(MLNMapView *mapView, MLNCameraChangeReason reason, BOOL animated) { - MGLCameraTransitionTests *strongSelf = weakself; + MLNCameraTransitionTests *strongSelf = weakself; if (!strongSelf) return; - MGLTestAssert(strongSelf, mapView.userTrackingMode != MGLUserTrackingModeFollowWithHeading); + MLNTestAssert(strongSelf, mapView.userTrackingMode != MLNUserTrackingModeFollowWithHeading); CLLocationCoordinate2D center = mapView.centerCoordinate; @@ -263,27 +263,27 @@ // Our center coordinate should match our target (assuming we're not // constrained by zoom level) - MGLTestAssertEqualWithAccuracy(strongSelf, + MLNTestAssertEqualWithAccuracy(strongSelf, target.longitude, center.longitude, 0.0005, @"center coordinate longitude should be at target"); - MGLTestAssertEqualWithAccuracy(strongSelf, + MLNTestAssertEqualWithAccuracy(strongSelf, target.latitude, center.latitude, 0.0005, @"center coordinate latitude should be at target"); // Now set another coordinate. - MGLMapCamera *camera = [MGLMapCamera cameraLookingAtCenterCoordinate:target2 + MLNMapCamera *camera = [MLNMapCamera cameraLookingAtCenterCoordinate:target2 altitude:altitude pitch:0.0 heading:0.0]; // flyToCamera can take a while... [mapView flyToCamera:camera completionHandler:^{ - MGLTestAssert(strongSelf, !runloop, @"Completion block should be called after delegate method"); + MLNTestAssert(strongSelf, !runloop, @"Completion block should be called after delegate method"); [expectation fulfill]; stop2 = CACurrentMediaTime(); }]; @@ -294,13 +294,13 @@ { // Our center coordinate should match our target (assuming we're not // constrained by zoom level) - MGLTestAssertEqualWithAccuracy(strongSelf, + MLNTestAssertEqualWithAccuracy(strongSelf, target2.longitude, center.longitude, 0.0005, @"center coordinate longitude should be at target2"); - MGLTestAssertEqualWithAccuracy(strongSelf, + MLNTestAssertEqualWithAccuracy(strongSelf, target2.latitude, center.latitude, 0.0005, @@ -311,7 +311,7 @@ } default: - MGLTestFail(strongSelf); + MLNTestFail(strongSelf); break; } @@ -320,7 +320,7 @@ [expectation fulfill]; }; - // Should take MGLAnimationDuration + // Should take MLNAnimationDuration [self.mapView setCenterCoordinate:target zoomLevel:zoomLevel animated:YES]; [self waitForExpectations:@[expectation] timeout:10]; @@ -351,11 +351,11 @@ expectation.expectedFulfillmentCount = 2; expectation.assertForOverFulfill = YES; - self.regionIsChanging = ^(MGLMapView *mapView) { + self.regionIsChanging = ^(MLNMapView *mapView) { [mapView resetNorth]; }; - self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + self.regionDidChange = ^(MLNMapView *mapView, MLNCameraChangeReason reason, BOOL animated) { [expectation fulfill]; }; @@ -377,11 +377,11 @@ __weak typeof(self) weakself = self; - self.regionIsChanging = ^(MGLMapView *mapView) { + self.regionIsChanging = ^(MLNMapView *mapView) { [weakself.mapView setCenterCoordinate:CLLocationCoordinate2DMake(-40.0, -40.0) animated:YES]; }; - self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + self.regionDidChange = ^(MLNMapView *mapView, MLNCameraChangeReason reason, BOOL animated) { [expectation fulfill]; }; diff --git a/platform/ios/platform/ios/Integration Tests/MBGLIntegrationTests.mm b/platform/ios/platform/ios/Integration Tests/MBGLIntegrationTests.mm index 1ed7f63bd..4c57907a9 100644 --- a/platform/ios/platform/ios/Integration Tests/MBGLIntegrationTests.mm +++ b/platform/ios/platform/ios/Integration Tests/MBGLIntegrationTests.mm @@ -1,10 +1,10 @@ -#import "MGLMapViewIntegrationTest.h" -#import "MGLMapView_Private.h" -#import "MGLMapView+Impl.h" +#import "MLNMapViewIntegrationTest.h" +#import "MLNMapView_Private.h" +#import "MLNMapView+Impl.h" #include -@interface MBGLIntegrationTests : MGLMapViewIntegrationTest +@interface MBGLIntegrationTests : MLNMapViewIntegrationTest @end @implementation MBGLIntegrationTests @@ -17,7 +17,7 @@ // This test does not strictly need to be in this test file/target. Including here for convenience. - (void)testOpenGLLayerDoesNotLeakWhenCreatedAndDestroyedWithoutAddingToStyle { - MGLOpenGLStyleLayer *layer = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; + MLNOpenGLStyleLayer *layer = [[MLNOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; __weak id weakLayer = layer; layer = nil; @@ -31,7 +31,7 @@ __weak id weakLayer = nil; @autoreleasepool { - MGLOpenGLStyleLayer *layer = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; + MLNOpenGLStyleLayer *layer = [[MLNOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; [self.style insertLayer:layer atIndex:0]; weakLayer = layer; @@ -49,15 +49,15 @@ } - (void)testReusingOpenGLLayerIdentifier { - __weak MGLOpenGLStyleLayer *weakLayer2; + __weak MLNOpenGLStyleLayer *weakLayer2; @autoreleasepool { - MGLOpenGLStyleLayer *layer1 = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; + MLNOpenGLStyleLayer *layer1 = [[MLNOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; [self.style insertLayer:layer1 atIndex:0]; [self waitForMapViewToBeRendered]; [self.style removeLayer:layer1]; - MGLOpenGLStyleLayer *layer2 = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; + MLNOpenGLStyleLayer *layer2 = [[MLNOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; weakLayer2 = layer2; XCTAssertNotNil(layer2); @@ -88,7 +88,7 @@ __weak id retrievedLayer = nil; @autoreleasepool { - MGLOpenGLStyleLayer *layer = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; + MLNOpenGLStyleLayer *layer = [[MLNOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; [self.style insertLayer:layer atIndex:0]; layer = nil; @@ -110,7 +110,7 @@ } - (void)testReusingOpenGLLayer { - MGLOpenGLStyleLayer *layer = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; + MLNOpenGLStyleLayer *layer = [[MLNOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; [self.style insertLayer:layer atIndex:0]; [self waitForMapViewToBeRendered]; @@ -127,7 +127,7 @@ - (void)testOpenGLLayerDoesNotLeakWhenRemovedFromStyle { __weak id weakLayer; @autoreleasepool { - MGLOpenGLStyleLayer *layer = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; + MLNOpenGLStyleLayer *layer = [[MLNOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; weakLayer = layer; [self.style insertLayer:layer atIndex:0]; layer = nil; @@ -136,7 +136,7 @@ [self.style removeLayer:[self.style layerWithIdentifier:@"gl-layer"]]; } - MGLStyleLayer *layer2 = weakLayer; + MLNStyleLayer *layer2 = weakLayer; XCTAssertNotNil(weakLayer); [self waitForMapViewToBeRendered]; @@ -146,11 +146,11 @@ } - (void)testOpenGLLayerDoesNotLeakWhenStyleChanged { - __weak MGLOpenGLStyleLayer *weakLayer; + __weak MLNOpenGLStyleLayer *weakLayer; @autoreleasepool { { - MGLOpenGLStyleLayer *layer = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; + MLNOpenGLStyleLayer *layer = [[MLNOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; weakLayer = layer; [self.style insertLayer:layer atIndex:0]; layer = nil; @@ -161,7 +161,7 @@ [self waitForMapViewToBeRendered]; - MGLStyleLayer *layer2 = [self.mapView.style layerWithIdentifier:@"gl-layer"]; + MLNStyleLayer *layer2 = [self.mapView.style layerWithIdentifier:@"gl-layer"]; NSURL *styleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"one-liner" withExtension:@"json"]; self.styleLoadingExpectation = [self expectationWithDescription:@"Map view should finish loading style."]; @@ -173,7 +173,7 @@ XCTAssertNotNil(weakLayer); // Asking the style for the layer should return nil - MGLStyleLayer *layer3 = [self.mapView.style layerWithIdentifier:@"gl-layer"]; + MLNStyleLayer *layer3 = [self.mapView.style layerWithIdentifier:@"gl-layer"]; XCTAssertNil(layer3); } @@ -184,7 +184,7 @@ @autoreleasepool { NSURL *styleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"one-liner" withExtension:@"json"]; - MGLMapView *mapView2 = [[MGLMapView alloc] initWithFrame:UIScreen.mainScreen.bounds styleURL:styleURL]; + MLNMapView *mapView2 = [[MLNMapView alloc] initWithFrame:UIScreen.mainScreen.bounds styleURL:styleURL]; mapView2.delegate = self; XCTAssertNil(mapView2.style); @@ -192,7 +192,7 @@ self.styleLoadingExpectation = [self expectationWithDescription:@"Map view should finish loading style."]; [self waitForExpectationsWithTimeout:10 handler:nil]; - MGLOpenGLStyleLayer *layer = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; + MLNOpenGLStyleLayer *layer = [[MLNOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; weakLayer = layer; [mapView2.style insertLayer:layer atIndex:0]; layer = nil; @@ -202,14 +202,14 @@ XCTAssertNil(weakLayer); } -- (void)testMGLMapViewImplHasCorrectSize { +- (void)testMLNMapViewImplHasCorrectSize { NSURL *styleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"one-liner" withExtension:@"json"]; self.styleLoadingExpectation = [self expectationWithDescription:@"Map view should finish loading style."]; [self.mapView setStyleURL:styleURL]; [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(9.6315313, 52.4133574) animated:NO]; [self waitForExpectations:@[self.styleLoadingExpectation] timeout:1]; - MGLMapViewImpl *mapViewImpl = [self.mapView viewImpl]; + MLNMapViewImpl *mapViewImpl = [self.mapView viewImpl]; CGFloat scaleFactor = [UIScreen mainScreen].scale; mbgl::Size renderableSize = mapViewImpl->getRendererBackend().getDefaultRenderable().getSize(); mbgl::Size viewSize = { @@ -224,11 +224,11 @@ CLLocationCoordinate2DMake(9.6315313, 52.4133574), CLLocationCoordinate2DMake(24.9410248, 60.1733244)}; - MGLPointCollectionFeature *points = [MGLPointCollectionFeature pointCollectionWithCoordinates:coordinates count:sizeof(coordinates)/sizeof(coordinates[0])]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"heatmap" shape:points options:nil]; + MLNPointCollectionFeature *points = [MLNPointCollectionFeature pointCollectionWithCoordinates:coordinates count:sizeof(coordinates)/sizeof(coordinates[0])]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"heatmap" shape:points options:nil]; [self.style addSource:source]; - MGLHeatmapStyleLayer *heatmapLayer = [[MGLHeatmapStyleLayer alloc] initWithIdentifier:@"lineLayer" source:source]; + MLNHeatmapStyleLayer *heatmapLayer = [[MLNHeatmapStyleLayer alloc] initWithIdentifier:@"lineLayer" source:source]; [self.style addLayer:heatmapLayer]; // Test that heatmap layer can create a texture and be successfully rendered. diff --git a/platform/ios/platform/ios/Integration Tests/MGLMapViewIntegrationTest.h b/platform/ios/platform/ios/Integration Tests/MGLMapViewIntegrationTest.h deleted file mode 100644 index 2e983f49c..000000000 --- a/platform/ios/platform/ios/Integration Tests/MGLMapViewIntegrationTest.h +++ /dev/null @@ -1,21 +0,0 @@ -#import "MGLIntegrationTestCase.h" - -@interface MGLMapViewIntegrationTest : MGLIntegrationTestCase -@property (nonatomic) MGLMapView *mapView; -@property (nonatomic) UIWindow *window; -@property (nonatomic) MGLStyle *style; -@property (nonatomic) XCTestExpectation *styleLoadingExpectation; -@property (nonatomic) XCTestExpectation *renderFinishedExpectation; -@property (nonatomic) MGLAnnotationView * (^viewForAnnotation)(MGLMapView *mapView, id annotation); -@property (nonatomic) void (^regionWillChange)(MGLMapView *mapView, BOOL animated); -@property (nonatomic) void (^regionIsChanging)(MGLMapView *mapView); -@property (nonatomic) void (^regionDidChange)(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated); -@property (nonatomic) CGPoint (^mapViewUserLocationAnchorPoint)(MGLMapView *mapView); -@property (nonatomic) BOOL (^mapViewAnnotationCanShowCalloutForAnnotation)(MGLMapView *mapView, id annotation); -@property (nonatomic) id (^mapViewCalloutViewForAnnotation)(MGLMapView *mapView, id annotation); - -// Utility methods -- (void)waitForMapViewToFinishLoadingStyleWithTimeout:(NSTimeInterval)timeout; -- (void)waitForMapViewToBeRenderedWithTimeout:(NSTimeInterval)timeout; -- (MGLMapView *)mapViewForTestWithFrame:(CGRect)rect styleURL:(NSURL *)styleURL; -@end diff --git a/platform/ios/platform/ios/Integration Tests/MGLStyleURLIntegrationTest.m b/platform/ios/platform/ios/Integration Tests/MGLStyleURLIntegrationTest.m deleted file mode 100644 index 4f7a98a83..000000000 --- a/platform/ios/platform/ios/Integration Tests/MGLStyleURLIntegrationTest.m +++ /dev/null @@ -1,22 +0,0 @@ -#import "MGLMapViewIntegrationTest.h" - -@interface MGLStyleURLIntegrationTest : MGLMapViewIntegrationTest -@end - -@implementation MGLStyleURLIntegrationTest - -- (void)setUp { - [super setUp]; - [MGLSettings useWellKnownTileServer:MGLMapTiler]; -} - -- (void)predefinedStylesLoadingTest { - - for (MGLDefaultStyle* style in [MGLStyle predefinedStyles]) { - NSString* styleName = style.name; - self.mapView.styleURL = [[MGLStyle predefinedStyle:styleName] url]; - [self waitForMapViewToFinishLoadingStyleWithTimeout:5]; - } -} - -@end diff --git a/platform/ios/platform/ios/Integration Tests/MGLTestLocationManager.h b/platform/ios/platform/ios/Integration Tests/MGLTestLocationManager.h deleted file mode 100644 index e0e6f25bb..000000000 --- a/platform/ios/platform/ios/Integration Tests/MGLTestLocationManager.h +++ /dev/null @@ -1,10 +0,0 @@ -#import -#import -#import "MGLTestUtility.h" - -@interface MGLTestLocationManager : NSObject -@end - -@interface MGLTestLocationManager() - -@end diff --git a/platform/ios/platform/ios/Integration Tests/MGLIntegrationTestCase.h b/platform/ios/platform/ios/Integration Tests/MLNIntegrationTestCase.h similarity index 67% rename from platform/ios/platform/ios/Integration Tests/MGLIntegrationTestCase.h rename to platform/ios/platform/ios/Integration Tests/MLNIntegrationTestCase.h index bf6c268a8..0e90ceb53 100644 --- a/platform/ios/platform/ios/Integration Tests/MGLIntegrationTestCase.h +++ b/platform/ios/platform/ios/Integration Tests/MLNIntegrationTestCase.h @@ -1,22 +1,22 @@ #import #import -#import "MGLTestUtility.h" +#import "MLNTestUtility.h" -#define MGLTestFail(myself, ...) \ +#define MLNTestFail(myself, ...) \ _XCTPrimitiveFail(myself, __VA_ARGS__) -#define MGLTestAssert(myself, expression, ...) \ +#define MLNTestAssert(myself, expression, ...) \ _XCTPrimitiveAssertTrue(myself, expression, @#expression, __VA_ARGS__) -#define MGLTestAssertEqualWithAccuracy(myself, expression1, expression2, accuracy, ...) \ +#define MLNTestAssertEqualWithAccuracy(myself, expression1, expression2, accuracy, ...) \ _XCTPrimitiveAssertEqualWithAccuracy(myself, expression1, @#expression1, expression2, @#expression2, accuracy, @#accuracy, __VA_ARGS__) -#define MGLTestAssertNil(myself, expression, ...) \ +#define MLNTestAssertNil(myself, expression, ...) \ _XCTPrimitiveAssertNil(myself, expression, @#expression, __VA_ARGS__) -#define MGLTestAssertNotNil(myself, expression, ...) \ +#define MLNTestAssertNotNil(myself, expression, ...) \ _XCTPrimitiveAssertNotNil(myself, expression, @#expression, __VA_ARGS__) -#define MGLTestWarning(expression, format, ...) \ +#define MLNTestWarning(expression, format, ...) \ ({ \ if (!(expression)) { \ NSString *message = [NSString stringWithFormat:format, ##__VA_ARGS__]; \ @@ -24,5 +24,5 @@ _XCTPrimitiveFail(myself, __VA_ARGS__) } \ }) -@interface MGLIntegrationTestCase: XCTestCase +@interface MLNIntegrationTestCase: XCTestCase @end diff --git a/platform/ios/platform/ios/Integration Tests/MGLIntegrationTestCase.m b/platform/ios/platform/ios/Integration Tests/MLNIntegrationTestCase.m similarity index 78% rename from platform/ios/platform/ios/Integration Tests/MGLIntegrationTestCase.m rename to platform/ios/platform/ios/Integration Tests/MLNIntegrationTestCase.m index a509b0296..9dcf8cd73 100644 --- a/platform/ios/platform/ios/Integration Tests/MGLIntegrationTestCase.m +++ b/platform/ios/platform/ios/Integration Tests/MLNIntegrationTestCase.m @@ -1,6 +1,6 @@ -#import "MGLIntegrationTestCase.h" +#import "MLNIntegrationTestCase.h" -@implementation MGLIntegrationTestCase +@implementation MLNIntegrationTestCase + (XCTestSuite*)defaultTestSuite { @@ -11,7 +11,7 @@ XCTestSuite *newTestSuite = [XCTestSuite testSuiteWithName:defaultTestSuite.name]; BOOL runPendingTests = [[[NSProcessInfo processInfo] environment][@"MAPBOX_RUN_PENDING_TESTS"] boolValue]; - NSString *apiKey = [[NSProcessInfo processInfo] environment][@"MGL_API_KEY"]; + NSString *apiKey = [[NSProcessInfo processInfo] environment][@"MLN_API_KEY"]; for (XCTest *test in tests) { @@ -27,7 +27,7 @@ // Check for tests that require a valid access token if ([test.name containsString:@"🔒"]) { if (!apiKey) { - printf("warning: MGL_API_KEY env var is required for test '%s' - skipping.\n", test.name.UTF8String); + printf("warning: MLN_API_KEY env var is required for test '%s' - skipping.\n", test.name.UTF8String); continue; } } @@ -44,13 +44,13 @@ NSString *apiKey; if ([self.name containsString:@"🔒"]) { - apiKey = [[NSProcessInfo processInfo] environment][@"MGL_API_KEY"]; + apiKey = [[NSProcessInfo processInfo] environment][@"MLN_API_KEY"]; if (!apiKey) { - printf("warning: MGL_API_KEY env var is required for test '%s' - trying anyway.\n", self.name.UTF8String); + printf("warning: MLN_API_KEY env var is required for test '%s' - trying anyway.\n", self.name.UTF8String); } } - [MGLSettings setApiKey:apiKey ?: @"pk.feedcafedeadbeefbadebede"]; + [MLNSettings setApiKey:apiKey ?: @"pk.feedcafedeadbeefbadebede"]; } @end diff --git a/platform/ios/platform/ios/Integration Tests/MLNMapViewIntegrationTest.h b/platform/ios/platform/ios/Integration Tests/MLNMapViewIntegrationTest.h new file mode 100644 index 000000000..574ed03b9 --- /dev/null +++ b/platform/ios/platform/ios/Integration Tests/MLNMapViewIntegrationTest.h @@ -0,0 +1,21 @@ +#import "MLNIntegrationTestCase.h" + +@interface MLNMapViewIntegrationTest : MLNIntegrationTestCase +@property (nonatomic) MLNMapView *mapView; +@property (nonatomic) UIWindow *window; +@property (nonatomic) MLNStyle *style; +@property (nonatomic) XCTestExpectation *styleLoadingExpectation; +@property (nonatomic) XCTestExpectation *renderFinishedExpectation; +@property (nonatomic) MLNAnnotationView * (^viewForAnnotation)(MLNMapView *mapView, id annotation); +@property (nonatomic) void (^regionWillChange)(MLNMapView *mapView, BOOL animated); +@property (nonatomic) void (^regionIsChanging)(MLNMapView *mapView); +@property (nonatomic) void (^regionDidChange)(MLNMapView *mapView, MLNCameraChangeReason reason, BOOL animated); +@property (nonatomic) CGPoint (^mapViewUserLocationAnchorPoint)(MLNMapView *mapView); +@property (nonatomic) BOOL (^mapViewAnnotationCanShowCalloutForAnnotation)(MLNMapView *mapView, id annotation); +@property (nonatomic) id (^mapViewCalloutViewForAnnotation)(MLNMapView *mapView, id annotation); + +// Utility methods +- (void)waitForMapViewToFinishLoadingStyleWithTimeout:(NSTimeInterval)timeout; +- (void)waitForMapViewToBeRenderedWithTimeout:(NSTimeInterval)timeout; +- (MLNMapView *)mapViewForTestWithFrame:(CGRect)rect styleURL:(NSURL *)styleURL; +@end diff --git a/platform/ios/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m b/platform/ios/platform/ios/Integration Tests/MLNMapViewIntegrationTest.m similarity index 78% rename from platform/ios/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m rename to platform/ios/platform/ios/Integration Tests/MLNMapViewIntegrationTest.m index b9f103072..a8d4434cc 100644 --- a/platform/ios/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m +++ b/platform/ios/platform/ios/Integration Tests/MLNMapViewIntegrationTest.m @@ -1,14 +1,14 @@ -#import "MGLMapViewIntegrationTest.h" +#import "MLNMapViewIntegrationTest.h" -@interface MGLMapView (MGLMapViewIntegrationTest) +@interface MLNMapView (MLNMapViewIntegrationTest) - (void)updateFromDisplayLink:(CADisplayLink *)displayLink; - (void)setNeedsRerender; @end -@implementation MGLMapViewIntegrationTest +@implementation MLNMapViewIntegrationTest -- (MGLMapView *)mapViewForTestWithFrame:(CGRect)rect styleURL:(NSURL *)styleURL { - return [[MGLMapView alloc] initWithFrame:UIScreen.mainScreen.bounds styleURL:styleURL]; +- (MLNMapView *)mapViewForTestWithFrame:(CGRect)rect styleURL:(NSURL *)styleURL { + return [[MLNMapView alloc] initWithFrame:UIScreen.mainScreen.bounds styleURL:styleURL]; } - (void)setUp { @@ -36,14 +36,14 @@ self.mapView = nil; self.style = nil; self.window = nil; - [MGLSettings setApiKey:nil]; + [MLNSettings setApiKey:nil]; [super tearDown]; } -// MARK: - MGLMapViewDelegate +// MARK: - MLNMapViewDelegate -- (MGLAnnotationView*)mapView:(MGLMapView *)mapView viewForAnnotation:(id)annotation { +- (MLNAnnotationView*)mapView:(MLNMapView *)mapView viewForAnnotation:(id)annotation { if (self.viewForAnnotation) { return self.viewForAnnotation(mapView, annotation); } @@ -51,51 +51,51 @@ return nil; } -- (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style { +- (void)mapView:(MLNMapView *)mapView didFinishLoadingStyle:(MLNStyle *)style { XCTAssertNotNil(mapView.style); XCTAssertEqual(mapView.style, style); [self.styleLoadingExpectation fulfill]; } -- (void)mapViewDidFinishRenderingFrame:(MGLMapView *)mapView fullyRendered:(__unused BOOL)fullyRendered { +- (void)mapViewDidFinishRenderingFrame:(MLNMapView *)mapView fullyRendered:(__unused BOOL)fullyRendered { [self.renderFinishedExpectation fulfill]; self.renderFinishedExpectation = nil; } -- (void)mapView:(MGLMapView *)mapView regionWillChangeAnimated:(BOOL)animated { +- (void)mapView:(MLNMapView *)mapView regionWillChangeAnimated:(BOOL)animated { if (self.regionWillChange) { self.regionWillChange(mapView, animated); } } -- (void)mapViewRegionIsChanging:(MGLMapView *)mapView { +- (void)mapViewRegionIsChanging:(MLNMapView *)mapView { if (self.regionIsChanging) { self.regionIsChanging(mapView); } } -- (void)mapView:(MGLMapView *)mapView regionDidChangeWithReason:(MGLCameraChangeReason)reason animated:(BOOL)animated { +- (void)mapView:(MLNMapView *)mapView regionDidChangeWithReason:(MLNCameraChangeReason)reason animated:(BOOL)animated { if (self.regionDidChange) { self.regionDidChange(mapView, reason, animated); } } -- (CGPoint)mapViewUserLocationAnchorPoint:(MGLMapView *)mapView { +- (CGPoint)mapViewUserLocationAnchorPoint:(MLNMapView *)mapView { if (self.mapViewUserLocationAnchorPoint) { return self.mapViewUserLocationAnchorPoint(mapView); } return CGPointZero; } -- (BOOL)mapView:(MGLMapView *)mapView annotationCanShowCallout:(id)annotation { +- (BOOL)mapView:(MLNMapView *)mapView annotationCanShowCallout:(id)annotation { if (self.mapViewAnnotationCanShowCalloutForAnnotation) { return self.mapViewAnnotationCanShowCalloutForAnnotation(mapView, annotation); } return NO; } -- (id)mapView:(MGLMapView *)mapView calloutViewForAnnotation:(id)annotation { +- (id)mapView:(MLNMapView *)mapView calloutViewForAnnotation:(id)annotation { if (self.mapViewCalloutViewForAnnotation) { return self.mapViewCalloutViewForAnnotation(mapView, annotation); } @@ -146,7 +146,7 @@ } } -- (MGLStyle *)style { +- (MLNStyle *)style { return self.mapView.style; } diff --git a/platform/ios/platform/ios/Integration Tests/MGLMapViewPendingBlockTests.m b/platform/ios/platform/ios/Integration Tests/MLNMapViewPendingBlockTests.m similarity index 89% rename from platform/ios/platform/ios/Integration Tests/MGLMapViewPendingBlockTests.m rename to platform/ios/platform/ios/Integration Tests/MLNMapViewPendingBlockTests.m index 0a5c864f2..62a3de299 100644 --- a/platform/ios/platform/ios/Integration Tests/MGLMapViewPendingBlockTests.m +++ b/platform/ios/platform/ios/Integration Tests/MLNMapViewPendingBlockTests.m @@ -1,17 +1,17 @@ -#import "MGLMapViewIntegrationTest.h" -#import "MGLTestUtility.h" +#import "MLNMapViewIntegrationTest.h" +#import "MLNTestUtility.h" -@interface MGLMapView (MGLMapViewPendingBlockTests) +@interface MLNMapView (MLNMapViewPendingBlockTests) @property (nonatomic) NSMutableArray *pendingCompletionBlocks; - (void)stopDisplayLink; @end -@interface MGLMapViewPendingBlockTests : MGLMapViewIntegrationTest +@interface MLNMapViewPendingBlockTests : MLNMapViewIntegrationTest @property (nonatomic, copy) void (^observation)(NSDictionary*); @property (nonatomic) BOOL completionHandlerCalled; @end -@implementation MGLMapViewPendingBlockTests +@implementation MLNMapViewPendingBlockTests - (void)testSetCenterCoordinate { __typeof__(self) weakSelf = self; @@ -66,7 +66,7 @@ __typeof__(self) strongSelf = weakSelf; if (strongSelf) { - MGLCoordinateBounds unitBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1)); + MLNCoordinateBounds unitBounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1)); [strongSelf.mapView setVisibleCoordinateBounds:unitBounds edgePadding:UIEdgeInsetsZero animated:NO @@ -89,7 +89,7 @@ __typeof__(self) strongSelf = weakSelf; if (strongSelf) { - MGLCoordinateBounds unitBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1)); + MLNCoordinateBounds unitBounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1)); [strongSelf.mapView setVisibleCoordinateBounds:unitBounds edgePadding:UIEdgeInsetsZero animated:YES @@ -112,8 +112,8 @@ __typeof__(self) strongSelf = weakSelf; if (strongSelf) { - MGLCoordinateBounds unitBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1)); - MGLMapCamera *camera = [strongSelf.mapView cameraThatFitsCoordinateBounds:unitBounds]; + MLNCoordinateBounds unitBounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1)); + MLNMapCamera *camera = [strongSelf.mapView cameraThatFitsCoordinateBounds:unitBounds]; [strongSelf.mapView setCamera:camera withDuration:0.0 animationTimingFunction:nil completionHandler:completion]; } @@ -134,8 +134,8 @@ __typeof__(self) strongSelf = weakSelf; if (strongSelf) { - MGLCoordinateBounds unitBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1)); - MGLMapCamera *camera = [strongSelf.mapView cameraThatFitsCoordinateBounds:unitBounds]; + MLNCoordinateBounds unitBounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1)); + MLNMapCamera *camera = [strongSelf.mapView cameraThatFitsCoordinateBounds:unitBounds]; [strongSelf.mapView setCamera:camera withDuration:0.3 animationTimingFunction:nil completionHandler:completion]; } @@ -156,8 +156,8 @@ __typeof__(self) strongSelf = weakSelf; if (strongSelf) { - MGLCoordinateBounds unitBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1)); - MGLMapCamera *camera = [strongSelf.mapView cameraThatFitsCoordinateBounds:unitBounds]; + MLNCoordinateBounds unitBounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1)); + MLNMapCamera *camera = [strongSelf.mapView cameraThatFitsCoordinateBounds:unitBounds]; [strongSelf.mapView flyToCamera:camera withDuration:0.0 completionHandler:completion]; } @@ -179,8 +179,8 @@ __typeof__(self) strongSelf = weakSelf; if (strongSelf) { - MGLCoordinateBounds unitBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1)); - MGLMapCamera *camera = [strongSelf.mapView cameraThatFitsCoordinateBounds:unitBounds]; + MLNCoordinateBounds unitBounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1)); + MLNMapCamera *camera = [strongSelf.mapView cameraThatFitsCoordinateBounds:unitBounds]; [strongSelf.mapView flyToCamera:camera withDuration:0.3 completionHandler:completion]; } @@ -219,12 +219,12 @@ dispatch_block_t addedToPending = ^{ __typeof__(self) strongSelf = weakSelf; - MGLTestAssert(strongSelf, !strongSelf.completionHandlerCalled); + MLNTestAssert(strongSelf, !strongSelf.completionHandlerCalled); // Now hide the mapview strongSelf.mapView.hidden = YES; - MGLTestAssert(strongSelf, strongSelf.completionHandlerCalled); + MLNTestAssert(strongSelf, strongSelf.completionHandlerCalled); }; [self internalTestCompletionBlockAddedToPendingForTestName:NSStringFromSelector(_cmd) @@ -254,12 +254,12 @@ dispatch_block_t addedToPending = ^{ __typeof__(self) strongSelf = weakSelf; - MGLTestAssert(strongSelf, !strongSelf.completionHandlerCalled); + MLNTestAssert(strongSelf, !strongSelf.completionHandlerCalled); // Stopping display link, should trigger the pending blocks [strongSelf.mapView stopDisplayLink]; - MGLTestAssert(strongSelf, strongSelf.completionHandlerCalled); + MLNTestAssert(strongSelf, strongSelf.completionHandlerCalled); }; [self internalTestCompletionBlockAddedToPendingForTestName:NSStringFromSelector(_cmd) @@ -289,12 +289,12 @@ dispatch_block_t addedToPending = ^{ __typeof__(self) strongSelf = weakSelf; - MGLTestAssert(strongSelf, !strongSelf.completionHandlerCalled); + MLNTestAssert(strongSelf, !strongSelf.completionHandlerCalled); // Remove from window, triggering validateDisplayLink [strongSelf.mapView removeFromSuperview]; - MGLTestAssert(strongSelf, strongSelf.completionHandlerCalled); + MLNTestAssert(strongSelf, strongSelf.completionHandlerCalled); }; [self internalTestCompletionBlockAddedToPendingForTestName:NSStringFromSelector(_cmd) @@ -332,11 +332,11 @@ NSArray *value = change[NSKeyValueChangeNewKey]; - MGLTestAssert(myself, [value isKindOfClass:[NSArray class]]); + MLNTestAssert(myself, [value isKindOfClass:[NSArray class]]); if (value.count > 0) { - MGLTestAssert(myself, [value containsObject:block]); - MGLTestAssert(myself, !blockAddedToPendingBlocks); + MLNTestAssert(myself, [value containsObject:block]); + MLNTestAssert(myself, !blockAddedToPendingBlocks); if ([myself.mapView.pendingCompletionBlocks containsObject:block]) { blockAddedToPendingBlocks = YES; diff --git a/platform/ios/platform/ios/Integration Tests/MGLNetworkConfigurationIntegrationTests.mm b/platform/ios/platform/ios/Integration Tests/MLNNetworkConfigurationIntegrationTests.mm similarity index 77% rename from platform/ios/platform/ios/Integration Tests/MGLNetworkConfigurationIntegrationTests.mm rename to platform/ios/platform/ios/Integration Tests/MLNNetworkConfigurationIntegrationTests.mm index fb384956a..1a7c544c1 100644 --- a/platform/ios/platform/ios/Integration Tests/MGLNetworkConfigurationIntegrationTests.mm +++ b/platform/ios/platform/ios/Integration Tests/MLNNetworkConfigurationIntegrationTests.mm @@ -1,63 +1,63 @@ #import @import Mapbox; -#import "MGLMapViewIntegrationTest.h" -#import "MGLNetworkConfiguration_Private.h" -#import "MGLOfflineStorage_Private.h" -#import "MGLFoundation_Private.h" +#import "MLNMapViewIntegrationTest.h" +#import "MLNNetworkConfiguration_Private.h" +#import "MLNOfflineStorage_Private.h" +#import "MLNFoundation_Private.h" -@interface MGLNetworkConfiguration (Testing) +@interface MLNNetworkConfiguration (Testing) + (void)testing_clearNativeNetworkManagerDelegate; + (id)testing_nativeNetworkManagerDelegate; @end -@interface MGLNetworkConfigurationTestDelegate: NSObject +@interface MLNNetworkConfigurationTestDelegate: NSObject @property (nonatomic) NSURLSession *(^handler)(); @end -@interface MGLNetworkConfigurationSessionDelegate: NSObject +@interface MLNNetworkConfigurationSessionDelegate: NSObject @property (nonatomic) dispatch_block_t authHandler; @end -@interface MGLNetworkConfigurationSessionDataDelegate: NSObject +@interface MLNNetworkConfigurationSessionDataDelegate: NSObject @property (nonatomic) void (^dataHandler)(NSURLSessionDataTask *, NSData *); @end -@interface MGLNetworkConfigurationIntegrationTests : MGLIntegrationTestCase +@interface MLNNetworkConfigurationIntegrationTests : MLNIntegrationTestCase @end #define ASSERT_NATIVE_DELEGATE_IS_NIL() \ - XCTAssertNil([MGLNetworkConfiguration testing_nativeNetworkManagerDelegate]) + XCTAssertNil([MLNNetworkConfiguration testing_nativeNetworkManagerDelegate]) #define ASSERT_NATIVE_DELEGATE_IS_NOT_NIL() \ - XCTAssertNotNil([MGLNetworkConfiguration testing_nativeNetworkManagerDelegate]) + XCTAssertNotNil([MLNNetworkConfiguration testing_nativeNetworkManagerDelegate]) // NOTE: These tests are currently assumed to run in this specific order. -@implementation MGLNetworkConfigurationIntegrationTests +@implementation MLNNetworkConfigurationIntegrationTests - (void)setUp { [super setUp]; // Reset before each test - [MGLNetworkConfiguration testing_clearNativeNetworkManagerDelegate]; + [MLNNetworkConfiguration testing_clearNativeNetworkManagerDelegate]; } - (void)test0_NativeNetworkManagerDelegateIsSet { ASSERT_NATIVE_DELEGATE_IS_NIL(); - MGLNetworkConfiguration *config = [[MGLNetworkConfiguration alloc] init]; + MLNNetworkConfiguration *config = [[MLNNetworkConfiguration alloc] init]; [config resetNativeNetworkManagerDelegate]; - id delegate = [MGLNetworkConfiguration testing_nativeNetworkManagerDelegate]; + id delegate = [MLNNetworkConfiguration testing_nativeNetworkManagerDelegate]; - id manager = MGL_OBJC_DYNAMIC_CAST_AS_PROTOCOL(delegate, MGLNativeNetworkDelegate); + id manager = MLN_OBJC_DYNAMIC_CAST_AS_PROTOCOL(delegate, MLNNativeNetworkDelegate); XCTAssertNotNil(manager); // Expected properties XCTAssertNotNil([manager sessionConfiguration]); - [MGLNetworkConfiguration sharedManager]; - id delegate2 = [MGLNetworkConfiguration testing_nativeNetworkManagerDelegate]; + [MLNNetworkConfiguration sharedManager]; + id delegate2 = [MLNNetworkConfiguration testing_nativeNetworkManagerDelegate]; XCTAssert(delegate != delegate2); } @@ -68,11 +68,11 @@ // Just calling the shared manager is also sufficient (even though, it's a // singleton and created with a dispatch_once, the delegate is re-set for // each call. - [MGLNetworkConfiguration sharedManager]; + [MLNNetworkConfiguration sharedManager]; ASSERT_NATIVE_DELEGATE_IS_NOT_NIL(); - id delegate = [MGLNetworkConfiguration testing_nativeNetworkManagerDelegate]; - id manager = MGL_OBJC_DYNAMIC_CAST_AS_PROTOCOL(delegate, MGLNativeNetworkDelegate); + id delegate = [MLNNetworkConfiguration testing_nativeNetworkManagerDelegate]; + id manager = MLN_OBJC_DYNAMIC_CAST_AS_PROTOCOL(delegate, MLNNativeNetworkDelegate); XCTAssertNotNil(manager); // Expected properties @@ -82,11 +82,11 @@ - (void)test2_NativeNetworkManagerDelegateIsSet { ASSERT_NATIVE_DELEGATE_IS_NIL(); - [MGLNetworkConfiguration sharedManager]; - id delegate = [MGLNetworkConfiguration testing_nativeNetworkManagerDelegate]; + [MLNNetworkConfiguration sharedManager]; + id delegate = [MLNNetworkConfiguration testing_nativeNetworkManagerDelegate]; - [[MGLNetworkConfiguration sharedManager] resetNativeNetworkManagerDelegate]; - id delegate2 = [MGLNetworkConfiguration testing_nativeNetworkManagerDelegate]; + [[MLNNetworkConfiguration sharedManager] resetNativeNetworkManagerDelegate]; + id delegate2 = [MLNNetworkConfiguration testing_nativeNetworkManagerDelegate]; XCTAssert(delegate == delegate2); } @@ -94,9 +94,9 @@ { ASSERT_NATIVE_DELEGATE_IS_NIL(); - // Similar to `[MGLNetworkConfiguration sharedManager]`, - // `[MGLOfflineStorage sharedOfflineStorage]` also sets the delegate. - [MGLOfflineStorage sharedOfflineStorage]; + // Similar to `[MLNNetworkConfiguration sharedManager]`, + // `[MLNOfflineStorage sharedOfflineStorage]` also sets the delegate. + [MLNOfflineStorage sharedOfflineStorage]; ASSERT_NATIVE_DELEGATE_IS_NOT_NIL(); } @@ -104,20 +104,20 @@ { // Testing a second time... ASSERT_NATIVE_DELEGATE_IS_NIL(); - [MGLOfflineStorage sharedOfflineStorage]; + [MLNOfflineStorage sharedOfflineStorage]; ASSERT_NATIVE_DELEGATE_IS_NOT_NIL(); } - (void)test5_NativeNetworkManagerDelegateIsSetByMapViewInit { ASSERT_NATIVE_DELEGATE_IS_NIL(); - (void)[[MGLMapView alloc] init]; + (void)[[MLNMapView alloc] init]; ASSERT_NATIVE_DELEGATE_IS_NOT_NIL(); } - (void)testNetworkConfigurationDelegateIsNil { - MGLNetworkConfiguration *manager = [MGLNetworkConfiguration sharedManager]; + MLNNetworkConfiguration *manager = [MLNNetworkConfiguration sharedManager]; XCTAssertNil(manager.delegate); } @@ -127,8 +127,8 @@ __block BOOL isMainThread = YES; // Setup delegate object that provides a NSURLSession - MGLNetworkConfiguration *manager = [MGLNetworkConfiguration sharedManager]; - MGLNetworkConfigurationTestDelegate *delegate = [[MGLNetworkConfigurationTestDelegate alloc] init]; + MLNNetworkConfiguration *manager = [MLNNetworkConfiguration sharedManager]; + MLNNetworkConfigurationTestDelegate *delegate = [[MLNNetworkConfigurationTestDelegate alloc] init]; delegate.handler = ^{ NSURLSession *internalSession; @synchronized (self) { @@ -141,13 +141,13 @@ manager.delegate = delegate; - // The following is modified/taken from MGLOfflineStorageTests as we do not yet have a + // The following is modified/taken from MLNOfflineStorageTests as we do not yet have a // good mechanism to test FileSource (in this SDK) // // Want to ensure we download from the network; nuclear option { XCTestExpectation *expectation = [self expectationWithDescription:@"Expect database to be reset without an error."]; - [[MGLOfflineStorage sharedOfflineStorage] resetDatabaseWithCompletionHandler:^(NSError * _Nullable error) { + [[MLNOfflineStorage sharedOfflineStorage] resetDatabaseWithCompletionHandler:^(NSError * _Nullable error) { XCTAssertNil(error); [expectation fulfill]; }]; @@ -155,12 +155,12 @@ } // Boston - MGLCoordinateBounds bounds = { + MLNCoordinateBounds bounds = { { .latitude = 42.360, .longitude = -71.056 }, { .latitude = 42.358, .longitude = -71.053 }, }; - NSURL *styleURL = [[MGLStyle predefinedStyle:@"Bright"] url]; - MGLTilePyramidOfflineRegion *region = [[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:styleURL + NSURL *styleURL = [[MLNStyle predefinedStyle:@"Bright"] url]; + MLNTilePyramidOfflineRegion *region = [[MLNTilePyramidOfflineRegion alloc] initWithStyleURL:styleURL bounds:bounds fromZoomLevel:20 toZoomLevel:20]; @@ -169,27 +169,27 @@ @"Name": @"Faneuil Hall" }]; - __block MGLOfflinePack *pack = nil; + __block MLNOfflinePack *pack = nil; // Add pack { XCTestExpectation *additionCompletionHandlerExpectation = [self expectationWithDescription:@"add pack completion handler"]; - [[MGLOfflineStorage sharedOfflineStorage] addPackForRegion:region + [[MLNOfflineStorage sharedOfflineStorage] addPackForRegion:region withContext:context - completionHandler:^(MGLOfflinePack * _Nullable completionHandlerPack, NSError * _Nullable error) { + completionHandler:^(MLNOfflinePack * _Nullable completionHandlerPack, NSError * _Nullable error) { pack = completionHandlerPack; [additionCompletionHandlerExpectation fulfill]; }]; [self waitForExpectationsWithTimeout:5 handler:nil]; } - XCTAssert(pack.state == MGLOfflinePackStateInactive); + XCTAssert(pack.state == MLNOfflinePackStateInactive); // Download { - XCTestExpectation *expectation = [self expectationForNotification:MGLOfflinePackProgressChangedNotification object:pack handler:^BOOL(NSNotification * _Nonnull notification) { - return pack.state == MGLOfflinePackStateComplete; + XCTestExpectation *expectation = [self expectationForNotification:MLNOfflinePackProgressChangedNotification object:pack handler:^BOOL(NSNotification * _Nonnull notification) { + return pack.state == MLNOfflinePackStateComplete; }]; expectation.inverted = !shouldDownload; @@ -204,7 +204,7 @@ // Remove pack, so we don't affect other tests { XCTestExpectation *expectation = [self expectationWithDescription:@"remove pack completion handler"]; - [[MGLOfflineStorage sharedOfflineStorage] removePack:pack withCompletionHandler:^(NSError * _Nullable error) { + [[MLNOfflineStorage sharedOfflineStorage] removePack:pack withCompletionHandler:^(NSError * _Nullable error) { [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:5 handler:nil]; @@ -247,7 +247,7 @@ __block BOOL isMainThread = YES; NSURLSessionConfiguration *sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration]; - MGLNetworkConfigurationSessionDelegate *delegate = [[MGLNetworkConfigurationSessionDelegate alloc] init]; + MLNNetworkConfigurationSessionDelegate *delegate = [[MLNNetworkConfigurationSessionDelegate alloc] init]; delegate.authHandler = ^{ @synchronized (self) { didCallAuthChallenge = YES; @@ -270,7 +270,7 @@ __block BOOL didCallReceiveData = NO; NSURLSessionConfiguration *sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration]; - MGLNetworkConfigurationSessionDataDelegate *delegate = [[MGLNetworkConfigurationSessionDataDelegate alloc] init]; + MLNNetworkConfigurationSessionDataDelegate *delegate = [[MLNNetworkConfigurationSessionDataDelegate alloc] init]; delegate.dataHandler = ^(NSURLSessionDataTask *task, NSData *data) { @synchronized (self) { didCallReceiveData = YES; @@ -298,7 +298,7 @@ } - (void)testNetworkConfigurationWithSessionConfigurationWithCustomHeaders🔒 { - // Custom session configuration, based on `MGLNetworkConfiguration.defaultSessionConfiguration` + // Custom session configuration, based on `MLNNetworkConfiguration.defaultSessionConfiguration` NSURLSessionConfiguration *sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration]; sessionConfig.HTTPAdditionalHeaders = @{ @"testing" : @YES }; sessionConfig.HTTPMaximumConnectionsPerHost = 1; @@ -313,10 +313,10 @@ @end -// MARK: - MGLNetworkConfiguration delegate +// MARK: - MLNNetworkConfiguration delegate -@implementation MGLNetworkConfigurationTestDelegate -- (NSURLSession *)sessionForNetworkConfiguration:(MGLNetworkConfiguration *)configuration { +@implementation MLNNetworkConfigurationTestDelegate +- (NSURLSession *)sessionForNetworkConfiguration:(MLNNetworkConfiguration *)configuration { if (self.handler) { return self.handler(); } @@ -327,7 +327,7 @@ // MARK: - NSURLSession delegate -@implementation MGLNetworkConfigurationSessionDelegate +@implementation MLNNetworkConfigurationSessionDelegate - (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler { if (self.authHandler) { self.authHandler(); @@ -340,7 +340,7 @@ // MARK: - NSURLSession data delegate -@implementation MGLNetworkConfigurationSessionDataDelegate +@implementation MLNNetworkConfigurationSessionDataDelegate - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data { if (self.dataHandler) { self.dataHandler(dataTask, data); diff --git a/platform/ios/platform/ios/Integration Tests/MGLShapeSourceTests.m b/platform/ios/platform/ios/Integration Tests/MLNShapeSourceTests.m similarity index 76% rename from platform/ios/platform/ios/Integration Tests/MGLShapeSourceTests.m rename to platform/ios/platform/ios/Integration Tests/MLNShapeSourceTests.m index 836118450..12a43f333 100644 --- a/platform/ios/platform/ios/Integration Tests/MGLShapeSourceTests.m +++ b/platform/ios/platform/ios/Integration Tests/MLNShapeSourceTests.m @@ -6,12 +6,12 @@ // Copyright © 2018 Mapbox. All rights reserved. // -#import "MGLMapViewIntegrationTest.h" +#import "MLNMapViewIntegrationTest.h" -@interface MGLShapeSourceTests : MGLMapViewIntegrationTest +@interface MLNShapeSourceTests : MLNMapViewIntegrationTest @end -@implementation MGLShapeSourceTests +@implementation MLNShapeSourceTests - (void)testSettingShapeSourceToNilInRegionDidChange { @@ -24,14 +24,14 @@ CLLocationCoordinate2DMake(round(0), round(i / 2 )), CLLocationCoordinate2DMake(round(20), round(i / 2))}; - MGLPolygonFeature *feature = [MGLPolygonFeature polygonWithCoordinates:coord count:4]; + MLNPolygonFeature *feature = [MLNPolygonFeature polygonWithCoordinates:coord count:4]; [features addObject:feature]; } - MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"source" features:features options:nil]; + MLNShapeSource *shapeSource = [[MLNShapeSource alloc] initWithIdentifier:@"source" features:features options:nil]; [self.style addSource:shapeSource]; - MGLFillStyleLayer *layer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"layer" source:shapeSource]; + MLNFillStyleLayer *layer = [[MLNFillStyleLayer alloc] initWithIdentifier:@"layer" source:shapeSource]; layer.fillOpacity = [NSExpression expressionForConstantValue:@0.5]; [self.style addLayer:layer]; @@ -42,9 +42,9 @@ __weak typeof(self) weakself = self; __block NSInteger delegateCallCount = 0; - self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + self.regionDidChange = ^(MLNMapView *mapView, MLNCameraChangeReason reason, BOOL animated) { - MGLShapeSourceTests *strongSelf = weakself; + MLNShapeSourceTests *strongSelf = weakself; if (!strongSelf) return; @@ -58,7 +58,7 @@ // See https://github.com/mapbox/mapbox-gl-native/issues/11180 if (delegateCallCount > 10) { - MGLTestFail(strongSelf); + MLNTestFail(strongSelf); } else { shapeSource.shape = nil; @@ -83,14 +83,14 @@ CLLocationCoordinate2DMake(round(0), round(i / 2 )), CLLocationCoordinate2DMake(round(20), round(i / 2))}; - MGLPolygonFeature *feature = [MGLPolygonFeature polygonWithCoordinates:coord count:4]; + MLNPolygonFeature *feature = [MLNPolygonFeature polygonWithCoordinates:coord count:4]; [features addObject:feature]; } - MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"source" features:features options:nil]; + MLNShapeSource *shapeSource = [[MLNShapeSource alloc] initWithIdentifier:@"source" features:features options:nil]; [self.style addSource:shapeSource]; - MGLFillStyleLayer *layer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"layer" source:shapeSource]; + MLNFillStyleLayer *layer = [[MLNFillStyleLayer alloc] initWithIdentifier:@"layer" source:shapeSource]; layer.fillOpacity = [NSExpression expressionForConstantValue:@0.5]; [self.style addLayer:layer]; @@ -101,23 +101,23 @@ __block NSInteger delegateCallCount = 0; __weak typeof(self) weakself = self; - self.regionIsChanging = ^(MGLMapView *mapView) { + self.regionIsChanging = ^(MLNMapView *mapView) { // See https://github.com/mapbox/mapbox-gl-native/issues/11180 shapeSource.shape = nil; }; - self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + self.regionDidChange = ^(MLNMapView *mapView, MLNCameraChangeReason reason, BOOL animated) { delegateCallCount++; if (delegateCallCount > 1) { - MGLTestFail(weakself); + MLNTestFail(weakself); } [expectation fulfill]; }; - // Should take MGLAnimationDuration seconds (0.3) + // Should take MLNAnimationDuration seconds (0.3) [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(10.0, 10.0) animated:YES]; [self waitForExpectations:@[expectation] timeout:1.0]; } @@ -127,10 +127,10 @@ CLLocationCoordinate2DMake(9.6315313, 52.4133574), CLLocationCoordinate2DMake(24.9410248, 60.1733244)}; - MGLPolylineFeature *polylineFeature = [MGLPolylineFeature polylineWithCoordinates:coordinates count:sizeof(coordinates)/sizeof(coordinates[0])]; - NSDictionary *options = @{MGLShapeSourceOptionLineDistanceMetrics: @YES}; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"route" shape:polylineFeature options:options]; - MGLLineStyleLayer *lineLayer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"lineLayer" source:source]; + MLNPolylineFeature *polylineFeature = [MLNPolylineFeature polylineWithCoordinates:coordinates count:sizeof(coordinates)/sizeof(coordinates[0])]; + NSDictionary *options = @{MLNShapeSourceOptionLineDistanceMetrics: @YES}; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"route" shape:polylineFeature options:options]; + MLNLineStyleLayer *lineLayer = [[MLNLineStyleLayer alloc] initWithIdentifier:@"lineLayer" source:source]; [self.style addSource:source]; [self.style addLayer:lineLayer]; @@ -141,18 +141,18 @@ expectation.assertForOverFulfill = YES; __weak id weakself = self; - self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + self.regionDidChange = ^(MLNMapView *mapView, MLNCameraChangeReason reason, BOOL animated) { id strongSelf = weakself; if (!strongSelf) return; NSArray *features = [source featuresMatchingPredicate:nil]; - MGLTestAssert(strongSelf, features.count == 1UL, @"Should contain one Feature"); + MLNTestAssert(strongSelf, features.count == 1UL, @"Should contain one Feature"); - MGLPolylineFeature *feature = [features objectAtIndex:0]; - MGLTestAssertNotNil(strongSelf, [feature.attributes objectForKey:@"mapbox_clip_start"], @"Attributes should contain mapbox_clip_start property"); - MGLTestAssertNotNil(strongSelf, [feature.attributes objectForKey:@"mapbox_clip_end"], @"Attributes should contain mapbox_clip_end property"); + MLNPolylineFeature *feature = [features objectAtIndex:0]; + MLNTestAssertNotNil(strongSelf, [feature.attributes objectForKey:@"mapbox_clip_start"], @"Attributes should contain mapbox_clip_start property"); + MLNTestAssertNotNil(strongSelf, [feature.attributes objectForKey:@"mapbox_clip_end"], @"Attributes should contain mapbox_clip_end property"); [expectation fulfill]; }; diff --git a/platform/ios/platform/ios/Integration Tests/MGLSourceTests.swift b/platform/ios/platform/ios/Integration Tests/MLNSourceTests.swift similarity index 84% rename from platform/ios/platform/ios/Integration Tests/MGLSourceTests.swift rename to platform/ios/platform/ios/Integration Tests/MLNSourceTests.swift index 69fa0182b..66876960b 100644 --- a/platform/ios/platform/ios/Integration Tests/MGLSourceTests.swift +++ b/platform/ios/platform/ios/Integration Tests/MLNSourceTests.swift @@ -1,6 +1,6 @@ import XCTest -class MGLSourceTests: MGLMapViewIntegrationTest { +class MLNSourceTests: MLNMapViewIntegrationTest { // See testForRaisingExceptionsOnStaleStyleObjects for Obj-C sibling. func testForRaisingExceptionsOnStaleStyleObjectsOnRemoveFromMapView() { @@ -11,7 +11,7 @@ class MGLSourceTests: MGLMapViewIntegrationTest { return } - let source = MGLVectorTileSource(identifier: "trees", configurationURL: configURL) + let source = MLNVectorTileSource(identifier: "trees", configurationURL: configURL) mapView.style?.addSource(source) let bundle = Bundle(for: type(of: self)) @@ -35,8 +35,8 @@ class MGLSourceTests: MGLMapViewIntegrationTest { try mapView.style?.removeSource(source, error: ()) } catch let error as NSError { - XCTAssertEqual(error.domain, MGLErrorDomain) - XCTAssertEqual(error.code, MGLErrorCode.sourceCannotBeRemovedFromStyle.rawValue) + XCTAssertEqual(error.domain, MLNErrorDomain) + XCTAssertEqual(error.code, MLNErrorCode.sourceCannotBeRemovedFromStyle.rawValue) expect.fulfill() } diff --git a/platform/ios/platform/ios/Integration Tests/MGLStyleLayerIntegrationTests.m b/platform/ios/platform/ios/Integration Tests/MLNStyleLayerIntegrationTests.m similarity index 83% rename from platform/ios/platform/ios/Integration Tests/MGLStyleLayerIntegrationTests.m rename to platform/ios/platform/ios/Integration Tests/MLNStyleLayerIntegrationTests.m index f5f2f957d..4bf12687d 100644 --- a/platform/ios/platform/ios/Integration Tests/MGLStyleLayerIntegrationTests.m +++ b/platform/ios/platform/ios/Integration Tests/MLNStyleLayerIntegrationTests.m @@ -1,19 +1,19 @@ -#import "MGLMapViewIntegrationTest.h" +#import "MLNMapViewIntegrationTest.h" -@interface MGLStyleLayerIntegrationTests : MGLMapViewIntegrationTest +@interface MLNStyleLayerIntegrationTests : MLNMapViewIntegrationTest @end -@implementation MGLStyleLayerIntegrationTests +@implementation MLNStyleLayerIntegrationTests -- (MGLCircleStyleLayer*)setupCircleStyleLayer { +- (MLNCircleStyleLayer*)setupCircleStyleLayer { // Adapted from https://docs.mapbox.com/ios/examples/dds-circle-layer/ // "mapbox://examples.2uf7qges" is a tileset ID. For more // more information, see docs.mapbox.com/help/glossary/tileset-id/ - MGLSource *source = [[MGLVectorTileSource alloc] initWithIdentifier:@"trees" configurationURL:[NSURL URLWithString:@"mapbox://examples.2uf7qges"]]; + MLNSource *source = [[MLNVectorTileSource alloc] initWithIdentifier:@"trees" configurationURL:[NSURL URLWithString:@"mapbox://examples.2uf7qges"]]; [self.mapView.style addSource:source]; - MGLCircleStyleLayer *layer = [[MGLCircleStyleLayer alloc] initWithIdentifier: @"tree-style" source:source]; + MLNCircleStyleLayer *layer = [[MLNCircleStyleLayer alloc] initWithIdentifier: @"tree-style" source:source]; // The source name from the source's TileJSON metadata: mapbox.com/api-documentation/maps/#retrieve-tilejson-metadata layer.sourceLayerIdentifier = @"yoshino-trees-a0puw5"; @@ -27,10 +27,10 @@ self.mapView.centerCoordinate = CLLocationCoordinate2DMake(38.897,-77.039); self.mapView.zoomLevel = 10.5; - MGLCircleStyleLayer *layer = [self setupCircleStyleLayer]; + MLNCircleStyleLayer *layer = [self setupCircleStyleLayer]; NSExpression *interpExpression = [NSExpression mgl_expressionForInterpolatingExpression:NSExpression.zoomLevelVariableExpression - withCurveType:MGLExpressionInterpolationModeLinear + withCurveType:MLNExpressionInterpolationModeLinear parameters:nil stops:[NSExpression expressionForConstantValue:@{}]]; @@ -46,7 +46,7 @@ self.mapView.centerCoordinate = CLLocationCoordinate2DMake(38.897,-77.039); self.mapView.zoomLevel = 10.5; - MGLCircleStyleLayer *layer = [self setupCircleStyleLayer]; + MLNCircleStyleLayer *layer = [self setupCircleStyleLayer]; NSExpression *steppingExpression = [NSExpression mgl_expressionForSteppingExpression:NSExpression.zoomLevelVariableExpression fromExpression:[NSExpression expressionForConstantValue:[UIColor greenColor]] @@ -62,7 +62,7 @@ self.mapView.centerCoordinate = CLLocationCoordinate2DMake(38.897,-77.039); self.mapView.zoomLevel = 10.5; - MGLVectorTileSource *source = [[MGLVectorTileSource alloc] initWithIdentifier:@"trees" configurationURL:[NSURL URLWithString:@"mapbox://examples.2uf7qges"]]; + MLNVectorTileSource *source = [[MLNVectorTileSource alloc] initWithIdentifier:@"trees" configurationURL:[NSURL URLWithString:@"mapbox://examples.2uf7qges"]]; [self.mapView.style addSource:source]; self.styleLoadingExpectation = nil; @@ -70,19 +70,19 @@ [self waitForMapViewToFinishLoadingStyleWithTimeout:10]; XCTAssertNotNil(source.description); - XCTAssertThrowsSpecificNamed(source.configurationURL, NSException, MGLInvalidStyleSourceException, @"MGLSource should raise an exception if its core peer got invalidated"); + XCTAssertThrowsSpecificNamed(source.configurationURL, NSException, MLNInvalidStyleSourceException, @"MLNSource should raise an exception if its core peer got invalidated"); } - (void)testForRaisingExceptionsOnStaleLayerObject { self.mapView.centerCoordinate = CLLocationCoordinate2DMake(38.897,-77.039); self.mapView.zoomLevel = 10.5; - MGLPointFeature *feature = [[MGLPointFeature alloc] init]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil]; + MLNPointFeature *feature = [[MLNPointFeature alloc] init]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil]; // Testing generated layers - MGLLineStyleLayer *lineLayer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"lineLayerID" source:source]; - MGLCircleStyleLayer *circleLayer = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"circleLayerID" source:source]; + MLNLineStyleLayer *lineLayer = [[MLNLineStyleLayer alloc] initWithIdentifier:@"lineLayerID" source:source]; + MLNCircleStyleLayer *circleLayer = [[MLNCircleStyleLayer alloc] initWithIdentifier:@"circleLayerID" source:source]; [self.mapView.style addSource:source]; [self.mapView.style addLayer:lineLayer]; @@ -103,8 +103,8 @@ XCTAssert([lineLayer.description containsString:@""]); XCTAssert([circleLayer.description containsString:@""]); - XCTAssertThrowsSpecificNamed(lineLayer.isVisible, NSException, MGLInvalidStyleLayerException, @"Layer should raise an exception if its core peer got invalidated"); - XCTAssertThrowsSpecificNamed(circleLayer.isVisible, NSException, MGLInvalidStyleLayerException, @"Layer should raise an exception if its core peer got invalidated"); + XCTAssertThrowsSpecificNamed(lineLayer.isVisible, NSException, MLNInvalidStyleLayerException, @"Layer should raise an exception if its core peer got invalidated"); + XCTAssertThrowsSpecificNamed(circleLayer.isVisible, NSException, MLNInvalidStyleLayerException, @"Layer should raise an exception if its core peer got invalidated"); XCTAssertThrowsSpecificNamed([self.mapView.style removeLayer:lineLayer], NSException, NSInvalidArgumentException, @"Style should raise an exception when attempting to remove an invalid layer (e.g. if its core peer got invalidated)"); XCTAssertThrowsSpecificNamed([self.mapView.style removeLayer:circleLayer], NSException, NSInvalidArgumentException, @"Style should raise an exception when attempting to remove an invalid layer (e.g. if its core peer got invalidated)"); diff --git a/platform/ios/platform/ios/Integration Tests/MLNStyleURLIntegrationTest.m b/platform/ios/platform/ios/Integration Tests/MLNStyleURLIntegrationTest.m new file mode 100644 index 000000000..66bf2bfff --- /dev/null +++ b/platform/ios/platform/ios/Integration Tests/MLNStyleURLIntegrationTest.m @@ -0,0 +1,22 @@ +#import "MLNMapViewIntegrationTest.h" + +@interface MLNStyleURLIntegrationTest : MLNMapViewIntegrationTest +@end + +@implementation MLNStyleURLIntegrationTest + +- (void)setUp { + [super setUp]; + [MLNSettings useWellKnownTileServer:MLNMapTiler]; +} + +- (void)predefinedStylesLoadingTest { + + for (MLNDefaultStyle* style in [MLNStyle predefinedStyles]) { + NSString* styleName = style.name; + self.mapView.styleURL = [[MLNStyle predefinedStyle:styleName] url]; + [self waitForMapViewToFinishLoadingStyleWithTimeout:5]; + } +} + +@end diff --git a/platform/ios/platform/ios/Integration Tests/MLNTestLocationManager.h b/platform/ios/platform/ios/Integration Tests/MLNTestLocationManager.h new file mode 100644 index 000000000..72fc80fd2 --- /dev/null +++ b/platform/ios/platform/ios/Integration Tests/MLNTestLocationManager.h @@ -0,0 +1,10 @@ +#import +#import +#import "MLNTestUtility.h" + +@interface MLNTestLocationManager : NSObject +@end + +@interface MLNTestLocationManager() + +@end diff --git a/platform/ios/platform/ios/Integration Tests/MGLTestLocationManager.m b/platform/ios/platform/ios/Integration Tests/MLNTestLocationManager.m similarity index 94% rename from platform/ios/platform/ios/Integration Tests/MGLTestLocationManager.m rename to platform/ios/platform/ios/Integration Tests/MLNTestLocationManager.m index f9a5a8650..b388286f2 100644 --- a/platform/ios/platform/ios/Integration Tests/MGLTestLocationManager.m +++ b/platform/ios/platform/ios/Integration Tests/MLNTestLocationManager.m @@ -1,10 +1,10 @@ -#import "MGLTestLocationManager.h" +#import "MLNTestLocationManager.h" // Used to supply integration tests with a simulated location manager. // Methods that are empty are not used within integration tests and are // therefore unimplemented. -@implementation MGLTestLocationManager +@implementation MLNTestLocationManager @synthesize delegate; diff --git a/platform/ios/platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterSwiftTests.swift b/platform/ios/platform/ios/Integration Tests/Snapshotter Tests/MLNMapSnapshotterSwiftTests.swift similarity index 77% rename from platform/ios/platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterSwiftTests.swift rename to platform/ios/platform/ios/Integration Tests/Snapshotter Tests/MLNMapSnapshotterSwiftTests.swift index 40b05c904..31c21656b 100644 --- a/platform/ios/platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterSwiftTests.swift +++ b/platform/ios/platform/ios/Integration Tests/Snapshotter Tests/MLNMapSnapshotterSwiftTests.swift @@ -1,23 +1,23 @@ import XCTest -class MGLMapSnapshotterSwiftTests: MGLMapViewIntegrationTest { +class MLNMapSnapshotterSwiftTests: MLNMapViewIntegrationTest { // Create snapshot options - private class func snapshotterOptions(size: CGSize) -> MGLMapSnapshotOptions { - let camera = MGLMapCamera() + private class func snapshotterOptions(size: CGSize) -> MLNMapSnapshotOptions { + let camera = MLNMapCamera() - let options = MGLMapSnapshotOptions(styleURL: MGLStyle.predefinedStyle("Hybrid").url , camera: camera, size: size) + let options = MLNMapSnapshotOptions(styleURL: MLNStyle.predefinedStyle("Hybrid").url , camera: camera, size: size) let sw = CLLocationCoordinate2D(latitude: 52.3, longitude: 13.0) let ne = CLLocationCoordinate2D(latitude: 52.5, longitude: 13.2) - options.coordinateBounds = MGLCoordinateBounds(sw:sw, ne:ne) + options.coordinateBounds = MLNCoordinateBounds(sw:sw, ne:ne) return options } public override func setUp() { super.setUp() - MGLSettings.use(MGLWellKnownTileServer.mapTiler) + MLNSettings.use(MLNWellKnownTileServer.mapTiler) } func testCapturingSnapshotterInSnapshotCompletion🔒() { @@ -27,7 +27,7 @@ class MGLMapSnapshotterSwiftTests: MGLMapViewIntegrationTest { let timeout: TimeInterval = 10.0 let expectation = self.expectation(description: "snapshot") - let options = MGLMapSnapshotterSwiftTests.snapshotterOptions(size: mapView.bounds.size) + let options = MLNMapSnapshotterSwiftTests.snapshotterOptions(size: mapView.bounds.size) let backgroundQueue = DispatchQueue.main @@ -37,7 +37,7 @@ class MGLMapSnapshotterSwiftTests: MGLMapViewIntegrationTest { DispatchQueue.main.async { - let snapshotter = MGLMapSnapshotter(options: options) + let snapshotter = MLNMapSnapshotter(options: options) snapshotter.start(completionHandler: { (snapshot, error) in @@ -63,8 +63,8 @@ class MGLMapSnapshotterSwiftTests: MGLMapViewIntegrationTest { } func testSnapshotOverlaySwiftErgonomics🔒() { - let options = MGLMapSnapshotterSwiftTests.snapshotterOptions(size: mapView.bounds.size) - let snapshotter = MGLMapSnapshotter(options: options) + let options = MLNMapSnapshotterSwiftTests.snapshotterOptions(size: mapView.bounds.size) + let snapshotter = MLNMapSnapshotter(options: options) let expectation = self.expectation(description: "snapshot") expectation.expectedFulfillmentCount = 2 diff --git a/platform/ios/platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterTest.m b/platform/ios/platform/ios/Integration Tests/Snapshotter Tests/MLNMapSnapshotterTest.m similarity index 75% rename from platform/ios/platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterTest.m rename to platform/ios/platform/ios/Integration Tests/Snapshotter Tests/MLNMapSnapshotterTest.m index b4e307e35..bc754943a 100644 --- a/platform/ios/platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterTest.m +++ b/platform/ios/platform/ios/Integration Tests/Snapshotter Tests/MLNMapSnapshotterTest.m @@ -1,50 +1,50 @@ -#import "MGLMapViewIntegrationTest.h" -#import "MGLMapSnapshotter_Private.h" +#import "MLNMapViewIntegrationTest.h" +#import "MLNMapSnapshotter_Private.h" -@interface MGLMapSnapshotter () +@interface MLNMapSnapshotter () @property (nonatomic) BOOL cancelled; @end -@interface MGLMapSnapshotterTest : MGLMapViewIntegrationTest +@interface MLNMapSnapshotterTest : MLNMapViewIntegrationTest @end // Convenience func to create snapshotter -MGLMapSnapshotter* snapshotterWithCoordinates(CLLocationCoordinate2D coordinates, CGSize size) { +MLNMapSnapshotter* snapshotterWithCoordinates(CLLocationCoordinate2D coordinates, CGSize size) { // Create snapshot options - MGLMapCamera* mapCamera = [[MGLMapCamera alloc] init]; + MLNMapCamera* mapCamera = [[MLNMapCamera alloc] init]; mapCamera.pitch = 20; mapCamera.centerCoordinate = coordinates; - MGLMapSnapshotOptions* options = [[MGLMapSnapshotOptions alloc] initWithStyleURL:[[MGLStyle predefinedStyle:@"Hybrid"] url] + MLNMapSnapshotOptions* options = [[MLNMapSnapshotOptions alloc] initWithStyleURL:[[MLNStyle predefinedStyle:@"Hybrid"] url] camera:mapCamera size:size]; options.zoomLevel = 10; // Create and start the snapshotter - MGLMapSnapshotter* snapshotter = [[MGLMapSnapshotter alloc] initWithOptions:options]; + MLNMapSnapshotter* snapshotter = [[MLNMapSnapshotter alloc] initWithOptions:options]; return snapshotter; } -MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size) { +MLNMapSnapshotter* snapshotterWithBounds(MLNCoordinateBounds bounds, CGSize size) { - MGLMapCamera* mapCamera = [[MGLMapCamera alloc] init]; - MGLMapSnapshotOptions* options = [[MGLMapSnapshotOptions alloc] initWithStyleURL:[[MGLStyle predefinedStyle:@"Hybrid"] url] + MLNMapCamera* mapCamera = [[MLNMapCamera alloc] init]; + MLNMapSnapshotOptions* options = [[MLNMapSnapshotOptions alloc] initWithStyleURL:[[MLNStyle predefinedStyle:@"Hybrid"] url] camera:mapCamera size:size]; options.coordinateBounds = bounds; // Create and start the snapshotter - MGLMapSnapshotter* snapshotter = [[MGLMapSnapshotter alloc] initWithOptions:options]; + MLNMapSnapshotter* snapshotter = [[MLNMapSnapshotter alloc] initWithOptions:options]; return snapshotter; } -@implementation MGLMapSnapshotterTest +@implementation MLNMapSnapshotterTest - (void)setUp { [super setUp]; - [MGLSettings useWellKnownTileServer:MGLMapTiler]; + [MLNSettings useWellKnownTileServer:MLNMapTiler]; } - (void)testMultipleSnapshotsWithASingleSnapshotter🔒 { @@ -56,15 +56,15 @@ MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(30.0, 30.0); - MGLMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); + MLNMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); XCTAssertNotNil(snapshotter); - [snapshotter startWithCompletionHandler:^(MGLMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { + [snapshotter startWithCompletionHandler:^(MLNMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { [expectation fulfill]; }]; @try { - [snapshotter startWithCompletionHandler:^(MGLMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { + [snapshotter startWithCompletionHandler:^(MLNMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { XCTFail(@"Should not be called - but should it?"); }]; XCTFail(@"Should not be called"); @@ -82,22 +82,22 @@ MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size CGSize size = self.mapView.bounds.size; CLLocationCoordinate2D coordinates = CLLocationCoordinate2DMake(30.0, 30.0); - __weak MGLMapSnapshotter *weakSnapshotter; + __weak MLNMapSnapshotter *weakSnapshotter; @autoreleasepool { - MGLMapSnapshotter *snapshotter = snapshotterWithCoordinates(coordinates, size); + MLNMapSnapshotter *snapshotter = snapshotterWithCoordinates(coordinates, size); weakSnapshotter = snapshotter; __weak __typeof__(self) weakSelf = self; - [snapshotter startWithCompletionHandler:^(MGLMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { - MGLTestAssertNotNil(weakSelf, weakSnapshotter, @"Snapshotter should not go away until the completion handler finishes executing."); + [snapshotter startWithCompletionHandler:^(MLNMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { + MLNTestAssertNotNil(weakSelf, weakSnapshotter, @"Snapshotter should not go away until the completion handler finishes executing."); // This completion block should be called. [expectation fulfill]; }]; - MGLTestAssertNotNil(self, weakSnapshotter, @"Locally scoped snapshotter should not go away while in scope."); + MLNTestAssertNotNil(self, weakSnapshotter, @"Locally scoped snapshotter should not go away while in scope."); } - MGLTestAssertNotNil(self, weakSnapshotter, @"Snapshotter should remain until it finishes even there’s no strong reference to it."); + MLNTestAssertNotNil(self, weakSnapshotter, @"Snapshotter should remain until it finishes even there’s no strong reference to it."); [self waitForExpectations:@[expectation] timeout:10.0]; - MGLTestAssertNil(self, weakSnapshotter, @"Completion handler should not leak snapshotter."); + MLNTestAssertNil(self, weakSnapshotter, @"Completion handler should not leak snapshotter."); } - (void)testSnapshotterInBackgroundWithoutStrongReference🔒 { @@ -112,7 +112,7 @@ MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size dispatch_queue_t backgroundQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); __weak __typeof__(self) weakself = self; - __block __weak MGLMapSnapshotter *weakSnapshotter; + __block __weak MLNMapSnapshotter *weakSnapshotter; dispatch_async(backgroundQueue, ^{ @@ -121,16 +121,16 @@ MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size dispatch_async(dispatch_get_main_queue(), ^{ @autoreleasepool { - MGLMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); + MLNMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); weakSnapshotter = snapshotter; - [snapshotter startWithCompletionHandler:^(MGLMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { + [snapshotter startWithCompletionHandler:^(MLNMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { // We expect this completion block to be called with an error __typeof__(self) strongself = weakself; - MGLTestAssertNotNil(strongself, snapshot); - MGLTestAssertNil(strongself, error, @"Snapshotter should have completed"); - MGLTestAssertNotNil(strongself, weakSnapshotter, @"Snapshotter should not have been deallocated yet."); + MLNTestAssertNotNil(strongself, snapshot); + MLNTestAssertNil(strongself, error, @"Snapshotter should have completed"); + MLNTestAssertNotNil(strongself, weakSnapshotter, @"Snapshotter should not have been deallocated yet."); dispatch_group_leave(dg); }]; @@ -143,7 +143,7 @@ MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size }); [self waitForExpectations:@[expectation] timeout:timeout]; - MGLTestAssertNil(self, weakSnapshotter, @"Snapshotter should not leak."); + MLNTestAssertNil(self, weakSnapshotter, @"Snapshotter should not leak."); } - (void)testSnapshotterUsingNestedDispatchQueues🔒 { @@ -169,13 +169,13 @@ MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size dispatch_async(dispatch_get_main_queue(), ^{ - __block MGLMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); + __block MLNMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); - [snapshotter startWithCompletionHandler:^(MGLMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { + [snapshotter startWithCompletionHandler:^(MLNMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { // We expect this completion block to be called with no error __typeof__(self) strongself = weakself; - MGLTestAssertNotNil(strongself, snapshot); - MGLTestAssertNil(strongself, error, @"Snapshotter should have completed"); + MLNTestAssertNotNil(strongself, snapshot); + MLNTestAssertNil(strongself, error, @"Snapshotter should have completed"); dispatch_group_leave(dg); snapshotter = nil; }]; @@ -193,20 +193,20 @@ MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size CGSize size = self.mapView.bounds.size; CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(30.0, 30.0); - __block __weak MGLMapSnapshotter *weakSnapshotter; + __block __weak MLNMapSnapshotter *weakSnapshotter; @autoreleasepool { - MGLMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); + MLNMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); weakSnapshotter = snapshotter; __weak __typeof__(self) weakself = self; - [snapshotter startWithCompletionHandler:^(MGLMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { + [snapshotter startWithCompletionHandler:^(MLNMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { __typeof__(self) strongself = weakself; - MGLTestFail(strongself, @"Completion handler should not be called when canceling."); + MLNTestFail(strongself, @"Completion handler should not be called when canceling."); }]; } - MGLTestAssertNotNil(self, weakSnapshotter); + MLNTestAssertNotNil(self, weakSnapshotter); [weakSnapshotter cancel]; - MGLTestAssertNil(self, weakSnapshotter, @"Snapshotter should not leak after being canceled."); + MLNTestAssertNil(self, weakSnapshotter, @"Snapshotter should not leak after being canceled."); } - (void)testAllocatingSnapshotOnBackgroundQueue🔒 { @@ -221,7 +221,7 @@ MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size dispatch_async(backgroundQueue, ^{ // Create the snapshotter - DO NOT START. - MGLMapSnapshotter* snapshotter = snapshotterWithCoordinates(coord, size); + MLNMapSnapshotter* snapshotter = snapshotterWithCoordinates(coord, size); dispatch_group_t group = dispatch_group_create(); dispatch_group_enter(group); @@ -256,27 +256,27 @@ MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size dispatch_queue_t backgroundQueue = dispatch_queue_create(__PRETTY_FUNCTION__, attr); // Use dispatch_group to keep the backgroundQueue block around (and - // so also the MGLMapSnapshotter + // so also the MLNMapSnapshotter dispatch_group_t group = dispatch_group_create(); dispatch_group_enter(group); dispatch_async(backgroundQueue, ^{ - MGLMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); + MLNMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); XCTAssertNotNil(snapshotter); - MGLMapSnapshotCompletionHandler completion = ^(MGLMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { + MLNMapSnapshotCompletionHandler completion = ^(MLNMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { // The completion block should not be called - MGLTestFail(weakself); + MLNTestFail(weakself); dispatch_group_leave(group); }; @try { [snapshotter startWithCompletionHandler:completion]; - MGLTestFail(weakself, @"startWithCompletionHandler: should raise an exception"); + MLNTestFail(weakself, @"startWithCompletionHandler: should raise an exception"); } @catch (NSException *exception) { - MGLTestAssert(weakself, exception.name == NSInvalidArgumentException); + MLNTestAssert(weakself, exception.name == NSInvalidArgumentException); dispatch_group_leave(group); } @@ -310,17 +310,17 @@ MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(57.0, lon); @autoreleasepool { - MGLMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); - [snapshotter startWithCompletionHandler:^(MGLMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { + MLNMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); + [snapshotter startWithCompletionHandler:^(MLNMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { // This should be the main queue __typeof__(self) strongself = weakself; - MGLTestAssertNotNil(strongself, strongself); + MLNTestAssertNotNil(strongself, strongself); - MGLTestAssertNotNil(strongself, snapshot); - MGLTestAssertNotNil(strongself, snapshot.image); - MGLTestAssertNil(strongself, error, @"Snapshot should not error with: %@", error); + MLNTestAssertNotNil(strongself, snapshot); + MLNTestAssertNotNil(strongself, snapshot.image); + MLNTestAssertNil(strongself, error, @"Snapshot should not error with: %@", error); // Change this to XCTAttachmentLifetimeKeepAlways to be able to look at the snapshots after running XCTAttachment *attachment = [XCTAttachment attachmentWithImage:snapshot.image]; @@ -344,28 +344,28 @@ MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(30.0, 30.0); - MGLMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); + MLNMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); XCTAssertNotNil(snapshotter); __weak __typeof__(self) weakself = self; - [snapshotter startWithCompletionHandler:^(MGLMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { + [snapshotter startWithCompletionHandler:^(MLNMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { __typeof__(self) myself = weakself; - MGLTestAssertNotNil(myself, snapshot); + MLNTestAssertNotNil(myself, snapshot); CGPoint point = [snapshot pointForCoordinate:coord]; CGFloat epsilon = 0.000001; - MGLTestAssertEqualWithAccuracy(myself, point.x, size.width/2.0, epsilon); - MGLTestAssertEqualWithAccuracy(myself, point.y, size.height/2.0, epsilon); + MLNTestAssertEqualWithAccuracy(myself, point.x, size.width/2.0, epsilon); + MLNTestAssertEqualWithAccuracy(myself, point.y, size.height/2.0, epsilon); CLLocationCoordinate2D coord2 = [snapshot coordinateForPoint:point]; - MGLTestAssertEqualWithAccuracy(myself, coord.latitude, coord2.latitude, epsilon); - MGLTestAssertEqualWithAccuracy(myself, coord.longitude, coord2.longitude, epsilon); + MLNTestAssertEqualWithAccuracy(myself, coord.latitude, coord2.latitude, epsilon); + MLNTestAssertEqualWithAccuracy(myself, coord.longitude, coord2.longitude, epsilon); [expectation fulfill]; }]; @@ -382,33 +382,33 @@ MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(30.0, 30.0); - MGLMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); + MLNMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); XCTAssertNotNil(snapshotter); __weak __typeof__(self) weakself = self; - [snapshotter startWithCompletionHandler:^(MGLMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { + [snapshotter startWithCompletionHandler:^(MLNMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { __typeof__(self) myself = weakself; CGFloat epsilon = 0.000001; - MGLTestAssertNotNil(myself, snapshot); + MLNTestAssertNotNil(myself, snapshot); CLLocationCoordinate2D coordTL = [snapshot coordinateForPoint:CGPointZero]; - MGLTestAssert(myself, coordTL.longitude < coord.longitude); - MGLTestAssert(myself, coordTL.latitude > coord.latitude); + MLNTestAssert(myself, coordTL.longitude < coord.longitude); + MLNTestAssert(myself, coordTL.latitude > coord.latitude); // And check point CGPoint tl = [snapshot pointForCoordinate:coordTL]; - MGLTestAssertEqualWithAccuracy(myself, tl.x, 0.0, epsilon); - MGLTestAssertEqualWithAccuracy(myself, tl.y, 0.0, epsilon); + MLNTestAssertEqualWithAccuracy(myself, tl.x, 0.0, epsilon); + MLNTestAssertEqualWithAccuracy(myself, tl.y, 0.0, epsilon); CLLocationCoordinate2D coordBR = [snapshot coordinateForPoint:CGPointMake(size.width, size.height)]; - MGLTestAssert(myself, coordBR.longitude > coord.longitude); - MGLTestAssert(myself, coordBR.latitude < coord.latitude); + MLNTestAssert(myself, coordBR.longitude > coord.longitude); + MLNTestAssert(myself, coordBR.latitude < coord.latitude); [expectation fulfill]; }]; @@ -424,19 +424,19 @@ MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(30.0, 30.0); - MGLMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); + MLNMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); XCTAssertNotNil(snapshotter); - [snapshotter startWithOverlayHandler:^(MGLMapSnapshotOverlay *snapshotOverlay) { + [snapshotter startWithOverlayHandler:^(MLNMapSnapshotOverlay *snapshotOverlay) { XCTAssertNotNil(snapshotOverlay); UIGraphicsEndImageContext(); [expectation fulfill]; - } completionHandler:^(MGLMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { + } completionHandler:^(MLNMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { XCTAssertNil(snapshot); XCTAssertNotNil(error); - XCTAssertEqualObjects(error.domain, MGLErrorDomain); - XCTAssertEqual(error.code, MGLErrorCodeSnapshotFailed); + XCTAssertEqualObjects(error.domain, MLNErrorDomain); + XCTAssertEqual(error.code, MLNErrorCodeSnapshotFailed); XCTAssertEqualObjects(error.localizedDescription, @"Failed to generate composited snapshot."); [expectation fulfill]; @@ -454,12 +454,12 @@ MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(30.0, 30.0); - MGLMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); + MLNMapSnapshotter *snapshotter = snapshotterWithCoordinates(coord, size); XCTAssertNotNil(snapshotter); CGFloat scale = snapshotter.options.scale; - [snapshotter startWithOverlayHandler:^(MGLMapSnapshotOverlay *snapshotOverlay) { + [snapshotter startWithOverlayHandler:^(MLNMapSnapshotOverlay *snapshotOverlay) { XCTAssertNotNil(snapshotOverlay); CGFloat width = CGBitmapContextGetWidth(snapshotOverlay.context); @@ -476,7 +476,7 @@ MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size CGContextAddRect(snapshotOverlay.context, snapshotRect); CGContextFillRect(snapshotOverlay.context, snapshotRect); [expectation fulfill]; - } completionHandler:^(MGLMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { + } completionHandler:^(MLNMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { XCTAssertNil(error); XCTAssertNotNil(snapshot); [expectation fulfill]; @@ -494,15 +494,15 @@ MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size CLLocationCoordinate2D london = { .latitude = 51.5074, .longitude = -0.1278 }; CLLocationCoordinate2D paris = { .latitude = 48.8566, .longitude = 2.3522 }; - MGLCoordinateBounds bounds = { + MLNCoordinateBounds bounds = { .ne = london, .sw = paris }; - MGLMapSnapshotter *snapshotter = snapshotterWithBounds(bounds, size); + MLNMapSnapshotter *snapshotter = snapshotterWithBounds(bounds, size); XCTAssertNotNil(snapshotter); - void (^testCoordinates)(id) = ^(id snapshot){ + void (^testCoordinates)(id) = ^(id snapshot){ XCTAssertNotNil(snapshot); CGPoint londonPoint = [snapshot pointForCoordinate:london]; @@ -525,14 +525,14 @@ MGLMapSnapshotter* snapshotterWithBounds(MGLCoordinateBounds bounds, CGSize size XCTAssertEqualWithAccuracy(paris.longitude, paris2.longitude, 0.0000001); }; - [snapshotter startWithOverlayHandler:^(MGLMapSnapshotOverlay *snapshotOverlay) { - XCTAssert([snapshotOverlay conformsToProtocol:@protocol(MGLMapSnapshotProtocol)]); - testCoordinates((id)snapshotOverlay); + [snapshotter startWithOverlayHandler:^(MLNMapSnapshotOverlay *snapshotOverlay) { + XCTAssert([snapshotOverlay conformsToProtocol:@protocol(MLNMapSnapshotProtocol)]); + testCoordinates((id)snapshotOverlay); [expectation fulfill]; - } completionHandler:^(MGLMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { - XCTAssert([snapshot conformsToProtocol:@protocol(MGLMapSnapshotProtocol)]); - testCoordinates((id)snapshot); + } completionHandler:^(MLNMapSnapshot * _Nullable snapshot, NSError * _Nullable error) { + XCTAssert([snapshot conformsToProtocol:@protocol(MLNMapSnapshotProtocol)]); + testCoordinates((id)snapshot); [expectation fulfill]; }]; diff --git a/platform/ios/platform/ios/Integration Tests/integration-Bridging-Header.h b/platform/ios/platform/ios/Integration Tests/integration-Bridging-Header.h index 55b44ea57..7ac0b2480 100644 --- a/platform/ios/platform/ios/Integration Tests/integration-Bridging-Header.h +++ b/platform/ios/platform/ios/Integration Tests/integration-Bridging-Header.h @@ -1,5 +1,5 @@ // // Use this file to import your target's public headers that you would like to expose to Swift. // -#import "MGLMapViewIntegrationTest.h" +#import "MLNMapViewIntegrationTest.h" diff --git a/platform/ios/platform/ios/Mapbox.playground/Contents.swift b/platform/ios/platform/ios/Mapbox.playground/Contents.swift index a7c81f49e..e3694576e 100644 --- a/platform/ios/platform/ios/Mapbox.playground/Contents.swift +++ b/platform/ios/platform/ios/Mapbox.playground/Contents.swift @@ -6,7 +6,7 @@ let width: CGFloat = 700 let height: CGFloat = 800 class Responder: NSObject { - var mapView: MGLMapView? + var mapView: MLNMapView? @objc func togglePitch(sender: UISwitch) { let camera = mapView!.camera camera.pitch = sender.isOn ? 60 : 0 @@ -51,9 +51,9 @@ panel.addSubview(pitchSwitch) Put your access token into a plain text file called `token`. Then select the “token” placeholder below, go to Editor ‣ Insert File Literal, and select the `token` file. */ var apiKey = try String(contentsOfURL: <#token#>) -MGLSettings.apiKey = apiKey +MLNSettings.apiKey = apiKey -class PlaygroundAnnotationView: MGLAnnotationView { +class PlaygroundAnnotationView: MLNAnnotationView { override func prepareForReuse() { isHidden = hideMarkerSwitchView.isOn @@ -63,11 +63,11 @@ class PlaygroundAnnotationView: MGLAnnotationView { //: Define a map delegate -class MapDelegate: NSObject, MGLMapViewDelegate { +class MapDelegate: NSObject, MLNMapViewDelegate { - var annotationViewByAnnotation = [MGLPointAnnotation: PlaygroundAnnotationView]() + var annotationViewByAnnotation = [MLNPointAnnotation: PlaygroundAnnotationView]() - func mapView(_ mapView: MGLMapView, viewFor annotation: MGLAnnotation) -> MGLAnnotationView? { + func mapView(_ mapView: MLNMapView, viewFor annotation: MLNAnnotation) -> MLNAnnotationView? { var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: "annotation") as? PlaygroundAnnotationView @@ -84,13 +84,13 @@ class MapDelegate: NSObject, MGLMapViewDelegate { annotationView!.subviews.first?.backgroundColor = .green } - annotationViewByAnnotation[annotation as! MGLPointAnnotation] = annotationView + annotationViewByAnnotation[annotation as! MLNPointAnnotation] = annotationView return annotationView } - func mapView(_ mapView: MGLMapView, didSelect annotation: MGLAnnotation) { - let pointAnnotation = annotation as! MGLPointAnnotation + func mapView(_ mapView: MLNMapView, didSelect annotation: MLNAnnotation) { + let pointAnnotation = annotation as! MLNPointAnnotation let annotationView: PlaygroundAnnotationView = annotationViewByAnnotation[pointAnnotation]! for view in annotationViewByAnnotation.values { @@ -116,12 +116,12 @@ class MapDelegate: NSObject, MGLMapViewDelegate { } @objc func handleTap(press: UILongPressGestureRecognizer) { - let mapView: MGLMapView = press.view as! MGLMapView + let mapView: MLNMapView = press.view as! MLNMapView let isRecognized = press.state == .recognized if (isRecognized) { - let annotation = MGLPointAnnotation() + let annotation = MLNPointAnnotation() annotation.title = "Dropped Marker" annotation.coordinate = mapView.convert(press.location(in: mapView), toCoordinateFrom: mapView) mapView.addAnnotation(annotation) @@ -133,7 +133,7 @@ class MapDelegate: NSObject, MGLMapViewDelegate { //: Create a map and its delegate -let mapView = MGLMapView(frame: CGRect(x: 0, y: 0, width: width, height: height)) +let mapView = MLNMapView(frame: CGRect(x: 0, y: 0, width: width, height: height)) mapView.frame = CGRect(x: 0, y: 0, width: width, height: height) PlaygroundPage.current.liveView = mapView diff --git a/platform/ios/platform/ios/Mapbox.playground/playground.xcworkspace/contents.xcworkspacedata b/platform/ios/platform/ios/Mapbox.playground/playground.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..919434a62 --- /dev/null +++ b/platform/ios/platform/ios/Mapbox.playground/playground.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/platform/ios/platform/ios/app/Info.plist b/platform/ios/platform/ios/app/Info.plist index 5bcd3b34b..fdd6bd6aa 100644 --- a/platform/ios/platform/ios/app/Info.plist +++ b/platform/ios/platform/ios/app/Info.plist @@ -32,7 +32,7 @@ The map will display your location. The map may also use your location when it isn’t visible in order to improve OpenStreetMap. NSLocationTemporaryUsageDescriptionDictionary - MGLAccuracyAuthorizationDescription + MLNAccuracyAuthorizationDescription MapLibre requires your precise location to help you navigate the map. NSLocationWhenInUseUsageDescription diff --git a/platform/ios/platform/ios/app/MBXAnnotationView.h b/platform/ios/platform/ios/app/MBXAnnotationView.h index 6bd799673..e5bd59cb2 100644 --- a/platform/ios/platform/ios/app/MBXAnnotationView.h +++ b/platform/ios/platform/ios/app/MBXAnnotationView.h @@ -1,4 +1,4 @@ @import Mapbox; -@interface MBXAnnotationView : MGLAnnotationView +@interface MBXAnnotationView : MLNAnnotationView @end diff --git a/platform/ios/platform/ios/app/MBXAnnotationView.m b/platform/ios/platform/ios/app/MBXAnnotationView.m index 6877c5cd3..3f13ba5e4 100644 --- a/platform/ios/platform/ios/app/MBXAnnotationView.m +++ b/platform/ios/platform/ios/app/MBXAnnotationView.m @@ -21,24 +21,24 @@ self.layer.borderWidth = selected ? 2.0 : 0; } -- (void)setDragState:(MGLAnnotationViewDragState)dragState animated:(BOOL)animated +- (void)setDragState:(MLNAnnotationViewDragState)dragState animated:(BOOL)animated { [super setDragState:dragState animated:NO]; switch (dragState) { - case MGLAnnotationViewDragStateNone: + case MLNAnnotationViewDragStateNone: break; - case MGLAnnotationViewDragStateStarting: { + case MLNAnnotationViewDragStateStarting: { [UIView animateWithDuration:.4 delay:0 usingSpringWithDamping:.4 initialSpringVelocity:.5 options:UIViewAnimationOptionCurveLinear animations:^{ self.transform = CGAffineTransformScale(CGAffineTransformIdentity, 2, 2); } completion:nil]; break; } - case MGLAnnotationViewDragStateDragging: + case MLNAnnotationViewDragStateDragging: break; - case MGLAnnotationViewDragStateCanceling: + case MLNAnnotationViewDragStateCanceling: break; - case MGLAnnotationViewDragStateEnding: { + case MLNAnnotationViewDragStateEnding: { self.transform = CGAffineTransformScale(CGAffineTransformIdentity, 2, 2); [UIView animateWithDuration:.4 delay:0 usingSpringWithDamping:.4 initialSpringVelocity:.5 options:UIViewAnimationOptionCurveLinear animations:^{ self.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1, 1); diff --git a/platform/ios/platform/ios/app/MBXAppDelegate.m b/platform/ios/platform/ios/app/MBXAppDelegate.m index 9ae42ba5b..a5867c32c 100644 --- a/platform/ios/platform/ios/app/MBXAppDelegate.m +++ b/platform/ios/platform/ios/app/MBXAppDelegate.m @@ -11,10 +11,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { -#ifndef MGL_DISABLE_LOGGING - [MGLLoggingConfiguration sharedConfiguration].loggingLevel = MGLLoggingLevelFault; +#ifndef MLN_DISABLE_LOGGING + [MLNLoggingConfiguration sharedConfiguration].loggingLevel = MLNLoggingLevelFault; #endif - [MGLSettings useWellKnownTileServer:MGLMapTiler]; + [MLNSettings useWellKnownTileServer:MLNMapTiler]; return YES; } diff --git a/platform/ios/platform/ios/app/MBXCustomCalloutView.h b/platform/ios/platform/ios/app/MBXCustomCalloutView.h index 5a7c9c926..a39b7474f 100644 --- a/platform/ios/platform/ios/app/MBXCustomCalloutView.h +++ b/platform/ios/platform/ios/app/MBXCustomCalloutView.h @@ -5,7 +5,7 @@ * add your own on your app. Will only show the * callout title for demonstration purpose. */ -@interface MBXCustomCalloutView : UIView +@interface MBXCustomCalloutView : UIView @property (nonatomic, assign, getter=isAnchoredToAnnotation) BOOL anchoredToAnnotation; @property (nonatomic, assign) BOOL dismissesAutomatically; diff --git a/platform/ios/platform/ios/app/MBXCustomCalloutView.m b/platform/ios/platform/ios/app/MBXCustomCalloutView.m index b6a1bdd8d..c753cdef7 100644 --- a/platform/ios/platform/ios/app/MBXCustomCalloutView.m +++ b/platform/ios/platform/ios/app/MBXCustomCalloutView.m @@ -10,10 +10,10 @@ static CGFloat const tipWidth = 10.0; @end @implementation MBXCustomCalloutView { - id _representedObject; + id _representedObject; UIView *_leftAccessoryView; UIView *_rightAccessoryView; - __weak id _delegate; + __weak id _delegate; } @synthesize representedObject = _representedObject; diff --git a/platform/ios/platform/ios/app/MBXCustomLocationViewController.m b/platform/ios/platform/ios/app/MBXCustomLocationViewController.m index 9c7bdc156..b092670dc 100644 --- a/platform/ios/platform/ios/app/MBXCustomLocationViewController.m +++ b/platform/ios/platform/ios/app/MBXCustomLocationViewController.m @@ -2,7 +2,7 @@ #import "MBXCustomLocationViewController.h" -@interface MBXCustomLocationManager : NSObject +@interface MBXCustomLocationManager : NSObject @end @interface MBXCustomLocationManager() @@ -144,7 +144,7 @@ @interface MBXCustomLocationViewController () -@property (strong, nonatomic) MGLMapView *mapView; +@property (strong, nonatomic) MLNMapView *mapView; @end @@ -153,7 +153,7 @@ - (void)viewDidLoad { [super viewDidLoad]; - self.mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds]; + self.mapView = [[MLNMapView alloc] initWithFrame:self.view.bounds]; self.mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; MBXCustomLocationManager *mbxLocationManager = [[MBXCustomLocationManager alloc] init]; diff --git a/platform/ios/platform/ios/app/MBXEmbeddedMapViewController.m b/platform/ios/platform/ios/app/MBXEmbeddedMapViewController.m index 1d12708da..999df6d31 100644 --- a/platform/ios/platform/ios/app/MBXEmbeddedMapViewController.m +++ b/platform/ios/platform/ios/app/MBXEmbeddedMapViewController.m @@ -12,7 +12,7 @@ typedef NS_ENUM(NSInteger, MBXEmbeddedControl) { @interface MBXEmbeddedMapViewController () @property (weak, nonatomic) IBOutlet UIScrollView *scrollView; -@property (weak, nonatomic) IBOutlet MGLMapView *mapView; +@property (weak, nonatomic) IBOutlet MLNMapView *mapView; @end diff --git a/platform/ios/platform/ios/app/MBXOfflinePacksTableViewController.h b/platform/ios/platform/ios/app/MBXOfflinePacksTableViewController.h index a0d8e703e..7d3d79d78 100644 --- a/platform/ios/platform/ios/app/MBXOfflinePacksTableViewController.h +++ b/platform/ios/platform/ios/app/MBXOfflinePacksTableViewController.h @@ -1,9 +1,9 @@ #import -@class MGLMapView; +@class MLNMapView; @interface MBXOfflinePacksTableViewController : UITableViewController -@property (nonatomic, weak) MGLMapView *mapView; +@property (nonatomic, weak) MLNMapView *mapView; @end diff --git a/platform/ios/platform/ios/app/MBXOfflinePacksTableViewController.m b/platform/ios/platform/ios/app/MBXOfflinePacksTableViewController.m index 84f9ebc0e..1e3705875 100644 --- a/platform/ios/platform/ios/app/MBXOfflinePacksTableViewController.m +++ b/platform/ios/platform/ios/app/MBXOfflinePacksTableViewController.m @@ -8,7 +8,7 @@ static NSString * const MBXOfflinePackContextNameKey = @"Name"; static NSString * const MBXOfflinePacksTableViewInactiveCellReuseIdentifier = @"Inactive"; static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Active"; -@implementation MGLOfflinePack (MBXAdditions) +@implementation MLNOfflinePack (MBXAdditions) - (NSString *)name { NSDictionary *userInfo = [NSKeyedUnarchiver unarchiveObjectWithData:self.context]; @@ -20,9 +20,9 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac @end -@implementation MGLTilePyramidOfflineRegion (MBXAdditions) +@implementation MLNTilePyramidOfflineRegion (MBXAdditions) -- (void)applyToMapView:(MGLMapView *)mapView { +- (void)applyToMapView:(MLNMapView *)mapView { mapView.styleURL = self.styleURL; [mapView setVisibleCoordinateBounds:self.bounds]; mapView.zoomLevel = MIN(self.maximumZoomLevel, MAX(self.minimumZoomLevel, mapView.zoomLevel)); @@ -35,14 +35,14 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac - (void)viewDidLoad { [super viewDidLoad]; - [[MGLOfflineStorage sharedOfflineStorage] addObserver:self forKeyPath:@"packs" options:NSKeyValueObservingOptionInitial context:NULL]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(offlinePackProgressDidChange:) name:MGLOfflinePackProgressChangedNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(offlinePackDidReceiveError:) name:MGLOfflinePackErrorNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(offlinePackDidReceiveMaximumAllowedMapboxTiles:) name:MGLOfflinePackMaximumMapboxTilesReachedNotification object:nil]; + [[MLNOfflineStorage sharedOfflineStorage] addObserver:self forKeyPath:@"packs" options:NSKeyValueObservingOptionInitial context:NULL]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(offlinePackProgressDidChange:) name:MLNOfflinePackProgressChangedNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(offlinePackDidReceiveError:) name:MLNOfflinePackErrorNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(offlinePackDidReceiveMaximumAllowedMapboxTiles:) name:MLNOfflinePackMaximumMapboxTilesReachedNotification object:nil]; } - (void)dealloc { - [[MGLOfflineStorage sharedOfflineStorage] removeObserver:self forKeyPath:@"packs"]; + [[MLNOfflineStorage sharedOfflineStorage] removeObserver:self forKeyPath:@"packs"]; [[NSNotificationCenter defaultCenter] removeObserver:self]; } @@ -73,8 +73,8 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac default: [self.tableView reloadData]; - for (MGLOfflinePack *pack in [MGLOfflineStorage sharedOfflineStorage].packs) { - if (pack.state == MGLOfflinePackStateUnknown) { + for (MLNOfflinePack *pack in [MLNOfflineStorage sharedOfflineStorage].packs) { + if (pack.state == MLNOfflinePackStateUnknown) { [pack requestProgress]; } } @@ -89,12 +89,12 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac - (IBAction)addCurrentRegion:(id)sender { UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Add Offline Pack" message:@"Choose a name for the pack:" preferredStyle:UIAlertControllerStyleAlert]; [alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) { - textField.placeholder = [NSString stringWithFormat:@"%@", MGLStringFromCoordinateBounds(self.mapView.visibleCoordinateBounds)]; + textField.placeholder = [NSString stringWithFormat:@"%@", MLNStringFromCoordinateBounds(self.mapView.visibleCoordinateBounds)]; }]; [alertController addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]]; UIAlertAction *downloadAction = [UIAlertAction actionWithTitle:@"Download" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { - MGLMapView *mapView = self.mapView; + MLNMapView *mapView = self.mapView; NSAssert(mapView, @"No map view to get the current region from."); UITextField *nameField = alertController.textFields.firstObject; @@ -103,8 +103,8 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac name = nameField.placeholder; } - MGLTilePyramidOfflineRegion *region = [[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:mapView.styleURL bounds:mapView.visibleCoordinateBounds fromZoomLevel:mapView.zoomLevel toZoomLevel:mapView.maximumZoomLevel]; - id ideographicFontFamilyName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MGLIdeographicFontFamilyName"]; + MLNTilePyramidOfflineRegion *region = [[MLNTilePyramidOfflineRegion alloc] initWithStyleURL:mapView.styleURL bounds:mapView.visibleCoordinateBounds fromZoomLevel:mapView.zoomLevel toZoomLevel:mapView.maximumZoomLevel]; + id ideographicFontFamilyName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MLNIdeographicFontFamilyName"]; if([ideographicFontFamilyName isKindOfClass:[NSNumber class]] && ![ideographicFontFamilyName boolValue]){ region.includesIdeographicGlyphs = YES; } @@ -112,7 +112,7 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac MBXOfflinePackContextNameKey: name, }]; - [[MGLOfflineStorage sharedOfflineStorage] addPackForRegion:region withContext:context completionHandler:^(MGLOfflinePack *pack, NSError *error) { + [[MLNOfflineStorage sharedOfflineStorage] addPackForRegion:region withContext:context completionHandler:^(MLNOfflinePack *pack, NSError *error) { if (error) { NSString *message = [NSString stringWithFormat:@"Mapbox GL was unable to add the offline pack “%@”.", name]; UIAlertController *errorAlertController = [UIAlertController alertControllerWithTitle:@"Can’t Add Offline Pack" message:message preferredStyle:UIAlertControllerStyleAlert]; @@ -130,10 +130,10 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac } - (IBAction)invalidatePacks:(id)sender { - for (MGLOfflinePack *pack in [MGLOfflineStorage sharedOfflineStorage].packs) { + for (MLNOfflinePack *pack in [MLNOfflineStorage sharedOfflineStorage].packs) { CFTimeInterval start = CACurrentMediaTime(); - [[MGLOfflineStorage sharedOfflineStorage] invalidatePack:pack withCompletionHandler:^(NSError * _Nullable error) { + [[MLNOfflineStorage sharedOfflineStorage] invalidatePack:pack withCompletionHandler:^(NSError * _Nullable error) { CFTimeInterval end = CACurrentMediaTime(); CFTimeInterval difference = end - start; NSLog(@"invalidatePack Started: %f Ended: %f Total Time: %f", start, end, difference); @@ -145,22 +145,22 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac // MARK: - Table view data source - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return [MGLOfflineStorage sharedOfflineStorage].packs.count; + return [MLNOfflineStorage sharedOfflineStorage].packs.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - MGLOfflinePack *pack = [MGLOfflineStorage sharedOfflineStorage].packs[indexPath.row]; + MLNOfflinePack *pack = [MLNOfflineStorage sharedOfflineStorage].packs[indexPath.row]; - NSString *reuseIdentifier = pack.state == MGLOfflinePackStateActive ? MBXOfflinePacksTableViewActiveCellReuseIdentifier : MBXOfflinePacksTableViewInactiveCellReuseIdentifier; + NSString *reuseIdentifier = pack.state == MLNOfflinePackStateActive ? MBXOfflinePacksTableViewActiveCellReuseIdentifier : MBXOfflinePacksTableViewInactiveCellReuseIdentifier; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier forIndexPath:indexPath]; [self updateTableViewCell:cell atIndexPath:indexPath forPack:pack]; return cell; } -- (void)updateTableViewCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath forPack:(MGLOfflinePack *)pack { +- (void)updateTableViewCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath forPack:(MLNOfflinePack *)pack { cell.textLabel.text = pack.name; - MGLOfflinePackProgress progress = pack.progress; + MLNOfflinePackProgress progress = pack.progress; NSString *completedString = [NSNumberFormatter localizedStringFromNumber:@(progress.countOfResourcesCompleted) numberStyle:NSNumberFormatterDecimalStyle]; NSString *expectedString = [NSNumberFormatter localizedStringFromNumber:@(progress.countOfResourcesExpected) @@ -169,21 +169,21 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac countStyle:NSByteCountFormatterCountStyleFile]; NSString *statusString; switch (pack.state) { - case MGLOfflinePackStateUnknown: + case MLNOfflinePackStateUnknown: statusString = @"Calculating progress…"; break; - case MGLOfflinePackStateInactive: + case MLNOfflinePackStateInactive: statusString = [NSString stringWithFormat:@"%@ of %@ resources (%@)", completedString, expectedString, byteCountString]; break; - case MGLOfflinePackStateComplete: + case MLNOfflinePackStateComplete: statusString = [NSString stringWithFormat:@"%@ resources (%@)", completedString, byteCountString]; break; - case MGLOfflinePackStateActive: + case MLNOfflinePackStateActive: if (progress.countOfResourcesExpected) { completedString = [NSNumberFormatter localizedStringFromNumber:@(progress.countOfResourcesCompleted + 1) numberStyle:NSNumberFormatterDecimalStyle]; @@ -195,7 +195,7 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac completedString, expectedString, byteCountString]; break; - case MGLOfflinePackStateInvalid: + case MLNOfflinePackStateInvalid: NSAssert(NO, @"Invalid offline pack at index path %@", indexPath); break; } @@ -204,8 +204,8 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { - MGLOfflinePack *pack = [MGLOfflineStorage sharedOfflineStorage].packs[indexPath.row]; - [[MGLOfflineStorage sharedOfflineStorage] removePack:pack withCompletionHandler:nil]; + MLNOfflinePack *pack = [MLNOfflineStorage sharedOfflineStorage].packs[indexPath.row]; + [[MLNOfflineStorage sharedOfflineStorage] removePack:pack withCompletionHandler:nil]; } } @@ -214,27 +214,27 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; - MGLOfflinePack *pack = [MGLOfflineStorage sharedOfflineStorage].packs[indexPath.row]; + MLNOfflinePack *pack = [MLNOfflineStorage sharedOfflineStorage].packs[indexPath.row]; switch (pack.state) { - case MGLOfflinePackStateUnknown: + case MLNOfflinePackStateUnknown: break; - case MGLOfflinePackStateComplete: + case MLNOfflinePackStateComplete: if ([pack.region respondsToSelector:@selector(applyToMapView:)]) { [pack.region performSelector:@selector(applyToMapView:) withObject:self.mapView]; } [self performSegueWithIdentifier:@"ReturnToMap" sender:self]; break; - case MGLOfflinePackStateInactive: + case MLNOfflinePackStateInactive: [pack resume]; break; - case MGLOfflinePackStateActive: + case MLNOfflinePackStateActive: [pack suspend]; break; - case MGLOfflinePackStateInvalid: + case MLNOfflinePackStateInvalid: NSAssert(NO, @"Invalid offline pack at index path %@", indexPath); break; } @@ -243,10 +243,10 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac // MARK: - Offline pack delegate - (void)offlinePackProgressDidChange:(NSNotification *)notification { - MGLOfflinePack *pack = notification.object; - NSAssert([pack isKindOfClass:[MGLOfflinePack class]], @"MGLOfflineStorage notification has a non-pack object."); + MLNOfflinePack *pack = notification.object; + NSAssert([pack isKindOfClass:[MLNOfflinePack class]], @"MLNOfflineStorage notification has a non-pack object."); - NSUInteger index = [[MGLOfflineStorage sharedOfflineStorage].packs indexOfObject:pack]; + NSUInteger index = [[MLNOfflineStorage sharedOfflineStorage].packs indexOfObject:pack]; if (index == NSNotFound) { return; } @@ -257,14 +257,14 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac } - (void)offlinePackDidReceiveError:(NSNotification *)notification { - MGLOfflinePack *pack = notification.object; - NSAssert([pack isKindOfClass:[MGLOfflinePack class]], @"MGLOfflineStorage notification has a non-pack object."); + MLNOfflinePack *pack = notification.object; + NSAssert([pack isKindOfClass:[MLNOfflinePack class]], @"MLNOfflineStorage notification has a non-pack object."); - NSError *error = notification.userInfo[MGLOfflinePackUserInfoKeyError]; - NSAssert([error isKindOfClass:[NSError class]], @"MGLOfflineStorage notification has a non-error error."); + NSError *error = notification.userInfo[MLNOfflinePackUserInfoKeyError]; + NSAssert([error isKindOfClass:[NSError class]], @"MLNOfflineStorage notification has a non-error error."); NSString *message = [NSString stringWithFormat:@"Mapbox GL encountered an error while downloading the offline pack “%@”: %@", pack.name, error.localizedFailureReason]; - if (error.code == MGLErrorCodeConnectionFailed) { + if (error.code == MLNErrorCodeConnectionFailed) { NSLog(@"%@", message); } else { UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Error Downloading Offline Pack" message:message preferredStyle:UIAlertControllerStyleAlert]; @@ -274,10 +274,10 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac } - (void)offlinePackDidReceiveMaximumAllowedMapboxTiles:(NSNotification *)notification { - MGLOfflinePack *pack = notification.object; - NSAssert([pack isKindOfClass:[MGLOfflinePack class]], @"MGLOfflineStorage notification has a non-pack object."); + MLNOfflinePack *pack = notification.object; + NSAssert([pack isKindOfClass:[MLNOfflinePack class]], @"MLNOfflineStorage notification has a non-pack object."); - uint64_t maximumCount = [notification.userInfo[MGLOfflinePackUserInfoKeyMaximumCount] unsignedLongLongValue]; + uint64_t maximumCount = [notification.userInfo[MLNOfflinePackUserInfoKeyMaximumCount] unsignedLongLongValue]; NSLog(@"Offline pack “%@” reached limit of %llu tiles.", pack.name, maximumCount); } diff --git a/platform/ios/platform/ios/app/MBXOrnamentsViewController.m b/platform/ios/platform/ios/app/MBXOrnamentsViewController.m index 28dc79641..1c642a86c 100644 --- a/platform/ios/platform/ios/app/MBXOrnamentsViewController.m +++ b/platform/ios/platform/ios/app/MBXOrnamentsViewController.m @@ -4,7 +4,7 @@ @interface MBXOrnamentsViewController () -@property (nonatomic) MGLMapView *mapView; +@property (nonatomic) MLNMapView *mapView; @property (nonatomic) NSTimer *timer; @property (nonatomic) NSInteger currentPositionIndex; @@ -13,39 +13,39 @@ @implementation MBXOrnamentsViewController - (void)setCurrentPositionIndex:(NSInteger)currentPositionIndex { - MGLOrnamentPosition ornamentPositions[5][4] = { + MLNOrnamentPosition ornamentPositions[5][4] = { { - MGLOrnamentPositionTopLeft, - MGLOrnamentPositionTopRight, - MGLOrnamentPositionBottomRight, - MGLOrnamentPositionBottomLeft + MLNOrnamentPositionTopLeft, + MLNOrnamentPositionTopRight, + MLNOrnamentPositionBottomRight, + MLNOrnamentPositionBottomLeft }, { - MGLOrnamentPositionTopRight, - MGLOrnamentPositionBottomRight, - MGLOrnamentPositionBottomLeft, - MGLOrnamentPositionTopLeft + MLNOrnamentPositionTopRight, + MLNOrnamentPositionBottomRight, + MLNOrnamentPositionBottomLeft, + MLNOrnamentPositionTopLeft }, { - MGLOrnamentPositionBottomRight, - MGLOrnamentPositionBottomLeft, - MGLOrnamentPositionTopLeft, - MGLOrnamentPositionTopRight + MLNOrnamentPositionBottomRight, + MLNOrnamentPositionBottomLeft, + MLNOrnamentPositionTopLeft, + MLNOrnamentPositionTopRight }, { - MGLOrnamentPositionBottomLeft, - MGLOrnamentPositionTopLeft, - MGLOrnamentPositionTopRight, - MGLOrnamentPositionBottomRight + MLNOrnamentPositionBottomLeft, + MLNOrnamentPositionTopLeft, + MLNOrnamentPositionTopRight, + MLNOrnamentPositionBottomRight }, { - MGLOrnamentPositionTopLeft, - MGLOrnamentPositionTopRight, - MGLOrnamentPositionBottomRight, - MGLOrnamentPositionBottomLeft + MLNOrnamentPositionTopLeft, + MLNOrnamentPositionTopRight, + MLNOrnamentPositionBottomRight, + MLNOrnamentPositionBottomLeft } }; - MGLOrnamentPosition *currentPosition = ornamentPositions[currentPositionIndex]; + MLNOrnamentPosition *currentPosition = ornamentPositions[currentPositionIndex]; self.mapView.scaleBarPosition = currentPosition[0]; self.mapView.compassViewPosition = currentPosition[1]; self.mapView.logoViewPosition = currentPosition[2]; @@ -58,7 +58,7 @@ [super viewDidLoad]; self.title = @"Ornaments"; - MGLMapView *mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds]; + MLNMapView *mapView = [[MLNMapView alloc] initWithFrame:self.view.bounds]; mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [mapView setCenterCoordinate:CLLocationCoordinate2DMake(39.915143, 116.404053) zoomLevel:16 diff --git a/platform/ios/platform/ios/app/MBXSnapshotsViewController.m b/platform/ios/platform/ios/app/MBXSnapshotsViewController.m index e95a66b09..f7eebada0 100644 --- a/platform/ios/platform/ios/app/MBXSnapshotsViewController.m +++ b/platform/ios/platform/ios/app/MBXSnapshotsViewController.m @@ -18,14 +18,14 @@ @implementation MBXSnapshotsViewController { // Top row - MGLMapSnapshotter* topLeftSnapshotter; - MGLMapSnapshotter* topCenterSnapshotter; - MGLMapSnapshotter* topRightSnapshotter; + MLNMapSnapshotter* topLeftSnapshotter; + MLNMapSnapshotter* topCenterSnapshotter; + MLNMapSnapshotter* topRightSnapshotter; // Bottom row - MGLMapSnapshotter* bottomLeftSnapshotter; - MGLMapSnapshotter* bottomCenterSnapshotter; - MGLMapSnapshotter* bottomRightSnapshotter; + MLNMapSnapshotter* bottomLeftSnapshotter; + MLNMapSnapshotter* bottomCenterSnapshotter; + MLNMapSnapshotter* bottomRightSnapshotter; } - (void)viewDidLoad { @@ -41,18 +41,18 @@ bottomRightSnapshotter = [self startSnapshotterForImageView:_snapshotImageViewBR coordinates:CLLocationCoordinate2DMake(31.2780, 121.4286)]; } -- (MGLMapSnapshotter*) startSnapshotterForImageView:(UIImageView*) imageView coordinates:(CLLocationCoordinate2D) coordinates { +- (MLNMapSnapshotter*) startSnapshotterForImageView:(UIImageView*) imageView coordinates:(CLLocationCoordinate2D) coordinates { // Create snapshot options - MGLMapCamera* mapCamera = [[MGLMapCamera alloc] init]; + MLNMapCamera* mapCamera = [[MLNMapCamera alloc] init]; mapCamera.pitch = 20; mapCamera.centerCoordinate = coordinates; - MGLMapSnapshotOptions* options = [[MGLMapSnapshotOptions alloc] initWithStyleURL:[[MGLStyle predefinedStyle:@"Hybrid"] url] camera:mapCamera size:CGSizeMake(imageView.frame.size.width, imageView.frame.size.height)]; + MLNMapSnapshotOptions* options = [[MLNMapSnapshotOptions alloc] initWithStyleURL:[[MLNStyle predefinedStyle:@"Hybrid"] url] camera:mapCamera size:CGSizeMake(imageView.frame.size.width, imageView.frame.size.height)]; options.zoomLevel = 10; // Create and start the snapshotter __weak UIImageView *weakImageView = imageView; - MGLMapSnapshotter* snapshotter = [[MGLMapSnapshotter alloc] initWithOptions:options]; - [snapshotter startWithCompletionHandler: ^(MGLMapSnapshot* snapshot, NSError *error) { + MLNMapSnapshotter* snapshotter = [[MLNMapSnapshotter alloc] initWithOptions:options]; + [snapshotter startWithCompletionHandler: ^(MLNMapSnapshot* snapshot, NSError *error) { if (error) { NSLog(@"Could not load snapshot: %@", [error localizedDescription]); } else { diff --git a/platform/ios/platform/ios/app/MBXState.h b/platform/ios/platform/ios/app/MBXState.h index cf68016e9..ff31a1f28 100644 --- a/platform/ios/platform/ios/app/MBXState.h +++ b/platform/ios/platform/ios/app/MBXState.h @@ -15,15 +15,15 @@ FOUNDATION_EXTERN NSString *const MBXReuseQueueStatsEnabled; @interface MBXState : NSObject -@property (nonatomic, nullable) MGLMapCamera *camera; +@property (nonatomic, nullable) MLNMapCamera *camera; @property (nonatomic) BOOL showsUserLocation; -@property (nonatomic) MGLUserTrackingMode userTrackingMode; +@property (nonatomic) MLNUserTrackingMode userTrackingMode; @property (nonatomic) BOOL showsUserHeadingIndicator; @property (nonatomic) BOOL showsMapScale; @property (nonatomic) BOOL showsZoomLevelOrnament; @property (nonatomic) BOOL showsTimeFrameGraph; @property (nonatomic) BOOL framerateMeasurementEnabled; -@property (nonatomic) MGLMapDebugMaskOptions debugMask; +@property (nonatomic) MLNMapDebugMaskOptions debugMask; @property (nonatomic) BOOL reuseQueueStatsEnabled; @property (nonatomic, readonly) NSString *debugDescription; diff --git a/platform/ios/platform/ios/app/MBXState.m b/platform/ios/platform/ios/app/MBXState.m index 455961e88..503319968 100644 --- a/platform/ios/platform/ios/app/MBXState.m +++ b/platform/ios/platform/ios/app/MBXState.m @@ -33,7 +33,7 @@ NSString *const MBXReuseQueueStatsEnabled = @"MBXReuseQueueStatsEnabled"; - (nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder { if (self = [super init]) { - MGLMapCamera *decodedCamera = [decoder decodeObjectForKey:MBXCamera]; + MLNMapCamera *decodedCamera = [decoder decodeObjectForKey:MBXCamera]; NSNumber *decodedUserTrackingMode = [decoder decodeObjectForKey:MBXUserTrackingMode]; BOOL decodedShowsUserLocation = [decoder decodeBoolForKey:MBXShowsUserLocation]; NSNumber *decodedDebugMaskOptions = [decoder decodeObjectForKey:MBXDebugMaskValue]; diff --git a/platform/ios/platform/ios/app/MBXUserLocationAnnotationView.h b/platform/ios/platform/ios/app/MBXUserLocationAnnotationView.h index a60658dd1..1c08e78e0 100644 --- a/platform/ios/platform/ios/app/MBXUserLocationAnnotationView.h +++ b/platform/ios/platform/ios/app/MBXUserLocationAnnotationView.h @@ -1,5 +1,5 @@ @import Mapbox; -@interface MBXUserLocationAnnotationView : MGLUserLocationAnnotationView +@interface MBXUserLocationAnnotationView : MLNUserLocationAnnotationView @end diff --git a/platform/ios/platform/ios/app/MBXUserLocationAnnotationView.m b/platform/ios/platform/ios/app/MBXUserLocationAnnotationView.m index 675a01930..6e1ac0c10 100644 --- a/platform/ios/platform/ios/app/MBXUserLocationAnnotationView.m +++ b/platform/ios/platform/ios/app/MBXUserLocationAnnotationView.m @@ -22,7 +22,7 @@ const CGFloat MBXUserLocationDotSize = 10; - (CGSize)intrinsicContentSize { CGSize carSize = CGSizeMake(30, 60); - return (self.mapView.userTrackingMode == MGLUserTrackingModeFollowWithCourse) ? carSize : [self dotSize]; + return (self.mapView.userTrackingMode == MLNUserTrackingModeFollowWithCourse) ? carSize : [self dotSize]; } - (CGSize)dotSize @@ -52,7 +52,7 @@ const CGFloat MBXUserLocationDotSize = 10; - (void)drawRect:(CGRect)rect { - (self.mapView.userTrackingMode == MGLUserTrackingModeFollowWithCourse) ? [self drawCar] : [self drawDot]; + (self.mapView.userTrackingMode == MLNUserTrackingModeFollowWithCourse) ? [self drawCar] : [self drawDot]; } - (void)drawDot diff --git a/platform/ios/platform/ios/app/MBXViewController.m b/platform/ios/platform/ios/app/MBXViewController.m index c5ae6fe81..0c868bc30 100644 --- a/platform/ios/platform/ios/app/MBXViewController.m +++ b/platform/ios/platform/ios/app/MBXViewController.m @@ -12,10 +12,10 @@ #import "MBXOrnamentsViewController.h" #import "MBXStateManager.h" #import "MBXState.h" -#import "MGLSettings.h" +#import "MLNSettings.h" #import "MBXFrameTimeGraphView.h" -#import "MGLMapView_Experimental.h" +#import "MLNMapView_Experimental.h" #import static const CLLocationCoordinate2D WorldTourDestinations[] = { @@ -26,7 +26,7 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = { { .latitude = 53.8948782, .longitude = 27.5558476 }, }; -static const MGLCoordinateBounds colorado = { +static const MLNCoordinateBounds colorado = { .sw = { .latitude = 36.986207, .longitude = -109.049896}, .ne = { .latitude = 40.989329, .longitude = -102.062592}, }; @@ -124,7 +124,7 @@ CLLocationCoordinate2D coordinateCentered(CLLocationCoordinate2D origin, CLLocat bearing *= multiplier; distance /= 6378137.0; - // Pulled from MGLRadianCoordinateAtDistanceFacingDirection: + // Pulled from MLNRadianCoordinateAtDistanceFacingDirection: double latitude = asin((sin(sourceLatitude) * cos(distance)) + (cos(sourceLatitude) * sin(distance) * cos(bearing))); @@ -173,13 +173,13 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { -@interface MBXDroppedPinAnnotation : MGLPointAnnotation +@interface MBXDroppedPinAnnotation : MLNPointAnnotation @end @implementation MBXDroppedPinAnnotation @end -@interface MBXCustomCalloutAnnotation : MGLPointAnnotation +@interface MBXCustomCalloutAnnotation : MLNPointAnnotation @property (nonatomic, assign) BOOL anchoredToAnnotation; @property (nonatomic, assign) BOOL dismissesAutomatically; @end @@ -187,7 +187,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { @implementation MBXCustomCalloutAnnotation @end -@interface MBXSpriteBackedAnnotation : MGLPointAnnotation +@interface MBXSpriteBackedAnnotation : MLNPointAnnotation @end @implementation MBXSpriteBackedAnnotation @@ -195,11 +195,11 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { @interface MBXViewController () + MLNMapViewDelegate, + MLNComputedShapeSourceDataSource> -@property (nonatomic) IBOutlet MGLMapView *mapView; +@property (nonatomic) IBOutlet MLNMapView *mapView; @property (nonatomic) MBXState *currentState; @property (weak, nonatomic) IBOutlet UIButton *hudLabel; @property (weak, nonatomic) IBOutlet MBXFrameTimeGraphView *frameTimeGraphView; @@ -218,7 +218,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { @property (nonatomic, copy) void (^locationBlock)(void); @end -@interface MGLMapView (MBXViewController) +@interface MLNMapView (MBXViewController) @property (nonatomic) NSDictionary *annotationViewReuseQueueByIdentifier; @end @@ -283,7 +283,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { UIWindow *helperWindow = [[UIWindow alloc] initWithFrame:helperScreen.bounds]; helperWindow.screen = helperScreen; UIViewController *helperViewController = [[UIViewController alloc] init]; - MGLMapView *helperMapView = [[MGLMapView alloc] initWithFrame:helperWindow.bounds styleURL:[[MGLStyle predefinedStyle:@"Hybrid"] url]]; + MLNMapView *helperMapView = [[MLNMapView alloc] initWithFrame:helperWindow.bounds styleURL:[[MLNStyle predefinedStyle:@"Hybrid"] url]]; helperMapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; helperMapView.camera = self.mapView.camera; helperMapView.compassView.hidden = YES; @@ -354,7 +354,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { { NSMutableArray *settingsTitles = [NSMutableArray array]; - MGLMapDebugMaskOptions debugMask = self.mapView.debugMask; + MLNMapDebugMaskOptions debugMask = self.mapView.debugMask; switch (section) { @@ -362,15 +362,15 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { [settingsTitles addObjectsFromArray:@[ @"Reset position", [NSString stringWithFormat:@"%@ tile boundaries", - (debugMask & MGLMapDebugTileBoundariesMask ? @"Hide" :@"Show")], + (debugMask & MLNMapDebugTileBoundariesMask ? @"Hide" :@"Show")], [NSString stringWithFormat:@"%@ tile info", - (debugMask & MGLMapDebugTileInfoMask ? @"Hide" :@"Show")], + (debugMask & MLNMapDebugTileInfoMask ? @"Hide" :@"Show")], [NSString stringWithFormat:@"%@ tile timestamps", - (debugMask & MGLMapDebugTimestampsMask ? @"Hide" :@"Show")], + (debugMask & MLNMapDebugTimestampsMask ? @"Hide" :@"Show")], [NSString stringWithFormat:@"%@ collision boxes", - (debugMask & MGLMapDebugCollisionBoxesMask ? @"Hide" :@"Show")], + (debugMask & MLNMapDebugCollisionBoxesMask ? @"Hide" :@"Show")], [NSString stringWithFormat:@"%@ overdraw visualization", - (debugMask & MGLMapDebugOverdrawVisualizationMask ? @"Hide" :@"Show")], + (debugMask & MLNMapDebugOverdrawVisualizationMask ? @"Hide" :@"Show")], [NSString stringWithFormat:@"%@ zoom level ornament", (self.zoomLevelOrnamentEnabled ? @"Hide" :@"Show")], [NSString stringWithFormat:@"%@ frame time graph", (self.frameTimeGraphEnabled ? @"Hide" :@"Show")], [NSString stringWithFormat:@"%@ reuse queue stats", (self.reuseQueueStatsEnabled ? @"Hide" :@"Show")] @@ -459,19 +459,19 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { [self.mapView resetPosition]; break; case MBXSettingsDebugToolsTileBoundaries: - self.currentState.debugMask ^= MGLMapDebugTileBoundariesMask; + self.currentState.debugMask ^= MLNMapDebugTileBoundariesMask; break; case MBXSettingsDebugToolsTileInfo: - self.currentState.debugMask ^= MGLMapDebugTileInfoMask; + self.currentState.debugMask ^= MLNMapDebugTileInfoMask; break; case MBXSettingsDebugToolsTimestamps: - self.currentState.debugMask ^= MGLMapDebugTimestampsMask; + self.currentState.debugMask ^= MLNMapDebugTimestampsMask; break; case MBXSettingsDebugToolsCollisionBoxes: - self.currentState.debugMask ^= MGLMapDebugCollisionBoxesMask; + self.currentState.debugMask ^= MLNMapDebugCollisionBoxesMask; break; case MBXSettingsDebugToolsOverdrawVisualization: - self.currentState.debugMask ^= MGLMapDebugOverdrawVisualizationMask; + self.currentState.debugMask ^= MLNMapDebugOverdrawVisualizationMask; break; case MBXSettingsDebugToolsShowZoomLevel: { @@ -725,7 +725,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { // Denver streets parallel to cardinal directions help illustrate // viewport center offset when edge insets are set. - MGLMapCamera *camera = [MGLMapCamera cameraLookingAtCenterCoordinate:CLLocationCoordinate2DMake(39.72707, -104.9986) + MLNMapCamera *camera = [MLNMapCamera cameraLookingAtCenterCoordinate:CLLocationCoordinate2DMake(39.72707, -104.9986) acrossDistance:100 pitch:60 heading:0]; @@ -817,7 +817,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { [feature[@"geometry"][@"coordinates"][0] doubleValue]); NSString *title = feature[@"properties"][@"NAME"]; - MGLPointAnnotation *annotation = (useViews ? [MGLPointAnnotation new] : [MBXSpriteBackedAnnotation new]); + MLNPointAnnotation *annotation = (useViews ? [MLNPointAnnotation new] : [MBXSpriteBackedAnnotation new]); annotation.coordinate = coordinate; annotation.title = title; @@ -838,7 +838,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { - (void)animateAnnotationView { - MGLPointAnnotation *annot = [[MGLPointAnnotation alloc] init]; + MLNPointAnnotation *annot = [[MLNPointAnnotation alloc] init]; annot.coordinate = self.mapView.centerCoordinate; [self.mapView addAnnotation:annot]; @@ -864,7 +864,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { CLLocationCoordinate2DMake(46, -121) }; - MGLPolygon *triangle = [MGLPolygon polygonWithCoordinates:triangleCoordinates count:3]; + MLNPolygon *triangle = [MLNPolygon polygonWithCoordinates:triangleCoordinates count:3]; [self.mapView addAnnotation:triangle]; @@ -876,7 +876,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { CLLocationCoordinate2DMake(37.7790, -122.4177), CLLocationCoordinate2DMake(34.0532, -118.2349) }; - MGLPolyline *line = [MGLPolyline polylineWithCoordinates:lineCoordinates count:4]; + MLNPolyline *line = [MLNPolyline polylineWithCoordinates:lineCoordinates count:4]; [self.mapView addAnnotation:line]; // Orcas Island, WA hike polyline @@ -896,7 +896,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { polylineCoordinates[i] = CLLocationCoordinate2DMake([hikeCoordinatePairs[i][1] doubleValue], [hikeCoordinatePairs[i][0] doubleValue]); } - MGLPolyline *polyline = [MGLPolyline polylineWithCoordinates:polylineCoordinates + MLNPolyline *polyline = [MLNPolyline polylineWithCoordinates:polylineCoordinates count:[hikeCoordinatePairs count]]; [self.mapView addAnnotation:polyline]; @@ -924,7 +924,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { polygonCoordinates[i] = CLLocationCoordinate2DMake([stateCoordinatePairs[i][1] doubleValue], [stateCoordinatePairs[i][0] doubleValue]); } - MGLPolygon *polygon = [MGLPolygon polygonWithCoordinates:polygonCoordinates count:[stateCoordinatePairs count]]; + MLNPolygon *polygon = [MLNPolygon polygonWithCoordinates:polygonCoordinates count:[stateCoordinatePairs count]]; polygon.title = feature[@"properties"][@"NAME"]; [self.mapView addAnnotation:polygon]; @@ -940,14 +940,14 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { CLLocationCoordinate2DMake(5, 5), CLLocationCoordinate2DMake(5, -5), }; - MGLPolygon *innerPolygon = [MGLPolygon polygonWithCoordinates:innerCoordinates count:sizeof(innerCoordinates) / sizeof(innerCoordinates[0])]; + MLNPolygon *innerPolygon = [MLNPolygon polygonWithCoordinates:innerCoordinates count:sizeof(innerCoordinates) / sizeof(innerCoordinates[0])]; CLLocationCoordinate2D outerCoordinates[] = { CLLocationCoordinate2DMake(-10, -10), CLLocationCoordinate2DMake(-10, 10), CLLocationCoordinate2DMake(10, 10), CLLocationCoordinate2DMake(10, -10), }; - MGLPolygon *outerPolygon = [MGLPolygon polygonWithCoordinates:outerCoordinates count:sizeof(outerCoordinates) / sizeof(outerCoordinates[0]) interiorPolygons:@[innerPolygon]]; + MLNPolygon *outerPolygon = [MLNPolygon polygonWithCoordinates:outerCoordinates count:sizeof(outerCoordinates) / sizeof(outerCoordinates[0]) interiorPolygons:@[innerPolygon]]; [self.mapView addAnnotation:outerPolygon]; } @@ -981,17 +981,17 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { - (void)styleBuildingExtrusions { - MGLSource* source = [self.mapView.style sourceWithIdentifier:@"composite"]; + MLNSource* source = [self.mapView.style sourceWithIdentifier:@"composite"]; if (source) { - MGLFillExtrusionStyleLayer* layer = [[MGLFillExtrusionStyleLayer alloc] initWithIdentifier:@"extrudedBuildings" source:source]; + MLNFillExtrusionStyleLayer* layer = [[MLNFillExtrusionStyleLayer alloc] initWithIdentifier:@"extrudedBuildings" source:source]; layer.sourceLayerIdentifier = @"building"; layer.predicate = [NSPredicate predicateWithFormat:@"extrude == 'true' AND CAST(height, 'NSNumber') > 0"]; layer.fillExtrusionBase = [NSExpression expressionForKeyPath:@"min_height"]; layer.fillExtrusionHeight = [NSExpression expressionForKeyPath:@"height"]; // Set the fill color to that of the existing building footprint layer, if it exists. - MGLFillStyleLayer* buildingLayer = (MGLFillStyleLayer*)[self.mapView.style layerWithIdentifier:@"building"]; + MLNFillStyleLayer* buildingLayer = (MLNFillStyleLayer*)[self.mapView.style layerWithIdentifier:@"building"]; if (buildingLayer) { if (buildingLayer.fillColor) { layer.fillExtrusionColor = buildingLayer.fillColor; @@ -1002,7 +1002,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { layer.fillExtrusionOpacity = [NSExpression expressionForConstantValue:@0.75]; } - MGLStyleLayer* labelLayer = [self.mapView.style layerWithIdentifier:@"waterway-label"]; + MLNStyleLayer* labelLayer = [self.mapView.style layerWithIdentifier:@"waterway-label"]; if (labelLayer) { [self.mapView.style insertLayer:layer belowLayer:labelLayer]; } else { @@ -1013,14 +1013,14 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { - (void)styleWaterLayer { - MGLFillStyleLayer *waterLayer = (MGLFillStyleLayer *)[self.mapView.style layerWithIdentifier:@"water"]; + MLNFillStyleLayer *waterLayer = (MLNFillStyleLayer *)[self.mapView.style layerWithIdentifier:@"water"]; NSDictionary *waterColorStops = @{@6.0f: [UIColor yellowColor], @8.0f: [UIColor blueColor], @10.0f: [UIColor redColor], @12.0f: [UIColor greenColor], @14.0f: [UIColor blueColor]}; NSExpression *fillColorExpression = [NSExpression mgl_expressionForInterpolatingExpression:NSExpression.zoomLevelVariableExpression - withCurveType:MGLExpressionInterpolationModeLinear + withCurveType:MLNExpressionInterpolationModeLinear parameters:nil stops:[NSExpression expressionForConstantValue:waterColorStops]]; waterLayer.fillColor = fillColorExpression; @@ -1037,7 +1037,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { - (void)styleRoadLayer { - MGLLineStyleLayer *roadLayer = (MGLLineStyleLayer *)[self.mapView.style layerWithIdentifier:@"road-primary"]; + MLNLineStyleLayer *roadLayer = (MLNLineStyleLayer *)[self.mapView.style layerWithIdentifier:@"road-primary"]; roadLayer.lineColor = [NSExpression expressionForConstantValue:[UIColor blackColor]]; NSDictionary *lineWidthStops = @{@5: @5, @@ -1064,10 +1064,10 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { - (void)styleRasterLayer { NSURL *rasterURL = [NSURL URLWithString:@"maptiler://sources/hybrid"]; - MGLRasterTileSource *rasterTileSource = [[MGLRasterTileSource alloc] initWithIdentifier:@"my-raster-tile-source" configurationURL:rasterURL tileSize:512]; + MLNRasterTileSource *rasterTileSource = [[MLNRasterTileSource alloc] initWithIdentifier:@"my-raster-tile-source" configurationURL:rasterURL tileSize:512]; [self.mapView.style addSource:rasterTileSource]; - MGLRasterStyleLayer *rasterLayer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"my-raster-layer" source:rasterTileSource]; + MLNRasterStyleLayer *rasterLayer = [[MLNRasterStyleLayer alloc] initWithIdentifier:@"my-raster-layer" source:rasterTileSource]; NSDictionary *opacityStops = @{@20.0f: @1.0f, @5.0f: @0.0f}; rasterLayer.rasterOpacity = [NSExpression expressionWithFormat: @@ -1080,10 +1080,10 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { { 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]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"ams" URL:geoJSONURL options:nil]; [self.mapView.style addSource:source]; - MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"test" source:source]; + MLNFillStyleLayer *fillLayer = [[MLNFillStyleLayer alloc] initWithIdentifier:@"test" source:source]; fillLayer.fillColor = [NSExpression expressionForConstantValue:[UIColor purpleColor]]; [self.mapView.style addLayer:fillLayer]; @@ -1091,27 +1091,27 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { - (void)styleSymbolLayer { - MGLSymbolStyleLayer *stateLayer = (MGLSymbolStyleLayer *)[self.mapView.style layerWithIdentifier:@"state-label-lg"]; + MLNSymbolStyleLayer *stateLayer = (MLNSymbolStyleLayer *)[self.mapView.style layerWithIdentifier:@"state-label-lg"]; stateLayer.textColor = [NSExpression expressionForConstantValue:[UIColor redColor]]; } - (void)styleBuildingLayer { - MGLTransition transition = { 5, 1 }; + MLNTransition transition = { 5, 1 }; self.mapView.style.transition = transition; - MGLFillStyleLayer *buildingLayer = (MGLFillStyleLayer *)[self.mapView.style layerWithIdentifier:@"building"]; + MLNFillStyleLayer *buildingLayer = (MLNFillStyleLayer *)[self.mapView.style layerWithIdentifier:@"building"]; buildingLayer.fillColor = [NSExpression expressionForConstantValue:[UIColor purpleColor]]; } - (void)styleFerryLayer { - MGLLineStyleLayer *ferryLineLayer = (MGLLineStyleLayer *)[self.mapView.style layerWithIdentifier:@"ferry"]; + MLNLineStyleLayer *ferryLineLayer = (MLNLineStyleLayer *)[self.mapView.style layerWithIdentifier:@"ferry"]; ferryLineLayer.lineColor = [NSExpression expressionForConstantValue:[UIColor redColor]]; } - (void)removeParkLayer { - MGLFillStyleLayer *parkLayer = (MGLFillStyleLayer *)[self.mapView.style layerWithIdentifier:@"park"]; + MLNFillStyleLayer *parkLayer = (MLNFillStyleLayer *)[self.mapView.style layerWithIdentifier:@"park"]; [self.mapView.style removeLayer:parkLayer]; } @@ -1124,7 +1124,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { // after slight delay, fill in Texas (atypical use; we want to clearly see the change for test purposes) dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^ { - MGLFillStyleLayer *statesLayer = (MGLFillStyleLayer *)[self.mapView.style layerWithIdentifier:@"states"]; + MLNFillStyleLayer *statesLayer = (MLNFillStyleLayer *)[self.mapView.style layerWithIdentifier:@"states"]; // filter statesLayer.predicate = [NSPredicate predicateWithFormat:@"name == 'Texas'"]; @@ -1144,7 +1144,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { // after slight delay, change styling for all Washington-named counties (atypical use; we want to clearly see the change for test purposes) dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^ { - MGLLineStyleLayer *countiesLayer = (MGLLineStyleLayer *)[self.mapView.style layerWithIdentifier:@"counties"]; + MLNLineStyleLayer *countiesLayer = (MLNLineStyleLayer *)[self.mapView.style layerWithIdentifier:@"counties"]; // filter countiesLayer.predicate = [NSPredicate predicateWithFormat:@"NAME10 == 'Washington'"]; @@ -1165,7 +1165,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { // after slight delay, change styling for regions 200-299 (atypical use; we want to clearly see the change for test purposes) dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^ { - MGLFillStyleLayer *regionsLayer = (MGLFillStyleLayer *)[self.mapView.style layerWithIdentifier:@"regions"]; + MLNFillStyleLayer *regionsLayer = (MLNFillStyleLayer *)[self.mapView.style layerWithIdentifier:@"regions"]; // filter (testing both inline and format strings) regionsLayer.predicate = [NSPredicate predicateWithFormat:@"CAST(HRRNUM, 'NSNumber') >= %@ AND CAST(HRRNUM, 'NSNumber') < 300", @(200)]; @@ -1186,22 +1186,22 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { // RTE if you don't remove the layer first // RTE if you pass a nill layer to remove layer - MGLStyleLayer *layer = [self.mapView.style layerWithIdentifier:queryLayerID]; + MLNStyleLayer *layer = [self.mapView.style layerWithIdentifier:queryLayerID]; if (layer) { [self.mapView.style removeLayer:layer]; } // RTE if you pass a nill source to remove source - MGLSource *source = [self.mapView.style sourceWithIdentifier:querySourceID]; + MLNSource *source = [self.mapView.style sourceWithIdentifier:querySourceID]; if (source) { [self.mapView.style removeSource:source]; } dispatch_async(dispatch_get_main_queue(), ^{ - MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:querySourceID features:visibleFeatures options:nil]; + MLNShapeSource *shapeSource = [[MLNShapeSource alloc] initWithIdentifier:querySourceID features:visibleFeatures options:nil]; [self.mapView.style addSource:shapeSource]; - MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:queryLayerID source:shapeSource]; + MLNFillStyleLayer *fillLayer = [[MLNFillStyleLayer alloc] initWithIdentifier:queryLayerID source:shapeSource]; fillLayer.fillColor = [NSExpression expressionForConstantValue:[UIColor blueColor]]; fillLayer.fillOpacity = [NSExpression expressionForConstantValue:@0.5]; [self.mapView.style addLayer:fillLayer]; @@ -1247,14 +1247,14 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { }; NSUInteger coordsCount = sizeof(leafCoords) / sizeof(leafCoords[0]); - MGLPolygonFeature *feature = [MGLPolygonFeature polygonWithCoordinates:leafCoords count:coordsCount]; + MLNPolygonFeature *feature = [MLNPolygonFeature polygonWithCoordinates:leafCoords count:coordsCount]; feature.identifier = @"leaf-feature"; feature.attributes = @{@"color": @"red"}; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"leaf-source" shape:feature options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"leaf-source" shape:feature options:nil]; [self.mapView.style addSource:source]; - MGLFillStyleLayer *layer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"leaf-fill-layer" source:source]; + MLNFillStyleLayer *layer = [[MLNFillStyleLayer alloc] initWithIdentifier:@"leaf-fill-layer" source:source]; layer.predicate = [NSPredicate predicateWithFormat:@"color = 'red'"]; layer.fillColor = [NSExpression expressionForConstantValue:[UIColor redColor]]; [self.mapView.style addLayer:layer]; @@ -1262,11 +1262,11 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { NSString *geoJSON = @"{\"type\": \"Feature\", \"properties\": {\"color\": \"green\"}, \"geometry\": { \"type\": \"Point\", \"coordinates\": [ -114.06847000122069, 51.050459433092655 ] }}"; NSData *data = [geoJSON dataUsingEncoding:NSUTF8StringEncoding]; - MGLShape *shape = [MGLShape shapeWithData:data encoding:NSUTF8StringEncoding error:NULL]; - MGLShapeSource *pointSource = [[MGLShapeSource alloc] initWithIdentifier:@"leaf-point-source" shape:shape options:nil]; + MLNShape *shape = [MLNShape shapeWithData:data encoding:NSUTF8StringEncoding error:NULL]; + MLNShapeSource *pointSource = [[MLNShapeSource alloc] initWithIdentifier:@"leaf-point-source" shape:shape options:nil]; [self.mapView.style addSource:pointSource]; - MGLCircleStyleLayer *circleLayer = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"leaf-circle-layer" source:pointSource]; + MLNCircleStyleLayer *circleLayer = [[MLNCircleStyleLayer alloc] initWithIdentifier:@"leaf-circle-layer" source:pointSource]; circleLayer.circleColor = [NSExpression expressionForConstantValue:[UIColor greenColor]]; circleLayer.predicate = [NSPredicate predicateWithFormat:@"color = 'green'"]; [self.mapView.style addLayer:circleLayer]; @@ -1279,11 +1279,11 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { {51.05607054183093, -113.98761749267578}, {51.056070541830934, -114.0274429321289}, }; - MGLPolygon *polygon = [MGLPolygon polygonWithCoordinates:squareCoords count:sizeof(squareCoords)/sizeof(squareCoords[0])]; - MGLShapeSource *plainShapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"leaf-plain-shape-source" shape:polygon options:nil]; + MLNPolygon *polygon = [MLNPolygon polygonWithCoordinates:squareCoords count:sizeof(squareCoords)/sizeof(squareCoords[0])]; + MLNShapeSource *plainShapeSource = [[MLNShapeSource alloc] initWithIdentifier:@"leaf-plain-shape-source" shape:polygon options:nil]; [self.mapView.style addSource:plainShapeSource]; - MGLFillStyleLayer *plainFillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"leaf-plain-fill-layer" source:plainShapeSource]; + MLNFillStyleLayer *plainFillLayer = [[MLNFillStyleLayer alloc] initWithIdentifier:@"leaf-plain-fill-layer" source:plainShapeSource]; plainFillLayer.fillColor = [NSExpression expressionForConstantValue:[UIColor yellowColor]]; [self.mapView.style addLayer:plainFillLayer]; } @@ -1295,17 +1295,17 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { NSString *geoJSON = @"{\"type\": \"FeatureCollection\",\"features\": [{\"type\": \"Feature\",\"properties\": {},\"geometry\": {\"type\": \"LineString\",\"coordinates\": [[-107.75390625,40.329795743702064],[-104.34814453125,37.64903402157866]]}}]}"; NSData *data = [geoJSON dataUsingEncoding:NSUTF8StringEncoding]; - MGLShape *shape = [MGLShape shapeWithData:data encoding:NSUTF8StringEncoding error:NULL]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"mutable-data-source-id" shape:shape options:nil]; + MLNShape *shape = [MLNShape shapeWithData:data encoding:NSUTF8StringEncoding error:NULL]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"mutable-data-source-id" shape:shape options:nil]; [self.mapView.style addSource:source]; - MGLLineStyleLayer *layer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"mutable-data-layer-id" source:source]; + MLNLineStyleLayer *layer = [[MLNLineStyleLayer alloc] initWithIdentifier:@"mutable-data-layer-id" source:source]; [self.mapView.style addLayer:layer]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ NSString *updatedGeoJSON = @"{\"type\": \"FeatureCollection\",\"features\": [{\"type\": \"Feature\",\"properties\": {},\"geometry\": {\"type\": \"LineString\",\"coordinates\": [[-107.75390625,40.329795743702064],[-109.34814453125,37.64903402157866]]}}]}"; NSData *updatedData = [updatedGeoJSON dataUsingEncoding:NSUTF8StringEncoding]; - MGLShape *updatedShape = [MGLShape shapeWithData:updatedData encoding:NSUTF8StringEncoding error:NULL]; + MLNShape *updatedShape = [MLNShape shapeWithData:updatedData encoding:NSUTF8StringEncoding error:NULL]; source.shape = updatedShape; }); } @@ -1316,10 +1316,10 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"polyline" ofType:@"geojson"]; NSURL *geoJSONURL = [NSURL fileURLWithPath:filePath]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"mutable-data-source-url-id" URL:geoJSONURL options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"mutable-data-source-url-id" URL:geoJSONURL options:nil]; [self.mapView.style addSource:source]; - MGLLineStyleLayer *layer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"mutable-data-layer-url-id" source:source]; + MLNLineStyleLayer *layer = [[MLNLineStyleLayer alloc] initWithIdentifier:@"mutable-data-layer-url-id" source:source]; [self.mapView.style addLayer:layer]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ @@ -1352,15 +1352,15 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { {-41.17710352162799, 288.67298126220703} }; - MGLPolygonFeature *smallBoxFeature = [MGLPolygonFeature polygonWithCoordinates:smallBox count:sizeof(smallBox)/sizeof(smallBox[0])]; - MGLPolygonFeature *largeBoxFeature = [MGLPolygonFeature polygonWithCoordinates:largeBox count:sizeof(largeBox)/sizeof(largeBox[0])]; + MLNPolygonFeature *smallBoxFeature = [MLNPolygonFeature polygonWithCoordinates:smallBox count:sizeof(smallBox)/sizeof(smallBox[0])]; + MLNPolygonFeature *largeBoxFeature = [MLNPolygonFeature polygonWithCoordinates:largeBox count:sizeof(largeBox)/sizeof(largeBox[0])]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"mutable-data-source-features-id" + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"mutable-data-source-features-id" shape:smallBoxFeature options:nil]; [self.mapView.style addSource:source]; - MGLFillStyleLayer *layer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"mutable-data-layer-features-id" source:source]; + MLNFillStyleLayer *layer = [[MLNFillStyleLayer alloc] initWithIdentifier:@"mutable-data-layer-features-id" source:source]; layer.fillColor = [NSExpression expressionForConstantValue:[UIColor redColor]]; [self.mapView.style addLayer:layer]; @@ -1379,25 +1379,25 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { {36.99453246847359, -109.04960632324219}, {36.99508088541243, -109.04007911682129}, }; - MGLPointCollectionFeature *feature = [MGLPointCollectionFeature pointCollectionWithCoordinates:coordinates count:4]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"wiggle-source" shape:feature options:nil]; + MLNPointCollectionFeature *feature = [MLNPointCollectionFeature pointCollectionWithCoordinates:coordinates count:4]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"wiggle-source" shape:feature options:nil]; [self.mapView.style addSource:source]; - MGLCircleStyleLayer *layer = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"wiggle-layer" source:source]; + MLNCircleStyleLayer *layer = [[MLNCircleStyleLayer alloc] initWithIdentifier:@"wiggle-layer" source:source]; [self.mapView.style addLayer:layer]; } - (void)styleVectorTileSource { NSURL *url = [[NSURL alloc] initWithString:@"maptiler://source/hillshade"]; - MGLVectorTileSource *vectorTileSource = [[MGLVectorTileSource alloc] initWithIdentifier:@"style-vector-tile-source-id" configurationURL:url]; + MLNVectorTileSource *vectorTileSource = [[MLNVectorTileSource alloc] initWithIdentifier:@"style-vector-tile-source-id" configurationURL:url]; [self.mapView.style addSource:vectorTileSource]; - MGLBackgroundStyleLayer *backgroundLayer = [[MGLBackgroundStyleLayer alloc] initWithIdentifier:@"style-vector-background-layer-id"]; + MLNBackgroundStyleLayer *backgroundLayer = [[MLNBackgroundStyleLayer alloc] initWithIdentifier:@"style-vector-background-layer-id"]; backgroundLayer.backgroundColor = [NSExpression expressionForConstantValue:[UIColor blackColor]]; [self.mapView.style addLayer:backgroundLayer]; - MGLLineStyleLayer *lineLayer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"style-vector-line-layer-id" source:vectorTileSource]; + MLNLineStyleLayer *lineLayer = [[MLNLineStyleLayer alloc] initWithIdentifier:@"style-vector-line-layer-id" source:vectorTileSource]; lineLayer.sourceLayerIdentifier = @"contour"; lineLayer.lineJoin = [NSExpression expressionForConstantValue:@"round"]; lineLayer.lineCap = [NSExpression expressionForConstantValue:@"round"]; @@ -1409,28 +1409,28 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { - (void)styleRasterTileSource { NSString *tileURL = [NSString stringWithFormat:@"https://stamen-tiles.a.ssl.fastly.net/terrain-background/{z}/{x}/{y}%@.jpg", UIScreen.mainScreen.nativeScale > 1 ? @"@2x" : @""]; - MGLRasterTileSource *rasterTileSource = [[MGLRasterTileSource alloc] initWithIdentifier:@"style-raster-tile-source-id" tileURLTemplates:@[tileURL] options:@{ - MGLTileSourceOptionTileSize: @256, + MLNRasterTileSource *rasterTileSource = [[MLNRasterTileSource alloc] initWithIdentifier:@"style-raster-tile-source-id" tileURLTemplates:@[tileURL] options:@{ + MLNTileSourceOptionTileSize: @256, }]; [self.mapView.style addSource:rasterTileSource]; - MGLRasterStyleLayer *rasterLayer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"style-raster-layer-id" source:rasterTileSource]; + MLNRasterStyleLayer *rasterLayer = [[MLNRasterStyleLayer alloc] initWithIdentifier:@"style-raster-layer-id" source:rasterTileSource]; [self.mapView.style addLayer:rasterLayer]; } - (void)styleImageSource { - MGLCoordinateQuad coordinateQuad = { + MLNCoordinateQuad coordinateQuad = { { 46.437, -80.425 }, { 37.936, -80.425 }, { 37.936, -71.516 }, { 46.437, -71.516 } }; - MGLImageSource *imageSource = [[MGLImageSource alloc] initWithIdentifier:@"style-image-source-id" coordinateQuad:coordinateQuad URL:[NSURL URLWithString:@"https://maplibre.org/maplibre-gl-js-docs/assets/radar0.gif"]]; + MLNImageSource *imageSource = [[MLNImageSource alloc] initWithIdentifier:@"style-image-source-id" coordinateQuad:coordinateQuad URL:[NSURL URLWithString:@"https://maplibre.org/maplibre-gl-js-docs/assets/radar0.gif"]]; [self.mapView.style addSource:imageSource]; - MGLRasterStyleLayer *rasterLayer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"style-raster-image-layer-id" source:imageSource]; + MLNRasterStyleLayer *rasterLayer = [[MLNRasterStyleLayer alloc] initWithIdentifier:@"style-raster-image-layer-id" source:imageSource]; [self.mapView.style addLayer:rasterLayer]; [NSTimer scheduledTimerWithTimeInterval:1.0 @@ -1443,7 +1443,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { - (void)updateAnimatedImageSource:(NSTimer *)timer { static int radarSuffix = 0; - MGLImageSource *imageSource = (MGLImageSource *)timer.userInfo; + MLNImageSource *imageSource = (MLNImageSource *)timer.userInfo; NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://maplibre.org/maplibre-gl-js-docs/assets/radar%d.gif", radarSuffix++]]; [imageSource setValue:url forKey:@"URL"]; if (radarSuffix > 3) { @@ -1473,12 +1473,12 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { [self.mapView setCenterCoordinate:coords[0] zoomLevel:16 animated:YES]; - MGLPolylineFeature *routeLine = [MGLPolylineFeature polylineWithCoordinates:coords count:count]; + MLNPolylineFeature *routeLine = [MLNPolylineFeature polylineWithCoordinates:coords count:count]; - MGLShapeSource *routeSource = [[MGLShapeSource alloc] initWithIdentifier:@"style-route-source" shape:routeLine options:nil]; + MLNShapeSource *routeSource = [[MLNShapeSource alloc] initWithIdentifier:@"style-route-source" shape:routeLine options:nil]; [self.mapView.style addSource:routeSource]; - MGLLineStyleLayer *baseRouteLayer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"style-base-route-layer" source:routeSource]; + MLNLineStyleLayer *baseRouteLayer = [[MLNLineStyleLayer alloc] initWithIdentifier:@"style-base-route-layer" source:routeSource]; baseRouteLayer.lineColor = [NSExpression expressionForConstantValue:[UIColor orangeColor]]; baseRouteLayer.lineWidth = [NSExpression expressionForConstantValue:@20]; baseRouteLayer.lineOpacity = [NSExpression expressionForConstantValue:@0.5]; @@ -1486,7 +1486,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { baseRouteLayer.lineJoin = [NSExpression expressionForConstantValue:@"round"]; [self.mapView.style addLayer:baseRouteLayer]; - MGLLineStyleLayer *routeLayer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"style-route-layer" source:routeSource]; + MLNLineStyleLayer *routeLayer = [[MLNLineStyleLayer alloc] initWithIdentifier:@"style-route-layer" source:routeSource]; routeLayer.lineColor = [NSExpression expressionForConstantValue:[UIColor whiteColor]]; routeLayer.lineWidth = [NSExpression expressionForConstantValue:@15]; routeLayer.lineOpacity = [NSExpression expressionForConstantValue:@0.8]; @@ -1516,17 +1516,17 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { {37.73135334055843, -122.41310119628906}, {37.73135334055843, -122.44640350341795}, }; - MGLPolygonFeature *leftFeature = [MGLPolygonFeature polygonWithCoordinates:leftCoords count:5]; + MLNPolygonFeature *leftFeature = [MLNPolygonFeature polygonWithCoordinates:leftCoords count:5]; leftFeature.attributes = @{@"fill": @(YES)}; - MGLPolygonFeature *rightFeature = [MGLPolygonFeature polygonWithCoordinates:rightCoords count:5]; + MLNPolygonFeature *rightFeature = [MLNPolygonFeature polygonWithCoordinates:rightCoords count:5]; rightFeature.attributes = @{@"opacity": @(0.5)}; - MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"shape-source" features:@[leftFeature, rightFeature] options:nil]; + MLNShapeSource *shapeSource = [[MLNShapeSource alloc] initWithIdentifier:@"shape-source" features:@[leftFeature, rightFeature] options:nil]; [self.mapView.style addSource:shapeSource]; // source, categorical function that sets any feature with a "fill" attribute value of true to red color and anything without to green - MGLFillStyleLayer *fillStyleLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"fill-layer" source:shapeSource]; + MLNFillStyleLayer *fillStyleLayer = [[MLNFillStyleLayer alloc] initWithIdentifier:@"fill-layer" source:shapeSource]; fillStyleLayer.fillColor = [NSExpression mgl_expressionForConditional:[NSPredicate predicateWithFormat:@"fill == YES"] trueExpression:[NSExpression expressionForConstantValue:[UIColor greenColor]] falseExpresssion:[NSExpression expressionForConstantValue:[UIColor redColor]]]; @@ -1542,14 +1542,14 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { - (void)addLatLonGrid { - MGLComputedShapeSource *source = [[MGLComputedShapeSource alloc] initWithIdentifier:@"latlon" - options:@{MGLShapeSourceOptionMaximumZoomLevel:@14}]; + MLNComputedShapeSource *source = [[MLNComputedShapeSource alloc] initWithIdentifier:@"latlon" + options:@{MLNShapeSourceOptionMaximumZoomLevel:@14}]; source.dataSource = self; [self.mapView.style addSource:source]; - MGLLineStyleLayer *lineLayer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"latlonlines" + MLNLineStyleLayer *lineLayer = [[MLNLineStyleLayer alloc] initWithIdentifier:@"latlonlines" source:source]; [self.mapView.style addLayer:lineLayer]; - MGLSymbolStyleLayer *labelLayer = [[MGLSymbolStyleLayer alloc] initWithIdentifier:@"latlonlabels" + MLNSymbolStyleLayer *labelLayer = [[MLNSymbolStyleLayer alloc] initWithIdentifier:@"latlonlabels" source:source]; labelLayer.text = [NSExpression expressionForKeyPath:@"value"]; [self.mapView.style addLayer:labelLayer]; @@ -1590,9 +1590,9 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { [self continueWorldTourWithRemainingAnnotations:annotations]; } -- (void)continueWorldTourWithRemainingAnnotations:(NSMutableArray *)annotations +- (void)continueWorldTourWithRemainingAnnotations:(NSMutableArray *)annotations { - MGLPointAnnotation *nextAnnotation = annotations.firstObject; + MLNPointAnnotation *nextAnnotation = annotations.firstObject; if (!nextAnnotation || !_isTouringWorld) { _isTouringWorld = NO; @@ -1600,7 +1600,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { } [annotations removeObjectAtIndex:0]; - MGLMapCamera *camera = [MGLMapCamera cameraLookingAtCenterCoordinate:nextAnnotation.coordinate + MLNMapCamera *camera = [MLNMapCamera cameraLookingAtCenterCoordinate:nextAnnotation.coordinate acrossDistance:10 pitch:arc4random_uniform(60) heading:arc4random_uniform(360)]; @@ -1617,7 +1617,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { { _customUserLocationAnnnotationEnabled = !_customUserLocationAnnnotationEnabled; self.mapView.showsUserLocation = NO; - self.mapView.userTrackingMode = MGLUserTrackingModeFollow; + self.mapView.userTrackingMode = MLNUserTrackingModeFollow; } - (void)testQueryPointAnnotations { @@ -1634,10 +1634,10 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { [self presentViewController:alertController animated:YES completion:nil]; } -- (id)randomOffscreenPointAnnotation { +- (id)randomOffscreenPointAnnotation { NSPredicate *pointAnnotationPredicate = [NSPredicate predicateWithBlock:^BOOL(id _Nullable evaluatedObject, NSDictionary * _Nullable bindings) { - return [evaluatedObject isKindOfClass:[MGLPointAnnotation class]]; + return [evaluatedObject isKindOfClass:[MLNPointAnnotation class]]; }]; NSArray *annotations = [self.mapView.annotations filteredArrayUsingPredicate:pointAnnotationPredicate]; @@ -1664,7 +1664,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { } - (void)selectAnOffscreenPointAnnotation { - id annotation = [self randomOffscreenPointAnnotation]; + id annotation = [self randomOffscreenPointAnnotation]; if (annotation) { [self.mapView selectAnnotation:annotation animated:YES completionHandler:nil]; @@ -1673,7 +1673,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { } - (void)centerSelectedAnnotation { - id annotation = self.mapView.selectedAnnotations.firstObject; + id annotation = self.mapView.selectedAnnotations.firstObject; if (!annotation) return; @@ -1696,7 +1696,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { lineCoords[3] = [self.mapView convertPoint: CGPointMake(CGRectGetMinX(constrainedRect), CGRectGetMaxY(constrainedRect)) toCoordinateFromView:self.mapView]; lineCoords[4] = lineCoords[0]; - MGLPolyline *line = [MGLPolyline polylineWithCoordinates:lineCoords + MLNPolyline *line = [MLNPolyline polylineWithCoordinates:lineCoords count:sizeof(lineCoords)/sizeof(lineCoords[0])]; [self.mapView addAnnotation:line]; } @@ -1709,7 +1709,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { [self.mapView setStyleURL:customStyleJSON]; } -- (UIImage *)mapView:(MGLMapView *)mapView didFailToLoadImage:(NSString *)imageName { +- (UIImage *)mapView:(MLNMapView *)mapView didFailToLoadImage:(NSString *)imageName { UIImage *backupImage = [UIImage imageNamed:@"AppIcon"]; return backupImage; } @@ -1761,7 +1761,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { // Add annotations around that coord [self addAnnotations:50 aroundCoordinate:annotation.coordinate radius:100000]; // 100km - MGLMapCamera *camera = [MGLMapCamera cameraLookingAtCenterCoordinate:annotation.coordinate + MLNMapCamera *camera = [MLNMapCamera cameraLookingAtCenterCoordinate:annotation.coordinate altitude:10000.0 pitch:(CLLocationDegrees)arc4random_uniform(60) heading:(CLLocationDegrees)arc4random_uniform(360)]; @@ -1785,7 +1785,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { - (void)toggleSecondMapView { if ([self.view viewWithTag:2] == nil) { - MGLMapView *secondMapView = [[MGLMapView alloc] initWithFrame: + MLNMapView *secondMapView = [[MLNMapView alloc] initWithFrame: CGRectMake(0, self.view.bounds.size.height / 2, self.view.bounds.size.width, self.view.bounds.size.height / 2)]; secondMapView.showsScale = YES; @@ -1840,7 +1840,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { ]]; } else { NSMutableArray *constraintsToRemove = [NSMutableArray array]; - MGLMapView *secondMapView = (MGLMapView *)[self.view viewWithTag:2]; + MLNMapView *secondMapView = (MLNMapView *)[self.view viewWithTag:2]; for (NSLayoutConstraint *constraint in self.view.constraints) { if (constraint.firstItem == secondMapView || constraint.secondItem == secondMapView) @@ -1877,7 +1877,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { CGPoint point = [longPress locationInView:longPress.view]; NSArray *features = [self.mapView visibleFeaturesAtPoint:point]; NSString *title; - for (id feature in features) { + for (id feature in features) { if (!title) { title = [feature attributeForKey:@"name_en"] ?: [feature attributeForKey:@"name"]; } @@ -1887,7 +1887,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { pin.coordinate = [self.mapView convertPoint:point toCoordinateFromView:self.mapView]; pin.title = title ?: @"Dropped Pin"; - pin.subtitle = [[[MGLCoordinateFormatter alloc] init] stringFromCoordinate:pin.coordinate]; + pin.subtitle = [[[MLNCoordinateFormatter alloc] init] stringFromCoordinate:pin.coordinate]; // Calling `addAnnotation:` on mapView is required here (since `selectAnnotation:animated` has @@ -1910,13 +1910,13 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { [self.styleURLs addObject:[NSURL URLWithString:@"https://demotiles.maplibre.org/style.json"]]; /// Add Mapbox Styles if an `apiKey` exists - NSString* apiKey = [MGLSettings apiKey]; + NSString* apiKey = [MLNSettings apiKey]; if (apiKey.length) { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - for (MGLDefaultStyle* predefinedStyle in [MGLStyle predefinedStyles]){ + for (MLNDefaultStyle* predefinedStyle in [MLNStyle predefinedStyles]){ [self.styleNames addObject:predefinedStyle.name]; [self.styleURLs addObject:predefinedStyle.url]; } @@ -1944,23 +1944,23 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { - (void)nextTrackingMode:(id)sender { - MGLUserTrackingMode nextMode; + MLNUserTrackingMode nextMode; NSString *nextAccessibilityValue; switch (self.mapView.userTrackingMode) { - case MGLUserTrackingModeNone: - nextMode = MGLUserTrackingModeFollow; + case MLNUserTrackingModeNone: + nextMode = MLNUserTrackingModeFollow; nextAccessibilityValue = @"Follow location"; break; - case MGLUserTrackingModeFollow: - nextMode = MGLUserTrackingModeFollowWithHeading; + case MLNUserTrackingModeFollow: + nextMode = MLNUserTrackingModeFollowWithHeading; nextAccessibilityValue = @"Follow location and heading"; break; - case MGLUserTrackingModeFollowWithHeading: - nextMode = MGLUserTrackingModeFollowWithCourse; + case MLNUserTrackingModeFollowWithHeading: + nextMode = MLNUserTrackingModeFollowWithCourse; nextAccessibilityValue = @"Follow course"; break; - case MGLUserTrackingModeFollowWithCourse: - nextMode = MGLUserTrackingModeNone; + case MLNUserTrackingModeFollowWithCourse: + nextMode = MLNUserTrackingModeNone; nextAccessibilityValue = @"Off"; break; } @@ -1985,9 +1985,9 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { } } -// MARK: - MGLMapViewDelegate +// MARK: - MLNMapViewDelegate -- (MGLAnnotationView *)mapView:(MGLMapView *)mapView viewForAnnotation:(id)annotation +- (MLNAnnotationView *)mapView:(MLNMapView *)mapView viewForAnnotation:(id)annotation { if (annotation == mapView.userLocation) { @@ -2025,7 +2025,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { return annotationView; } -- (MGLAnnotationImage *)mapView:(MGLMapView * __nonnull)mapView imageForAnnotation:(id __nonnull)annotation +- (MLNAnnotationImage *)mapView:(MLNMapView * __nonnull)mapView imageForAnnotation:(id __nonnull)annotation { if ([annotation isKindOfClass:[MBXDroppedPinAnnotation class]] || [annotation isKindOfClass:[MBXCustomCalloutAnnotation class]]) { @@ -2034,11 +2034,11 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { NSAssert([annotation isKindOfClass:[MBXSpriteBackedAnnotation class]], @"Annotations should be sprite-backed."); - NSString *title = [(MGLPointAnnotation *)annotation title]; + NSString *title = [(MLNPointAnnotation *)annotation title]; if (!title.length) return nil; NSString *lastTwoCharacters = [title substringFromIndex:title.length - 2]; - MGLAnnotationImage *annotationImage = [mapView dequeueReusableAnnotationImageWithIdentifier:lastTwoCharacters]; + MLNAnnotationImage *annotationImage = [mapView dequeueReusableAnnotationImageWithIdentifier:lastTwoCharacters]; if ( ! annotationImage) { @@ -2052,7 +2052,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { } UIImage *image = [self imageWithText:lastTwoCharacters backgroundColor:color]; - annotationImage = [MGLAnnotationImage annotationImageWithImage:image reuseIdentifier:lastTwoCharacters]; + annotationImage = [MLNAnnotationImage annotationImageWithImage:image reuseIdentifier:lastTwoCharacters]; // don't allow touches on blue annotations if ([color isEqual:[UIColor blueColor]]) annotationImage.enabled = NO; @@ -2092,46 +2092,46 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { return image; } -- (BOOL)mapView:(__unused MGLMapView *)mapView annotationCanShowCallout:(__unused id )annotation +- (BOOL)mapView:(__unused MLNMapView *)mapView annotationCanShowCallout:(__unused id )annotation { return YES; } -- (CGFloat)mapView:(__unused MGLMapView *)mapView alphaForShapeAnnotation:(MGLShape *)annotation +- (CGFloat)mapView:(__unused MLNMapView *)mapView alphaForShapeAnnotation:(MLNShape *)annotation { - return ([annotation isKindOfClass:[MGLPolygon class]] ? 0.5 : 1.0); + return ([annotation isKindOfClass:[MLNPolygon class]] ? 0.5 : 1.0); } -- (UIColor *)mapView:(__unused MGLMapView *)mapView strokeColorForShapeAnnotation:(MGLShape *)annotation +- (UIColor *)mapView:(__unused MLNMapView *)mapView strokeColorForShapeAnnotation:(MLNShape *)annotation { - UIColor *color = [annotation isKindOfClass:[MGLPolyline class]] ? [UIColor greenColor] : [UIColor blackColor]; + UIColor *color = [annotation isKindOfClass:[MLNPolyline class]] ? [UIColor greenColor] : [UIColor blackColor]; return [color colorWithAlphaComponent:0.9]; } -- (UIColor *)mapView:(__unused MGLMapView *)mapView fillColorForPolygonAnnotation:(__unused MGLPolygon *)annotation +- (UIColor *)mapView:(__unused MLNMapView *)mapView fillColorForPolygonAnnotation:(__unused MLNPolygon *)annotation { UIColor *color = annotation.pointCount > 3 ? [UIColor greenColor] : [UIColor redColor]; return [color colorWithAlphaComponent:0.5]; } -- (void)mapView:(__unused MGLMapView *)mapView didChangeUserTrackingMode:(MGLUserTrackingMode)mode animated:(__unused BOOL)animated +- (void)mapView:(__unused MLNMapView *)mapView didChangeUserTrackingMode:(MLNUserTrackingMode)mode animated:(__unused BOOL)animated { UIImage *newButtonImage; NSString *newButtonTitle; switch (mode) { - case MGLUserTrackingModeNone: + case MLNUserTrackingModeNone: newButtonImage = [UIImage imageNamed:@"TrackingLocationOffMask.png"]; break; - case MGLUserTrackingModeFollow: + case MLNUserTrackingModeFollow: newButtonImage = [UIImage imageNamed:@"TrackingLocationMask.png"]; break; - case MGLUserTrackingModeFollowWithHeading: + case MLNUserTrackingModeFollowWithHeading: newButtonImage = [UIImage imageNamed:@"TrackingHeadingMask.png"]; break; - case MGLUserTrackingModeFollowWithCourse: + case MLNUserTrackingModeFollowWithCourse: newButtonImage = nil; newButtonTitle = @"Course"; break; @@ -2143,7 +2143,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { }]; } -- (nullable id )mapView:(__unused MGLMapView *)mapView calloutViewForAnnotation:(id)annotation +- (nullable id )mapView:(__unused MLNMapView *)mapView calloutViewForAnnotation:(id)annotation { if ([annotation respondsToSelector:@selector(title)] && [annotation isKindOfClass:[MBXCustomCalloutAnnotation class]]) @@ -2158,7 +2158,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { return nil; } -- (UIView *)mapView:(__unused MGLMapView *)mapView leftCalloutAccessoryViewForAnnotation:(__unused id)annotation +- (UIView *)mapView:(__unused MLNMapView *)mapView leftCalloutAccessoryViewForAnnotation:(__unused id)annotation { UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem]; button.frame = CGRectZero; @@ -2167,7 +2167,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { return button; } -- (UIView *)mapView:(__unused MGLMapView *)mapView rightCalloutAccessoryViewForAnnotation:(__unused id)annotation +- (UIView *)mapView:(__unused MLNMapView *)mapView rightCalloutAccessoryViewForAnnotation:(__unused id)annotation { UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem]; button.frame = CGRectZero; @@ -2176,18 +2176,18 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { return button; } -- (void)mapView:(MGLMapView *)mapView tapOnCalloutForAnnotation:(id )annotation +- (void)mapView:(MLNMapView *)mapView tapOnCalloutForAnnotation:(id )annotation { - if ( ! [annotation isKindOfClass:[MGLPointAnnotation class]]) + if ( ! [annotation isKindOfClass:[MLNPointAnnotation class]]) { return; } - MGLPointAnnotation *point = (MGLPointAnnotation *)annotation; + MLNPointAnnotation *point = (MLNPointAnnotation *)annotation; point.coordinate = [self.mapView convertPoint:self.mapView.center toCoordinateFromView:self.mapView]; } -- (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style +- (void)mapView:(MLNMapView *)mapView didFinishLoadingStyle:(MLNStyle *)style { // Default Mapbox styles use {name_en} as their label language, which means // that a device with an English-language locale is already effectively @@ -2195,24 +2195,24 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { _localizingLabels = [[self bestLanguageForUser] isEqualToString:@"en"]; } -- (BOOL)mapView:(MGLMapView *)mapView shouldChangeFromCamera:(MGLMapCamera *)oldCamera toCamera:(MGLMapCamera *)newCamera { +- (BOOL)mapView:(MLNMapView *)mapView shouldChangeFromCamera:(MLNMapCamera *)oldCamera toCamera:(MLNMapCamera *)newCamera { if (_shouldLimitCameraChanges) { // Get the current camera to restore it after. - MGLMapCamera *currentCamera = mapView.camera; + MLNMapCamera *currentCamera = mapView.camera; // From the new camera obtain the center to test if it’s inside the boundaries. CLLocationCoordinate2D newCameraCenter = newCamera.centerCoordinate; // Set the map’s visible bounds to newCamera. mapView.camera = newCamera; - MGLCoordinateBounds newVisibleCoordinates = mapView.visibleCoordinateBounds; + MLNCoordinateBounds newVisibleCoordinates = mapView.visibleCoordinateBounds; // Revert the camera. mapView.camera = currentCamera; // Test if the newCameraCenter and newVisibleCoordinates are inside Colorado. - BOOL inside = MGLCoordinateInCoordinateBounds(newCameraCenter, colorado); - BOOL intersects = MGLCoordinateInCoordinateBounds(newVisibleCoordinates.ne, colorado) && MGLCoordinateInCoordinateBounds(newVisibleCoordinates.sw, colorado); + BOOL inside = MLNCoordinateInCoordinateBounds(newCameraCenter, colorado); + BOOL intersects = MLNCoordinateInCoordinateBounds(newVisibleCoordinates.ne, colorado) && MLNCoordinateInCoordinateBounds(newVisibleCoordinates.sw, colorado); return inside && intersects; } else { @@ -2220,15 +2220,15 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { } } -- (void)mapViewRegionIsChanging:(MGLMapView *)mapView +- (void)mapViewRegionIsChanging:(MLNMapView *)mapView { [self updateHUD]; [self updateHelperMapViews]; } -- (void)mapView:(MGLMapView *)mapView regionDidChangeWithReason:(MGLCameraChangeReason)reason animated:(BOOL)animated +- (void)mapView:(MLNMapView *)mapView regionDidChangeWithReason:(MLNCameraChangeReason)reason animated:(BOOL)animated { - if (reason != MGLCameraChangeReasonProgrammatic) { + if (reason != MLNCameraChangeReasonProgrammatic) { self.randomWalk = NO; } @@ -2236,13 +2236,13 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { [self updateHelperMapViews]; } -- (void)mapView:(MGLMapView *)mapView didUpdateUserLocation:(MGLUserLocation *)userLocation { +- (void)mapView:(MLNMapView *)mapView didUpdateUserLocation:(MLNUserLocation *)userLocation { [self updateHUD]; } - (void)updateHelperMapViews { for (UIWindow *window in self.helperWindows) { - MGLMapView *mapView = (MGLMapView *)window.rootViewController.view; + MLNMapView *mapView = (MLNMapView *)window.rootViewController.view; mapView.camera = self.mapView.camera; } } @@ -2270,9 +2270,9 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { [self.hudLabel setTitle:hudString forState:UIControlStateNormal]; } -// MARK: - MGLComputedShapeSourceDataSource +// MARK: - MLNComputedShapeSourceDataSource -- (NSArray>*)featuresInCoordinateBounds:(MGLCoordinateBounds)bounds zoomLevel:(NSUInteger)zoom { +- (NSArray>*)featuresInCoordinateBounds:(MLNCoordinateBounds)bounds zoomLevel:(NSUInteger)zoom { double gridSpacing; if(zoom >= 13) { gridSpacing = 0.01; @@ -2296,13 +2296,13 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { gridSpacing = 20; } - NSMutableArray > * features = [NSMutableArray array]; + NSMutableArray > * features = [NSMutableArray array]; CLLocationCoordinate2D coords[2]; for (double y = ceil(bounds.ne.latitude / gridSpacing) * gridSpacing; y >= floor(bounds.sw.latitude / gridSpacing) * gridSpacing; y -= gridSpacing) { coords[0] = CLLocationCoordinate2DMake(y, bounds.sw.longitude); coords[1] = CLLocationCoordinate2DMake(y, bounds.ne.longitude); - MGLPolylineFeature *feature = [MGLPolylineFeature polylineWithCoordinates:coords count:2]; + MLNPolylineFeature *feature = [MLNPolylineFeature polylineWithCoordinates:coords count:2]; feature.attributes = @{@"value": @(y)}; [features addObject:feature]; } @@ -2310,7 +2310,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { for (double x = floor(bounds.sw.longitude / gridSpacing) * gridSpacing; x <= ceil(bounds.ne.longitude / gridSpacing) * gridSpacing; x += gridSpacing) { coords[0] = CLLocationCoordinate2DMake(bounds.sw.latitude, x); coords[1] = CLLocationCoordinate2DMake(bounds.ne.latitude, x); - MGLPolylineFeature *feature = [MGLPolylineFeature polylineWithCoordinates:coords count:2]; + MLNPolylineFeature *feature = [MLNPolylineFeature polylineWithCoordinates:coords count:2]; feature.attributes = @{@"value": @(x)}; [features addObject:feature]; } @@ -2318,13 +2318,13 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { return features; } -- (void)mapViewDidFinishRenderingFrame:(MGLMapView *)mapView fullyRendered:(BOOL)fullyRendered { +- (void)mapViewDidFinishRenderingFrame:(MLNMapView *)mapView fullyRendered:(BOOL)fullyRendered { if (self.frameTimeGraphEnabled) { [self.frameTimeGraphView updatePathWithFrameDuration:mapView.frameTime]; } } -- (void)mapView:(nonnull MGLMapView *)mapView didChangeLocationManagerAuthorization:(nonnull id)manager { +- (void)mapView:(nonnull MLNMapView *)mapView didChangeLocationManagerAuthorization:(nonnull id)manager { if (@available(iOS 14, *)) { #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 if (manager.authorizationStatus == kCLAuthorizationStatusDenied || manager.accuracyAuthorization == CLAccuracyAuthorizationReducedAccuracy) { diff --git a/platform/ios/platform/ios/app/MGLMapView_Experimental.h b/platform/ios/platform/ios/app/MLNMapView_Experimental.h similarity index 95% rename from platform/ios/platform/ios/app/MGLMapView_Experimental.h rename to platform/ios/platform/ios/app/MLNMapView_Experimental.h index be6d27388..6fc3ccbf3 100644 --- a/platform/ios/platform/ios/app/MGLMapView_Experimental.h +++ b/platform/ios/platform/ios/app/MLNMapView_Experimental.h @@ -1,6 +1,6 @@ #import -@interface MGLMapView (Experimental) +@interface MLNMapView (Experimental) // MARK: Rendering Performance Measurement diff --git a/platform/ios/platform/ios/app/Main.storyboard b/platform/ios/platform/ios/app/Main.storyboard index ac83bd968..c97ab0b65 100644 --- a/platform/ios/platform/ios/app/Main.storyboard +++ b/platform/ios/platform/ios/app/Main.storyboard @@ -16,7 +16,7 @@ - + @@ -951,7 +951,7 @@ CA - + context countOfResourcesCompleted diff --git a/platform/ios/platform/macos/app/Base.lproj/MapDocument.xib b/platform/ios/platform/macos/app/Base.lproj/MapDocument.xib index 9a319bfd0..028202f43 100644 --- a/platform/ios/platform/macos/app/Base.lproj/MapDocument.xib +++ b/platform/ios/platform/macos/app/Base.lproj/MapDocument.xib @@ -24,7 +24,7 @@ - + style @@ -32,7 +32,7 @@ - + layers name @@ -42,7 +42,7 @@ - + identifier visible @@ -138,7 +138,7 @@ - + diff --git a/platform/ios/platform/macos/app/DroppedPinAnnotation.h b/platform/ios/platform/macos/app/DroppedPinAnnotation.h index 0897219b1..c5a56bb54 100644 --- a/platform/ios/platform/macos/app/DroppedPinAnnotation.h +++ b/platform/ios/platform/macos/app/DroppedPinAnnotation.h @@ -2,7 +2,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface DroppedPinAnnotation : MGLPointAnnotation +@interface DroppedPinAnnotation : MLNPointAnnotation @property (nonatomic, copy, nullable) NSString *note; @property (nonatomic, readonly) NSTimeInterval elapsedShownTime; diff --git a/platform/ios/platform/macos/app/DroppedPinAnnotation.m b/platform/ios/platform/macos/app/DroppedPinAnnotation.m index b60140509..a88843174 100644 --- a/platform/ios/platform/macos/app/DroppedPinAnnotation.m +++ b/platform/ios/platform/macos/app/DroppedPinAnnotation.m @@ -5,7 +5,7 @@ #import -static MGLCoordinateFormatter *DroppedPinCoordinateFormatter; +static MLNCoordinateFormatter *DroppedPinCoordinateFormatter; @implementation DroppedPinAnnotation { NSTimer *_timer; @@ -17,7 +17,7 @@ static MGLCoordinateFormatter *DroppedPinCoordinateFormatter; + (void)initialize { if (self == [DroppedPinAnnotation class]) { - DroppedPinCoordinateFormatter = [[MGLCoordinateFormatter alloc] init]; + DroppedPinCoordinateFormatter = [[MLNCoordinateFormatter alloc] init]; } } diff --git a/platform/ios/platform/macos/app/LocationCoordinate2DTransformer.m b/platform/ios/platform/macos/app/LocationCoordinate2DTransformer.m index 59654f167..3bdccbe13 100644 --- a/platform/ios/platform/macos/app/LocationCoordinate2DTransformer.m +++ b/platform/ios/platform/macos/app/LocationCoordinate2DTransformer.m @@ -3,7 +3,7 @@ #import @implementation LocationCoordinate2DTransformer { - MGLCoordinateFormatter *_coordinateFormatter; + MLNCoordinateFormatter *_coordinateFormatter; } + (Class)transformedValueClass { @@ -16,7 +16,7 @@ - (instancetype)init { if (self = [super init]) { - _coordinateFormatter = [[MGLCoordinateFormatter alloc] init]; + _coordinateFormatter = [[MLNCoordinateFormatter alloc] init]; } return self; } diff --git a/platform/ios/platform/macos/app/MGLStyle+MBXAdditions.h b/platform/ios/platform/macos/app/MGLStyle+MBXAdditions.h deleted file mode 100644 index 29c2cda86..000000000 --- a/platform/ios/platform/macos/app/MGLStyle+MBXAdditions.h +++ /dev/null @@ -1,7 +0,0 @@ -#import - -@interface MGLStyle (MBXAdditions) - -@property (nonatomic, strong) NSArray<__kindof MGLStyleLayer *> *reversedLayers; - -@end diff --git a/platform/ios/platform/macos/app/MLNStyle+MBXAdditions.h b/platform/ios/platform/macos/app/MLNStyle+MBXAdditions.h new file mode 100644 index 000000000..e39a3dcb7 --- /dev/null +++ b/platform/ios/platform/macos/app/MLNStyle+MBXAdditions.h @@ -0,0 +1,7 @@ +#import + +@interface MLNStyle (MBXAdditions) + +@property (nonatomic, strong) NSArray<__kindof MLNStyleLayer *> *reversedLayers; + +@end diff --git a/platform/ios/platform/macos/app/MGLStyle+MBXAdditions.m b/platform/ios/platform/macos/app/MLNStyle+MBXAdditions.m similarity index 69% rename from platform/ios/platform/macos/app/MGLStyle+MBXAdditions.m rename to platform/ios/platform/macos/app/MLNStyle+MBXAdditions.m index a0773cc2c..2f902cd4c 100644 --- a/platform/ios/platform/macos/app/MGLStyle+MBXAdditions.m +++ b/platform/ios/platform/macos/app/MLNStyle+MBXAdditions.m @@ -1,16 +1,16 @@ -#import "MGLStyle+MBXAdditions.h" +#import "MLNStyle+MBXAdditions.h" -@implementation MGLStyle (MBXAdditions) +@implementation MLNStyle (MBXAdditions) + (NSSet *)keyPathsForValuesAffectingReversedLayers { return [NSSet setWithObject:@"layers"]; } -- (NSArray<__kindof MGLStyleLayer *> *)reversedLayers { +- (NSArray<__kindof MLNStyleLayer *> *)reversedLayers { return self.layers.reverseObjectEnumerator.allObjects; } -- (void)setReversedLayers:(NSArray<__kindof MGLStyleLayer *> *)reversedLayers { +- (void)setReversedLayers:(NSArray<__kindof MLNStyleLayer *> *)reversedLayers { self.layers = reversedLayers.reverseObjectEnumerator.allObjects; } @@ -23,15 +23,15 @@ return layers[layers.count - 1 - index]; } -- (void)getReversedLayers:(__kindof MGLStyleLayer **)buffer range:(NSRange)inRange { +- (void)getReversedLayers:(__kindof MLNStyleLayer **)buffer range:(NSRange)inRange { NSArray *layers = self.layers; for (NSUInteger i = inRange.location; i < NSMaxRange(inRange); i++) { - MGLStyleLayer *styleLayer = layers[layers.count - 1 - i]; + MLNStyleLayer *styleLayer = layers[layers.count - 1 - i]; buffer[i] = styleLayer; } } -- (void)insertObject:(__kindof MGLStyleLayer *)object inReversedLayersAtIndex:(NSUInteger)index { +- (void)insertObject:(__kindof MLNStyleLayer *)object inReversedLayersAtIndex:(NSUInteger)index { [self insertLayer:object atIndex:self.layers.count - index]; } diff --git a/platform/ios/platform/macos/app/MapDocument.h b/platform/ios/platform/macos/app/MapDocument.h index fa70212cf..e9054365f 100644 --- a/platform/ios/platform/macos/app/MapDocument.h +++ b/platform/ios/platform/macos/app/MapDocument.h @@ -1,10 +1,10 @@ #import -@class MGLMapView; +@class MLNMapView; @interface MapDocument : NSDocument -@property (weak) IBOutlet MGLMapView *mapView; +@property (weak) IBOutlet MLNMapView *mapView; - (IBAction)showStyle:(id)sender; - (IBAction)chooseCustomStyle:(id)sender; diff --git a/platform/ios/platform/macos/app/MapDocument.m b/platform/ios/platform/macos/app/MapDocument.m index aea07f0fe..807f96bcc 100644 --- a/platform/ios/platform/macos/app/MapDocument.m +++ b/platform/ios/platform/macos/app/MapDocument.m @@ -3,14 +3,14 @@ #import "AppDelegate.h" #import "LimeGreenStyleLayer.h" #import "DroppedPinAnnotation.h" -#import "MGLMapsnapshotter.h" +#import "MLNMapsnapshotter.h" -#import "MGLStyle+MBXAdditions.h" -#import "MGLVectorTileSource_Private.h" +#import "MLNStyle+MBXAdditions.h" +#import "MLNVectorTileSource_Private.h" #import -static NSString * const MGLDroppedPinAnnotationImageIdentifier = @"dropped"; +static NSString * const MLNDroppedPinAnnotationImageIdentifier = @"dropped"; static const CLLocationCoordinate2D WorldTourDestinations[] = { { .latitude = 38.8999418, .longitude = -77.033996 }, @@ -20,26 +20,26 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = { { .latitude = 53.8948782, .longitude = 27.5558476 }, }; -NSArray> *MBXFlattenedShapes(NSArray> *shapes) { +NSArray> *MBXFlattenedShapes(NSArray> *shapes) { NSMutableArray *flattenedShapes = [NSMutableArray arrayWithCapacity:shapes.count]; - for (id shape in shapes) { + for (id shape in shapes) { NSArray *subshapes; - 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]; + if ([shape isKindOfClass:[MLNMultiPolyline class]]) { + subshapes = [(MLNMultiPolyline *)shape polylines]; + } else if ([shape isKindOfClass:[MLNMultiPolygon class]]) { + subshapes = [(MLNMultiPolygon *)shape polygons]; + } else if ([shape isKindOfClass:[MLNPointCollection class]]) { + NSUInteger pointCount = [(MLNPointCollection *)shape pointCount]; + CLLocationCoordinate2D *coordinates = [(MLNPointCollection *)shape coordinates]; NSMutableArray *pointAnnotations = [NSMutableArray arrayWithCapacity:pointCount]; for (NSUInteger i = 0; i < pointCount; i++) { - MGLPointAnnotation *pointAnnotation = [[MGLPointAnnotation alloc] init]; + MLNPointAnnotation *pointAnnotation = [[MLNPointAnnotation alloc] init]; pointAnnotation.coordinate = coordinates[i]; [pointAnnotations addObject:pointAnnotation]; } subshapes = pointAnnotations; - } else if ([shape isKindOfClass:[MGLShapeCollection class]]) { - subshapes = MBXFlattenedShapes([(MGLShapeCollection *)shape shapes]); + } else if ([shape isKindOfClass:[MLNShapeCollection class]]) { + subshapes = MBXFlattenedShapes([(MLNShapeCollection *)shape shapes]); } if (subshapes) { @@ -51,13 +51,13 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha return flattenedShapes; } -@interface MGLVectorTileSource (MBXAdditions) +@interface MLNVectorTileSource (MBXAdditions) @property (nonatomic, readonly, getter=isMapboxTerrain) BOOL mapboxTerrain; @end -@implementation MGLVectorTileSource (MBXAdditions) +@implementation MLNVectorTileSource (MBXAdditions) - (BOOL)isMapboxTerrain { NSURL *url = self.configurationURL; @@ -70,7 +70,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha @end -@interface MapDocument () +@interface MapDocument () @property (weak) IBOutlet NSArrayController *styleLayersArrayController; @property (weak) IBOutlet NSTableView *styleLayersTableView; @@ -102,7 +102,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha BOOL _isShowingPolygonAndPolylineAnnotations; BOOL _isShowingAnimatedAnnotation; - MGLMapSnapshotter *_snapshotter; + MLNMapSnapshotter *_snapshotter; } // MARK: Lifecycle @@ -146,9 +146,9 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha - (void)userDefaultsDidChange:(NSNotification *)notification { NSUserDefaults *userDefaults = notification.object; - NSString *apiKey = [userDefaults stringForKey:MGLApiKeyDefaultsKey]; - if (![apiKey isEqualToString:[MGLSettings apiKey]]) { - [MGLSettings setApiKey:apiKey]; + NSString *apiKey = [userDefaults stringForKey:MLNApiKeyDefaultsKey]; + if (![apiKey isEqualToString:[MLNSettings apiKey]]) { + [MLNSettings setApiKey:apiKey]; [self reload:self]; } } @@ -175,10 +175,10 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha - (NSURL *)shareURL { NSArray *components = self.mapView.styleURL.pathComponents; - MGLMapCamera *camera = self.mapView.camera; + MLNMapCamera *camera = self.mapView.camera; return [NSURL URLWithString: [NSString stringWithFormat:@"https://api.mapbox.com/styles/v1/%@/%@.html?access_token=%@#%.2f/%.5f/%.5f/%.f/%.f", - components[1], components[2], [MGLSettings apiKey], + components[1], components[2], [MLNSettings apiKey], self.mapView.zoomLevel, camera.centerCoordinate.latitude, camera.centerCoordinate.longitude, camera.heading, camera.pitch]]; } @@ -209,16 +209,16 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha [simplestyle-spec](https://github.com/mapbox/simplestyle-spec/tree/master/1.1.0/). */ - (void)importFromURL:(NSURL *)url { - MGLStyle *style = self.mapView.style; + MLNStyle *style = self.mapView.style; if (!style) { return; } - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:[NSUUID UUID].UUIDString URL:url options:nil]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:[NSUUID UUID].UUIDString URL:url options:nil]; [self.mapView.style addSource:source]; NSString *pointIdentifier = [NSString stringWithFormat:@"%@ marker", source.identifier]; - MGLSymbolStyleLayer *pointLayer = [[MGLSymbolStyleLayer alloc] initWithIdentifier:pointIdentifier source:source]; + MLNSymbolStyleLayer *pointLayer = [[MLNSymbolStyleLayer alloc] initWithIdentifier:pointIdentifier source:source]; pointLayer.iconImageName = [NSExpression expressionWithFormat:@"mgl_join({%K, '-', CAST(TERNARY(%K = 'small', 11, 15), 'NSString')})", @"marker-symbol", @"marker-size"]; @@ -229,14 +229,14 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha [style addLayer:pointLayer]; NSString *fillIdentifier = [NSString stringWithFormat:@"%@ fill", source.identifier]; - MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:fillIdentifier source:source]; + MLNFillStyleLayer *fillLayer = [[MLNFillStyleLayer alloc] initWithIdentifier:fillIdentifier source:source]; fillLayer.predicate = [NSPredicate predicateWithFormat:@"fill != nil OR %K != nil", @"fill-opacity"]; fillLayer.fillColor = [NSExpression expressionWithFormat:@"CAST(mgl_coalesce({fill, '#555555'}), 'NSColor')"]; fillLayer.fillOpacity = [NSExpression expressionWithFormat:@"mgl_coalesce({%K, 0.5})", @"fill-opacity"]; [style addLayer:fillLayer]; NSString *lineIdentifier = [NSString stringWithFormat:@"%@ stroke", source.identifier]; - MGLLineStyleLayer *lineLayer = [[MGLLineStyleLayer alloc] initWithIdentifier:lineIdentifier source:source]; + MLNLineStyleLayer *lineLayer = [[MLNLineStyleLayer alloc] initWithIdentifier:lineIdentifier source:source]; lineLayer.lineColor = [NSExpression expressionWithFormat:@"CAST(mgl_coalesce({stroke, '#555555'}), 'NSColor')"]; lineLayer.lineOpacity = [NSExpression expressionWithFormat:@"mgl_coalesce({%K, 1.0})", @"stroke-opacity"]; lineLayer.lineWidth = [NSExpression expressionWithFormat:@"mgl_coalesce({%K, 2})", @"stroke-width"]; @@ -246,16 +246,16 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha } - (IBAction)takeSnapshot:(id)sender { - MGLMapCamera *camera = self.mapView.camera; + MLNMapCamera *camera = self.mapView.camera; - MGLMapSnapshotOptions *options = [[MGLMapSnapshotOptions alloc] initWithStyleURL:self.mapView.styleURL camera:camera size:self.mapView.bounds.size]; + MLNMapSnapshotOptions *options = [[MLNMapSnapshotOptions alloc] initWithStyleURL:self.mapView.styleURL camera:camera size:self.mapView.bounds.size]; options.zoomLevel = self.mapView.zoomLevel; // Create and start the snapshotter __weak __typeof__(self) weakSelf = self; - _snapshotter = [[MGLMapSnapshotter alloc] initWithOptions:options]; + _snapshotter = [[MLNMapSnapshotter alloc] initWithOptions:options]; _snapshotter.delegate = self; - [_snapshotter startWithCompletionHandler:^(MGLMapSnapshot *snapshot, NSError *error) { + [_snapshotter startWithCompletionHandler:^(MLNMapSnapshot *snapshot, NSError *error) { __typeof__(self) strongSelf = weakSelf; if (!strongSelf) { return; @@ -320,7 +320,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha } else if ([sender isKindOfClass:[NSPopUpButton class]]) { tag = [sender selectedTag]; } - NSURL *styleURL = [[[MGLStyle predefinedStyles] objectAtIndex:tag - 1] url]; + NSURL *styleURL = [[[MLNStyle predefinedStyles] objectAtIndex:tag - 1] url]; [self.undoManager removeAllActionsWithTarget:self]; self.mapView.styleURL = styleURL; @@ -393,7 +393,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha } - (void)toggleStyleLayersAtArrangedObjectIndexes:(NSIndexSet *)indices { - NSArray *layers = [self.mapView.style.reversedLayers objectsAtIndexes:indices]; + NSArray *layers = [self.mapView.style.reversedLayers objectsAtIndexes:indices]; BOOL isVisible = layers.firstObject.visible; [self.undoManager registerUndoWithTarget:self handler:^(MapDocument * _Nonnull target) { [target toggleStyleLayersAtArrangedObjectIndexes:indices]; @@ -412,7 +412,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha [self.undoManager setActionName:actionName]; } - for (MGLStyleLayer *layer in layers) { + for (MLNStyleLayer *layer in layers) { layer.visible = !isVisible; } @@ -429,7 +429,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha [self deleteStyleLayersAtArrangedObjectIndexes:indices]; } -- (void)insertStyleLayers:(NSArray *)layers atArrangedObjectIndexes:(NSIndexSet *)indices { +- (void)insertStyleLayers:(NSArray *)layers atArrangedObjectIndexes:(NSIndexSet *)indices { [self.undoManager registerUndoWithTarget:self handler:^(id _Nonnull target) { [self deleteStyleLayersAtArrangedObjectIndexes:indices]; }]; @@ -449,7 +449,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha } - (void)deleteStyleLayersAtArrangedObjectIndexes:(NSIndexSet *)indices { - NSArray *layers = [self.mapView.style.reversedLayers objectsAtIndexes:indices]; + NSArray *layers = [self.mapView.style.reversedLayers objectsAtIndexes:indices]; [self.undoManager registerUndoWithTarget:self handler:^(id _Nonnull target) { [self insertStyleLayers:layers atArrangedObjectIndexes:indices]; }]; @@ -496,9 +496,9 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha appDelegate.pendingZoomLevel = -1; appDelegate.pendingCamera = nil; } - if (!MGLCoordinateBoundsIsEmpty(appDelegate.pendingVisibleCoordinateBounds)) { + if (!MLNCoordinateBoundsIsEmpty(appDelegate.pendingVisibleCoordinateBounds)) { self.mapView.visibleCoordinateBounds = appDelegate.pendingVisibleCoordinateBounds; - appDelegate.pendingVisibleCoordinateBounds = (MGLCoordinateBounds){ { 0, 0 }, { 0, 0 } }; + appDelegate.pendingVisibleCoordinateBounds = (MLNCoordinateBounds){ { 0, 0 }, { 0, 0 } }; } if (appDelegate.pendingDebugMask) { self.mapView.debugMask = appDelegate.pendingDebugMask; @@ -514,7 +514,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha // Temporarily set the display name to the default center coordinate instead // of “Untitled” until the binding kicks in. - NSValue *coordinateValue = [NSValue valueWithMGLCoordinate:self.mapView.centerCoordinate]; + NSValue *coordinateValue = [NSValue valueWithMLNCoordinate:self.mapView.centerCoordinate]; NSString *coordinateString = [[NSValueTransformer valueTransformerForName:@"LocationCoordinate2DTransformer"] transformedValue:coordinateValue]; @@ -525,38 +525,38 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha // MARK: Debug methods - (IBAction)toggleTileBoundaries:(id)sender { - self.mapView.debugMask ^= MGLMapDebugTileBoundariesMask; + self.mapView.debugMask ^= MLNMapDebugTileBoundariesMask; } - (IBAction)toggleTileInfo:(id)sender { - self.mapView.debugMask ^= MGLMapDebugTileInfoMask; + self.mapView.debugMask ^= MLNMapDebugTileInfoMask; } - (IBAction)toggleTileTimestamps:(id)sender { - self.mapView.debugMask ^= MGLMapDebugTimestampsMask; + self.mapView.debugMask ^= MLNMapDebugTimestampsMask; } - (IBAction)toggleCollisionBoxes:(id)sender { - self.mapView.debugMask ^= MGLMapDebugCollisionBoxesMask; + self.mapView.debugMask ^= MLNMapDebugCollisionBoxesMask; } - (IBAction)toggleOverdrawVisualization:(id)sender { - self.mapView.debugMask ^= MGLMapDebugOverdrawVisualizationMask; + self.mapView.debugMask ^= MLNMapDebugOverdrawVisualizationMask; } - (IBAction)showColorBuffer:(id)sender { - self.mapView.debugMask &= ~MGLMapDebugStencilBufferMask; - self.mapView.debugMask &= ~MGLMapDebugDepthBufferMask; + self.mapView.debugMask &= ~MLNMapDebugStencilBufferMask; + self.mapView.debugMask &= ~MLNMapDebugDepthBufferMask; } - (IBAction)showStencilBuffer:(id)sender { - self.mapView.debugMask &= ~MGLMapDebugDepthBufferMask; - self.mapView.debugMask |= MGLMapDebugStencilBufferMask; + self.mapView.debugMask &= ~MLNMapDebugDepthBufferMask; + self.mapView.debugMask |= MLNMapDebugStencilBufferMask; } - (IBAction)showDepthBuffer:(id)sender { - self.mapView.debugMask &= ~MGLMapDebugStencilBufferMask; - self.mapView.debugMask |= MGLMapDebugDepthBufferMask; + self.mapView.debugMask &= ~MLNMapDebugStencilBufferMask; + self.mapView.debugMask |= MLNMapDebugDepthBufferMask; } - (IBAction)toggleShowsToolTipsOnDroppedPins:(id)sender { @@ -617,7 +617,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha NSUInteger numberOfAnnotations = sizeof(WorldTourDestinations) / sizeof(WorldTourDestinations[0]); NSMutableArray *annotations = [NSMutableArray arrayWithCapacity:numberOfAnnotations]; for (NSUInteger i = 0; i < numberOfAnnotations; i++) { - MGLPointAnnotation *annotation = [[MGLPointAnnotation alloc] init]; + MLNPointAnnotation *annotation = [[MLNPointAnnotation alloc] init]; annotation.coordinate = WorldTourDestinations[i]; [annotations addObject:annotation]; } @@ -625,15 +625,15 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha [self continueWorldTourWithRemainingAnnotations:annotations]; } -- (void)continueWorldTourWithRemainingAnnotations:(NSMutableArray *)annotations { - MGLPointAnnotation *nextAnnotation = annotations.firstObject; +- (void)continueWorldTourWithRemainingAnnotations:(NSMutableArray *)annotations { + MLNPointAnnotation *nextAnnotation = annotations.firstObject; if (!nextAnnotation || !_isTouringWorld) { _isTouringWorld = NO; return; } [annotations removeObjectAtIndex:0]; - MGLMapCamera *camera = [MGLMapCamera cameraLookingAtCenterCoordinate:nextAnnotation.coordinate + MLNMapCamera *camera = [MLNMapCamera cameraLookingAtCenterCoordinate:nextAnnotation.coordinate acrossDistance:0 pitch:arc4random_uniform(60) heading:arc4random_uniform(360)]; @@ -667,7 +667,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha CLLocationCoordinate2DMake(46, -122), CLLocationCoordinate2DMake(46, -121) }; - MGLPolygon *triangle = [MGLPolygon polygonWithCoordinates:triangleCoordinates count:3]; + MLNPolygon *triangle = [MLNPolygon polygonWithCoordinates:triangleCoordinates count:3]; [self.mapView addAnnotation:triangle]; // West coast line @@ -677,7 +677,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha CLLocationCoordinate2DMake(37.7790, -122.4177), CLLocationCoordinate2DMake(34.0532, -118.2349) }; - MGLPolyline *line = [MGLPolyline polylineWithCoordinates:lineCoordinates count:4]; + MLNPolyline *line = [MLNPolyline polylineWithCoordinates:lineCoordinates count:4]; [self.mapView addAnnotation:line]; } @@ -695,10 +695,10 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha } -- (id)randomOffscreenPointAnnotation { +- (id)randomOffscreenPointAnnotation { NSPredicate *pointAnnotationPredicate = [NSPredicate predicateWithBlock:^BOOL(id _Nullable evaluatedObject, NSDictionary * _Nullable bindings) { - return [evaluatedObject isKindOfClass:[MGLPointAnnotation class]]; + return [evaluatedObject isKindOfClass:[MLNPointAnnotation class]]; }]; NSArray *annotations = [self.mapView.annotations filteredArrayUsingPredicate:pointAnnotationPredicate]; @@ -729,7 +729,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha } - (IBAction)selectOffscreenPointAnnotation:(id)sender { - id annotation = [self randomOffscreenPointAnnotation]; + id annotation = [self randomOffscreenPointAnnotation]; if (annotation) { [self.mapView selectAnnotation:annotation]; @@ -749,13 +749,13 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha - (IBAction) addAnimatedImageSource:(id)sender { - MGLImage *image = [[NSBundle bundleForClass:[self class]] imageForResource:@"southeast_0"]; + MLNImage *image = [[NSBundle bundleForClass:[self class]] imageForResource:@"southeast_0"]; - MGLCoordinateBounds bounds = { {22.551103322318994, -90.24006072802854}, {36.928147474567794, -75.1441643681673} }; - MGLImageSource *imageSource = [[MGLImageSource alloc] initWithIdentifier:@"animated-radar-source" coordinateQuad:MGLCoordinateQuadFromCoordinateBounds(bounds) image:image]; + MLNCoordinateBounds bounds = { {22.551103322318994, -90.24006072802854}, {36.928147474567794, -75.1441643681673} }; + MLNImageSource *imageSource = [[MLNImageSource alloc] initWithIdentifier:@"animated-radar-source" coordinateQuad:MLNCoordinateQuadFromCoordinateBounds(bounds) image:image]; [self.mapView.style addSource:imageSource]; - MGLRasterStyleLayer * imageLayer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"animated-radar-layer" source:imageSource]; + MLNRasterStyleLayer * imageLayer = [[MLNRasterStyleLayer alloc] initWithIdentifier:@"animated-radar-layer" source:imageSource]; [self.mapView.style addLayer:imageLayer]; [NSTimer scheduledTimerWithTimeInterval:1.0 @@ -768,9 +768,9 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha - (void)updateAnimatedImageSource:(NSTimer *)timer { static int radarSuffix = 0; - MGLImageSource *imageSource = (MGLImageSource *)timer.userInfo; + MLNImageSource *imageSource = (MLNImageSource *)timer.userInfo; - MGLImage *image = [[NSBundle bundleForClass:[self class]] imageForResource:[NSString stringWithFormat:@"southeast_%d", radarSuffix++]]; + MLNImage *image = [[NSBundle bundleForClass:[self class]] imageForResource:[NSString stringWithFormat:@"southeast_%d", radarSuffix++]]; [imageSource setValue:image forKey:@"image"]; if(radarSuffix > 3) { @@ -788,7 +788,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha } LimeGreenStyleLayer *layer = [[LimeGreenStyleLayer alloc] initWithIdentifier:@"mbx-custom"]; - MGLStyleLayer *houseNumberLayer = [self.mapView.style layerWithIdentifier:@"housenum-label"]; + MLNStyleLayer *houseNumberLayer = [self.mapView.style layerWithIdentifier:@"housenum-label"]; if (houseNumberLayer) { [self.mapView.style insertLayer:layer belowLayer:houseNumberLayer]; } else { @@ -805,7 +805,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha [self.undoManager setActionName:@"Delete Lime Green Layer"]; } - MGLStyleLayer *layer = [self.mapView.style layerWithIdentifier:@"mbx-custom"]; + MLNStyleLayer *layer = [self.mapView.style layerWithIdentifier:@"mbx-custom"]; [self.mapView.style removeLayer:layer]; } @@ -819,19 +819,19 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha } NSDictionary *sourceOptions = @{ - MGLShapeSourceOptionMaximumZoomLevel:@14, - MGLShapeSourceOptionWrapsCoordinates: @YES, - MGLShapeSourceOptionClipsCoordinates: @YES, + MLNShapeSourceOptionMaximumZoomLevel:@14, + MLNShapeSourceOptionWrapsCoordinates: @YES, + MLNShapeSourceOptionClipsCoordinates: @YES, }; - MGLComputedShapeSource *source = [[MGLComputedShapeSource alloc] initWithIdentifier:@"graticule" + MLNComputedShapeSource *source = [[MLNComputedShapeSource alloc] initWithIdentifier:@"graticule" options:sourceOptions]; source.dataSource = self; [self.mapView.style addSource:source]; - MGLLineStyleLayer *lineLayer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"graticule.lines" + MLNLineStyleLayer *lineLayer = [[MLNLineStyleLayer alloc] initWithIdentifier:@"graticule.lines" source:source]; [self.mapView.style addLayer:lineLayer]; - MGLSymbolStyleLayer *labelLayer = [[MGLSymbolStyleLayer alloc] initWithIdentifier:@"graticule.labels" + MLNSymbolStyleLayer *labelLayer = [[MLNSymbolStyleLayer alloc] initWithIdentifier:@"graticule.labels" source:source]; labelLayer.text = [NSExpression expressionWithFormat:@"value"]; [self.mapView.style addLayer:labelLayer]; @@ -846,25 +846,25 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha [self.undoManager setActionName:@"Delete Graticule"]; } - MGLStyleLayer *layer = [self.mapView.style layerWithIdentifier:@"graticule.lines"]; + MLNStyleLayer *layer = [self.mapView.style layerWithIdentifier:@"graticule.lines"]; [self.mapView.style removeLayer:layer]; layer = [self.mapView.style layerWithIdentifier:@"graticule.labels"]; [self.mapView.style removeLayer:layer]; - MGLSource *source = [self.mapView.style sourceWithIdentifier:@"graticule"]; + MLNSource *source = [self.mapView.style sourceWithIdentifier:@"graticule"]; [self.mapView.style removeSource:source]; } - (IBAction)enhanceTerrain:(id)sender { // Works only with Mapbox tileserver - if (![[MGLSettings tileServerOptions].uriSchemeAlias isEqualToString:@"mapbox"]) + if (![[MLNSettings tileServerOptions].uriSchemeAlias isEqualToString:@"mapbox"]) return; // Find all the identifiers of Mapbox Terrain sources used in the style. NSMutableSet *terrainSourceIdentifiers = [NSMutableSet set]; - for (MGLVectorTileSource *source in self.mapView.style.sources) { - if (![source isKindOfClass:[MGLVectorTileSource class]]) { + for (MLNVectorTileSource *source in self.mapView.style.sources) { + if (![source isKindOfClass:[MLNVectorTileSource class]]) { continue; } @@ -876,9 +876,9 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha // Find and remove all the style layers using those sources. NSUInteger hillshadeIndex = NSNotFound; NSEnumerator *layerEnumerator = self.mapView.style.layers.objectEnumerator; - MGLVectorStyleLayer *layer; + MLNVectorStyleLayer *layer; for (NSUInteger i = 0; (layer = layerEnumerator.nextObject); i++) { - if (![layer isKindOfClass:[MGLVectorStyleLayer class]]) { + if (![layer isKindOfClass:[MLNVectorStyleLayer class]]) { continue; } @@ -895,11 +895,11 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha // Add terrain-RGB source. NSURL *terrainRGBURL = [NSURL URLWithString:@"maptiler://sources/terrain-rgb"]; - MGLRasterDEMSource *terrainRGBSource = [[MGLRasterDEMSource alloc] initWithIdentifier:@"terrain" configurationURL:terrainRGBURL]; + MLNRasterDEMSource *terrainRGBSource = [[MLNRasterDEMSource alloc] initWithIdentifier:@"terrain" configurationURL:terrainRGBURL]; [self.mapView.style addSource:terrainRGBSource]; // Insert a hillshade layer where the Mapbox Terrain–based layers were. - MGLHillshadeStyleLayer *hillshadeLayer = [[MGLHillshadeStyleLayer alloc] initWithIdentifier:@"hillshade" source:terrainRGBSource]; + MLNHillshadeStyleLayer *hillshadeLayer = [[MLNHillshadeStyleLayer alloc] initWithIdentifier:@"hillshade" source:terrainRGBSource]; [self.mapView.style insertLayer:hillshadeLayer atIndex:hillshadeIndex]; } @@ -907,7 +907,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha - (IBAction)addOfflinePack:(id)sender { self.offlinePackNameField.stringValue = @""; - self.offlinePackNameField.placeholderString = MGLStringFromCoordinateBounds(self.mapView.visibleCoordinateBounds); + self.offlinePackNameField.placeholderString = MLNStringFromCoordinateBounds(self.mapView.visibleCoordinateBounds); self.minimumOfflinePackZoomLevelField.doubleValue = floor(self.mapView.zoomLevel); self.maximumOfflinePackZoomLevelField.doubleValue = ceil(self.mapView.maximumZoomLevel); self.minimumOfflinePackZoomLevelFormatter.minimum = @(floor(self.mapView.minimumZoomLevel)); @@ -915,7 +915,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha self.minimumOfflinePackZoomLevelFormatter.maximum = @(ceil(self.mapView.maximumZoomLevel)); self.maximumOfflinePackZoomLevelFormatter.maximum = @(ceil(self.mapView.maximumZoomLevel)); - id ideographicFontFamilyName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MGLIdeographicFontFamilyName"]; + id ideographicFontFamilyName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MLNIdeographicFontFamilyName"]; self.includesIdeographicGlyphsBox.state = ([ideographicFontFamilyName isKindOfClass:[NSNumber class]] && ![ideographicFontFamilyName boolValue]) ? NSOffState : NSOnState; [self.addOfflinePackWindow makeFirstResponder:self.offlinePackNameField]; @@ -926,8 +926,8 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha return; } - id region = - [[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:strongSelf.mapView.styleURL + id region = + [[MLNTilePyramidOfflineRegion alloc] initWithStyleURL:strongSelf.mapView.styleURL bounds:strongSelf.mapView.visibleCoordinateBounds fromZoomLevel:strongSelf.minimumOfflinePackZoomLevelField.integerValue toZoomLevel:strongSelf.maximumOfflinePackZoomLevelField.integerValue]; @@ -937,7 +937,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha name = strongSelf.offlinePackNameField.placeholderString; } NSData *context = [[NSValueTransformer valueTransformerForName:@"OfflinePackNameValueTransformer"] reverseTransformedValue:name]; - [[MGLOfflineStorage sharedOfflineStorage] addPackForRegion:region withContext:context completionHandler:^(MGLOfflinePack * _Nullable pack, NSError * _Nullable error) { + [[MLNOfflineStorage sharedOfflineStorage] addPackForRegion:region withContext:context completionHandler:^(MLNOfflinePack * _Nullable pack, NSError * _Nullable error) { if (error) { [[NSAlert alertWithError:error] runModal]; } else { @@ -967,13 +967,13 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha - (IBAction)manipulateStyle:(id)sender { // Works only with Mapbox tileserver - if (![[MGLSettings tileServerOptions].uriSchemeAlias isEqualToString:@"mapbox"]) + if (![[MLNSettings tileServerOptions].uriSchemeAlias isEqualToString:@"mapbox"]) return; - MGLTransition transition = { .duration = 5, .delay = 1 }; + MLNTransition transition = { .duration = 5, .delay = 1 }; self.mapView.style.transition = transition; - MGLStyleLayer *waterLayer = [self.mapView.style layerWithIdentifier:@"water"]; + MLNStyleLayer *waterLayer = [self.mapView.style layerWithIdentifier:@"water"]; NSExpression *colorExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{ @0.0: [NSColor redColor], @10.0: [NSColor yellowColor], @@ -988,21 +988,21 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha 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]; + MLNShapeSource *source = [[MLNShapeSource alloc] initWithIdentifier:@"ams" URL:geoJSONURL options:nil]; [self.mapView.style addSource:source]; - MGLCircleStyleLayer *circleLayer = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"test" source:source]; + MLNCircleStyleLayer *circleLayer = [[MLNCircleStyleLayer alloc] initWithIdentifier:@"test" source:source]; circleLayer.circleColor = [NSExpression expressionForConstantValue:[NSColor greenColor]]; circleLayer.circleRadius = [NSExpression expressionForConstantValue:@40]; // fillLayer.predicate = [NSPredicate predicateWithFormat:@"%K == %@", @"type", @"park"]; [self.mapView.style addLayer:circleLayer]; - MGLSource *streetsSource = [self.mapView.style sourceWithIdentifier:@"composite"]; + MLNSource *streetsSource = [self.mapView.style sourceWithIdentifier:@"composite"]; if (streetsSource) { NSImage *image = [NSImage imageNamed:NSImageNameIChatTheaterTemplate]; [self.mapView.style setImage:image forName:NSImageNameIChatTheaterTemplate]; - MGLSymbolStyleLayer *theaterLayer = [[MGLSymbolStyleLayer alloc] initWithIdentifier:@"theaters" source:streetsSource]; + MLNSymbolStyleLayer *theaterLayer = [[MLNSymbolStyleLayer alloc] initWithIdentifier:@"theaters" source:streetsSource]; theaterLayer.sourceLayerIdentifier = @"poi_label"; theaterLayer.predicate = [NSPredicate predicateWithFormat:@"maki == 'theatre'"]; theaterLayer.iconImageName = [NSExpression expressionForConstantValue:NSImageNameIChatTheaterTemplate]; @@ -1017,7 +1017,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha NSImage *ohio = [NSImage imageNamed:@"ohio"]; [self.mapView.style setImage:ohio forName:@"ohio"]; - MGLSymbolStyleLayer *ohioLayer = [[MGLSymbolStyleLayer alloc] initWithIdentifier:@"ohio" source:streetsSource]; + MLNSymbolStyleLayer *ohioLayer = [[MLNSymbolStyleLayer alloc] initWithIdentifier:@"ohio" source:streetsSource]; ohioLayer.sourceLayerIdentifier = @"road"; ohioLayer.predicate = [NSPredicate predicateWithFormat:@"shield = 'circle-white' and iso_3166_2 = 'US-OH'"]; ohioLayer.symbolPlacement = [NSExpression expressionForConstantValue:@"line"]; @@ -1033,17 +1033,17 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha } NSURL *imageURL = [NSURL URLWithString:@"https://maplibre.org/maplibre-gl-js-docs/assets/radar.gif"]; - MGLCoordinateQuad quad = { {46.437, -80.425}, + MLNCoordinateQuad quad = { {46.437, -80.425}, {37.936, -80.425}, {37.936, -71.516}, {46.437, -71.516} }; - MGLImageSource *imageSource = [[MGLImageSource alloc] initWithIdentifier:@"radar-source" coordinateQuad:quad URL:imageURL]; + MLNImageSource *imageSource = [[MLNImageSource alloc] initWithIdentifier:@"radar-source" coordinateQuad:quad URL:imageURL]; [self.mapView.style addSource:imageSource]; - MGLRasterStyleLayer * imageLayer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"radar-layer" source:imageSource]; + MLNRasterStyleLayer * imageLayer = [[MLNRasterStyleLayer alloc] initWithIdentifier:@"radar-layer" source:imageSource]; [self.mapView.style addLayer:imageLayer]; - MGLCircleStyleLayer *ucLayer = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"uc" source:streetsSource]; + MLNCircleStyleLayer *ucLayer = [[MLNCircleStyleLayer alloc] initWithIdentifier:@"uc" source:streetsSource]; ucLayer.sourceLayerIdentifier = @"poi_label"; ucLayer.predicate = [NSPredicate predicateWithFormat:@"$geometryType = 'Point'"]; CLLocationCoordinate2D ucCoordinates[] = { @@ -1053,7 +1053,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha { .latitude = 39.1360, .longitude = -84.5212 }, { .latitude = 39.1279, .longitude = -84.5209 }, }; - MGLPolygon *uc = [MGLPolygon polygonWithCoordinates:ucCoordinates count:sizeof(ucCoordinates) / sizeof(ucCoordinates[0])]; + MLNPolygon *uc = [MLNPolygon polygonWithCoordinates:ucCoordinates count:sizeof(ucCoordinates) / sizeof(ucCoordinates[0])]; ucLayer.circleOpacity = [NSExpression expressionWithFormat:@"TERNARY(SELF IN %@, 1, 0)", uc]; ucLayer.circleRadius = [NSExpression expressionForConstantValue:@5]; ucLayer.circleColor = [NSExpression expressionForConstantValue:NSColor.redColor]; @@ -1074,7 +1074,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha NSArray *features = [self.mapView visibleFeaturesAtPoint:point]; NSString *title; NSString *description; - for (id feature in features) { + for (id feature in features) { if (!title) { title = [feature attributeForKey:@"title"] ?: [feature attributeForKey:@"name_en"] ?: [feature attributeForKey:@"name"]; @@ -1128,7 +1128,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { if (menuItem.action == @selector(showStyle:)) { NSURL *styleURL = self.mapView.styleURL; - NSArray* predefinedStyles = [MGLStyle predefinedStyles]; + NSArray* predefinedStyles = [MLNStyle predefinedStyles]; NSCellStateValue state; if (menuItem.tag >= 1 && menuItem.tag <= (unsigned)[predefinedStyles count]) { NSURL* refStyleURL = [predefinedStyles objectAtIndex:menuItem.tag - 1].url; @@ -1179,7 +1179,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha menuItem.state = menuItem.tag == _isLocalizingLabels ? NSOnState: NSOffState; if (menuItem.tag) { NSLocale *locale = [NSLocale localeWithLocaleIdentifier:[NSBundle mainBundle].developmentLocalization]; - NSString *preferredLanguage = [MGLVectorTileSource preferredMapboxStreetsLanguage] ?: @"en"; + NSString *preferredLanguage = [MLNVectorTileSource preferredMapboxStreetsLanguage] ?: @"en"; menuItem.title = [locale displayNameForKey:NSLocaleIdentifier value:preferredLanguage]; } return YES; @@ -1188,12 +1188,12 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha return YES; } if (menuItem.action == @selector(dropPin:)) { - id annotationUnderCursor = [self.mapView annotationAtPoint:_mouseLocationForMapViewContextMenu]; + id annotationUnderCursor = [self.mapView annotationAtPoint:_mouseLocationForMapViewContextMenu]; menuItem.hidden = annotationUnderCursor != nil; return YES; } if (menuItem.action == @selector(removePin:)) { - id annotationUnderCursor = [self.mapView annotationAtPoint:_mouseLocationForMapViewContextMenu]; + id annotationUnderCursor = [self.mapView annotationAtPoint:_mouseLocationForMapViewContextMenu]; menuItem.hidden = annotationUnderCursor == nil; return YES; } @@ -1201,42 +1201,42 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha return YES; } if (menuItem.action == @selector(toggleTileBoundaries:)) { - BOOL isShown = self.mapView.debugMask & MGLMapDebugTileBoundariesMask; + BOOL isShown = self.mapView.debugMask & MLNMapDebugTileBoundariesMask; menuItem.title = isShown ? @"Hide Tile Boundaries" : @"Show Tile Boundaries"; return YES; } if (menuItem.action == @selector(toggleTileInfo:)) { - BOOL isShown = self.mapView.debugMask & MGLMapDebugTileInfoMask; + BOOL isShown = self.mapView.debugMask & MLNMapDebugTileInfoMask; menuItem.title = isShown ? @"Hide Tile Info" : @"Show Tile Info"; return YES; } if (menuItem.action == @selector(toggleTileTimestamps:)) { - BOOL isShown = self.mapView.debugMask & MGLMapDebugTimestampsMask; + BOOL isShown = self.mapView.debugMask & MLNMapDebugTimestampsMask; menuItem.title = isShown ? @"Hide Tile Timestamps" : @"Show Tile Timestamps"; return YES; } if (menuItem.action == @selector(toggleCollisionBoxes:)) { - BOOL isShown = self.mapView.debugMask & MGLMapDebugCollisionBoxesMask; + BOOL isShown = self.mapView.debugMask & MLNMapDebugCollisionBoxesMask; menuItem.title = isShown ? @"Hide Collision Boxes" : @"Show Collision Boxes"; return YES; } if (menuItem.action == @selector(toggleOverdrawVisualization:)) { - BOOL isShown = self.mapView.debugMask & MGLMapDebugOverdrawVisualizationMask; + BOOL isShown = self.mapView.debugMask & MLNMapDebugOverdrawVisualizationMask; menuItem.title = isShown ? @"Hide Overdraw Visualization" : @"Show Overdraw Visualization"; return YES; } if (menuItem.action == @selector(showColorBuffer:)) { - BOOL enabled = self.mapView.debugMask & (MGLMapDebugStencilBufferMask | MGLMapDebugDepthBufferMask); + BOOL enabled = self.mapView.debugMask & (MLNMapDebugStencilBufferMask | MLNMapDebugDepthBufferMask); menuItem.state = enabled ? NSOffState : NSOnState; return YES; } if (menuItem.action == @selector(showStencilBuffer:)) { - BOOL enabled = self.mapView.debugMask & MGLMapDebugStencilBufferMask; + BOOL enabled = self.mapView.debugMask & MLNMapDebugStencilBufferMask; menuItem.state = enabled ? NSOnState : NSOffState; return YES; } if (menuItem.action == @selector(showDepthBuffer:)) { - BOOL enabled = self.mapView.debugMask & MGLMapDebugDepthBufferMask; + BOOL enabled = self.mapView.debugMask & MLNMapDebugDepthBufferMask; menuItem.state = enabled ? NSOnState : NSOffState; return YES; } @@ -1299,7 +1299,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha - (NSUInteger)indexOfStyleInToolbarItem { NSMutableArray* styleURLs = [[NSMutableArray alloc] init]; - for (MGLDefaultStyle* defaultStyle in [MGLStyle predefinedStyles]) { + for (MLNDefaultStyle* defaultStyle in [MLNStyle predefinedStyles]) { [styleURLs addObject:defaultStyle.url]; } return [styleURLs indexOfObject:self.mapView.styleURL]; @@ -1313,7 +1313,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha SEL action = toolbarItem.action; if (action == @selector(showShareMenu:)) { [(NSButton *)toolbarItem.view sendActionOn:NSEventMaskLeftMouseDown]; - if (![MGLSettings apiKey]) { + if (![MLNSettings apiKey]) { return NO; } NSURL *styleURL = self.mapView.styleURL; @@ -1379,28 +1379,28 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha return YES; } -// MARK: MGLMapViewDelegate methods +// MARK: MLNMapViewDelegate methods -- (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style { +- (void)mapView:(MLNMapView *)mapView didFinishLoadingStyle:(MLNStyle *)style { [self updateLabels]; } -- (BOOL)mapView:(MGLMapView *)mapView annotationCanShowCallout:(id )annotation { +- (BOOL)mapView:(MLNMapView *)mapView annotationCanShowCallout:(id )annotation { return YES; } -- (MGLAnnotationImage *)mapView:(MGLMapView *)mapView imageForAnnotation:(id )annotation { - MGLAnnotationImage *annotationImage = [self.mapView dequeueReusableAnnotationImageWithIdentifier:MGLDroppedPinAnnotationImageIdentifier]; +- (MLNAnnotationImage *)mapView:(MLNMapView *)mapView imageForAnnotation:(id )annotation { + MLNAnnotationImage *annotationImage = [self.mapView dequeueReusableAnnotationImageWithIdentifier:MLNDroppedPinAnnotationImageIdentifier]; if (!annotationImage) { - NSString *imagePath = [[NSBundle bundleForClass:[MGLMapView class]] + NSString *imagePath = [[NSBundle bundleForClass:[MLNMapView class]] pathForResource:@"default_marker" ofType:@"pdf"]; NSImage *image = [[NSImage alloc] initWithContentsOfFile:imagePath]; NSRect alignmentRect = image.alignmentRect; alignmentRect.origin.y = NSMidY(alignmentRect); alignmentRect.size.height /= 2; image.alignmentRect = alignmentRect; - annotationImage = [MGLAnnotationImage annotationImageWithImage:image - reuseIdentifier:MGLDroppedPinAnnotationImageIdentifier]; + annotationImage = [MLNAnnotationImage annotationImageWithImage:image + reuseIdentifier:MLNDroppedPinAnnotationImageIdentifier]; } if (_randomizesCursorsOnDroppedPins) { NSArray *cursors = @[ @@ -1421,47 +1421,47 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha return annotationImage; } -- (void)mapView:(MGLMapView *)mapView didSelectAnnotation:(id )annotation { +- (void)mapView:(MLNMapView *)mapView didSelectAnnotation:(id )annotation { if ([annotation isKindOfClass:[DroppedPinAnnotation class]]) { DroppedPinAnnotation *droppedPin = (DroppedPinAnnotation *)annotation; [droppedPin resume]; } } -- (void)mapView:(MGLMapView *)mapView didDeselectAnnotation:(id )annotation { +- (void)mapView:(MLNMapView *)mapView didDeselectAnnotation:(id )annotation { if ([annotation isKindOfClass:[DroppedPinAnnotation class]]) { DroppedPinAnnotation *droppedPin = (DroppedPinAnnotation *)annotation; [droppedPin pause]; } } -- (CGFloat)mapView:(MGLMapView *)mapView alphaForShapeAnnotation:(MGLShape *)annotation { +- (CGFloat)mapView:(MLNMapView *)mapView alphaForShapeAnnotation:(MLNShape *)annotation { return 0.8; } -// MARK: MGLMapSnapshotterDelegate methods +// MARK: MLNMapSnapshotterDelegate methods -- (void)mapSnapshotter:(MGLMapSnapshotter *)snapshotter didFinishLoadingStyle:(MGLStyle *)style { +- (void)mapSnapshotter:(MLNMapSnapshotter *)snapshotter didFinishLoadingStyle:(MLNStyle *)style { [style localizeLabelsIntoLocale:_isLocalizingLabels ? nil : [NSLocale localeWithLocaleIdentifier:@"mul"]]; // Layers hidden in the sidebar should be hidden in the snapshot too. NSMutableArray *hiddenLayerIdentifiers = [NSMutableArray array]; - for (MGLStyleLayer *layer in self.mapView.style.layers) { + for (MLNStyleLayer *layer in self.mapView.style.layers) { if (!layer.visible) { [hiddenLayerIdentifiers addObject:layer.identifier]; } } NSSet *hiddenLayerIdentifierSet = [NSSet setWithArray:hiddenLayerIdentifiers]; - for (MGLStyleLayer *layer in style.layers) { + for (MLNStyleLayer *layer in style.layers) { if ([hiddenLayerIdentifierSet containsObject:layer.identifier]) { layer.visible = NO; } } } -// MARK: - MGLComputedShapeSourceDataSource -- (NSArray>*)featuresInCoordinateBounds:(MGLCoordinateBounds)bounds zoomLevel:(NSUInteger)zoom { +// MARK: - MLNComputedShapeSourceDataSource +- (NSArray>*)featuresInCoordinateBounds:(MLNCoordinateBounds)bounds zoomLevel:(NSUInteger)zoom { double gridSpacing; if(zoom >= 13) { gridSpacing = 0.01; @@ -1485,13 +1485,13 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha gridSpacing = 20; } - NSMutableArray > * features = [NSMutableArray array]; + NSMutableArray > * features = [NSMutableArray array]; CLLocationCoordinate2D coords[2]; for (double y = ceil(bounds.ne.latitude / gridSpacing) * gridSpacing; y >= floor(bounds.sw.latitude / gridSpacing) * gridSpacing; y -= gridSpacing) { coords[0] = CLLocationCoordinate2DMake(y, bounds.sw.longitude); coords[1] = CLLocationCoordinate2DMake(y, bounds.ne.longitude); - MGLPolylineFeature *feature = [MGLPolylineFeature polylineWithCoordinates:coords count:2]; + MLNPolylineFeature *feature = [MLNPolylineFeature polylineWithCoordinates:coords count:2]; feature.attributes = @{@"value": @(y)}; [features addObject:feature]; } @@ -1499,7 +1499,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha for (double x = floor(bounds.sw.longitude / gridSpacing) * gridSpacing; x <= ceil(bounds.ne.longitude / gridSpacing) * gridSpacing; x += gridSpacing) { coords[0] = CLLocationCoordinate2DMake(bounds.sw.latitude, x); coords[1] = CLLocationCoordinate2DMake(bounds.ne.latitude, x); - MGLPolylineFeature *feature = [MGLPolylineFeature polylineWithCoordinates:coords count:2]; + MLNPolylineFeature *feature = [MLNPolylineFeature polylineWithCoordinates:coords count:2]; feature.attributes = @{@"value": @(x)}; [features addObject:feature]; } diff --git a/platform/ios/platform/macos/app/StyleLayerIconTransformer.m b/platform/ios/platform/macos/app/StyleLayerIconTransformer.m index c08916592..bbf6d34d3 100644 --- a/platform/ios/platform/macos/app/StyleLayerIconTransformer.m +++ b/platform/ios/platform/macos/app/StyleLayerIconTransformer.m @@ -12,32 +12,32 @@ return NO; } -- (id)transformedValue:(MGLStyleLayer *)layer { - if ([layer isKindOfClass:[MGLBackgroundStyleLayer class]]) { +- (id)transformedValue:(MLNStyleLayer *)layer { + if ([layer isKindOfClass:[MLNBackgroundStyleLayer class]]) { return [NSImage imageNamed:@"background"]; } - if ([layer isKindOfClass:[MGLCircleStyleLayer class]]) { + if ([layer isKindOfClass:[MLNCircleStyleLayer class]]) { return [NSImage imageNamed:@"circle"]; } - if ([layer isKindOfClass:[MGLFillStyleLayer class]]) { + if ([layer isKindOfClass:[MLNFillStyleLayer class]]) { return [NSImage imageNamed:@"fill"]; } - if ([layer isKindOfClass:[MGLFillExtrusionStyleLayer class]]) { + if ([layer isKindOfClass:[MLNFillExtrusionStyleLayer class]]) { return [NSImage imageNamed:@"fill-extrusion"]; } - if ([layer isKindOfClass:[MGLLineStyleLayer class]]) { + if ([layer isKindOfClass:[MLNLineStyleLayer class]]) { return [NSImage imageNamed:@"NSListViewTemplate"]; } - if ([layer isKindOfClass:[MGLRasterStyleLayer class]]) { + if ([layer isKindOfClass:[MLNRasterStyleLayer class]]) { return [[NSWorkspace sharedWorkspace] iconForFileType:@"jpg"]; } - if ([layer isKindOfClass:[MGLSymbolStyleLayer class]]) { + if ([layer isKindOfClass:[MLNSymbolStyleLayer class]]) { return [NSImage imageNamed:@"symbol"]; } - if ([layer isKindOfClass:[MGLHeatmapStyleLayer class]]) { + if ([layer isKindOfClass:[MLNHeatmapStyleLayer class]]) { return [NSImage imageNamed:@"heatmap"]; } - if ([layer isKindOfClass:[MGLHillshadeStyleLayer class]]) { + if ([layer isKindOfClass:[MLNHillshadeStyleLayer class]]) { return [NSImage imageNamed:@"hillshade"]; } diff --git a/platform/ios/platform/macos/core-files.json b/platform/ios/platform/macos/core-files.json index b0536c486..02cb1be86 100644 --- a/platform/ios/platform/macos/core-files.json +++ b/platform/ios/platform/macos/core-files.json @@ -22,7 +22,7 @@ ], "public_headers": { "mbgl/storage/reachability.h": "platform/darwin/include/mbgl/storage/reachability.h", - "mbgl/util/image+MGLAdditions.hpp": "platform/darwin/include/mbgl/util/image+MGLAdditions.hpp", + "mbgl/util/image+MLNAdditions.hpp": "platform/darwin/include/mbgl/util/image+MLNAdditions.hpp", "mbgl/gfx/headless_backend.hpp": "platform/default/include/mbgl/gfx/headless_backend.hpp", "mbgl/gfx/headless_frontend.hpp": "platform/default/include/mbgl/gfx/headless_frontend.hpp", "mbgl/gl/headless_backend.hpp": "platform/default/include/mbgl/gl/headless_backend.hpp", diff --git a/platform/ios/platform/macos/docs/guides/Info.plist Keys.md b/platform/ios/platform/macos/docs/guides/Info.plist Keys.md index 8a84b1912..1ef9826ef 100644 --- a/platform/ios/platform/macos/docs/guides/Info.plist Keys.md +++ b/platform/ios/platform/macos/docs/guides/Info.plist Keys.md @@ -2,38 +2,38 @@ The Mapbox Maps SDK for macOS supports custom `Info.plist` keys in your application in order to configure various settings. -## MGLApiKey +## MLNApiKey -Some vector tiles servers require a API key. Set the API key to be used by all instances of `MGLMapView` in the current application. +Some vector tiles servers require a API key. Set the API key to be used by all instances of `MLNMapView` in the current application. -As an alternative, you can use `MGLSettings.accessToken` to set a token in code. See [our guide](https://www.mapbox.com/help/ios-private-access-token/) for some tips on keeping access tokens in open source code private. +As an alternative, you can use `MLNSettings.accessToken` to set a token in code. See [our guide](https://www.mapbox.com/help/ios-private-access-token/) for some tips on keeping access tokens in open source code private. -## MGLTileServerBaseURL +## MLNTileServerBaseURL Use this key if you need to customize the API base URL used throughout the SDK. -## MGLIdeographicFontFamilyName +## MLNIdeographicFontFamilyName This key configures a global fallback font or fonts for [client-side text rendering](customizing-fonts.html#client-side-fonts) of Chinese hanzi, Japanese kana, and Korean hangul characters (CJK) that appear in text labels. -If the fonts you specify in the `MGLSymbolStyleLayer.textFontNames` property are all unavailable or lack a glyph for rendering a given CJK character, the map uses the contents of this key to choose a [system font](https://developer.apple.com/fonts/system-fonts/) or a font [bundled with your application](https://developer.apple.com/documentation/bundleresources/information_property_list/atsapplicationfontspath). This key specifies a fallback for all style layers in all map views and map snapshots. If you do not specify this key or none of the font names matches, the map applies a font from the system’s font cascade list, which may vary based on the system language and other installed applications. +If the fonts you specify in the `MLNSymbolStyleLayer.textFontNames` property are all unavailable or lack a glyph for rendering a given CJK character, the map uses the contents of this key to choose a [system font](https://developer.apple.com/fonts/system-fonts/) or a font [bundled with your application](https://developer.apple.com/documentation/bundleresources/information_property_list/atsapplicationfontspath). This key specifies a fallback for all style layers in all map views and map snapshots. If you do not specify this key or none of the font names matches, the map applies a font from the system’s font cascade list, which may vary based on the system language and other installed applications. This key can either be set to a single string or an array of strings, which the map tries to apply in order from most preferred to least preferred. Each string can be a family name (for example, “PingFang TC”), display name (“PingFang TC Ultralight”), or PostScript name (“PingFangTC-Ultralight”). To disable client-side rendering of CJK characters in favor of [server-side rendering](customizing-fonts.html#server-side-fonts), set this key to the Boolean value `NO`. -## MGLOfflineStorageDatabasePath +## MLNOfflineStorageDatabasePath -This key customizes the file path at which `MGLOfflineStorage` keeps the offline map database, which contains any offline packs as well as the ambient cache. Most applications should not need to customize this path; however, you could customize it to implement a migration path between different versions of your application. +This key customizes the file path at which `MLNOfflineStorage` keeps the offline map database, which contains any offline packs as well as the ambient cache. Most applications should not need to customize this path; however, you could customize it to implement a migration path between different versions of your application. The key is interpreted as either an absolute file path or a file path relative to the main bundle’s resource folder, resolving any tilde or symbolic link. The path must be writable. If a database does not exist at the path you specify, one will be created automatically. An offline map database can consume a significant amount of the user’s bandwidth and iCloud storage due to iCloud backups. To exclude the database from backups, set the containing directory’s `NSURLIsExcludedFromBackupKey` resource property to the Boolean value `YES` using the `-[NSURL setResourceValue:forKey:error:]` method. The entire directory will be affected, not just the database file. If the user restores the application from a backup, your application will need to restore any offline packs that had been previously downloaded. -At runtime, you can obtain the value of this key using the `MGLOfflineStorage.databasePath` and `MGLOfflineStorage.databaseURL` properties. +At runtime, you can obtain the value of this key using the `MLNOfflineStorage.databasePath` and `MLNOfflineStorage.databaseURL` properties. -## MGLCollisionBehaviorPre4_0 +## MLNCollisionBehaviorPre4_0 -If this key is set to YES (`true`), collision detection is performed only between symbol style layers based on the same source, as in versions 0.1–0.7 of the Mapbox Maps SDK for iOS. In other words, symbols in an `MGLSymbolStyleLayer` based on one source (for example, an `MGLShapeSource`) may overlap with symbols in another layer that is based on a different source (such as the Mapbox Streets source). This is the case regardless of the `MGLSymbolStyleLayer.iconAllowsOverlap`, `MGLSymbolStyleLayer.iconIgnoresPlacement`, `MGLSymbolStyleLayer.textAllowsOverlap`, and `MGLSymbolStyleLayer.textIgnoresPlacement` properties. +If this key is set to YES (`true`), collision detection is performed only between symbol style layers based on the same source, as in versions 0.1–0.7 of the Mapbox Maps SDK for iOS. In other words, symbols in an `MLNSymbolStyleLayer` based on one source (for example, an `MLNShapeSource`) may overlap with symbols in another layer that is based on a different source (such as the Mapbox Streets source). This is the case regardless of the `MLNSymbolStyleLayer.iconAllowsOverlap`, `MLNSymbolStyleLayer.iconIgnoresPlacement`, `MLNSymbolStyleLayer.textAllowsOverlap`, and `MLNSymbolStyleLayer.textIgnoresPlacement` properties. -Beginning in version 0.7, the SDK also performs collision detection between style layers based on different sources by default. For the default behavior, omit the `MGLCollisionBehaviorPre4_0` key or set it to NO (`false`). This property is so named because version 0.7 of the Mapbox Maps SDK for macOS corresponds to version 4.0 of the Mapbox Maps SDK for iOS. +Beginning in version 0.7, the SDK also performs collision detection between style layers based on different sources by default. For the default behavior, omit the `MLNCollisionBehaviorPre4_0` key or set it to NO (`false`). This property is so named because version 0.7 of the Mapbox Maps SDK for macOS corresponds to version 4.0 of the Mapbox Maps SDK for iOS. diff --git a/platform/ios/platform/macos/docs/pod-README.md b/platform/ios/platform/macos/docs/pod-README.md index 212f6f9ea..9fc1db9c9 100644 --- a/platform/ios/platform/macos/docs/pod-README.md +++ b/platform/ios/platform/macos/docs/pod-README.md @@ -48,13 +48,13 @@ where _x.y_ is the current version. In Terminal, run `pod install`. ## Usage -Some vector tiles servers require a API key. In the project editor, select the application target, then go to the Info tab. Under the Info section, Under the “Custom macOS Application Target Properties” section, set `MGLApiKey` to your api key. +Some vector tiles servers require a API key. In the project editor, select the application target, then go to the Info tab. Under the Info section, Under the “Custom macOS Application Target Properties” section, set `MLNApiKey` to your api key. Then, in a storyboard or XIB: 1. Add a view to your view controller or window. (Drag Custom View from the Object library to the View Controller scene on the Interface Builder canvas. In a XIB, drag it instead to the window on the canvas.) -2. In the Identity inspector, set the view’s custom class to `MGLMapView`. -3. MGLMapView needs to be layer-backed: +2. In the Identity inspector, set the view’s custom class to `MLNMapView`. +3. MLNMapView needs to be layer-backed: * You can make the window layer-backed by selecting the window and checking Full Size Content View in the Attributes inspector. This allows the map view to underlap the title bar and toolbar. * Alternatively, if you don’t want the entire window to be layer-backed, you can make just the map view layer-backed by selecting it and checking its entry under the View Effects inspector’s Core Animation Layer section. 4. Add a map feedback item to your Help menu. (Drag Menu Item from the Object library into Main Menu ‣ Help ‣ Menu.) Title it “Improve This Map” or similar, and connect it to the `giveFeedback:` action of First Responder. @@ -71,7 +71,7 @@ If you need to manipulate the map view programmatically: @interface ViewController : NSViewController -@property (strong) IBOutlet MGLMapView *mapView; +@property (strong) IBOutlet MLNMapView *mapView; @end ``` @@ -81,7 +81,7 @@ If you need to manipulate the map view programmatically: import Mapbox class ViewController: NSViewController { - @IBOutlet var mapView: MGLMapView! + @IBOutlet var mapView: MLNMapView! } ``` diff --git a/platform/ios/platform/macos/jazzy.yml b/platform/ios/platform/macos/jazzy.yml index 8850bac2d..176f78a8b 100644 --- a/platform/ios/platform/macos/jazzy.yml +++ b/platform/ios/platform/macos/jazzy.yml @@ -26,94 +26,94 @@ custom_categories: - Info.plist Keys - name: Maps children: - - MGLSettings - - MGLMapCamera - - MGLMapView - - MGLMapViewDelegate - - MGLMapSnapshot - - MGLMapSnapshotOptions - - MGLMapSnapshotter + - MLNSettings + - MLNMapCamera + - MLNMapView + - MLNMapViewDelegate + - MLNMapSnapshot + - MLNMapSnapshotOptions + - MLNMapSnapshotter - name: Shapes and Annotations children: - - MGLAnnotation - - MGLAnnotationImage - - MGLOverlay - - MGLShape - - MGLMultiPoint - - MGLPointAnnotation - - MGLPointCollection - - MGLPolygon - - MGLPolyline - - MGLMultiPolygon - - MGLMultiPolyline - - MGLShapeCollection + - MLNAnnotation + - MLNAnnotationImage + - MLNOverlay + - MLNShape + - MLNMultiPoint + - MLNPointAnnotation + - MLNPointCollection + - MLNPolygon + - MLNPolyline + - MLNMultiPolygon + - MLNMultiPolyline + - MLNShapeCollection - name: Styling the Map children: - - MGLStyle - - MGLLight + - MLNStyle + - MLNLight - name: Content Primitives children: - - MGLFeature - - MGLPointFeature - - MGLPolygonFeature - - MGLPolylineFeature - - MGLMultiPolygonFeature - - MGLMultiPolylineFeature - - MGLPointCollectionFeature - - MGLShapeCollectionFeature + - MLNFeature + - MLNPointFeature + - MLNPolygonFeature + - MLNPolylineFeature + - MLNMultiPolygonFeature + - MLNMultiPolylineFeature + - MLNPointCollectionFeature + - MLNShapeCollectionFeature - name: Content Sources children: - - MGLSource - - MGLShapeSource - - MGLComputedShapeSource - - MGLTileSource - - MGLRasterTileSource - - MGLRasterDEMSource - - MGLVectorTileSource - - MGLImageSource + - MLNSource + - MLNShapeSource + - MLNComputedShapeSource + - MLNTileSource + - MLNRasterTileSource + - MLNRasterDEMSource + - MLNVectorTileSource + - MLNImageSource - name: Style Layers children: - - MGLStyleLayer - - MGLForegroundStyleLayer - - MGLBackgroundStyleLayer - - MGLRasterStyleLayer - - MGLVectorStyleLayer - - MGLCircleStyleLayer - - MGLFillStyleLayer - - MGLFillExtrusionStyleLayer - - MGLHeatmapStyleLayer - - MGLHillshadeStyleLayer - - MGLLineStyleLayer - - MGLSymbolStyleLayer + - MLNStyleLayer + - MLNForegroundStyleLayer + - MLNBackgroundStyleLayer + - MLNRasterStyleLayer + - MLNVectorStyleLayer + - MLNCircleStyleLayer + - MLNFillStyleLayer + - MLNFillExtrusionStyleLayer + - MLNHeatmapStyleLayer + - MLNHillshadeStyleLayer + - MLNLineStyleLayer + - MLNSymbolStyleLayer - name: Offline Maps children: - - MGLOfflineRegion - - MGLOfflineStorage - - MGLOfflinePack - - MGLOfflinePackProgress - - MGLOfflinePackState - - MGLTilePyramidOfflineRegion - - MGLShapeOfflineRegion + - MLNOfflineRegion + - MLNOfflineStorage + - MLNOfflinePack + - MLNOfflinePackProgress + - MLNOfflinePackState + - MLNTilePyramidOfflineRegion + - MLNShapeOfflineRegion - name: Geometry children: - - MGLCoordinateBounds - - MGLCoordinateBoundsEqualToCoordinateBounds - - MGLCoordinateBoundsGetCoordinateSpan - - MGLCoordinateBoundsIntersectsCoordinateBounds - - MGLCoordinateBoundsIsEmpty - - MGLCoordinateBoundsMake - - MGLCoordinateBoundsOffset - - MGLCoordinateInCoordinateBounds - - MGLCoordinateSpan - - MGLCoordinateSpanEqualToCoordinateSpan - - MGLCoordinateSpanMake - - MGLCoordinateSpanZero - - MGLDegreesFromRadians - - MGLRadiansFromDegrees - - MGLStringFromCoordinateBounds + - MLNCoordinateBounds + - MLNCoordinateBoundsEqualToCoordinateBounds + - MLNCoordinateBoundsGetCoordinateSpan + - MLNCoordinateBoundsIntersectsCoordinateBounds + - MLNCoordinateBoundsIsEmpty + - MLNCoordinateBoundsMake + - MLNCoordinateBoundsOffset + - MLNCoordinateInCoordinateBounds + - MLNCoordinateSpan + - MLNCoordinateSpanEqualToCoordinateSpan + - MLNCoordinateSpanMake + - MLNCoordinateSpanZero + - MLNDegreesFromRadians + - MLNRadiansFromDegrees + - MLNStringFromCoordinateBounds - name: Formatters children: - - MGLClockDirectionFormatter - - MGLCompassDirectionFormatter - - MGLCoordinateFormatter - - MGLDistanceFormatter + - MLNClockDirectionFormatter + - MLNCompassDirectionFormatter + - MLNCoordinateFormatter + - MLNDistanceFormatter diff --git a/platform/ios/platform/macos/macos.xcodeproj/project.pbxproj b/platform/ios/platform/macos/macos.xcodeproj/project.pbxproj index b4e838523..3dfe1a1a7 100644 --- a/platform/ios/platform/macos/macos.xcodeproj/project.pbxproj +++ b/platform/ios/platform/macos/macos.xcodeproj/project.pbxproj @@ -7,220 +7,220 @@ objects = { /* Begin PBXBuildFile section */ - 0721493F1EE200E900085505 /* MGLImageSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 07A019EB1ED662D800ACD43E /* MGLImageSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 076171C5213A0DC200668A35 /* MGLMapViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 076171C4213A0DC200668A35 /* MGLMapViewTests.m */; }; - 07A019EF1ED665CD00ACD43E /* MGLImageSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07A019EC1ED662D800ACD43E /* MGLImageSource.mm */; }; - 07A240941F675674002C8210 /* MGLComputedShapeSourceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 07A240921F67566F002C8210 /* MGLComputedShapeSourceTests.m */; }; - 07BA4CAC1EE21887004528F5 /* MGLImageSourceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BA4CAB1EE21887004528F5 /* MGLImageSourceTests.m */; }; - 07D9474D1F67441B00E37934 /* MGLComputedShapeSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 07D947471F6741F500E37934 /* MGLComputedShapeSource_Private.h */; }; - 07F8E2F71F674C8800F794BB /* MGLComputedShapeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F8E2F41F674C8000F794BB /* MGLComputedShapeSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 07F8E2F81F674C9000F794BB /* MGLComputedShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07F8E2F51F674C8000F794BB /* MGLComputedShapeSource.mm */; }; - 170A82BF201BDD1B00943087 /* MGLHeatmapStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 170A82BE201BDD1B00943087 /* MGLHeatmapStyleLayerTests.mm */; }; - 170A82C4201FB6EC00943087 /* MGLHeatmapColorTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 170A82C2201FAFF800943087 /* MGLHeatmapColorTests.mm */; }; - 1753ED401E53CE6100A9FD90 /* MGLConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1753ED3F1E53CE5200A9FD90 /* MGLConversion.h */; }; - 1F2B94C3221E22E600210640 /* MGLNetworkConfiguration_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F2B94C2221E22E500210640 /* MGLNetworkConfiguration_Private.h */; }; - 1F7454A31ECFB00300021D39 /* MGLLight_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F7454A01ECFB00300021D39 /* MGLLight_Private.h */; }; - 1F7454A41ECFB00300021D39 /* MGLLight.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F7454A11ECFB00300021D39 /* MGLLight.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1F7454A51ECFB00300021D39 /* MGLLight.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F7454A21ECFB00300021D39 /* MGLLight.mm */; }; - 1F7454AB1ED1DDBD00021D39 /* MGLLightTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F7454AA1ED1DDBD00021D39 /* MGLLightTest.mm */; }; + 0721493F1EE200E900085505 /* MLNImageSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 07A019EB1ED662D800ACD43E /* MLNImageSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 076171C5213A0DC200668A35 /* MLNMapViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 076171C4213A0DC200668A35 /* MLNMapViewTests.m */; }; + 07A019EF1ED665CD00ACD43E /* MLNImageSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07A019EC1ED662D800ACD43E /* MLNImageSource.mm */; }; + 07A240941F675674002C8210 /* MLNComputedShapeSourceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 07A240921F67566F002C8210 /* MLNComputedShapeSourceTests.m */; }; + 07BA4CAC1EE21887004528F5 /* MLNImageSourceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BA4CAB1EE21887004528F5 /* MLNImageSourceTests.m */; }; + 07D9474D1F67441B00E37934 /* MLNComputedShapeSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 07D947471F6741F500E37934 /* MLNComputedShapeSource_Private.h */; }; + 07F8E2F71F674C8800F794BB /* MLNComputedShapeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F8E2F41F674C8000F794BB /* MLNComputedShapeSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 07F8E2F81F674C9000F794BB /* MLNComputedShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07F8E2F51F674C8000F794BB /* MLNComputedShapeSource.mm */; }; + 170A82BF201BDD1B00943087 /* MLNHeatmapStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 170A82BE201BDD1B00943087 /* MLNHeatmapStyleLayerTests.mm */; }; + 170A82C4201FB6EC00943087 /* MLNHeatmapColorTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 170A82C2201FAFF800943087 /* MLNHeatmapColorTests.mm */; }; + 1753ED401E53CE6100A9FD90 /* MLNConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1753ED3F1E53CE5200A9FD90 /* MLNConversion.h */; }; + 1F2B94C3221E22E600210640 /* MLNNetworkConfiguration_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F2B94C2221E22E500210640 /* MLNNetworkConfiguration_Private.h */; }; + 1F7454A31ECFB00300021D39 /* MLNLight_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F7454A01ECFB00300021D39 /* MLNLight_Private.h */; }; + 1F7454A41ECFB00300021D39 /* MLNLight.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F7454A11ECFB00300021D39 /* MLNLight.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1F7454A51ECFB00300021D39 /* MLNLight.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F7454A21ECFB00300021D39 /* MLNLight.mm */; }; + 1F7454AB1ED1DDBD00021D39 /* MLNLightTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F7454AA1ED1DDBD00021D39 /* MLNLightTest.mm */; }; 1F8A59FA21653483004DFE75 /* sideload_sat.db in Resources */ = {isa = PBXBuildFile; fileRef = 1F8A59F921653483004DFE75 /* sideload_sat.db */; }; - 1F8A5A04216D4696004DFE75 /* MGLLoggingConfiguration_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F8A5A01216D4695004DFE75 /* MGLLoggingConfiguration_Private.h */; }; - 1F8A5A06216D4696004DFE75 /* MGLLoggingConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F8A5A03216D4696004DFE75 /* MGLLoggingConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1F95931B1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F95931A1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm */; }; + 1F8A5A04216D4696004DFE75 /* MLNLoggingConfiguration_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F8A5A01216D4695004DFE75 /* MLNLoggingConfiguration_Private.h */; }; + 1F8A5A06216D4696004DFE75 /* MLNLoggingConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F8A5A03216D4696004DFE75 /* MLNLoggingConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1F95931B1E6DE2B600D5B294 /* MLNNSDateAdditionsTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F95931A1E6DE2B600D5B294 /* MLNNSDateAdditionsTests.mm */; }; 1F9EF4061FBA1B0E0063FBB0 /* mapbox_helmet.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 1F9EF4051FBA1B0D0063FBB0 /* mapbox_helmet.pdf */; }; - 1FC481852098F323000D09B4 /* NSPredicate+MGLPrivateAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FC481842098F323000D09B4 /* NSPredicate+MGLPrivateAdditions.h */; }; - 1FF4858D2237235300F19727 /* MGLAttributedExpression.m in Sources */ = {isa = PBXBuildFile; fileRef = 1FF4858B2237235200F19727 /* MGLAttributedExpression.m */; }; - 1FF4858E2237235300F19727 /* MGLAttributedExpression.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FF4858C2237235200F19727 /* MGLAttributedExpression.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3508EC641D749D39009B0EE4 /* NSExpression+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3508EC621D749D39009B0EE4 /* NSExpression+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3508EC651D749D39009B0EE4 /* NSExpression+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3508EC631D749D39009B0EE4 /* NSExpression+MGLAdditions.mm */; }; - 3526EABD1DF9B19800006B43 /* MGLCodingTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3526EABC1DF9B19800006B43 /* MGLCodingTests.mm */; }; - 352742781D4C220900A1ECE6 /* MGLStyleValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 352742771D4C220900A1ECE6 /* MGLStyleValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 352742811D4C243B00A1ECE6 /* MGLSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 3527427F1D4C243B00A1ECE6 /* MGLSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 352742821D4C243B00A1ECE6 /* MGLSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 352742801D4C243B00A1ECE6 /* MGLSource.mm */; }; - 352742851D4C244700A1ECE6 /* MGLRasterTileSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 352742831D4C244700A1ECE6 /* MGLRasterTileSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 352742861D4C244700A1ECE6 /* MGLRasterTileSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 352742841D4C244700A1ECE6 /* MGLRasterTileSource.mm */; }; - 352742891D4C245800A1ECE6 /* MGLShapeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 352742871D4C245800A1ECE6 /* MGLShapeSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3527428A1D4C245800A1ECE6 /* MGLShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 352742881D4C245800A1ECE6 /* MGLShapeSource.mm */; }; - 3527428D1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3527428B1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3527428E1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3527428C1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.mm */; }; - 352742A11D4C25BD00A1ECE6 /* MGLStyleValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3527429E1D4C25BD00A1ECE6 /* MGLStyleValue.mm */; }; - 3529039B1D6C63B80002C7DF /* NSPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 352903991D6C63B80002C7DF /* NSPredicate+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3529039C1D6C63B80002C7DF /* NSPredicate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3529039A1D6C63B80002C7DF /* NSPredicate+MGLAdditions.mm */; }; - 3537CA741D3F93A600380318 /* MGLStyle_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3537CA731D3F93A600380318 /* MGLStyle_Private.h */; }; - 3538AA231D542685008EC33D /* MGLStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3538AA211D542685008EC33D /* MGLStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3538AA241D542685008EC33D /* MGLStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3538AA221D542685008EC33D /* MGLStyleLayer.mm */; }; + 1FC481852098F323000D09B4 /* NSPredicate+MLNPrivateAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FC481842098F323000D09B4 /* NSPredicate+MLNPrivateAdditions.h */; }; + 1FF4858D2237235300F19727 /* MLNAttributedExpression.m in Sources */ = {isa = PBXBuildFile; fileRef = 1FF4858B2237235200F19727 /* MLNAttributedExpression.m */; }; + 1FF4858E2237235300F19727 /* MLNAttributedExpression.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FF4858C2237235200F19727 /* MLNAttributedExpression.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3508EC641D749D39009B0EE4 /* NSExpression+MLNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3508EC621D749D39009B0EE4 /* NSExpression+MLNAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3508EC651D749D39009B0EE4 /* NSExpression+MLNAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3508EC631D749D39009B0EE4 /* NSExpression+MLNAdditions.mm */; }; + 3526EABD1DF9B19800006B43 /* MLNCodingTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3526EABC1DF9B19800006B43 /* MLNCodingTests.mm */; }; + 352742781D4C220900A1ECE6 /* MLNStyleValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 352742771D4C220900A1ECE6 /* MLNStyleValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 352742811D4C243B00A1ECE6 /* MLNSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 3527427F1D4C243B00A1ECE6 /* MLNSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 352742821D4C243B00A1ECE6 /* MLNSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 352742801D4C243B00A1ECE6 /* MLNSource.mm */; }; + 352742851D4C244700A1ECE6 /* MLNRasterTileSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 352742831D4C244700A1ECE6 /* MLNRasterTileSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 352742861D4C244700A1ECE6 /* MLNRasterTileSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 352742841D4C244700A1ECE6 /* MLNRasterTileSource.mm */; }; + 352742891D4C245800A1ECE6 /* MLNShapeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 352742871D4C245800A1ECE6 /* MLNShapeSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3527428A1D4C245800A1ECE6 /* MLNShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 352742881D4C245800A1ECE6 /* MLNShapeSource.mm */; }; + 3527428D1D4C24AB00A1ECE6 /* MLNCircleStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3527428B1D4C24AB00A1ECE6 /* MLNCircleStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3527428E1D4C24AB00A1ECE6 /* MLNCircleStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3527428C1D4C24AB00A1ECE6 /* MLNCircleStyleLayer.mm */; }; + 352742A11D4C25BD00A1ECE6 /* MLNStyleValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3527429E1D4C25BD00A1ECE6 /* MLNStyleValue.mm */; }; + 3529039B1D6C63B80002C7DF /* NSPredicate+MLNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 352903991D6C63B80002C7DF /* NSPredicate+MLNAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3529039C1D6C63B80002C7DF /* NSPredicate+MLNAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3529039A1D6C63B80002C7DF /* NSPredicate+MLNAdditions.mm */; }; + 3537CA741D3F93A600380318 /* MLNStyle_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3537CA731D3F93A600380318 /* MLNStyle_Private.h */; }; + 3538AA231D542685008EC33D /* MLNStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3538AA211D542685008EC33D /* MLNStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3538AA241D542685008EC33D /* MLNStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3538AA221D542685008EC33D /* MLNStyleLayer.mm */; }; 353BAEF81D6463B8009A8DA9 /* amsterdam.geojson in Resources */ = {isa = PBXBuildFile; fileRef = 358EB3AE1D61F0DB00E46D9C /* amsterdam.geojson */; }; - 355BA4ED1D41633E00CCC6D5 /* NSColor+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 355BA4EB1D41633E00CCC6D5 /* NSColor+MGLAdditions.h */; }; - 355BA4EE1D41633E00CCC6D5 /* NSColor+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 355BA4EC1D41633E00CCC6D5 /* NSColor+MGLAdditions.mm */; }; - 35602BFA1D3EA99F0050646F /* MGLFillStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 35602BF81D3EA99F0050646F /* MGLFillStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35602BFB1D3EA99F0050646F /* MGLFillStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35602BF91D3EA99F0050646F /* MGLFillStyleLayer.mm */; }; - 35602BFF1D3EA9B40050646F /* MGLStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 35602BFC1D3EA9B40050646F /* MGLStyleLayer_Private.h */; }; - 35602C001D3EA9B40050646F /* MGLForegroundStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 35602BFD1D3EA9B40050646F /* MGLForegroundStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35602C011D3EA9B40050646F /* MGLForegroundStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35602BFE1D3EA9B40050646F /* MGLForegroundStyleLayer.mm */; }; + 355BA4ED1D41633E00CCC6D5 /* NSColor+MLNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 355BA4EB1D41633E00CCC6D5 /* NSColor+MLNAdditions.h */; }; + 355BA4EE1D41633E00CCC6D5 /* NSColor+MLNAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 355BA4EC1D41633E00CCC6D5 /* NSColor+MLNAdditions.mm */; }; + 35602BFA1D3EA99F0050646F /* MLNFillStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 35602BF81D3EA99F0050646F /* MLNFillStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 35602BFB1D3EA99F0050646F /* MLNFillStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35602BF91D3EA99F0050646F /* MLNFillStyleLayer.mm */; }; + 35602BFF1D3EA9B40050646F /* MLNStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 35602BFC1D3EA9B40050646F /* MLNStyleLayer_Private.h */; }; + 35602C001D3EA9B40050646F /* MLNForegroundStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 35602BFD1D3EA9B40050646F /* MLNForegroundStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 35602C011D3EA9B40050646F /* MLNForegroundStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35602BFE1D3EA9B40050646F /* MLNForegroundStyleLayer.mm */; }; 35724FC41D630502002A4AB4 /* amsterdam.geojson in Resources */ = {isa = PBXBuildFile; fileRef = 358EB3AE1D61F0DB00E46D9C /* amsterdam.geojson */; }; - 359819591E02F611008FC139 /* NSCoder+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 359819571E02F611008FC139 /* NSCoder+MGLAdditions.h */; }; - 3598195A1E02F611008FC139 /* NSCoder+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 359819581E02F611008FC139 /* NSCoder+MGLAdditions.mm */; }; - 35C5D8471D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C5D8431D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.h */; }; - 35C5D8481D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35C5D8441D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.mm */; }; - 35C5D8491D6DD66D00E95907 /* NSCompoundPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C5D8451D6DD66D00E95907 /* NSCompoundPredicate+MGLAdditions.h */; }; - 35C5D84A1D6DD66D00E95907 /* NSCompoundPredicate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35C5D8461D6DD66D00E95907 /* NSCompoundPredicate+MGLAdditions.mm */; }; - 35C6DF841E214C0400ACA483 /* MGLDistanceFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C6DF821E214C0400ACA483 /* MGLDistanceFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35C6DF851E214C0400ACA483 /* MGLDistanceFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6DF831E214C0400ACA483 /* MGLDistanceFormatter.m */; }; - 35C6DF871E214C1800ACA483 /* MGLDistanceFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6DF861E214C1800ACA483 /* MGLDistanceFormatterTests.m */; }; - 35D65C5A1D65AD5500722C23 /* NSDate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35D65C581D65AD5500722C23 /* NSDate+MGLAdditions.h */; }; - 35D65C5B1D65AD5500722C23 /* NSDate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35D65C591D65AD5500722C23 /* NSDate+MGLAdditions.mm */; }; + 359819591E02F611008FC139 /* NSCoder+MLNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 359819571E02F611008FC139 /* NSCoder+MLNAdditions.h */; }; + 3598195A1E02F611008FC139 /* NSCoder+MLNAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 359819581E02F611008FC139 /* NSCoder+MLNAdditions.mm */; }; + 35C5D8471D6DD66D00E95907 /* NSComparisonPredicate+MLNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C5D8431D6DD66D00E95907 /* NSComparisonPredicate+MLNAdditions.h */; }; + 35C5D8481D6DD66D00E95907 /* NSComparisonPredicate+MLNAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35C5D8441D6DD66D00E95907 /* NSComparisonPredicate+MLNAdditions.mm */; }; + 35C5D8491D6DD66D00E95907 /* NSCompoundPredicate+MLNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C5D8451D6DD66D00E95907 /* NSCompoundPredicate+MLNAdditions.h */; }; + 35C5D84A1D6DD66D00E95907 /* NSCompoundPredicate+MLNAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35C5D8461D6DD66D00E95907 /* NSCompoundPredicate+MLNAdditions.mm */; }; + 35C6DF841E214C0400ACA483 /* MLNDistanceFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C6DF821E214C0400ACA483 /* MLNDistanceFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 35C6DF851E214C0400ACA483 /* MLNDistanceFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6DF831E214C0400ACA483 /* MLNDistanceFormatter.m */; }; + 35C6DF871E214C1800ACA483 /* MLNDistanceFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6DF861E214C1800ACA483 /* MLNDistanceFormatterTests.m */; }; + 35D65C5A1D65AD5500722C23 /* NSDate+MLNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35D65C581D65AD5500722C23 /* NSDate+MLNAdditions.h */; }; + 35D65C5B1D65AD5500722C23 /* NSDate+MLNAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35D65C591D65AD5500722C23 /* NSDate+MLNAdditions.mm */; }; 3E6465D9206576A900685536 /* LimeGreenStyleLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E6465D7206576A800685536 /* LimeGreenStyleLayer.m */; }; - 3EA9317388DC9A0BF46B7674 /* MGLRendererConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA9369A4C46957566058822 /* MGLRendererConfiguration.h */; }; - 3EA93BA38DBB4B814B6C1FCC /* MGLRendererConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EA93B1B0864609938506E12 /* MGLRendererConfiguration.m */; }; - 4031ACFC1E9EB3C100A3EA26 /* MGLMapViewDelegateIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4031ACFB1E9EB3C100A3EA26 /* MGLMapViewDelegateIntegrationTests.swift */; }; - 4031AD031E9FD6AA00A3EA26 /* MGLSDKTestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4031AD011E9FD6A300A3EA26 /* MGLSDKTestHelpers.swift */; }; - 4049C2A51DB6CE7F00B3F799 /* MGLPointCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 4049C2A11DB6CE7800B3F799 /* MGLPointCollection.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4049C2AD1DB8020600B3F799 /* MGLPointCollection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4049C2A71DB6D09B00B3F799 /* MGLPointCollection.mm */; }; - 408AA85B1DAEECFE00022900 /* MGLShape_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 408AA85A1DAEECF100022900 /* MGLShape_Private.h */; }; - 408AA8671DAEEE3900022900 /* NSDictionary+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 408AA85F1DAEED3300022900 /* NSDictionary+MGLAdditions.h */; }; - 408AA86A1DAEEE5D00022900 /* NSDictionary+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 408AA85E1DAEED3300022900 /* NSDictionary+MGLAdditions.mm */; }; - 40ABDB561DB0022100372083 /* NSImage+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 405C03971DB0004E001AC280 /* NSImage+MGLAdditions.mm */; }; - 40B77E451DB11BC9003DA2FE /* NSArray+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 40B77E431DB11BB0003DA2FE /* NSArray+MGLAdditions.h */; }; - 40B77E461DB11BCD003DA2FE /* NSArray+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 40B77E421DB11BB0003DA2FE /* NSArray+MGLAdditions.mm */; }; - 40E1601D1DF217D6005EA6D9 /* MGLStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 40E1601B1DF216E6005EA6D9 /* MGLStyleLayerTests.m */; }; - 4BBCDC4D265260FF004106C3 /* MGLTileServerOptions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BBCDC49265260FE004106C3 /* MGLTileServerOptions.mm */; }; - 4BBCDC4E265260FF004106C3 /* MGLDefaultStyle.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BBCDC4A265260FF004106C3 /* MGLDefaultStyle.mm */; }; - 4BBCDC4F265260FF004106C3 /* MGLTileServerOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BBCDC4B265260FF004106C3 /* MGLTileServerOptions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4BBCDC50265260FF004106C3 /* MGLDefaultStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BBCDC4C265260FF004106C3 /* MGLDefaultStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 55335DF9212EC542000CE5F8 /* NSImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 405C03961DB0004E001AC280 /* NSImage+MGLAdditions.h */; }; + 3EA9317388DC9A0BF46B7674 /* MLNRendererConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA9369A4C46957566058822 /* MLNRendererConfiguration.h */; }; + 3EA93BA38DBB4B814B6C1FCC /* MLNRendererConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EA93B1B0864609938506E12 /* MLNRendererConfiguration.m */; }; + 4031ACFC1E9EB3C100A3EA26 /* MLNMapViewDelegateIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4031ACFB1E9EB3C100A3EA26 /* MLNMapViewDelegateIntegrationTests.swift */; }; + 4031AD031E9FD6AA00A3EA26 /* MLNSDKTestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4031AD011E9FD6A300A3EA26 /* MLNSDKTestHelpers.swift */; }; + 4049C2A51DB6CE7F00B3F799 /* MLNPointCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 4049C2A11DB6CE7800B3F799 /* MLNPointCollection.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4049C2AD1DB8020600B3F799 /* MLNPointCollection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4049C2A71DB6D09B00B3F799 /* MLNPointCollection.mm */; }; + 408AA85B1DAEECFE00022900 /* MLNShape_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 408AA85A1DAEECF100022900 /* MLNShape_Private.h */; }; + 408AA8671DAEEE3900022900 /* NSDictionary+MLNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 408AA85F1DAEED3300022900 /* NSDictionary+MLNAdditions.h */; }; + 408AA86A1DAEEE5D00022900 /* NSDictionary+MLNAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 408AA85E1DAEED3300022900 /* NSDictionary+MLNAdditions.mm */; }; + 40ABDB561DB0022100372083 /* NSImage+MLNAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 405C03971DB0004E001AC280 /* NSImage+MLNAdditions.mm */; }; + 40B77E451DB11BC9003DA2FE /* NSArray+MLNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 40B77E431DB11BB0003DA2FE /* NSArray+MLNAdditions.h */; }; + 40B77E461DB11BCD003DA2FE /* NSArray+MLNAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 40B77E421DB11BB0003DA2FE /* NSArray+MLNAdditions.mm */; }; + 40E1601D1DF217D6005EA6D9 /* MLNStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 40E1601B1DF216E6005EA6D9 /* MLNStyleLayerTests.m */; }; + 4BBCDC4D265260FF004106C3 /* MLNTileServerOptions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BBCDC49265260FE004106C3 /* MLNTileServerOptions.mm */; }; + 4BBCDC4E265260FF004106C3 /* MLNDefaultStyle.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BBCDC4A265260FF004106C3 /* MLNDefaultStyle.mm */; }; + 4BBCDC4F265260FF004106C3 /* MLNTileServerOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BBCDC4B265260FF004106C3 /* MLNTileServerOptions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4BBCDC50265260FF004106C3 /* MLNDefaultStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BBCDC4C265260FF004106C3 /* MLNDefaultStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 55335DF9212EC542000CE5F8 /* NSImage+MLNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 405C03961DB0004E001AC280 /* NSImage+MLNAdditions.h */; }; 5548BE781D09E718005DDE81 /* libmbgl-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAE6C3451CC31D1200DB3429 /* libmbgl-core.a */; }; - 556660C61E1BEA0100E2C41B /* MGLFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 556660C51E1BEA0100E2C41B /* MGLFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 556660D61E1D07E400E2C41B /* MGLVersionNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 556660D51E1D07E400E2C41B /* MGLVersionNumber.m */; }; - 558DE7A61E56161C00C7916D /* MGLFoundation_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 558DE7A41E56161C00C7916D /* MGLFoundation_Private.h */; }; - 558DE7A71E56161C00C7916D /* MGLFoundation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 558DE7A51E56161C00C7916D /* MGLFoundation.mm */; }; - 5591AC6A2298361600FF9ADF /* MGLMapView+Impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 5591AC682298361600FF9ADF /* MGLMapView+Impl.h */; }; - 5591AC6B2298361600FF9ADF /* MGLMapView+Impl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5591AC692298361600FF9ADF /* MGLMapView+Impl.mm */; }; - 55CAF6322294407F00F17770 /* MGLMapView+OpenGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 55CAF6312294407F00F17770 /* MGLMapView+OpenGL.h */; }; - 55CAF6342294409B00F17770 /* MGLMapView+OpenGL.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55CAF6332294409B00F17770 /* MGLMapView+OpenGL.mm */; }; + 556660C61E1BEA0100E2C41B /* MLNFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 556660C51E1BEA0100E2C41B /* MLNFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556660D61E1D07E400E2C41B /* MLNVersionNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 556660D51E1D07E400E2C41B /* MLNVersionNumber.m */; }; + 558DE7A61E56161C00C7916D /* MLNFoundation_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 558DE7A41E56161C00C7916D /* MLNFoundation_Private.h */; }; + 558DE7A71E56161C00C7916D /* MLNFoundation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 558DE7A51E56161C00C7916D /* MLNFoundation.mm */; }; + 5591AC6A2298361600FF9ADF /* MLNMapView+Impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 5591AC682298361600FF9ADF /* MLNMapView+Impl.h */; }; + 5591AC6B2298361600FF9ADF /* MLNMapView+Impl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5591AC692298361600FF9ADF /* MLNMapView+Impl.mm */; }; + 55CAF6322294407F00F17770 /* MLNMapView+OpenGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 55CAF6312294407F00F17770 /* MLNMapView+OpenGL.h */; }; + 55CAF6342294409B00F17770 /* MLNMapView+OpenGL.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55CAF6332294409B00F17770 /* MLNMapView+OpenGL.mm */; }; 55CF7533213EDADF00ED86C4 /* libmbgl-vendor-icu.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55CF7532213EDADF00ED86C4 /* libmbgl-vendor-icu.a */; }; - 55E2AD111E5B0A6900E8C587 /* MGLOfflineStorageTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55E2AD101E5B0A6900E8C587 /* MGLOfflineStorageTests.mm */; }; - 747ABE59219B2BDB00523B67 /* MGLFillExtrusionStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE54219B2BDA00523B67 /* MGLFillExtrusionStyleLayer_Private.h */; }; - 747ABE5A219B2BDB00523B67 /* MGLCircleStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE55219B2BDA00523B67 /* MGLCircleStyleLayer_Private.h */; }; - 747ABE5B219B2BDB00523B67 /* MGLBackgroundStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE56219B2BDB00523B67 /* MGLBackgroundStyleLayer_Private.h */; }; - 747ABE5C219B2BDB00523B67 /* MGLFillStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE57219B2BDB00523B67 /* MGLFillStyleLayer_Private.h */; }; - 747ABE5D219B2BDB00523B67 /* MGLHeatmapStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE58219B2BDB00523B67 /* MGLHeatmapStyleLayer_Private.h */; }; - 747ABE5F219B2BED00523B67 /* MGLHillshadeStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE5E219B2BED00523B67 /* MGLHillshadeStyleLayer_Private.h */; }; - 747ABE61219B2C0000523B67 /* MGLLineStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE60219B2C0000523B67 /* MGLLineStyleLayer_Private.h */; }; - 747ABE64219B2C1800523B67 /* MGLOpenGLStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE62219B2C1700523B67 /* MGLOpenGLStyleLayer_Private.h */; }; - 747ABE65219B2C1800523B67 /* MGLRasterStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE63219B2C1700523B67 /* MGLRasterStyleLayer_Private.h */; }; - 747ABE67219B2C3200523B67 /* MGLSymbolStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE66219B2C3200523B67 /* MGLSymbolStyleLayer_Private.h */; }; - 749EC8912199CCB9005608D7 /* MGLStyleLayerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 749EC88F2199CCB8005608D7 /* MGLStyleLayerManager.h */; }; - 749EC8932199CCB9005608D7 /* MGLStyleLayerManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 749EC8902199CCB9005608D7 /* MGLStyleLayerManager.mm */; }; + 55E2AD111E5B0A6900E8C587 /* MLNOfflineStorageTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55E2AD101E5B0A6900E8C587 /* MLNOfflineStorageTests.mm */; }; + 747ABE59219B2BDB00523B67 /* MLNFillExtrusionStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE54219B2BDA00523B67 /* MLNFillExtrusionStyleLayer_Private.h */; }; + 747ABE5A219B2BDB00523B67 /* MLNCircleStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE55219B2BDA00523B67 /* MLNCircleStyleLayer_Private.h */; }; + 747ABE5B219B2BDB00523B67 /* MLNBackgroundStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE56219B2BDB00523B67 /* MLNBackgroundStyleLayer_Private.h */; }; + 747ABE5C219B2BDB00523B67 /* MLNFillStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE57219B2BDB00523B67 /* MLNFillStyleLayer_Private.h */; }; + 747ABE5D219B2BDB00523B67 /* MLNHeatmapStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE58219B2BDB00523B67 /* MLNHeatmapStyleLayer_Private.h */; }; + 747ABE5F219B2BED00523B67 /* MLNHillshadeStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE5E219B2BED00523B67 /* MLNHillshadeStyleLayer_Private.h */; }; + 747ABE61219B2C0000523B67 /* MLNLineStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE60219B2C0000523B67 /* MLNLineStyleLayer_Private.h */; }; + 747ABE64219B2C1800523B67 /* MLNOpenGLStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE62219B2C1700523B67 /* MLNOpenGLStyleLayer_Private.h */; }; + 747ABE65219B2C1800523B67 /* MLNRasterStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE63219B2C1700523B67 /* MLNRasterStyleLayer_Private.h */; }; + 747ABE67219B2C3200523B67 /* MLNSymbolStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 747ABE66219B2C3200523B67 /* MLNSymbolStyleLayer_Private.h */; }; + 749EC8912199CCB9005608D7 /* MLNStyleLayerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 749EC88F2199CCB8005608D7 /* MLNStyleLayerManager.h */; }; + 749EC8932199CCB9005608D7 /* MLNStyleLayerManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 749EC8902199CCB9005608D7 /* MLNStyleLayerManager.mm */; }; 89462399200D199100DA8EF2 /* heatmap.json in Resources */ = {isa = PBXBuildFile; fileRef = 89462398200D199100DA8EF2 /* heatmap.json */; }; - 8946239D200E744800DA8EF2 /* MGLHeatmapStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8946239A200E73CA00DA8EF2 /* MGLHeatmapStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 894623A0200E748000DA8EF2 /* MGLHeatmapStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8946239B200E73CA00DA8EF2 /* MGLHeatmapStyleLayer.mm */; }; - 92092EF01F5EB10E00AF5130 /* MGLMapSnapshotter.h in Headers */ = {isa = PBXBuildFile; fileRef = 92092EEE1F5EB10E00AF5130 /* MGLMapSnapshotter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 92092EF11F5EB10E00AF5130 /* MGLMapSnapshotter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 92092EEF1F5EB10E00AF5130 /* MGLMapSnapshotter.mm */; }; - 920A3E591E6F859D00C16EFC /* MGLSourceQueryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 920A3E581E6F859D00C16EFC /* MGLSourceQueryTests.m */; }; - 9221BAAF20699CBB0054BDF4 /* MGLTilePyramidOfflineRegion_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 9221BAAE20699CBA0054BDF4 /* MGLTilePyramidOfflineRegion_Private.h */; }; - 9250B8C32073C69100EF338C /* MGLShapeOfflineRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = 9250B8C22073C69000EF338C /* MGLShapeOfflineRegion.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 92F2C3EB1F0E3A1900268EC0 /* MGLRendererFrontend.h in Headers */ = {isa = PBXBuildFile; fileRef = 92F2C3EA1F0E3A1900268EC0 /* MGLRendererFrontend.h */; }; - 92FC0AE4207CC8DA007B6B54 /* MGLShapeOfflineRegion_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 92FC0AE3207CC8DA007B6B54 /* MGLShapeOfflineRegion_Private.h */; }; - 92FC0AE6207CDD8D007B6B54 /* MGLShapeOfflineRegion.mm in Sources */ = {isa = PBXBuildFile; fileRef = 92FC0AE5207CDD8D007B6B54 /* MGLShapeOfflineRegion.mm */; }; - 9654C12B1FFC38E000DB6A19 /* MGLPolyline_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 9654C12A1FFC38E000DB6A19 /* MGLPolyline_Private.h */; }; - 9654C12D1FFC394700DB6A19 /* MGLPolygon_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 9654C12C1FFC394700DB6A19 /* MGLPolygon_Private.h */; }; + 8946239D200E744800DA8EF2 /* MLNHeatmapStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8946239A200E73CA00DA8EF2 /* MLNHeatmapStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 894623A0200E748000DA8EF2 /* MLNHeatmapStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8946239B200E73CA00DA8EF2 /* MLNHeatmapStyleLayer.mm */; }; + 92092EF01F5EB10E00AF5130 /* MLNMapSnapshotter.h in Headers */ = {isa = PBXBuildFile; fileRef = 92092EEE1F5EB10E00AF5130 /* MLNMapSnapshotter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 92092EF11F5EB10E00AF5130 /* MLNMapSnapshotter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 92092EEF1F5EB10E00AF5130 /* MLNMapSnapshotter.mm */; }; + 920A3E591E6F859D00C16EFC /* MLNSourceQueryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 920A3E581E6F859D00C16EFC /* MLNSourceQueryTests.m */; }; + 9221BAAF20699CBB0054BDF4 /* MLNTilePyramidOfflineRegion_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 9221BAAE20699CBA0054BDF4 /* MLNTilePyramidOfflineRegion_Private.h */; }; + 9250B8C32073C69100EF338C /* MLNShapeOfflineRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = 9250B8C22073C69000EF338C /* MLNShapeOfflineRegion.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 92F2C3EB1F0E3A1900268EC0 /* MLNRendererFrontend.h in Headers */ = {isa = PBXBuildFile; fileRef = 92F2C3EA1F0E3A1900268EC0 /* MLNRendererFrontend.h */; }; + 92FC0AE4207CC8DA007B6B54 /* MLNShapeOfflineRegion_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 92FC0AE3207CC8DA007B6B54 /* MLNShapeOfflineRegion_Private.h */; }; + 92FC0AE6207CDD8D007B6B54 /* MLNShapeOfflineRegion.mm in Sources */ = {isa = PBXBuildFile; fileRef = 92FC0AE5207CDD8D007B6B54 /* MLNShapeOfflineRegion.mm */; }; + 9654C12B1FFC38E000DB6A19 /* MLNPolyline_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 9654C12A1FFC38E000DB6A19 /* MLNPolyline_Private.h */; }; + 9654C12D1FFC394700DB6A19 /* MLNPolygon_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 9654C12C1FFC394700DB6A19 /* MLNPolygon_Private.h */; }; 96E027311E57C9A7004B8E66 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 96E027331E57C9A7004B8E66 /* Localizable.strings */; }; - CA0B3C072329F7E700E4B493 /* MGLTestAssertionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = CA0B3C052329F7E600E4B493 /* MGLTestAssertionHandler.m */; }; - CA0B3C092329FB4800E4B493 /* MGLOfflinePackTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = CA0B3C082329FB4800E4B493 /* MGLOfflinePackTests.mm */; }; - CA4045C7216720D700B356E1 /* MGLCluster.h in Headers */ = {isa = PBXBuildFile; fileRef = CA4045C4216720D700B356E1 /* MGLCluster.h */; settings = {ATTRIBUTES = (Public, ); }; }; - CA8FBC0D21A4A74300D1203C /* MGLRendererConfigurationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CA8FBC0C21A4A74300D1203C /* MGLRendererConfigurationTests.m */; }; - CA9461A620884CCB0015EB12 /* MGLAnnotationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CA9461A520884CCB0015EB12 /* MGLAnnotationTests.m */; }; - CAD9D0AC22A88A32001B25EE /* MGLResourceTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = CAD9D0AB22A88A32001B25EE /* MGLResourceTests.mm */; }; - CF762DEF22DC7EFF00338472 /* MGLLoggingConfiguration.mm in Sources */ = {isa = PBXBuildFile; fileRef = CF762DEE22DC7EFF00338472 /* MGLLoggingConfiguration.mm */; }; - DA00FC8A1D5EEAC3009AABC8 /* MGLAttributionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = DA00FC881D5EEAC3009AABC8 /* MGLAttributionInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DA00FC8B1D5EEAC3009AABC8 /* MGLAttributionInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA00FC891D5EEAC3009AABC8 /* MGLAttributionInfo.mm */; }; - DA0CD58E1CF56F5800A5F5A5 /* MGLFeatureTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA0CD58D1CF56F5800A5F5A5 /* MGLFeatureTests.mm */; }; - DA0E9F3B24119F6B007C75D4 /* MGLImageTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA0E9F3A24119F6B007C75D4 /* MGLImageTests.mm */; }; + CA0B3C072329F7E700E4B493 /* MLNTestAssertionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = CA0B3C052329F7E600E4B493 /* MLNTestAssertionHandler.m */; }; + CA0B3C092329FB4800E4B493 /* MLNOfflinePackTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = CA0B3C082329FB4800E4B493 /* MLNOfflinePackTests.mm */; }; + CA4045C7216720D700B356E1 /* MLNCluster.h in Headers */ = {isa = PBXBuildFile; fileRef = CA4045C4216720D700B356E1 /* MLNCluster.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA8FBC0D21A4A74300D1203C /* MLNRendererConfigurationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CA8FBC0C21A4A74300D1203C /* MLNRendererConfigurationTests.m */; }; + CA9461A620884CCB0015EB12 /* MLNAnnotationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CA9461A520884CCB0015EB12 /* MLNAnnotationTests.m */; }; + CAD9D0AC22A88A32001B25EE /* MLNResourceTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = CAD9D0AB22A88A32001B25EE /* MLNResourceTests.mm */; }; + CF762DEF22DC7EFF00338472 /* MLNLoggingConfiguration.mm in Sources */ = {isa = PBXBuildFile; fileRef = CF762DEE22DC7EFF00338472 /* MLNLoggingConfiguration.mm */; }; + DA00FC8A1D5EEAC3009AABC8 /* MLNAttributionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = DA00FC881D5EEAC3009AABC8 /* MLNAttributionInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DA00FC8B1D5EEAC3009AABC8 /* MLNAttributionInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA00FC891D5EEAC3009AABC8 /* MLNAttributionInfo.mm */; }; + DA0CD58E1CF56F5800A5F5A5 /* MLNFeatureTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA0CD58D1CF56F5800A5F5A5 /* MLNFeatureTests.mm */; }; + DA0E9F3B24119F6B007C75D4 /* MLNImageTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA0E9F3A24119F6B007C75D4 /* MLNImageTests.mm */; }; DA2784FE1DF03060001D5B8D /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DA2784FD1DF03060001D5B8D /* Media.xcassets */; }; - DA29875A1E1A4290002299F5 /* MGLDocumentationExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA2987591E1A4290002299F5 /* MGLDocumentationExampleTests.swift */; }; - DA35A2A41CC9EB1A00E826B2 /* MGLCoordinateFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = DA35A2A31CC9EB1A00E826B2 /* MGLCoordinateFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DA35A2A61CC9EB2700E826B2 /* MGLCoordinateFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35A2A51CC9EB2700E826B2 /* MGLCoordinateFormatter.m */; }; - DA35A2A81CC9F41600E826B2 /* MGLCoordinateFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35A2A71CC9F41600E826B2 /* MGLCoordinateFormatterTests.m */; }; - DA35A2AD1CCA091800E826B2 /* MGLCompassDirectionFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = DA35A2AB1CCA091800E826B2 /* MGLCompassDirectionFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DA35A2AE1CCA091800E826B2 /* MGLCompassDirectionFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35A2AC1CCA091800E826B2 /* MGLCompassDirectionFormatter.m */; }; - DA35A2B61CCA14D700E826B2 /* MGLCompassDirectionFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35A2B51CCA14D700E826B2 /* MGLCompassDirectionFormatterTests.m */; }; - DA35A2BF1CCA9B1A00E826B2 /* MGLClockDirectionFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = DA35A2BD1CCA9B1A00E826B2 /* MGLClockDirectionFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DA35A2C01CCA9B1A00E826B2 /* MGLClockDirectionFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35A2BE1CCA9B1A00E826B2 /* MGLClockDirectionFormatter.m */; }; - DA35A2C21CCA9F4A00E826B2 /* MGLClockDirectionFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35A2C11CCA9F4A00E826B2 /* MGLClockDirectionFormatterTests.m */; }; - DA35A2CF1CCAAED300E826B2 /* NSValue+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA35A2CD1CCAAED300E826B2 /* NSValue+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DA35A2D01CCAAED300E826B2 /* NSValue+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35A2CE1CCAAED300E826B2 /* NSValue+MGLAdditions.m */; }; + DA29875A1E1A4290002299F5 /* MLNDocumentationExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA2987591E1A4290002299F5 /* MLNDocumentationExampleTests.swift */; }; + DA35A2A41CC9EB1A00E826B2 /* MLNCoordinateFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = DA35A2A31CC9EB1A00E826B2 /* MLNCoordinateFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DA35A2A61CC9EB2700E826B2 /* MLNCoordinateFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35A2A51CC9EB2700E826B2 /* MLNCoordinateFormatter.m */; }; + DA35A2A81CC9F41600E826B2 /* MLNCoordinateFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35A2A71CC9F41600E826B2 /* MLNCoordinateFormatterTests.m */; }; + DA35A2AD1CCA091800E826B2 /* MLNCompassDirectionFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = DA35A2AB1CCA091800E826B2 /* MLNCompassDirectionFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DA35A2AE1CCA091800E826B2 /* MLNCompassDirectionFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35A2AC1CCA091800E826B2 /* MLNCompassDirectionFormatter.m */; }; + DA35A2B61CCA14D700E826B2 /* MLNCompassDirectionFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35A2B51CCA14D700E826B2 /* MLNCompassDirectionFormatterTests.m */; }; + DA35A2BF1CCA9B1A00E826B2 /* MLNClockDirectionFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = DA35A2BD1CCA9B1A00E826B2 /* MLNClockDirectionFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DA35A2C01CCA9B1A00E826B2 /* MLNClockDirectionFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35A2BE1CCA9B1A00E826B2 /* MLNClockDirectionFormatter.m */; }; + DA35A2C21CCA9F4A00E826B2 /* MLNClockDirectionFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35A2C11CCA9F4A00E826B2 /* MLNClockDirectionFormatterTests.m */; }; + DA35A2CF1CCAAED300E826B2 /* NSValue+MLNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA35A2CD1CCAAED300E826B2 /* NSValue+MLNAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DA35A2D01CCAAED300E826B2 /* NSValue+MLNAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35A2CE1CCAAED300E826B2 /* NSValue+MLNAdditions.m */; }; DA35D08A1E1A631B007DED41 /* one-liner.json in Resources */ = {isa = PBXBuildFile; fileRef = DA35D0891E1A631B007DED41 /* one-liner.json */; }; - DA35D9C6240916380013ECB0 /* MGLReachability.h in Headers */ = {isa = PBXBuildFile; fileRef = DA35D9C4240916370013ECB0 /* MGLReachability.h */; }; - DA35D9C7240916380013ECB0 /* MGLReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35D9C5240916380013ECB0 /* MGLReachability.m */; }; + DA35D9C6240916380013ECB0 /* MLNReachability.h in Headers */ = {isa = PBXBuildFile; fileRef = DA35D9C4240916370013ECB0 /* MLNReachability.h */; }; + DA35D9C7240916380013ECB0 /* MLNReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35D9C5240916380013ECB0 /* MLNReachability.m */; }; DA35D9C92409205B0013ECB0 /* libmbgl-vendor-csscolorparser.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA35D9C82409205B0013ECB0 /* libmbgl-vendor-csscolorparser.a */; }; DA35D9CB240920640013ECB0 /* libmbgl-vendor-parsedate.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA35D9CA240920640013ECB0 /* libmbgl-vendor-parsedate.a */; }; DA35D9D3240925BD0013ECB0 /* libmbgl-vendor-csscolorparser.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA35D9C82409205B0013ECB0 /* libmbgl-vendor-csscolorparser.a */; }; - DA551B821DB496AC0009AFAF /* MGLTileSource.h in Headers */ = {isa = PBXBuildFile; fileRef = DA551B7F1DB496AC0009AFAF /* MGLTileSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DA551B831DB496AC0009AFAF /* MGLTileSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA551B801DB496AC0009AFAF /* MGLTileSource_Private.h */; }; - DA551B841DB496AC0009AFAF /* MGLTileSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA551B811DB496AC0009AFAF /* MGLTileSource.mm */; }; + DA551B821DB496AC0009AFAF /* MLNTileSource.h in Headers */ = {isa = PBXBuildFile; fileRef = DA551B7F1DB496AC0009AFAF /* MLNTileSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DA551B831DB496AC0009AFAF /* MLNTileSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA551B801DB496AC0009AFAF /* MLNTileSource_Private.h */; }; + DA551B841DB496AC0009AFAF /* MLNTileSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA551B811DB496AC0009AFAF /* MLNTileSource.mm */; }; DA5589771D320C41006B7F64 /* wms.json in Resources */ = {isa = PBXBuildFile; fileRef = DA5589761D320C41006B7F64 /* wms.json */; }; - DA57D4B11EBC699800793288 /* MGLDocumentationGuideTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA57D4B01EBC699800793288 /* MGLDocumentationGuideTests.swift */; }; - DA6408D71DA4E5DA00908C90 /* MGLVectorStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DA6408D51DA4E5DA00908C90 /* MGLVectorStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DA6408D81DA4E5DA00908C90 /* MGLVectorStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA6408D61DA4E5DA00908C90 /* MGLVectorStyleLayer.mm */; }; - DA695424215B1E6C002041A4 /* MGLMapCameraTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA695423215B1E6C002041A4 /* MGLMapCameraTests.m */; }; - DA7262071DEEDD460043BB89 /* MGLOpenGLStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DA7262051DEEDD460043BB89 /* MGLOpenGLStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DA7262081DEEDD460043BB89 /* MGLOpenGLStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA7262061DEEDD460043BB89 /* MGLOpenGLStyleLayer.mm */; }; - DA7DC9811DED5F5C0027472F /* MGLVectorTileSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA7DC9801DED5F5C0027472F /* MGLVectorTileSource_Private.h */; }; - DA7DC9831DED647F0027472F /* MGLRasterTileSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA7DC9821DED647F0027472F /* MGLRasterTileSource_Private.h */; }; + DA57D4B11EBC699800793288 /* MLNDocumentationGuideTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA57D4B01EBC699800793288 /* MLNDocumentationGuideTests.swift */; }; + DA6408D71DA4E5DA00908C90 /* MLNVectorStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DA6408D51DA4E5DA00908C90 /* MLNVectorStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DA6408D81DA4E5DA00908C90 /* MLNVectorStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA6408D61DA4E5DA00908C90 /* MLNVectorStyleLayer.mm */; }; + DA695424215B1E6C002041A4 /* MLNMapCameraTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA695423215B1E6C002041A4 /* MLNMapCameraTests.m */; }; + DA7262071DEEDD460043BB89 /* MLNOpenGLStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DA7262051DEEDD460043BB89 /* MLNOpenGLStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DA7262081DEEDD460043BB89 /* MLNOpenGLStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA7262061DEEDD460043BB89 /* MLNOpenGLStyleLayer.mm */; }; + DA7DC9811DED5F5C0027472F /* MLNVectorTileSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA7DC9801DED5F5C0027472F /* MLNVectorTileSource_Private.h */; }; + DA7DC9831DED647F0027472F /* MLNRasterTileSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA7DC9821DED647F0027472F /* MLNRasterTileSource_Private.h */; }; DA839E971CC2E3400062CAFB /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DA839E961CC2E3400062CAFB /* AppDelegate.m */; }; DA839E9A1CC2E3400062CAFB /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DA839E991CC2E3400062CAFB /* main.m */; }; DA839E9D1CC2E3400062CAFB /* MapDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = DA839E9C1CC2E3400062CAFB /* MapDocument.m */; }; DA839EA01CC2E3400062CAFB /* MapDocument.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA839E9E1CC2E3400062CAFB /* MapDocument.xib */; }; DA839EA21CC2E3400062CAFB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DA839EA11CC2E3400062CAFB /* Assets.xcassets */; }; DA839EA51CC2E3400062CAFB /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA839EA31CC2E3400062CAFB /* MainMenu.xib */; }; - DA87A9981DC9D88400810D09 /* MGLShapeSourceTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA87A9961DC9D88400810D09 /* MGLShapeSourceTests.mm */; }; - DA87A9991DC9D88400810D09 /* MGLTileSetTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA87A9971DC9D88400810D09 /* MGLTileSetTests.mm */; }; - DA87A99C1DC9D8DD00810D09 /* MGLShapeSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA87A99B1DC9D8DD00810D09 /* MGLShapeSource_Private.h */; }; - DA87A99E1DC9DC2100810D09 /* MGLPredicateTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35C5D84B1D6DD75B00E95907 /* MGLPredicateTests.mm */; }; - DA87A9A01DC9DC6200810D09 /* MGLValueEvaluator.h in Headers */ = {isa = PBXBuildFile; fileRef = DA87A99F1DC9DC6200810D09 /* MGLValueEvaluator.h */; }; - DA87A9A21DC9DCF100810D09 /* MGLFillStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25741D51C5F40010E6B5 /* MGLFillStyleLayerTests.mm */; }; - DA87A9A31DCACC5000810D09 /* MGLRasterStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25751D51C5F40010E6B5 /* MGLRasterStyleLayerTests.mm */; }; - DA87A9A41DCACC5000810D09 /* MGLSymbolStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25761D51C5F40010E6B5 /* MGLSymbolStyleLayerTests.mm */; }; - DA87A9A51DCACC5000810D09 /* MGLLineStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25771D51C5F40010E6B5 /* MGLLineStyleLayerTests.mm */; }; - DA87A9A61DCACC5000810D09 /* MGLCircleStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25781D51C5F40010E6B5 /* MGLCircleStyleLayerTests.mm */; }; - DA87A9A71DCACC5000810D09 /* MGLBackgroundStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25791D51C5F40010E6B5 /* MGLBackgroundStyleLayerTests.mm */; }; - DA8933A51CCD287300E68420 /* MGLAnnotationCallout.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA8933A71CCD287300E68420 /* MGLAnnotationCallout.xib */; }; + DA87A9981DC9D88400810D09 /* MLNShapeSourceTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA87A9961DC9D88400810D09 /* MLNShapeSourceTests.mm */; }; + DA87A9991DC9D88400810D09 /* MLNTileSetTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA87A9971DC9D88400810D09 /* MLNTileSetTests.mm */; }; + DA87A99C1DC9D8DD00810D09 /* MLNShapeSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA87A99B1DC9D8DD00810D09 /* MLNShapeSource_Private.h */; }; + DA87A99E1DC9DC2100810D09 /* MLNPredicateTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35C5D84B1D6DD75B00E95907 /* MLNPredicateTests.mm */; }; + DA87A9A01DC9DC6200810D09 /* MLNValueEvaluator.h in Headers */ = {isa = PBXBuildFile; fileRef = DA87A99F1DC9DC6200810D09 /* MLNValueEvaluator.h */; }; + DA87A9A21DC9DCF100810D09 /* MLNFillStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25741D51C5F40010E6B5 /* MLNFillStyleLayerTests.mm */; }; + DA87A9A31DCACC5000810D09 /* MLNRasterStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25751D51C5F40010E6B5 /* MLNRasterStyleLayerTests.mm */; }; + DA87A9A41DCACC5000810D09 /* MLNSymbolStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25761D51C5F40010E6B5 /* MLNSymbolStyleLayerTests.mm */; }; + DA87A9A51DCACC5000810D09 /* MLNLineStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25771D51C5F40010E6B5 /* MLNLineStyleLayerTests.mm */; }; + DA87A9A61DCACC5000810D09 /* MLNCircleStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25781D51C5F40010E6B5 /* MLNCircleStyleLayerTests.mm */; }; + DA87A9A71DCACC5000810D09 /* MLNBackgroundStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25791D51C5F40010E6B5 /* MLNBackgroundStyleLayerTests.mm */; }; + DA8933A51CCD287300E68420 /* MLNAnnotationCallout.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA8933A71CCD287300E68420 /* MLNAnnotationCallout.xib */; }; DA8933AE1CCD290700E68420 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA8933AB1CCD290700E68420 /* Localizable.strings */; }; DA8933B51CCD2C2500E68420 /* Foundation.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA8933B31CCD2C2500E68420 /* Foundation.strings */; }; DA8933B81CCD2C2D00E68420 /* Foundation.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = DA8933B61CCD2C2D00E68420 /* Foundation.stringsdict */; }; - DA8F25871D51C9E10010E6B5 /* MGLBackgroundStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25851D51C9E10010E6B5 /* MGLBackgroundStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DA8F25881D51C9E10010E6B5 /* MGLBackgroundStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25861D51C9E10010E6B5 /* MGLBackgroundStyleLayer.mm */; }; - DA8F258B1D51CA540010E6B5 /* MGLLineStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25891D51CA540010E6B5 /* MGLLineStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DA8F258C1D51CA540010E6B5 /* MGLLineStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F258A1D51CA540010E6B5 /* MGLLineStyleLayer.mm */; }; - DA8F258F1D51CA600010E6B5 /* MGLRasterStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F258D1D51CA600010E6B5 /* MGLRasterStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DA8F25901D51CA600010E6B5 /* MGLRasterStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F258E1D51CA600010E6B5 /* MGLRasterStyleLayer.mm */; }; - DA8F25931D51CA750010E6B5 /* MGLSymbolStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25911D51CA750010E6B5 /* MGLSymbolStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DA8F25941D51CA750010E6B5 /* MGLSymbolStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25921D51CA750010E6B5 /* MGLSymbolStyleLayer.mm */; }; - DA8F25971D51CAC70010E6B5 /* MGLVectorTileSource.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25951D51CAC70010E6B5 /* MGLVectorTileSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DA8F25981D51CAC70010E6B5 /* MGLVectorTileSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25961D51CAC70010E6B5 /* MGLVectorTileSource.mm */; }; - DA8F259A1D51CAD00010E6B5 /* MGLSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25991D51CAD00010E6B5 /* MGLSource_Private.h */; }; - DA8F259C1D51CB000010E6B5 /* MGLStyleValue_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F259B1D51CB000010E6B5 /* MGLStyleValue_Private.h */; }; - DA8F25B21D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25A61D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h */; }; - DA8F25B31D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25A71D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.mm */; }; - DAA4227C24294137008457DB /* MGLMapSnapshotterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA4227B24294137008457DB /* MGLMapSnapshotterTests.m */; }; + DA8F25871D51C9E10010E6B5 /* MLNBackgroundStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25851D51C9E10010E6B5 /* MLNBackgroundStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DA8F25881D51C9E10010E6B5 /* MLNBackgroundStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25861D51C9E10010E6B5 /* MLNBackgroundStyleLayer.mm */; }; + DA8F258B1D51CA540010E6B5 /* MLNLineStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25891D51CA540010E6B5 /* MLNLineStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DA8F258C1D51CA540010E6B5 /* MLNLineStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F258A1D51CA540010E6B5 /* MLNLineStyleLayer.mm */; }; + DA8F258F1D51CA600010E6B5 /* MLNRasterStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F258D1D51CA600010E6B5 /* MLNRasterStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DA8F25901D51CA600010E6B5 /* MLNRasterStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F258E1D51CA600010E6B5 /* MLNRasterStyleLayer.mm */; }; + DA8F25931D51CA750010E6B5 /* MLNSymbolStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25911D51CA750010E6B5 /* MLNSymbolStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DA8F25941D51CA750010E6B5 /* MLNSymbolStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25921D51CA750010E6B5 /* MLNSymbolStyleLayer.mm */; }; + DA8F25971D51CAC70010E6B5 /* MLNVectorTileSource.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25951D51CAC70010E6B5 /* MLNVectorTileSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DA8F25981D51CAC70010E6B5 /* MLNVectorTileSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25961D51CAC70010E6B5 /* MLNVectorTileSource.mm */; }; + DA8F259A1D51CAD00010E6B5 /* MLNSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25991D51CAD00010E6B5 /* MLNSource_Private.h */; }; + DA8F259C1D51CB000010E6B5 /* MLNStyleValue_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F259B1D51CB000010E6B5 /* MLNStyleValue_Private.h */; }; + DA8F25B21D51CB270010E6B5 /* NSValue+MLNStyleAttributeAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8F25A61D51CB270010E6B5 /* NSValue+MLNStyleAttributeAdditions.h */; }; + DA8F25B31D51CB270010E6B5 /* NSValue+MLNStyleAttributeAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25A71D51CB270010E6B5 /* NSValue+MLNStyleAttributeAdditions.mm */; }; + DAA4227C24294137008457DB /* MLNMapSnapshotterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA4227B24294137008457DB /* MLNMapSnapshotterTests.m */; }; DAA48EFD1D6A4731006A7E36 /* StyleLayerIconTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA48EFC1D6A4731006A7E36 /* StyleLayerIconTransformer.m */; }; - DAA998FB1E9F545C002E6EA6 /* MGLFillExtrusionStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DAA998F91E9F545C002E6EA6 /* MGLFillExtrusionStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAA998FC1E9F545C002E6EA6 /* MGLFillExtrusionStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAA998FA1E9F545C002E6EA6 /* MGLFillExtrusionStyleLayer.mm */; }; - DAA999011E9F5EC5002E6EA6 /* MGLFillExtrusionStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAA999001E9F5EC5002E6EA6 /* MGLFillExtrusionStyleLayerTests.mm */; }; - DAC25FCA200FD5E2009BE98E /* NSExpression+MGLPrivateAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DAC25FC9200FD5E2009BE98E /* NSExpression+MGLPrivateAdditions.h */; }; - DAC2ABC51CC6D343006D18C4 /* MGLAnnotationImage_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAC2ABC41CC6D343006D18C4 /* MGLAnnotationImage_Private.h */; }; + DAA998FB1E9F545C002E6EA6 /* MLNFillExtrusionStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DAA998F91E9F545C002E6EA6 /* MLNFillExtrusionStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAA998FC1E9F545C002E6EA6 /* MLNFillExtrusionStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAA998FA1E9F545C002E6EA6 /* MLNFillExtrusionStyleLayer.mm */; }; + DAA999011E9F5EC5002E6EA6 /* MLNFillExtrusionStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAA999001E9F5EC5002E6EA6 /* MLNFillExtrusionStyleLayerTests.mm */; }; + DAC25FCA200FD5E2009BE98E /* NSExpression+MLNPrivateAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DAC25FC9200FD5E2009BE98E /* NSExpression+MLNPrivateAdditions.h */; }; + DAC2ABC51CC6D343006D18C4 /* MLNAnnotationImage_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAC2ABC41CC6D343006D18C4 /* MLNAnnotationImage_Private.h */; }; DAC8325F24049D8700A61BF8 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = DAE6C3C61CC3499100DB3429 /* libsqlite3.tbd */; }; DAC8326024049D9C00A61BF8 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 55D9B4B01D005D3900C1CCE2 /* libz.tbd */; }; DAC8A47E24527EBB00C795BB /* glyphs.pbf in Resources */ = {isa = PBXBuildFile; fileRef = DAC8A47D24527EBB00C795BB /* glyphs.pbf */; }; DAC8A4842452972F00C795BB /* mixed.json in Resources */ = {isa = PBXBuildFile; fileRef = DAC8A4832452972F00C795BB /* mixed.json */; }; - DACA8622201920BE00E9693A /* MGLRasterDEMSource.h in Headers */ = {isa = PBXBuildFile; fileRef = DACA8620201920BE00E9693A /* MGLRasterDEMSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DACA8623201920BE00E9693A /* MGLRasterDEMSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = DACA8621201920BE00E9693A /* MGLRasterDEMSource.mm */; }; - DACB0C391E18DFFD005DDBEA /* MGLStyle+MBXAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DACB0C381E18DFFD005DDBEA /* MGLStyle+MBXAdditions.m */; }; - DACC22141CF3D3E200D220D9 /* MGLFeature.h in Headers */ = {isa = PBXBuildFile; fileRef = DACC22121CF3D3E200D220D9 /* MGLFeature.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DACC22151CF3D3E200D220D9 /* MGLFeature.mm in Sources */ = {isa = PBXBuildFile; fileRef = DACC22131CF3D3E200D220D9 /* MGLFeature.mm */; }; - DACC22181CF3D4F700D220D9 /* MGLFeature_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DACC22171CF3D4F700D220D9 /* MGLFeature_Private.h */; }; - DAD165741CF4CD7A001FF4B9 /* MGLShapeCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = DAD165721CF4CD7A001FF4B9 /* MGLShapeCollection.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAD165751CF4CD7A001FF4B9 /* MGLShapeCollection.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAD165731CF4CD7A001FF4B9 /* MGLShapeCollection.mm */; }; + DACA8622201920BE00E9693A /* MLNRasterDEMSource.h in Headers */ = {isa = PBXBuildFile; fileRef = DACA8620201920BE00E9693A /* MLNRasterDEMSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DACA8623201920BE00E9693A /* MLNRasterDEMSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = DACA8621201920BE00E9693A /* MLNRasterDEMSource.mm */; }; + DACB0C391E18DFFD005DDBEA /* MLNStyle+MBXAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DACB0C381E18DFFD005DDBEA /* MLNStyle+MBXAdditions.m */; }; + DACC22141CF3D3E200D220D9 /* MLNFeature.h in Headers */ = {isa = PBXBuildFile; fileRef = DACC22121CF3D3E200D220D9 /* MLNFeature.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DACC22151CF3D3E200D220D9 /* MLNFeature.mm in Sources */ = {isa = PBXBuildFile; fileRef = DACC22131CF3D3E200D220D9 /* MLNFeature.mm */; }; + DACC22181CF3D4F700D220D9 /* MLNFeature_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DACC22171CF3D4F700D220D9 /* MLNFeature_Private.h */; }; + DAD165741CF4CD7A001FF4B9 /* MLNShapeCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = DAD165721CF4CD7A001FF4B9 /* MLNShapeCollection.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAD165751CF4CD7A001FF4B9 /* MLNShapeCollection.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAD165731CF4CD7A001FF4B9 /* MLNShapeCollection.mm */; }; DAE0DD7A1D5F015A005A6BB1 /* libmbgl-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAE6C3451CC31D1200DB3429 /* libmbgl-core.a */; }; DAE6C2E21CC304F900DB3429 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = DAE6C2E11CC304F900DB3429 /* Credits.rtf */; }; DAE6C2ED1CC3050F00DB3429 /* DroppedPinAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C2E41CC3050F00DB3429 /* DroppedPinAnnotation.m */; }; @@ -230,81 +230,81 @@ DAE6C3321CC30DB200DB3429 /* Mapbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAE6C3281CC30DB200DB3429 /* Mapbox.framework */; }; DAE6C33D1CC30DB200DB3429 /* Mapbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAE6C3281CC30DB200DB3429 /* Mapbox.framework */; }; DAE6C33E1CC30DB200DB3429 /* Mapbox.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DAE6C3281CC30DB200DB3429 /* Mapbox.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - DAE6C35A1CC31E0400DB3429 /* MGLSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C34A1CC31E0400DB3429 /* MGLSettings.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C35B1CC31E0400DB3429 /* MGLAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C34B1CC31E0400DB3429 /* MGLAnnotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C35C1CC31E0400DB3429 /* MGLGeometry.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C34C1CC31E0400DB3429 /* MGLGeometry.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C35D1CC31E0400DB3429 /* MGLMapCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C34D1CC31E0400DB3429 /* MGLMapCamera.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C35E1CC31E0400DB3429 /* MGLMultiPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C34E1CC31E0400DB3429 /* MGLMultiPoint.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C35F1CC31E0400DB3429 /* MGLOfflinePack.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C34F1CC31E0400DB3429 /* MGLOfflinePack.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C3601CC31E0400DB3429 /* MGLOfflineRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3501CC31E0400DB3429 /* MGLOfflineRegion.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C3611CC31E0400DB3429 /* MGLOfflineStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3511CC31E0400DB3429 /* MGLOfflineStorage.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C3621CC31E0400DB3429 /* MGLOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3521CC31E0400DB3429 /* MGLOverlay.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C3631CC31E0400DB3429 /* MGLPointAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3531CC31E0400DB3429 /* MGLPointAnnotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C3641CC31E0400DB3429 /* MGLPolygon.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3541CC31E0400DB3429 /* MGLPolygon.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C3651CC31E0400DB3429 /* MGLPolyline.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3551CC31E0400DB3429 /* MGLPolyline.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C3661CC31E0400DB3429 /* MGLShape.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3561CC31E0400DB3429 /* MGLShape.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C3671CC31E0400DB3429 /* MGLStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3571CC31E0400DB3429 /* MGLStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C3681CC31E0400DB3429 /* MGLTilePyramidOfflineRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3581CC31E0400DB3429 /* MGLTilePyramidOfflineRegion.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C3691CC31E0400DB3429 /* MGLTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3591CC31E0400DB3429 /* MGLTypes.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C3841CC31E2A00DB3429 /* MGLSettings_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C36A1CC31E2A00DB3429 /* MGLSettings_Private.h */; }; - DAE6C3851CC31E2A00DB3429 /* MGLSettings.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C36B1CC31E2A00DB3429 /* MGLSettings.mm */; }; - DAE6C3861CC31E2A00DB3429 /* MGLGeometry_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C36C1CC31E2A00DB3429 /* MGLGeometry_Private.h */; }; - DAE6C3871CC31E2A00DB3429 /* MGLGeometry.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C36D1CC31E2A00DB3429 /* MGLGeometry.mm */; }; - DAE6C3881CC31E2A00DB3429 /* MGLMapCamera.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C36E1CC31E2A00DB3429 /* MGLMapCamera.mm */; }; - DAE6C3891CC31E2A00DB3429 /* MGLMultiPoint_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C36F1CC31E2A00DB3429 /* MGLMultiPoint_Private.h */; }; - DAE6C38A1CC31E2A00DB3429 /* MGLMultiPoint.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3701CC31E2A00DB3429 /* MGLMultiPoint.mm */; }; - DAE6C38B1CC31E2A00DB3429 /* MGLOfflinePack_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3711CC31E2A00DB3429 /* MGLOfflinePack_Private.h */; }; - DAE6C38C1CC31E2A00DB3429 /* MGLOfflinePack.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3721CC31E2A00DB3429 /* MGLOfflinePack.mm */; }; - DAE6C38D1CC31E2A00DB3429 /* MGLOfflineRegion_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3731CC31E2A00DB3429 /* MGLOfflineRegion_Private.h */; }; - DAE6C38E1CC31E2A00DB3429 /* MGLOfflineStorage_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3741CC31E2A00DB3429 /* MGLOfflineStorage_Private.h */; }; - DAE6C38F1CC31E2A00DB3429 /* MGLOfflineStorage.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3751CC31E2A00DB3429 /* MGLOfflineStorage.mm */; }; - DAE6C3901CC31E2A00DB3429 /* MGLPointAnnotation.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3761CC31E2A00DB3429 /* MGLPointAnnotation.mm */; }; - DAE6C3911CC31E2A00DB3429 /* MGLPolygon.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3771CC31E2A00DB3429 /* MGLPolygon.mm */; }; - DAE6C3921CC31E2A00DB3429 /* MGLPolyline.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3781CC31E2A00DB3429 /* MGLPolyline.mm */; }; - DAE6C3931CC31E2A00DB3429 /* MGLShape.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3791CC31E2A00DB3429 /* MGLShape.mm */; }; - DAE6C3941CC31E2A00DB3429 /* MGLStyle.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C37A1CC31E2A00DB3429 /* MGLStyle.mm */; }; - DAE6C3951CC31E2A00DB3429 /* MGLTilePyramidOfflineRegion.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C37B1CC31E2A00DB3429 /* MGLTilePyramidOfflineRegion.mm */; }; - DAE6C3961CC31E2A00DB3429 /* MGLTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C37C1CC31E2A00DB3429 /* MGLTypes.m */; }; - DAE6C3971CC31E2A00DB3429 /* NSBundle+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C37D1CC31E2A00DB3429 /* NSBundle+MGLAdditions.h */; }; - DAE6C3981CC31E2A00DB3429 /* NSBundle+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C37E1CC31E2A00DB3429 /* NSBundle+MGLAdditions.mm */; }; - DAE6C3991CC31E2A00DB3429 /* NSException+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C37F1CC31E2A00DB3429 /* NSException+MGLAdditions.h */; }; - DAE6C39A1CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3801CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.h */; }; - DAE6C39B1CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3811CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.m */; }; - DAE6C39C1CC31E2A00DB3429 /* NSString+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3821CC31E2A00DB3429 /* NSString+MGLAdditions.h */; }; - DAE6C39D1CC31E2A00DB3429 /* NSString+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3831CC31E2A00DB3429 /* NSString+MGLAdditions.m */; }; - DAE6C3A31CC31E9400DB3429 /* MGLAnnotationImage.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C39F1CC31E9400DB3429 /* MGLAnnotationImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C3A41CC31E9400DB3429 /* MGLMapView.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3A01CC31E9400DB3429 /* MGLMapView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C3A51CC31E9400DB3429 /* MGLMapView+IBAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3A11CC31E9400DB3429 /* MGLMapView+IBAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C3A61CC31E9400DB3429 /* MGLMapViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3A21CC31E9400DB3429 /* MGLMapViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C3B11CC31EF300DB3429 /* MGLAnnotationImage.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3A71CC31EF300DB3429 /* MGLAnnotationImage.m */; }; - DAE6C3B21CC31EF300DB3429 /* MGLAttributionButton.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3A81CC31EF300DB3429 /* MGLAttributionButton.h */; }; - DAE6C3B31CC31EF300DB3429 /* MGLAttributionButton.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3A91CC31EF300DB3429 /* MGLAttributionButton.mm */; }; - DAE6C3B41CC31EF300DB3429 /* MGLCompassCell.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3AA1CC31EF300DB3429 /* MGLCompassCell.h */; }; - DAE6C3B51CC31EF300DB3429 /* MGLCompassCell.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3AB1CC31EF300DB3429 /* MGLCompassCell.m */; }; - DAE6C3B61CC31EF300DB3429 /* MGLMapView_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3AC1CC31EF300DB3429 /* MGLMapView_Private.h */; }; - DAE6C3B71CC31EF300DB3429 /* MGLMapView.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3AD1CC31EF300DB3429 /* MGLMapView.mm */; }; - DAE6C3B81CC31EF300DB3429 /* MGLMapView+IBAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3AE1CC31EF300DB3429 /* MGLMapView+IBAdditions.mm */; }; - DAE6C3B91CC31EF300DB3429 /* MGLOpenGLLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3AF1CC31EF300DB3429 /* MGLOpenGLLayer.h */; }; - DAE6C3BA1CC31EF300DB3429 /* MGLOpenGLLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3B01CC31EF300DB3429 /* MGLOpenGLLayer.mm */; }; + DAE6C35A1CC31E0400DB3429 /* MLNSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C34A1CC31E0400DB3429 /* MLNSettings.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C35B1CC31E0400DB3429 /* MLNAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C34B1CC31E0400DB3429 /* MLNAnnotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C35C1CC31E0400DB3429 /* MLNGeometry.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C34C1CC31E0400DB3429 /* MLNGeometry.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C35D1CC31E0400DB3429 /* MLNMapCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C34D1CC31E0400DB3429 /* MLNMapCamera.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C35E1CC31E0400DB3429 /* MLNMultiPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C34E1CC31E0400DB3429 /* MLNMultiPoint.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C35F1CC31E0400DB3429 /* MLNOfflinePack.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C34F1CC31E0400DB3429 /* MLNOfflinePack.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C3601CC31E0400DB3429 /* MLNOfflineRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3501CC31E0400DB3429 /* MLNOfflineRegion.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C3611CC31E0400DB3429 /* MLNOfflineStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3511CC31E0400DB3429 /* MLNOfflineStorage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C3621CC31E0400DB3429 /* MLNOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3521CC31E0400DB3429 /* MLNOverlay.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C3631CC31E0400DB3429 /* MLNPointAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3531CC31E0400DB3429 /* MLNPointAnnotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C3641CC31E0400DB3429 /* MLNPolygon.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3541CC31E0400DB3429 /* MLNPolygon.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C3651CC31E0400DB3429 /* MLNPolyline.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3551CC31E0400DB3429 /* MLNPolyline.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C3661CC31E0400DB3429 /* MLNShape.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3561CC31E0400DB3429 /* MLNShape.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C3671CC31E0400DB3429 /* MLNStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3571CC31E0400DB3429 /* MLNStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C3681CC31E0400DB3429 /* MLNTilePyramidOfflineRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3581CC31E0400DB3429 /* MLNTilePyramidOfflineRegion.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C3691CC31E0400DB3429 /* MLNTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3591CC31E0400DB3429 /* MLNTypes.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C3841CC31E2A00DB3429 /* MLNSettings_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C36A1CC31E2A00DB3429 /* MLNSettings_Private.h */; }; + DAE6C3851CC31E2A00DB3429 /* MLNSettings.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C36B1CC31E2A00DB3429 /* MLNSettings.mm */; }; + DAE6C3861CC31E2A00DB3429 /* MLNGeometry_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C36C1CC31E2A00DB3429 /* MLNGeometry_Private.h */; }; + DAE6C3871CC31E2A00DB3429 /* MLNGeometry.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C36D1CC31E2A00DB3429 /* MLNGeometry.mm */; }; + DAE6C3881CC31E2A00DB3429 /* MLNMapCamera.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C36E1CC31E2A00DB3429 /* MLNMapCamera.mm */; }; + DAE6C3891CC31E2A00DB3429 /* MLNMultiPoint_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C36F1CC31E2A00DB3429 /* MLNMultiPoint_Private.h */; }; + DAE6C38A1CC31E2A00DB3429 /* MLNMultiPoint.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3701CC31E2A00DB3429 /* MLNMultiPoint.mm */; }; + DAE6C38B1CC31E2A00DB3429 /* MLNOfflinePack_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3711CC31E2A00DB3429 /* MLNOfflinePack_Private.h */; }; + DAE6C38C1CC31E2A00DB3429 /* MLNOfflinePack.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3721CC31E2A00DB3429 /* MLNOfflinePack.mm */; }; + DAE6C38D1CC31E2A00DB3429 /* MLNOfflineRegion_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3731CC31E2A00DB3429 /* MLNOfflineRegion_Private.h */; }; + DAE6C38E1CC31E2A00DB3429 /* MLNOfflineStorage_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3741CC31E2A00DB3429 /* MLNOfflineStorage_Private.h */; }; + DAE6C38F1CC31E2A00DB3429 /* MLNOfflineStorage.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3751CC31E2A00DB3429 /* MLNOfflineStorage.mm */; }; + DAE6C3901CC31E2A00DB3429 /* MLNPointAnnotation.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3761CC31E2A00DB3429 /* MLNPointAnnotation.mm */; }; + DAE6C3911CC31E2A00DB3429 /* MLNPolygon.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3771CC31E2A00DB3429 /* MLNPolygon.mm */; }; + DAE6C3921CC31E2A00DB3429 /* MLNPolyline.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3781CC31E2A00DB3429 /* MLNPolyline.mm */; }; + DAE6C3931CC31E2A00DB3429 /* MLNShape.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3791CC31E2A00DB3429 /* MLNShape.mm */; }; + DAE6C3941CC31E2A00DB3429 /* MLNStyle.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C37A1CC31E2A00DB3429 /* MLNStyle.mm */; }; + DAE6C3951CC31E2A00DB3429 /* MLNTilePyramidOfflineRegion.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C37B1CC31E2A00DB3429 /* MLNTilePyramidOfflineRegion.mm */; }; + DAE6C3961CC31E2A00DB3429 /* MLNTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C37C1CC31E2A00DB3429 /* MLNTypes.m */; }; + DAE6C3971CC31E2A00DB3429 /* NSBundle+MLNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C37D1CC31E2A00DB3429 /* NSBundle+MLNAdditions.h */; }; + DAE6C3981CC31E2A00DB3429 /* NSBundle+MLNAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C37E1CC31E2A00DB3429 /* NSBundle+MLNAdditions.mm */; }; + DAE6C3991CC31E2A00DB3429 /* NSException+MLNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C37F1CC31E2A00DB3429 /* NSException+MLNAdditions.h */; }; + DAE6C39A1CC31E2A00DB3429 /* NSProcessInfo+MLNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3801CC31E2A00DB3429 /* NSProcessInfo+MLNAdditions.h */; }; + DAE6C39B1CC31E2A00DB3429 /* NSProcessInfo+MLNAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3811CC31E2A00DB3429 /* NSProcessInfo+MLNAdditions.m */; }; + DAE6C39C1CC31E2A00DB3429 /* NSString+MLNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3821CC31E2A00DB3429 /* NSString+MLNAdditions.h */; }; + DAE6C39D1CC31E2A00DB3429 /* NSString+MLNAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3831CC31E2A00DB3429 /* NSString+MLNAdditions.m */; }; + DAE6C3A31CC31E9400DB3429 /* MLNAnnotationImage.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C39F1CC31E9400DB3429 /* MLNAnnotationImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C3A41CC31E9400DB3429 /* MLNMapView.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3A01CC31E9400DB3429 /* MLNMapView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C3A51CC31E9400DB3429 /* MLNMapView+IBAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3A11CC31E9400DB3429 /* MLNMapView+IBAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C3A61CC31E9400DB3429 /* MLNMapViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3A21CC31E9400DB3429 /* MLNMapViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAE6C3B11CC31EF300DB3429 /* MLNAnnotationImage.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3A71CC31EF300DB3429 /* MLNAnnotationImage.m */; }; + DAE6C3B21CC31EF300DB3429 /* MLNAttributionButton.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3A81CC31EF300DB3429 /* MLNAttributionButton.h */; }; + DAE6C3B31CC31EF300DB3429 /* MLNAttributionButton.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3A91CC31EF300DB3429 /* MLNAttributionButton.mm */; }; + DAE6C3B41CC31EF300DB3429 /* MLNCompassCell.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3AA1CC31EF300DB3429 /* MLNCompassCell.h */; }; + DAE6C3B51CC31EF300DB3429 /* MLNCompassCell.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3AB1CC31EF300DB3429 /* MLNCompassCell.m */; }; + DAE6C3B61CC31EF300DB3429 /* MLNMapView_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3AC1CC31EF300DB3429 /* MLNMapView_Private.h */; }; + DAE6C3B71CC31EF300DB3429 /* MLNMapView.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3AD1CC31EF300DB3429 /* MLNMapView.mm */; }; + DAE6C3B81CC31EF300DB3429 /* MLNMapView+IBAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3AE1CC31EF300DB3429 /* MLNMapView+IBAdditions.mm */; }; + DAE6C3B91CC31EF300DB3429 /* MLNOpenGLLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3AF1CC31EF300DB3429 /* MLNOpenGLLayer.h */; }; + DAE6C3BA1CC31EF300DB3429 /* MLNOpenGLLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3B01CC31EF300DB3429 /* MLNOpenGLLayer.mm */; }; DAE6C3BE1CC31F2E00DB3429 /* default_marker.pdf in Resources */ = {isa = PBXBuildFile; fileRef = DAE6C3BB1CC31F2E00DB3429 /* default_marker.pdf */; }; DAE6C3BF1CC31F2E00DB3429 /* mapbox.pdf in Resources */ = {isa = PBXBuildFile; fileRef = DAE6C3BC1CC31F2E00DB3429 /* mapbox.pdf */; }; DAE6C3C21CC31F4500DB3429 /* Mapbox.h in Headers */ = {isa = PBXBuildFile; fileRef = DAE6C3C11CC31F4500DB3429 /* Mapbox.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAE6C3D21CC34C9900DB3429 /* MGLGeometryTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3C81CC34BD800DB3429 /* MGLGeometryTests.mm */; }; - DAE6C3D41CC34C9900DB3429 /* MGLOfflineRegionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3CA1CC34BD800DB3429 /* MGLOfflineRegionTests.m */; }; - DAE6C3D61CC34C9900DB3429 /* MGLStyleTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3CC1CC34BD800DB3429 /* MGLStyleTests.mm */; }; - DAE7DEC41E24549F007505A6 /* MGLNSStringAdditionsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE7DEC31E24549F007505A6 /* MGLNSStringAdditionsTests.m */; }; - DAED385F1D62CED700D7640F /* NSURL+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DAED385D1D62CED700D7640F /* NSURL+MGLAdditions.h */; }; - DAED38601D62CED700D7640F /* NSURL+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DAED385E1D62CED700D7640F /* NSURL+MGLAdditions.m */; }; - DAEDC4321D6033F1000224FF /* MGLAttributionInfoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DAEDC4311D6033F1000224FF /* MGLAttributionInfoTests.m */; }; - DAEDC4371D606291000224FF /* MGLAttributionButtonTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DAEDC4361D606291000224FF /* MGLAttributionButtonTests.m */; }; - DAF0D80E1DFE0E5D00B28378 /* MGLPointCollection_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAF0D80D1DFE0E5D00B28378 /* MGLPointCollection_Private.h */; }; - DAF0D8161DFE6B1800B28378 /* MGLAttributionInfo_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAF0D8151DFE6B1800B28378 /* MGLAttributionInfo_Private.h */; }; - DAF25715201901C200367EF5 /* MGLHillshadeStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAF25713201901C100367EF5 /* MGLHillshadeStyleLayer.mm */; }; - DAF25716201901C200367EF5 /* MGLHillshadeStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DAF25714201901C200367EF5 /* MGLHillshadeStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DAF25721201902C100367EF5 /* MGLHillshadeStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAF2571D201902A500367EF5 /* MGLHillshadeStyleLayerTests.mm */; }; - DD0902B21DB1AC6400C5BDCE /* MGLNetworkConfiguration.mm in Sources */ = {isa = PBXBuildFile; fileRef = DD0902AF1DB1AC6400C5BDCE /* MGLNetworkConfiguration.mm */; }; - DD0902B31DB1AC6400C5BDCE /* MGLNetworkConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = DD0902B01DB1AC6400C5BDCE /* MGLNetworkConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DD58A4C91D822C6700E1F038 /* MGLExpressionTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DD58A4C71D822C6200E1F038 /* MGLExpressionTests.mm */; }; + DAE6C3D21CC34C9900DB3429 /* MLNGeometryTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3C81CC34BD800DB3429 /* MLNGeometryTests.mm */; }; + DAE6C3D41CC34C9900DB3429 /* MLNOfflineRegionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3CA1CC34BD800DB3429 /* MLNOfflineRegionTests.m */; }; + DAE6C3D61CC34C9900DB3429 /* MLNStyleTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAE6C3CC1CC34BD800DB3429 /* MLNStyleTests.mm */; }; + DAE7DEC41E24549F007505A6 /* MLNNSStringAdditionsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE7DEC31E24549F007505A6 /* MLNNSStringAdditionsTests.m */; }; + DAED385F1D62CED700D7640F /* NSURL+MLNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DAED385D1D62CED700D7640F /* NSURL+MLNAdditions.h */; }; + DAED38601D62CED700D7640F /* NSURL+MLNAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DAED385E1D62CED700D7640F /* NSURL+MLNAdditions.m */; }; + DAEDC4321D6033F1000224FF /* MLNAttributionInfoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DAEDC4311D6033F1000224FF /* MLNAttributionInfoTests.m */; }; + DAEDC4371D606291000224FF /* MLNAttributionButtonTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DAEDC4361D606291000224FF /* MLNAttributionButtonTests.m */; }; + DAF0D80E1DFE0E5D00B28378 /* MLNPointCollection_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAF0D80D1DFE0E5D00B28378 /* MLNPointCollection_Private.h */; }; + DAF0D8161DFE6B1800B28378 /* MLNAttributionInfo_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAF0D8151DFE6B1800B28378 /* MLNAttributionInfo_Private.h */; }; + DAF25715201901C200367EF5 /* MLNHillshadeStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAF25713201901C100367EF5 /* MLNHillshadeStyleLayer.mm */; }; + DAF25716201901C200367EF5 /* MLNHillshadeStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DAF25714201901C200367EF5 /* MLNHillshadeStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DAF25721201902C100367EF5 /* MLNHillshadeStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAF2571D201902A500367EF5 /* MLNHillshadeStyleLayerTests.mm */; }; + DD0902B21DB1AC6400C5BDCE /* MLNNetworkConfiguration.mm in Sources */ = {isa = PBXBuildFile; fileRef = DD0902AF1DB1AC6400C5BDCE /* MLNNetworkConfiguration.mm */; }; + DD0902B31DB1AC6400C5BDCE /* MLNNetworkConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = DD0902B01DB1AC6400C5BDCE /* MLNNetworkConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DD58A4C91D822C6700E1F038 /* MLNExpressionTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DD58A4C71D822C6200E1F038 /* MLNExpressionTests.mm */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -339,127 +339,127 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 076171C4213A0DC200668A35 /* MGLMapViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MGLMapViewTests.m; path = ../../darwin/test/MGLMapViewTests.m; sourceTree = ""; }; - 07A019EB1ED662D800ACD43E /* MGLImageSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLImageSource.h; sourceTree = ""; }; - 07A019EC1ED662D800ACD43E /* MGLImageSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLImageSource.mm; sourceTree = ""; }; - 07A240921F67566F002C8210 /* MGLComputedShapeSourceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLComputedShapeSourceTests.m; sourceTree = ""; }; - 07BA4CAB1EE21887004528F5 /* MGLImageSourceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLImageSourceTests.m; sourceTree = ""; }; - 07D947471F6741F500E37934 /* MGLComputedShapeSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLComputedShapeSource_Private.h; sourceTree = ""; }; - 07F8E2F41F674C8000F794BB /* MGLComputedShapeSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLComputedShapeSource.h; sourceTree = ""; }; - 07F8E2F51F674C8000F794BB /* MGLComputedShapeSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLComputedShapeSource.mm; sourceTree = ""; }; - 170A82BE201BDD1B00943087 /* MGLHeatmapStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLHeatmapStyleLayerTests.mm; sourceTree = ""; }; - 170A82C2201FAFF800943087 /* MGLHeatmapColorTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLHeatmapColorTests.mm; sourceTree = ""; }; - 1753ED3F1E53CE5200A9FD90 /* MGLConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLConversion.h; sourceTree = ""; }; - 1F2B94C2221E22E500210640 /* MGLNetworkConfiguration_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLNetworkConfiguration_Private.h; sourceTree = ""; }; - 1F7454A01ECFB00300021D39 /* MGLLight_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLLight_Private.h; sourceTree = ""; }; - 1F7454A11ECFB00300021D39 /* MGLLight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLLight.h; sourceTree = ""; }; - 1F7454A21ECFB00300021D39 /* MGLLight.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLLight.mm; sourceTree = ""; }; - 1F7454AA1ED1DDBD00021D39 /* MGLLightTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLLightTest.mm; sourceTree = ""; }; + 076171C4213A0DC200668A35 /* MLNMapViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MLNMapViewTests.m; path = ../../darwin/test/MLNMapViewTests.m; sourceTree = ""; }; + 07A019EB1ED662D800ACD43E /* MLNImageSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNImageSource.h; sourceTree = ""; }; + 07A019EC1ED662D800ACD43E /* MLNImageSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNImageSource.mm; sourceTree = ""; }; + 07A240921F67566F002C8210 /* MLNComputedShapeSourceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLNComputedShapeSourceTests.m; sourceTree = ""; }; + 07BA4CAB1EE21887004528F5 /* MLNImageSourceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLNImageSourceTests.m; sourceTree = ""; }; + 07D947471F6741F500E37934 /* MLNComputedShapeSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNComputedShapeSource_Private.h; sourceTree = ""; }; + 07F8E2F41F674C8000F794BB /* MLNComputedShapeSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNComputedShapeSource.h; sourceTree = ""; }; + 07F8E2F51F674C8000F794BB /* MLNComputedShapeSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNComputedShapeSource.mm; sourceTree = ""; }; + 170A82BE201BDD1B00943087 /* MLNHeatmapStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNHeatmapStyleLayerTests.mm; sourceTree = ""; }; + 170A82C2201FAFF800943087 /* MLNHeatmapColorTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNHeatmapColorTests.mm; sourceTree = ""; }; + 1753ED3F1E53CE5200A9FD90 /* MLNConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNConversion.h; sourceTree = ""; }; + 1F2B94C2221E22E500210640 /* MLNNetworkConfiguration_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNNetworkConfiguration_Private.h; sourceTree = ""; }; + 1F7454A01ECFB00300021D39 /* MLNLight_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNLight_Private.h; sourceTree = ""; }; + 1F7454A11ECFB00300021D39 /* MLNLight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNLight.h; sourceTree = ""; }; + 1F7454A21ECFB00300021D39 /* MLNLight.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNLight.mm; sourceTree = ""; }; + 1F7454AA1ED1DDBD00021D39 /* MLNLightTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNLightTest.mm; sourceTree = ""; }; 1F8A59F921653483004DFE75 /* sideload_sat.db */ = {isa = PBXFileReference; lastKnownFileType = file; name = sideload_sat.db; path = ../../../../../test/fixtures/offline_database/sideload_sat.db; sourceTree = ""; }; - 1F8A5A01216D4695004DFE75 /* MGLLoggingConfiguration_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLLoggingConfiguration_Private.h; sourceTree = ""; }; - 1F8A5A03216D4696004DFE75 /* MGLLoggingConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLLoggingConfiguration.h; sourceTree = ""; }; - 1F95931A1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLNSDateAdditionsTests.mm; path = ../../darwin/test/MGLNSDateAdditionsTests.mm; sourceTree = ""; }; + 1F8A5A01216D4695004DFE75 /* MLNLoggingConfiguration_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNLoggingConfiguration_Private.h; sourceTree = ""; }; + 1F8A5A03216D4696004DFE75 /* MLNLoggingConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNLoggingConfiguration.h; sourceTree = ""; }; + 1F95931A1E6DE2B600D5B294 /* MLNNSDateAdditionsTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MLNNSDateAdditionsTests.mm; path = ../../darwin/test/MLNNSDateAdditionsTests.mm; sourceTree = ""; }; 1F9EF4051FBA1B0D0063FBB0 /* mapbox_helmet.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = mapbox_helmet.pdf; sourceTree = ""; }; - 1FC481842098F323000D09B4 /* NSPredicate+MGLPrivateAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSPredicate+MGLPrivateAdditions.h"; sourceTree = ""; }; + 1FC481842098F323000D09B4 /* NSPredicate+MLNPrivateAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSPredicate+MLNPrivateAdditions.h"; sourceTree = ""; }; 1FDB00CC21F8F1FD00D21389 /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/Localizable.strings; sourceTree = ""; }; 1FDB00CD21F8F1FF00D21389 /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/Localizable.strings; sourceTree = ""; }; - 1FF4858B2237235200F19727 /* MGLAttributedExpression.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLAttributedExpression.m; sourceTree = ""; }; - 1FF4858C2237235200F19727 /* MGLAttributedExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAttributedExpression.h; sourceTree = ""; }; - 3508EC621D749D39009B0EE4 /* NSExpression+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSExpression+MGLAdditions.h"; sourceTree = ""; }; - 3508EC631D749D39009B0EE4 /* NSExpression+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSExpression+MGLAdditions.mm"; sourceTree = ""; }; - 3526EABC1DF9B19800006B43 /* MGLCodingTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLCodingTests.mm; path = ../../darwin/test/MGLCodingTests.mm; sourceTree = ""; }; - 352742771D4C220900A1ECE6 /* MGLStyleValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleValue.h; sourceTree = ""; }; - 3527427F1D4C243B00A1ECE6 /* MGLSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLSource.h; sourceTree = ""; }; - 352742801D4C243B00A1ECE6 /* MGLSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLSource.mm; sourceTree = ""; }; - 352742831D4C244700A1ECE6 /* MGLRasterTileSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRasterTileSource.h; sourceTree = ""; }; - 352742841D4C244700A1ECE6 /* MGLRasterTileSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLRasterTileSource.mm; sourceTree = ""; }; - 352742871D4C245800A1ECE6 /* MGLShapeSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLShapeSource.h; sourceTree = ""; }; - 352742881D4C245800A1ECE6 /* MGLShapeSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLShapeSource.mm; sourceTree = ""; }; - 3527428B1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLCircleStyleLayer.h; sourceTree = ""; }; - 3527428C1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLCircleStyleLayer.mm; sourceTree = ""; }; - 3527429E1D4C25BD00A1ECE6 /* MGLStyleValue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLStyleValue.mm; sourceTree = ""; }; - 352903991D6C63B80002C7DF /* NSPredicate+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSPredicate+MGLAdditions.h"; sourceTree = ""; }; - 3529039A1D6C63B80002C7DF /* NSPredicate+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSPredicate+MGLAdditions.mm"; sourceTree = ""; }; - 3537CA731D3F93A600380318 /* MGLStyle_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyle_Private.h; sourceTree = ""; }; - 3538AA211D542685008EC33D /* MGLStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleLayer.h; sourceTree = ""; }; - 3538AA221D542685008EC33D /* MGLStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLStyleLayer.mm; sourceTree = ""; }; - 355BA4EB1D41633E00CCC6D5 /* NSColor+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSColor+MGLAdditions.h"; sourceTree = ""; }; - 355BA4EC1D41633E00CCC6D5 /* NSColor+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSColor+MGLAdditions.mm"; sourceTree = ""; }; - 35602BF81D3EA99F0050646F /* MGLFillStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLFillStyleLayer.h; sourceTree = ""; }; - 35602BF91D3EA99F0050646F /* MGLFillStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLFillStyleLayer.mm; sourceTree = ""; }; - 35602BFC1D3EA9B40050646F /* MGLStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleLayer_Private.h; sourceTree = ""; }; - 35602BFD1D3EA9B40050646F /* MGLForegroundStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLForegroundStyleLayer.h; sourceTree = ""; }; - 35602BFE1D3EA9B40050646F /* MGLForegroundStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLForegroundStyleLayer.mm; sourceTree = ""; }; + 1FF4858B2237235200F19727 /* MLNAttributedExpression.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLNAttributedExpression.m; sourceTree = ""; }; + 1FF4858C2237235200F19727 /* MLNAttributedExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNAttributedExpression.h; sourceTree = ""; }; + 3508EC621D749D39009B0EE4 /* NSExpression+MLNAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSExpression+MLNAdditions.h"; sourceTree = ""; }; + 3508EC631D749D39009B0EE4 /* NSExpression+MLNAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSExpression+MLNAdditions.mm"; sourceTree = ""; }; + 3526EABC1DF9B19800006B43 /* MLNCodingTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MLNCodingTests.mm; path = ../../darwin/test/MLNCodingTests.mm; sourceTree = ""; }; + 352742771D4C220900A1ECE6 /* MLNStyleValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNStyleValue.h; sourceTree = ""; }; + 3527427F1D4C243B00A1ECE6 /* MLNSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNSource.h; sourceTree = ""; }; + 352742801D4C243B00A1ECE6 /* MLNSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNSource.mm; sourceTree = ""; }; + 352742831D4C244700A1ECE6 /* MLNRasterTileSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNRasterTileSource.h; sourceTree = ""; }; + 352742841D4C244700A1ECE6 /* MLNRasterTileSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNRasterTileSource.mm; sourceTree = ""; }; + 352742871D4C245800A1ECE6 /* MLNShapeSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNShapeSource.h; sourceTree = ""; }; + 352742881D4C245800A1ECE6 /* MLNShapeSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNShapeSource.mm; sourceTree = ""; }; + 3527428B1D4C24AB00A1ECE6 /* MLNCircleStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNCircleStyleLayer.h; sourceTree = ""; }; + 3527428C1D4C24AB00A1ECE6 /* MLNCircleStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNCircleStyleLayer.mm; sourceTree = ""; }; + 3527429E1D4C25BD00A1ECE6 /* MLNStyleValue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNStyleValue.mm; sourceTree = ""; }; + 352903991D6C63B80002C7DF /* NSPredicate+MLNAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSPredicate+MLNAdditions.h"; sourceTree = ""; }; + 3529039A1D6C63B80002C7DF /* NSPredicate+MLNAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSPredicate+MLNAdditions.mm"; sourceTree = ""; }; + 3537CA731D3F93A600380318 /* MLNStyle_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNStyle_Private.h; sourceTree = ""; }; + 3538AA211D542685008EC33D /* MLNStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNStyleLayer.h; sourceTree = ""; }; + 3538AA221D542685008EC33D /* MLNStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNStyleLayer.mm; sourceTree = ""; }; + 355BA4EB1D41633E00CCC6D5 /* NSColor+MLNAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSColor+MLNAdditions.h"; sourceTree = ""; }; + 355BA4EC1D41633E00CCC6D5 /* NSColor+MLNAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSColor+MLNAdditions.mm"; sourceTree = ""; }; + 35602BF81D3EA99F0050646F /* MLNFillStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNFillStyleLayer.h; sourceTree = ""; }; + 35602BF91D3EA99F0050646F /* MLNFillStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNFillStyleLayer.mm; sourceTree = ""; }; + 35602BFC1D3EA9B40050646F /* MLNStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNStyleLayer_Private.h; sourceTree = ""; }; + 35602BFD1D3EA9B40050646F /* MLNForegroundStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNForegroundStyleLayer.h; sourceTree = ""; }; + 35602BFE1D3EA9B40050646F /* MLNForegroundStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNForegroundStyleLayer.mm; sourceTree = ""; }; 358EB3AE1D61F0DB00E46D9C /* amsterdam.geojson */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = amsterdam.geojson; path = ../../darwin/test/amsterdam.geojson; sourceTree = ""; }; - 359819571E02F611008FC139 /* NSCoder+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSCoder+MGLAdditions.h"; sourceTree = ""; }; - 359819581E02F611008FC139 /* NSCoder+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSCoder+MGLAdditions.mm"; sourceTree = ""; }; - 35C5D8431D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSComparisonPredicate+MGLAdditions.h"; sourceTree = ""; }; - 35C5D8441D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSComparisonPredicate+MGLAdditions.mm"; sourceTree = ""; }; - 35C5D8451D6DD66D00E95907 /* NSCompoundPredicate+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSCompoundPredicate+MGLAdditions.h"; sourceTree = ""; }; - 35C5D8461D6DD66D00E95907 /* NSCompoundPredicate+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSCompoundPredicate+MGLAdditions.mm"; sourceTree = ""; }; - 35C5D84B1D6DD75B00E95907 /* MGLPredicateTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLPredicateTests.mm; path = ../../darwin/test/MGLPredicateTests.mm; sourceTree = ""; }; - 35C6DF821E214C0400ACA483 /* MGLDistanceFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLDistanceFormatter.h; sourceTree = ""; }; - 35C6DF831E214C0400ACA483 /* MGLDistanceFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLDistanceFormatter.m; sourceTree = ""; }; - 35C6DF861E214C1800ACA483 /* MGLDistanceFormatterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLDistanceFormatterTests.m; path = ../../darwin/test/MGLDistanceFormatterTests.m; sourceTree = ""; }; - 35D65C581D65AD5500722C23 /* NSDate+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+MGLAdditions.h"; sourceTree = ""; }; - 35D65C591D65AD5500722C23 /* NSDate+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSDate+MGLAdditions.mm"; sourceTree = ""; }; + 359819571E02F611008FC139 /* NSCoder+MLNAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSCoder+MLNAdditions.h"; sourceTree = ""; }; + 359819581E02F611008FC139 /* NSCoder+MLNAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSCoder+MLNAdditions.mm"; sourceTree = ""; }; + 35C5D8431D6DD66D00E95907 /* NSComparisonPredicate+MLNAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSComparisonPredicate+MLNAdditions.h"; sourceTree = ""; }; + 35C5D8441D6DD66D00E95907 /* NSComparisonPredicate+MLNAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSComparisonPredicate+MLNAdditions.mm"; sourceTree = ""; }; + 35C5D8451D6DD66D00E95907 /* NSCompoundPredicate+MLNAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSCompoundPredicate+MLNAdditions.h"; sourceTree = ""; }; + 35C5D8461D6DD66D00E95907 /* NSCompoundPredicate+MLNAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSCompoundPredicate+MLNAdditions.mm"; sourceTree = ""; }; + 35C5D84B1D6DD75B00E95907 /* MLNPredicateTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MLNPredicateTests.mm; path = ../../darwin/test/MLNPredicateTests.mm; sourceTree = ""; }; + 35C6DF821E214C0400ACA483 /* MLNDistanceFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNDistanceFormatter.h; sourceTree = ""; }; + 35C6DF831E214C0400ACA483 /* MLNDistanceFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLNDistanceFormatter.m; sourceTree = ""; }; + 35C6DF861E214C1800ACA483 /* MLNDistanceFormatterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLNDistanceFormatterTests.m; path = ../../darwin/test/MLNDistanceFormatterTests.m; sourceTree = ""; }; + 35D65C581D65AD5500722C23 /* NSDate+MLNAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+MLNAdditions.h"; sourceTree = ""; }; + 35D65C591D65AD5500722C23 /* NSDate+MLNAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSDate+MLNAdditions.mm"; sourceTree = ""; }; 3E6465D7206576A800685536 /* LimeGreenStyleLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LimeGreenStyleLayer.m; path = ../../darwin/app/LimeGreenStyleLayer.m; sourceTree = ""; }; 3E6465D8206576A900685536 /* LimeGreenStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LimeGreenStyleLayer.h; path = ../../darwin/app/LimeGreenStyleLayer.h; sourceTree = ""; }; - 3EA9369A4C46957566058822 /* MGLRendererConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRendererConfiguration.h; sourceTree = ""; }; - 3EA93B1B0864609938506E12 /* MGLRendererConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLRendererConfiguration.m; sourceTree = ""; }; - 4031ACFB1E9EB3C100A3EA26 /* MGLMapViewDelegateIntegrationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MGLMapViewDelegateIntegrationTests.swift; sourceTree = ""; }; - 4031AD011E9FD6A300A3EA26 /* MGLSDKTestHelpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MGLSDKTestHelpers.swift; path = ../../darwin/test/MGLSDKTestHelpers.swift; sourceTree = ""; }; - 4049C2A11DB6CE7800B3F799 /* MGLPointCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLPointCollection.h; sourceTree = ""; }; - 4049C2A71DB6D09B00B3F799 /* MGLPointCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLPointCollection.mm; sourceTree = ""; }; - 405C03961DB0004E001AC280 /* NSImage+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSImage+MGLAdditions.h"; sourceTree = ""; }; - 405C03971DB0004E001AC280 /* NSImage+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSImage+MGLAdditions.mm"; sourceTree = ""; }; - 408AA85A1DAEECF100022900 /* MGLShape_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLShape_Private.h; sourceTree = ""; }; - 408AA85E1DAEED3300022900 /* NSDictionary+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSDictionary+MGLAdditions.mm"; sourceTree = ""; }; - 408AA85F1DAEED3300022900 /* NSDictionary+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+MGLAdditions.h"; sourceTree = ""; }; - 40B77E421DB11BB0003DA2FE /* NSArray+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSArray+MGLAdditions.mm"; sourceTree = ""; }; - 40B77E431DB11BB0003DA2FE /* NSArray+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+MGLAdditions.h"; sourceTree = ""; }; - 40E1601A1DF216E6005EA6D9 /* MGLStyleLayerTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleLayerTests.h; sourceTree = ""; }; - 40E1601B1DF216E6005EA6D9 /* MGLStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLStyleLayerTests.m; sourceTree = ""; }; - 4BBCDC49265260FE004106C3 /* MGLTileServerOptions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLTileServerOptions.mm; sourceTree = ""; }; - 4BBCDC4A265260FF004106C3 /* MGLDefaultStyle.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLDefaultStyle.mm; sourceTree = ""; }; - 4BBCDC4B265260FF004106C3 /* MGLTileServerOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLTileServerOptions.h; sourceTree = ""; }; - 4BBCDC4C265260FF004106C3 /* MGLDefaultStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLDefaultStyle.h; sourceTree = ""; }; - 556660C51E1BEA0100E2C41B /* MGLFoundation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLFoundation.h; sourceTree = ""; }; - 556660D51E1D07E400E2C41B /* MGLVersionNumber.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MGLVersionNumber.m; path = ../../darwin/test/MGLVersionNumber.m; sourceTree = ""; }; - 558DE7A41E56161C00C7916D /* MGLFoundation_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLFoundation_Private.h; sourceTree = ""; }; - 558DE7A51E56161C00C7916D /* MGLFoundation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLFoundation.mm; sourceTree = ""; }; - 5591AC682298361600FF9ADF /* MGLMapView+Impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MGLMapView+Impl.h"; sourceTree = ""; }; - 5591AC692298361600FF9ADF /* MGLMapView+Impl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "MGLMapView+Impl.mm"; sourceTree = ""; }; - 55CAF6312294407F00F17770 /* MGLMapView+OpenGL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MGLMapView+OpenGL.h"; sourceTree = ""; }; - 55CAF6332294409B00F17770 /* MGLMapView+OpenGL.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = "MGLMapView+OpenGL.mm"; sourceTree = ""; }; + 3EA9369A4C46957566058822 /* MLNRendererConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNRendererConfiguration.h; sourceTree = ""; }; + 3EA93B1B0864609938506E12 /* MLNRendererConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLNRendererConfiguration.m; sourceTree = ""; }; + 4031ACFB1E9EB3C100A3EA26 /* MLNMapViewDelegateIntegrationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MLNMapViewDelegateIntegrationTests.swift; sourceTree = ""; }; + 4031AD011E9FD6A300A3EA26 /* MLNSDKTestHelpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MLNSDKTestHelpers.swift; path = ../../darwin/test/MLNSDKTestHelpers.swift; sourceTree = ""; }; + 4049C2A11DB6CE7800B3F799 /* MLNPointCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNPointCollection.h; sourceTree = ""; }; + 4049C2A71DB6D09B00B3F799 /* MLNPointCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNPointCollection.mm; sourceTree = ""; }; + 405C03961DB0004E001AC280 /* NSImage+MLNAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSImage+MLNAdditions.h"; sourceTree = ""; }; + 405C03971DB0004E001AC280 /* NSImage+MLNAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSImage+MLNAdditions.mm"; sourceTree = ""; }; + 408AA85A1DAEECF100022900 /* MLNShape_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNShape_Private.h; sourceTree = ""; }; + 408AA85E1DAEED3300022900 /* NSDictionary+MLNAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSDictionary+MLNAdditions.mm"; sourceTree = ""; }; + 408AA85F1DAEED3300022900 /* NSDictionary+MLNAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+MLNAdditions.h"; sourceTree = ""; }; + 40B77E421DB11BB0003DA2FE /* NSArray+MLNAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSArray+MLNAdditions.mm"; sourceTree = ""; }; + 40B77E431DB11BB0003DA2FE /* NSArray+MLNAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+MLNAdditions.h"; sourceTree = ""; }; + 40E1601A1DF216E6005EA6D9 /* MLNStyleLayerTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNStyleLayerTests.h; sourceTree = ""; }; + 40E1601B1DF216E6005EA6D9 /* MLNStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLNStyleLayerTests.m; sourceTree = ""; }; + 4BBCDC49265260FE004106C3 /* MLNTileServerOptions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNTileServerOptions.mm; sourceTree = ""; }; + 4BBCDC4A265260FF004106C3 /* MLNDefaultStyle.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNDefaultStyle.mm; sourceTree = ""; }; + 4BBCDC4B265260FF004106C3 /* MLNTileServerOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNTileServerOptions.h; sourceTree = ""; }; + 4BBCDC4C265260FF004106C3 /* MLNDefaultStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNDefaultStyle.h; sourceTree = ""; }; + 556660C51E1BEA0100E2C41B /* MLNFoundation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MLNFoundation.h; sourceTree = ""; }; + 556660D51E1D07E400E2C41B /* MLNVersionNumber.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MLNVersionNumber.m; path = ../../darwin/test/MLNVersionNumber.m; sourceTree = ""; }; + 558DE7A41E56161C00C7916D /* MLNFoundation_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNFoundation_Private.h; sourceTree = ""; }; + 558DE7A51E56161C00C7916D /* MLNFoundation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNFoundation.mm; sourceTree = ""; }; + 5591AC682298361600FF9ADF /* MLNMapView+Impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MLNMapView+Impl.h"; sourceTree = ""; }; + 5591AC692298361600FF9ADF /* MLNMapView+Impl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "MLNMapView+Impl.mm"; sourceTree = ""; }; + 55CAF6312294407F00F17770 /* MLNMapView+OpenGL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MLNMapView+OpenGL.h"; sourceTree = ""; }; + 55CAF6332294409B00F17770 /* MLNMapView+OpenGL.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = "MLNMapView+OpenGL.mm"; sourceTree = ""; }; 55CF7532213EDADF00ED86C4 /* libmbgl-vendor-icu.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libmbgl-vendor-icu.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 55D9B4B01D005D3900C1CCE2 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; - 55E2AD101E5B0A6900E8C587 /* MGLOfflineStorageTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLOfflineStorageTests.mm; path = ../../darwin/test/MGLOfflineStorageTests.mm; sourceTree = ""; }; - 747ABE54219B2BDA00523B67 /* MGLFillExtrusionStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLFillExtrusionStyleLayer_Private.h; sourceTree = ""; }; - 747ABE55219B2BDA00523B67 /* MGLCircleStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLCircleStyleLayer_Private.h; sourceTree = ""; }; - 747ABE56219B2BDB00523B67 /* MGLBackgroundStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLBackgroundStyleLayer_Private.h; sourceTree = ""; }; - 747ABE57219B2BDB00523B67 /* MGLFillStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLFillStyleLayer_Private.h; sourceTree = ""; }; - 747ABE58219B2BDB00523B67 /* MGLHeatmapStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLHeatmapStyleLayer_Private.h; sourceTree = ""; }; - 747ABE5E219B2BED00523B67 /* MGLHillshadeStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLHillshadeStyleLayer_Private.h; sourceTree = ""; }; - 747ABE60219B2C0000523B67 /* MGLLineStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLLineStyleLayer_Private.h; sourceTree = ""; }; - 747ABE62219B2C1700523B67 /* MGLOpenGLStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLOpenGLStyleLayer_Private.h; sourceTree = ""; }; - 747ABE63219B2C1700523B67 /* MGLRasterStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRasterStyleLayer_Private.h; sourceTree = ""; }; - 747ABE66219B2C3200523B67 /* MGLSymbolStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLSymbolStyleLayer_Private.h; sourceTree = ""; }; - 749EC88F2199CCB8005608D7 /* MGLStyleLayerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleLayerManager.h; sourceTree = ""; }; - 749EC8902199CCB9005608D7 /* MGLStyleLayerManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLStyleLayerManager.mm; sourceTree = ""; }; + 55E2AD101E5B0A6900E8C587 /* MLNOfflineStorageTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MLNOfflineStorageTests.mm; path = ../../darwin/test/MLNOfflineStorageTests.mm; sourceTree = ""; }; + 747ABE54219B2BDA00523B67 /* MLNFillExtrusionStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNFillExtrusionStyleLayer_Private.h; sourceTree = ""; }; + 747ABE55219B2BDA00523B67 /* MLNCircleStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNCircleStyleLayer_Private.h; sourceTree = ""; }; + 747ABE56219B2BDB00523B67 /* MLNBackgroundStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNBackgroundStyleLayer_Private.h; sourceTree = ""; }; + 747ABE57219B2BDB00523B67 /* MLNFillStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNFillStyleLayer_Private.h; sourceTree = ""; }; + 747ABE58219B2BDB00523B67 /* MLNHeatmapStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNHeatmapStyleLayer_Private.h; sourceTree = ""; }; + 747ABE5E219B2BED00523B67 /* MLNHillshadeStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNHillshadeStyleLayer_Private.h; sourceTree = ""; }; + 747ABE60219B2C0000523B67 /* MLNLineStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNLineStyleLayer_Private.h; sourceTree = ""; }; + 747ABE62219B2C1700523B67 /* MLNOpenGLStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNOpenGLStyleLayer_Private.h; sourceTree = ""; }; + 747ABE63219B2C1700523B67 /* MLNRasterStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNRasterStyleLayer_Private.h; sourceTree = ""; }; + 747ABE66219B2C3200523B67 /* MLNSymbolStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNSymbolStyleLayer_Private.h; sourceTree = ""; }; + 749EC88F2199CCB8005608D7 /* MLNStyleLayerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNStyleLayerManager.h; sourceTree = ""; }; + 749EC8902199CCB9005608D7 /* MLNStyleLayerManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNStyleLayerManager.mm; sourceTree = ""; }; 89462398200D199100DA8EF2 /* heatmap.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = heatmap.json; sourceTree = ""; }; - 8946239A200E73CA00DA8EF2 /* MGLHeatmapStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLHeatmapStyleLayer.h; sourceTree = ""; }; - 8946239B200E73CA00DA8EF2 /* MGLHeatmapStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLHeatmapStyleLayer.mm; sourceTree = ""; }; - 92092EEE1F5EB10E00AF5130 /* MGLMapSnapshotter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLMapSnapshotter.h; sourceTree = ""; }; - 92092EEF1F5EB10E00AF5130 /* MGLMapSnapshotter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLMapSnapshotter.mm; sourceTree = ""; }; - 920A3E581E6F859D00C16EFC /* MGLSourceQueryTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLSourceQueryTests.m; sourceTree = ""; }; - 9221BAAE20699CBA0054BDF4 /* MGLTilePyramidOfflineRegion_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLTilePyramidOfflineRegion_Private.h; sourceTree = ""; }; - 9250B8C22073C69000EF338C /* MGLShapeOfflineRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLShapeOfflineRegion.h; sourceTree = ""; }; - 92F2C3EA1F0E3A1900268EC0 /* MGLRendererFrontend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRendererFrontend.h; sourceTree = ""; }; - 92FC0AE3207CC8DA007B6B54 /* MGLShapeOfflineRegion_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLShapeOfflineRegion_Private.h; sourceTree = ""; }; - 92FC0AE5207CDD8D007B6B54 /* MGLShapeOfflineRegion.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLShapeOfflineRegion.mm; sourceTree = ""; }; - 9654C12A1FFC38E000DB6A19 /* MGLPolyline_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLPolyline_Private.h; sourceTree = ""; }; - 9654C12C1FFC394700DB6A19 /* MGLPolygon_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLPolygon_Private.h; sourceTree = ""; }; + 8946239A200E73CA00DA8EF2 /* MLNHeatmapStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNHeatmapStyleLayer.h; sourceTree = ""; }; + 8946239B200E73CA00DA8EF2 /* MLNHeatmapStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNHeatmapStyleLayer.mm; sourceTree = ""; }; + 92092EEE1F5EB10E00AF5130 /* MLNMapSnapshotter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNMapSnapshotter.h; sourceTree = ""; }; + 92092EEF1F5EB10E00AF5130 /* MLNMapSnapshotter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNMapSnapshotter.mm; sourceTree = ""; }; + 920A3E581E6F859D00C16EFC /* MLNSourceQueryTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLNSourceQueryTests.m; sourceTree = ""; }; + 9221BAAE20699CBA0054BDF4 /* MLNTilePyramidOfflineRegion_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNTilePyramidOfflineRegion_Private.h; sourceTree = ""; }; + 9250B8C22073C69000EF338C /* MLNShapeOfflineRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNShapeOfflineRegion.h; sourceTree = ""; }; + 92F2C3EA1F0E3A1900268EC0 /* MLNRendererFrontend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNRendererFrontend.h; sourceTree = ""; }; + 92FC0AE3207CC8DA007B6B54 /* MLNShapeOfflineRegion_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNShapeOfflineRegion_Private.h; sourceTree = ""; }; + 92FC0AE5207CDD8D007B6B54 /* MLNShapeOfflineRegion.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNShapeOfflineRegion.mm; sourceTree = ""; }; + 9654C12A1FFC38E000DB6A19 /* MLNPolyline_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNPolyline_Private.h; sourceTree = ""; }; + 9654C12C1FFC394700DB6A19 /* MLNPolygon_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNPolygon_Private.h; sourceTree = ""; }; 966091701E5BBFF700A9A03B /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = ""; }; 966091711E5BBFF900A9A03B /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = ""; }; 966091721E5BBFFA00A9A03B /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Localizable.strings; sourceTree = ""; }; @@ -473,50 +473,50 @@ 96E027391E57C9B9004B8E66 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Localizable.strings; sourceTree = ""; }; 96E0273A1E57C9BB004B8E66 /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = vi.lproj/Localizable.strings; sourceTree = ""; }; 96E0273B1E57C9BC004B8E66 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = ""; }; - CA0B3C042329F7E600E4B493 /* MGLTestAssertionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MGLTestAssertionHandler.h; path = ../../darwin/test/MGLTestAssertionHandler.h; sourceTree = ""; }; - CA0B3C052329F7E600E4B493 /* MGLTestAssertionHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLTestAssertionHandler.m; path = ../../darwin/test/MGLTestAssertionHandler.m; sourceTree = ""; }; - CA0B3C082329FB4800E4B493 /* MGLOfflinePackTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLOfflinePackTests.mm; path = ../../darwin/test/MGLOfflinePackTests.mm; sourceTree = ""; }; - CA4045C4216720D700B356E1 /* MGLCluster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLCluster.h; sourceTree = ""; }; - CA8FBC0C21A4A74300D1203C /* MGLRendererConfigurationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLRendererConfigurationTests.m; path = ../../darwin/test/MGLRendererConfigurationTests.m; sourceTree = ""; }; - CA9461A520884CCB0015EB12 /* MGLAnnotationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLAnnotationTests.m; path = test/MGLAnnotationTests.m; sourceTree = SOURCE_ROOT; }; - CAD9D0AB22A88A32001B25EE /* MGLResourceTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLResourceTests.mm; path = ../../darwin/test/MGLResourceTests.mm; sourceTree = ""; }; - CF762DEE22DC7EFF00338472 /* MGLLoggingConfiguration.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLLoggingConfiguration.mm; sourceTree = ""; }; - DA00FC881D5EEAC3009AABC8 /* MGLAttributionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAttributionInfo.h; sourceTree = ""; }; - DA00FC891D5EEAC3009AABC8 /* MGLAttributionInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLAttributionInfo.mm; sourceTree = ""; }; - DA0CD58D1CF56F5800A5F5A5 /* MGLFeatureTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLFeatureTests.mm; path = ../../darwin/test/MGLFeatureTests.mm; sourceTree = ""; }; - DA0E9F3A24119F6B007C75D4 /* MGLImageTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLImageTests.mm; path = ../../darwin/test/MGLImageTests.mm; sourceTree = ""; }; + CA0B3C042329F7E600E4B493 /* MLNTestAssertionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MLNTestAssertionHandler.h; path = ../../darwin/test/MLNTestAssertionHandler.h; sourceTree = ""; }; + CA0B3C052329F7E600E4B493 /* MLNTestAssertionHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLNTestAssertionHandler.m; path = ../../darwin/test/MLNTestAssertionHandler.m; sourceTree = ""; }; + CA0B3C082329FB4800E4B493 /* MLNOfflinePackTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MLNOfflinePackTests.mm; path = ../../darwin/test/MLNOfflinePackTests.mm; sourceTree = ""; }; + CA4045C4216720D700B356E1 /* MLNCluster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNCluster.h; sourceTree = ""; }; + CA8FBC0C21A4A74300D1203C /* MLNRendererConfigurationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLNRendererConfigurationTests.m; path = ../../darwin/test/MLNRendererConfigurationTests.m; sourceTree = ""; }; + CA9461A520884CCB0015EB12 /* MLNAnnotationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLNAnnotationTests.m; path = test/MLNAnnotationTests.m; sourceTree = SOURCE_ROOT; }; + CAD9D0AB22A88A32001B25EE /* MLNResourceTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MLNResourceTests.mm; path = ../../darwin/test/MLNResourceTests.mm; sourceTree = ""; }; + CF762DEE22DC7EFF00338472 /* MLNLoggingConfiguration.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNLoggingConfiguration.mm; sourceTree = ""; }; + DA00FC881D5EEAC3009AABC8 /* MLNAttributionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNAttributionInfo.h; sourceTree = ""; }; + DA00FC891D5EEAC3009AABC8 /* MLNAttributionInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNAttributionInfo.mm; sourceTree = ""; }; + DA0CD58D1CF56F5800A5F5A5 /* MLNFeatureTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MLNFeatureTests.mm; path = ../../darwin/test/MLNFeatureTests.mm; sourceTree = ""; }; + DA0E9F3A24119F6B007C75D4 /* MLNImageTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = MLNImageTests.mm; path = ../../darwin/test/MLNImageTests.mm; sourceTree = ""; }; DA1AC01E1E5B8826006DF1D6 /* lt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = lt; path = lt.lproj/Localizable.strings; sourceTree = ""; }; DA1AC01F1E5B8904006DF1D6 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = uk; path = uk.lproj/Foundation.stringsdict; sourceTree = ""; }; DA2207BA1DC076930002F84D /* test-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "test-Bridging-Header.h"; sourceTree = ""; }; DA2784FD1DF03060001D5B8D /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Media.xcassets; path = ../../darwin/test/Media.xcassets; sourceTree = ""; }; - DA2987591E1A4290002299F5 /* MGLDocumentationExampleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MGLDocumentationExampleTests.swift; path = ../../darwin/test/MGLDocumentationExampleTests.swift; sourceTree = ""; }; + DA2987591E1A4290002299F5 /* MLNDocumentationExampleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MLNDocumentationExampleTests.swift; path = ../../darwin/test/MLNDocumentationExampleTests.swift; sourceTree = ""; }; DA3389601FA3EAC4001EA329 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Foundation.strings"; sourceTree = ""; }; DA3389611FA3EDCE001EA329 /* bg */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = bg; path = bg.lproj/Localizable.strings; sourceTree = ""; }; DA3389621FA3EDEF001EA329 /* bg */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = bg; path = bg.lproj/Foundation.strings; sourceTree = ""; }; DA3389631FA3EDF5001EA329 /* bg */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = bg; path = bg.lproj/Foundation.stringsdict; sourceTree = ""; }; DA3389641FA3EE00001EA329 /* bg */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = bg; path = bg.lproj/Localizable.strings; sourceTree = ""; }; DA33896C1FA3EF51001EA329 /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = hu; path = hu.lproj/Foundation.stringsdict; sourceTree = ""; }; - DA35A2A31CC9EB1A00E826B2 /* MGLCoordinateFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLCoordinateFormatter.h; sourceTree = ""; }; - DA35A2A51CC9EB2700E826B2 /* MGLCoordinateFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLCoordinateFormatter.m; sourceTree = ""; }; - DA35A2A71CC9F41600E826B2 /* MGLCoordinateFormatterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLCoordinateFormatterTests.m; path = ../../darwin/test/MGLCoordinateFormatterTests.m; sourceTree = ""; }; - DA35A2AB1CCA091800E826B2 /* MGLCompassDirectionFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLCompassDirectionFormatter.h; sourceTree = ""; }; - DA35A2AC1CCA091800E826B2 /* MGLCompassDirectionFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLCompassDirectionFormatter.m; sourceTree = ""; }; - DA35A2B51CCA14D700E826B2 /* MGLCompassDirectionFormatterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLCompassDirectionFormatterTests.m; path = ../../darwin/test/MGLCompassDirectionFormatterTests.m; sourceTree = ""; }; - DA35A2BD1CCA9B1A00E826B2 /* MGLClockDirectionFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLClockDirectionFormatter.h; sourceTree = ""; }; - DA35A2BE1CCA9B1A00E826B2 /* MGLClockDirectionFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLClockDirectionFormatter.m; sourceTree = ""; }; - DA35A2C11CCA9F4A00E826B2 /* MGLClockDirectionFormatterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLClockDirectionFormatterTests.m; path = ../../darwin/test/MGLClockDirectionFormatterTests.m; sourceTree = ""; }; - DA35A2CD1CCAAED300E826B2 /* NSValue+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSValue+MGLAdditions.h"; sourceTree = ""; }; - DA35A2CE1CCAAED300E826B2 /* NSValue+MGLAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSValue+MGLAdditions.m"; sourceTree = ""; }; + DA35A2A31CC9EB1A00E826B2 /* MLNCoordinateFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNCoordinateFormatter.h; sourceTree = ""; }; + DA35A2A51CC9EB2700E826B2 /* MLNCoordinateFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLNCoordinateFormatter.m; sourceTree = ""; }; + DA35A2A71CC9F41600E826B2 /* MLNCoordinateFormatterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLNCoordinateFormatterTests.m; path = ../../darwin/test/MLNCoordinateFormatterTests.m; sourceTree = ""; }; + DA35A2AB1CCA091800E826B2 /* MLNCompassDirectionFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNCompassDirectionFormatter.h; sourceTree = ""; }; + DA35A2AC1CCA091800E826B2 /* MLNCompassDirectionFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLNCompassDirectionFormatter.m; sourceTree = ""; }; + DA35A2B51CCA14D700E826B2 /* MLNCompassDirectionFormatterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLNCompassDirectionFormatterTests.m; path = ../../darwin/test/MLNCompassDirectionFormatterTests.m; sourceTree = ""; }; + DA35A2BD1CCA9B1A00E826B2 /* MLNClockDirectionFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNClockDirectionFormatter.h; sourceTree = ""; }; + DA35A2BE1CCA9B1A00E826B2 /* MLNClockDirectionFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLNClockDirectionFormatter.m; sourceTree = ""; }; + DA35A2C11CCA9F4A00E826B2 /* MLNClockDirectionFormatterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLNClockDirectionFormatterTests.m; path = ../../darwin/test/MLNClockDirectionFormatterTests.m; sourceTree = ""; }; + DA35A2CD1CCAAED300E826B2 /* NSValue+MLNAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSValue+MLNAdditions.h"; sourceTree = ""; }; + DA35A2CE1CCAAED300E826B2 /* NSValue+MLNAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSValue+MLNAdditions.m"; sourceTree = ""; }; DA35D0891E1A631B007DED41 /* one-liner.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = "one-liner.json"; path = "../../darwin/test/one-liner.json"; sourceTree = ""; }; - DA35D9C4240916370013ECB0 /* MGLReachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLReachability.h; sourceTree = ""; }; - DA35D9C5240916380013ECB0 /* MGLReachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLReachability.m; sourceTree = ""; }; + DA35D9C4240916370013ECB0 /* MLNReachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNReachability.h; sourceTree = ""; }; + DA35D9C5240916380013ECB0 /* MLNReachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLNReachability.m; sourceTree = ""; }; DA35D9C82409205B0013ECB0 /* libmbgl-vendor-csscolorparser.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libmbgl-vendor-csscolorparser.a"; sourceTree = BUILT_PRODUCTS_DIR; }; DA35D9CA240920640013ECB0 /* libmbgl-vendor-parsedate.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libmbgl-vendor-parsedate.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - DA551B7F1DB496AC0009AFAF /* MGLTileSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLTileSource.h; sourceTree = ""; }; - DA551B801DB496AC0009AFAF /* MGLTileSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLTileSource_Private.h; sourceTree = ""; }; - DA551B811DB496AC0009AFAF /* MGLTileSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLTileSource.mm; sourceTree = ""; }; + DA551B7F1DB496AC0009AFAF /* MLNTileSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNTileSource.h; sourceTree = ""; }; + DA551B801DB496AC0009AFAF /* MLNTileSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNTileSource_Private.h; sourceTree = ""; }; + DA551B811DB496AC0009AFAF /* MLNTileSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNTileSource.mm; sourceTree = ""; }; DA5589761D320C41006B7F64 /* wms.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = wms.json; sourceTree = ""; }; - DA57D4B01EBC699800793288 /* MGLDocumentationGuideTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MGLDocumentationGuideTests.swift; path = ../../darwin/test/MGLDocumentationGuideTests.swift; sourceTree = ""; }; + DA57D4B01EBC699800793288 /* MLNDocumentationGuideTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MLNDocumentationGuideTests.swift; path = ../../darwin/test/MLNDocumentationGuideTests.swift; sourceTree = ""; }; DA6023EF1E4CE8E500DBFF23 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Foundation.strings; sourceTree = ""; }; DA6023F01E4CE8FF00DBFF23 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = sv; path = sv.lproj/Foundation.stringsdict; sourceTree = ""; }; DA618B131E68850300CB7F44 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = ""; }; @@ -529,22 +529,22 @@ DA618B241E6891F300CB7F44 /* lt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = lt; path = lt.lproj/Foundation.stringsdict; sourceTree = ""; }; DA618B271E68926E00CB7F44 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Localizable.strings; sourceTree = ""; }; DA618B2A1E6892B500CB7F44 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Localizable.strings; sourceTree = ""; }; - DA6408D51DA4E5DA00908C90 /* MGLVectorStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLVectorStyleLayer.h; sourceTree = ""; }; - DA6408D61DA4E5DA00908C90 /* MGLVectorStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLVectorStyleLayer.mm; sourceTree = ""; }; - DA695423215B1E6C002041A4 /* MGLMapCameraTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MGLMapCameraTests.m; path = ../../darwin/test/MGLMapCameraTests.m; sourceTree = ""; }; + DA6408D51DA4E5DA00908C90 /* MLNVectorStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNVectorStyleLayer.h; sourceTree = ""; }; + DA6408D61DA4E5DA00908C90 /* MLNVectorStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNVectorStyleLayer.mm; sourceTree = ""; }; + DA695423215B1E6C002041A4 /* MLNMapCameraTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MLNMapCameraTests.m; path = ../../darwin/test/MLNMapCameraTests.m; sourceTree = ""; }; DA704CBA1F6372E8004B3F28 /* ru */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Foundation.strings; sourceTree = ""; }; DA704CBE1F637531004B3F28 /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/Localizable.strings; sourceTree = ""; }; DA704CBF1F637548004B3F28 /* hu */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/Localizable.strings; sourceTree = ""; }; DA704CC61F666385004B3F28 /* uk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Foundation.strings; sourceTree = ""; }; - DA7262051DEEDD460043BB89 /* MGLOpenGLStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLOpenGLStyleLayer.h; sourceTree = ""; }; - DA7262061DEEDD460043BB89 /* MGLOpenGLStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLOpenGLStyleLayer.mm; sourceTree = ""; }; + DA7262051DEEDD460043BB89 /* MLNOpenGLStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNOpenGLStyleLayer.h; sourceTree = ""; }; + DA7262061DEEDD460043BB89 /* MLNOpenGLStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNOpenGLStyleLayer.mm; sourceTree = ""; }; DA737ADE1E5914AD00AD2CDE /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = es; path = es.lproj/Foundation.stringsdict; sourceTree = ""; }; DA737ADF1E5914D300AD2CDE /* es */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = ""; }; DA737AE31E5915A500AD2CDE /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = pl; path = pl.lproj/Foundation.stringsdict; sourceTree = ""; }; DA737AE41E5915B000AD2CDE /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = ""; }; DA737AEC1E59180E00AD2CDE /* uk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Localizable.strings; sourceTree = ""; }; - DA7DC9801DED5F5C0027472F /* MGLVectorTileSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLVectorTileSource_Private.h; sourceTree = ""; }; - DA7DC9821DED647F0027472F /* MGLRasterTileSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRasterTileSource_Private.h; sourceTree = ""; }; + DA7DC9801DED5F5C0027472F /* MLNVectorTileSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNVectorTileSource_Private.h; sourceTree = ""; }; + DA7DC9821DED647F0027472F /* MLNRasterTileSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNRasterTileSource_Private.h; sourceTree = ""; }; DA80E95D1FE84A300065FC9B /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Localizable.strings; sourceTree = ""; }; DA80E95F1FE84A540065FC9B /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ar; path = ar.lproj/Foundation.stringsdict; sourceTree = ""; }; DA839E921CC2E3400062CAFB /* Mapbox GL.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Mapbox GL.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -557,39 +557,39 @@ DA839EA11CC2E3400062CAFB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; DA839EA41CC2E3400062CAFB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; DA839EA61CC2E3400062CAFB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - DA87A9961DC9D88400810D09 /* MGLShapeSourceTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLShapeSourceTests.mm; sourceTree = ""; }; - DA87A9971DC9D88400810D09 /* MGLTileSetTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLTileSetTests.mm; sourceTree = ""; }; - DA87A99B1DC9D8DD00810D09 /* MGLShapeSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLShapeSource_Private.h; sourceTree = ""; }; - DA87A99F1DC9DC6200810D09 /* MGLValueEvaluator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLValueEvaluator.h; sourceTree = ""; }; + DA87A9961DC9D88400810D09 /* MLNShapeSourceTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNShapeSourceTests.mm; sourceTree = ""; }; + DA87A9971DC9D88400810D09 /* MLNTileSetTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNTileSetTests.mm; sourceTree = ""; }; + DA87A99B1DC9D8DD00810D09 /* MLNShapeSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNShapeSource_Private.h; sourceTree = ""; }; + DA87A99F1DC9DC6200810D09 /* MLNValueEvaluator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNValueEvaluator.h; sourceTree = ""; }; DA88520F1E0A4D0D009D7AD6 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; DA8852101E0A4D3A009D7AD6 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Foundation.strings"; sourceTree = ""; }; - DA8933A61CCD287300E68420 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MGLAnnotationCallout.xib; sourceTree = ""; }; + DA8933A61CCD287300E68420 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MLNAnnotationCallout.xib; sourceTree = ""; }; DA8933AC1CCD290700E68420 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; }; DA8933B41CCD2C2500E68420 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Foundation.strings; sourceTree = ""; }; DA8933B71CCD2C2D00E68420 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Foundation.stringsdict; sourceTree = ""; }; - DA8F25741D51C5F40010E6B5 /* MGLFillStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLFillStyleLayerTests.mm; sourceTree = ""; }; - DA8F25751D51C5F40010E6B5 /* MGLRasterStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLRasterStyleLayerTests.mm; sourceTree = ""; }; - DA8F25761D51C5F40010E6B5 /* MGLSymbolStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLSymbolStyleLayerTests.mm; sourceTree = ""; }; - DA8F25771D51C5F40010E6B5 /* MGLLineStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLLineStyleLayerTests.mm; sourceTree = ""; }; - DA8F25781D51C5F40010E6B5 /* MGLCircleStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLCircleStyleLayerTests.mm; sourceTree = ""; }; - DA8F25791D51C5F40010E6B5 /* MGLBackgroundStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLBackgroundStyleLayerTests.mm; sourceTree = ""; }; - DA8F25851D51C9E10010E6B5 /* MGLBackgroundStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLBackgroundStyleLayer.h; sourceTree = ""; }; - DA8F25861D51C9E10010E6B5 /* MGLBackgroundStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLBackgroundStyleLayer.mm; sourceTree = ""; }; - DA8F25891D51CA540010E6B5 /* MGLLineStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLLineStyleLayer.h; sourceTree = ""; }; - DA8F258A1D51CA540010E6B5 /* MGLLineStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLLineStyleLayer.mm; sourceTree = ""; }; - DA8F258D1D51CA600010E6B5 /* MGLRasterStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRasterStyleLayer.h; sourceTree = ""; }; - DA8F258E1D51CA600010E6B5 /* MGLRasterStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLRasterStyleLayer.mm; sourceTree = ""; }; - DA8F25911D51CA750010E6B5 /* MGLSymbolStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLSymbolStyleLayer.h; sourceTree = ""; }; - DA8F25921D51CA750010E6B5 /* MGLSymbolStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLSymbolStyleLayer.mm; sourceTree = ""; }; - DA8F25951D51CAC70010E6B5 /* MGLVectorTileSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLVectorTileSource.h; sourceTree = ""; }; - DA8F25961D51CAC70010E6B5 /* MGLVectorTileSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLVectorTileSource.mm; sourceTree = ""; }; - DA8F25991D51CAD00010E6B5 /* MGLSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLSource_Private.h; sourceTree = ""; }; - DA8F259B1D51CB000010E6B5 /* MGLStyleValue_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleValue_Private.h; sourceTree = ""; }; - DA8F25A61D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSValue+MGLStyleAttributeAdditions.h"; sourceTree = ""; }; - DA8F25A71D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSValue+MGLStyleAttributeAdditions.mm"; sourceTree = ""; }; - DA8F25B51D51D2240010E6B5 /* MGLStyleLayerTests.mm.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; name = MGLStyleLayerTests.mm.ejs; path = ../test/MGLStyleLayerTests.mm.ejs; sourceTree = ""; }; - DA8F25B61D51D2240010E6B5 /* MGLStyleLayer.h.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; path = MGLStyleLayer.h.ejs; sourceTree = ""; }; - DA8F25B71D51D2240010E6B5 /* MGLStyleLayer.mm.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; path = MGLStyleLayer.mm.ejs; sourceTree = ""; }; + DA8F25741D51C5F40010E6B5 /* MLNFillStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNFillStyleLayerTests.mm; sourceTree = ""; }; + DA8F25751D51C5F40010E6B5 /* MLNRasterStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNRasterStyleLayerTests.mm; sourceTree = ""; }; + DA8F25761D51C5F40010E6B5 /* MLNSymbolStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNSymbolStyleLayerTests.mm; sourceTree = ""; }; + DA8F25771D51C5F40010E6B5 /* MLNLineStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNLineStyleLayerTests.mm; sourceTree = ""; }; + DA8F25781D51C5F40010E6B5 /* MLNCircleStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNCircleStyleLayerTests.mm; sourceTree = ""; }; + DA8F25791D51C5F40010E6B5 /* MLNBackgroundStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNBackgroundStyleLayerTests.mm; sourceTree = ""; }; + DA8F25851D51C9E10010E6B5 /* MLNBackgroundStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNBackgroundStyleLayer.h; sourceTree = ""; }; + DA8F25861D51C9E10010E6B5 /* MLNBackgroundStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNBackgroundStyleLayer.mm; sourceTree = ""; }; + DA8F25891D51CA540010E6B5 /* MLNLineStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNLineStyleLayer.h; sourceTree = ""; }; + DA8F258A1D51CA540010E6B5 /* MLNLineStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNLineStyleLayer.mm; sourceTree = ""; }; + DA8F258D1D51CA600010E6B5 /* MLNRasterStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNRasterStyleLayer.h; sourceTree = ""; }; + DA8F258E1D51CA600010E6B5 /* MLNRasterStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNRasterStyleLayer.mm; sourceTree = ""; }; + DA8F25911D51CA750010E6B5 /* MLNSymbolStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNSymbolStyleLayer.h; sourceTree = ""; }; + DA8F25921D51CA750010E6B5 /* MLNSymbolStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNSymbolStyleLayer.mm; sourceTree = ""; }; + DA8F25951D51CAC70010E6B5 /* MLNVectorTileSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNVectorTileSource.h; sourceTree = ""; }; + DA8F25961D51CAC70010E6B5 /* MLNVectorTileSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNVectorTileSource.mm; sourceTree = ""; }; + DA8F25991D51CAD00010E6B5 /* MLNSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNSource_Private.h; sourceTree = ""; }; + DA8F259B1D51CB000010E6B5 /* MLNStyleValue_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNStyleValue_Private.h; sourceTree = ""; }; + DA8F25A61D51CB270010E6B5 /* NSValue+MLNStyleAttributeAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSValue+MLNStyleAttributeAdditions.h"; sourceTree = ""; }; + DA8F25A71D51CB270010E6B5 /* NSValue+MLNStyleAttributeAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSValue+MLNStyleAttributeAdditions.mm"; sourceTree = ""; }; + DA8F25B51D51D2240010E6B5 /* MLNStyleLayerTests.mm.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; name = MLNStyleLayerTests.mm.ejs; path = ../test/MLNStyleLayerTests.mm.ejs; sourceTree = ""; }; + DA8F25B61D51D2240010E6B5 /* MLNStyleLayer.h.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; path = MLNStyleLayer.h.ejs; sourceTree = ""; }; + DA8F25B71D51D2240010E6B5 /* MLNStyleLayer.mm.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; path = MLNStyleLayer.mm.ejs; sourceTree = ""; }; DA934097208562590059919A /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = "pt-PT.lproj/Localizable.strings"; sourceTree = ""; }; DA934098208562870059919A /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = "pt-PT"; path = "pt-PT.lproj/Foundation.stringsdict"; sourceTree = ""; }; DA9340992085629E0059919A /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = "pt-PT.lproj/Localizable.strings"; sourceTree = ""; }; @@ -606,14 +606,14 @@ DAA32CBA1E4C4F10006F8D24 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Localizable.strings; sourceTree = ""; }; DAA32CC01E4C4F89006F8D24 /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = vi.lproj/Foundation.strings; sourceTree = ""; }; DAA32CC11E4C4F93006F8D24 /* vi */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = vi; path = vi.lproj/Localizable.strings; sourceTree = ""; }; - DAA4227B24294137008457DB /* MGLMapSnapshotterTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MGLMapSnapshotterTests.m; path = ../../darwin/test/MGLMapSnapshotterTests.m; sourceTree = ""; }; + DAA4227B24294137008457DB /* MLNMapSnapshotterTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MLNMapSnapshotterTests.m; path = ../../darwin/test/MLNMapSnapshotterTests.m; sourceTree = ""; }; DAA48EFB1D6A4731006A7E36 /* StyleLayerIconTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleLayerIconTransformer.h; sourceTree = ""; }; DAA48EFC1D6A4731006A7E36 /* StyleLayerIconTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StyleLayerIconTransformer.m; sourceTree = ""; }; - DAA998F91E9F545C002E6EA6 /* MGLFillExtrusionStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLFillExtrusionStyleLayer.h; sourceTree = ""; }; - DAA998FA1E9F545C002E6EA6 /* MGLFillExtrusionStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLFillExtrusionStyleLayer.mm; sourceTree = ""; }; - DAA999001E9F5EC5002E6EA6 /* MGLFillExtrusionStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLFillExtrusionStyleLayerTests.mm; sourceTree = ""; }; - DAC25FC9200FD5E2009BE98E /* NSExpression+MGLPrivateAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSExpression+MGLPrivateAdditions.h"; sourceTree = ""; }; - DAC2ABC41CC6D343006D18C4 /* MGLAnnotationImage_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAnnotationImage_Private.h; sourceTree = ""; }; + DAA998F91E9F545C002E6EA6 /* MLNFillExtrusionStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNFillExtrusionStyleLayer.h; sourceTree = ""; }; + DAA998FA1E9F545C002E6EA6 /* MLNFillExtrusionStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNFillExtrusionStyleLayer.mm; sourceTree = ""; }; + DAA999001E9F5EC5002E6EA6 /* MLNFillExtrusionStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNFillExtrusionStyleLayerTests.mm; sourceTree = ""; }; + DAC25FC9200FD5E2009BE98E /* NSExpression+MLNPrivateAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSExpression+MLNPrivateAdditions.h"; sourceTree = ""; }; + DAC2ABC41CC6D343006D18C4 /* MLNAnnotationImage_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNAnnotationImage_Private.h; sourceTree = ""; }; DAC832622404AF4300A61BF8 /* macos.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = macos.xcconfig; sourceTree = ""; }; DAC832632404AF7F00A61BF8 /* darwin.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = darwin.xcconfig; path = ../darwin/darwin.xcconfig; sourceTree = ""; }; DAC832652404AF9E00A61BF8 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; name = Makefile; path = ../../Makefile; sourceTree = ""; }; @@ -621,20 +621,20 @@ DAC832682404B26400A61BF8 /* jazzy.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = jazzy.yml; sourceTree = ""; }; DAC8A47D24527EBB00C795BB /* glyphs.pbf */ = {isa = PBXFileReference; lastKnownFileType = file; name = glyphs.pbf; path = ../../../../../test/fixtures/resources/glyphs.pbf; sourceTree = ""; }; DAC8A4832452972F00C795BB /* mixed.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = mixed.json; path = ../../../../../test/fixtures/local_glyphs/mixed.json; sourceTree = ""; }; - DACA8620201920BE00E9693A /* MGLRasterDEMSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLRasterDEMSource.h; sourceTree = ""; }; - DACA8621201920BE00E9693A /* MGLRasterDEMSource.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLRasterDEMSource.mm; sourceTree = ""; }; - DACB0C371E18DFFD005DDBEA /* MGLStyle+MBXAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MGLStyle+MBXAdditions.h"; sourceTree = ""; }; - DACB0C381E18DFFD005DDBEA /* MGLStyle+MBXAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MGLStyle+MBXAdditions.m"; sourceTree = ""; }; + DACA8620201920BE00E9693A /* MLNRasterDEMSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MLNRasterDEMSource.h; sourceTree = ""; }; + DACA8621201920BE00E9693A /* MLNRasterDEMSource.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNRasterDEMSource.mm; sourceTree = ""; }; + DACB0C371E18DFFD005DDBEA /* MLNStyle+MBXAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MLNStyle+MBXAdditions.h"; sourceTree = ""; }; + DACB0C381E18DFFD005DDBEA /* MLNStyle+MBXAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MLNStyle+MBXAdditions.m"; sourceTree = ""; }; DACBC6082011885800C4D7E2 /* he */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = he; path = he.lproj/Localizable.strings; sourceTree = ""; }; DACBC6092011888C00C4D7E2 /* he */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = he; path = he.lproj/Foundation.strings; sourceTree = ""; }; DACBC60A2011889E00C4D7E2 /* he */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = he; path = he.lproj/Localizable.strings; sourceTree = ""; }; - DACC22121CF3D3E200D220D9 /* MGLFeature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLFeature.h; sourceTree = ""; }; - DACC22131CF3D3E200D220D9 /* MGLFeature.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLFeature.mm; sourceTree = ""; }; - DACC22171CF3D4F700D220D9 /* MGLFeature_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLFeature_Private.h; sourceTree = ""; }; + DACC22121CF3D3E200D220D9 /* MLNFeature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNFeature.h; sourceTree = ""; }; + DACC22131CF3D3E200D220D9 /* MLNFeature.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNFeature.mm; sourceTree = ""; }; + DACC22171CF3D4F700D220D9 /* MLNFeature_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNFeature_Private.h; sourceTree = ""; }; DACCD9C71F1F443B00BB09A1 /* fr */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Foundation.strings; sourceTree = ""; }; DACFE7971F66EA0C00630DA8 /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = vi; path = vi.lproj/Foundation.stringsdict; sourceTree = ""; }; - DAD165721CF4CD7A001FF4B9 /* MGLShapeCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLShapeCollection.h; sourceTree = ""; }; - DAD165731CF4CD7A001FF4B9 /* MGLShapeCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLShapeCollection.mm; sourceTree = ""; }; + DAD165721CF4CD7A001FF4B9 /* MLNShapeCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNShapeCollection.h; sourceTree = ""; }; + DAD165731CF4CD7A001FF4B9 /* MLNShapeCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNShapeCollection.mm; sourceTree = ""; }; DAD88E03202ACF5900AAA536 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Localizable.strings; sourceTree = ""; }; DAD88E04202ACF7C00AAA536 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Foundation.strings; sourceTree = ""; }; DAD88E05202ACF8200AAA536 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = da; path = da.lproj/Foundation.stringsdict; sourceTree = ""; }; @@ -653,70 +653,70 @@ DAE6C3311CC30DB200DB3429 /* test.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = test.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; DAE6C33A1CC30DB200DB3429 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; DAE6C3451CC31D1200DB3429 /* libmbgl-core.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libmbgl-core.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - DAE6C34A1CC31E0400DB3429 /* MGLSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLSettings.h; sourceTree = ""; }; - DAE6C34B1CC31E0400DB3429 /* MGLAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAnnotation.h; sourceTree = ""; }; - DAE6C34C1CC31E0400DB3429 /* MGLGeometry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLGeometry.h; sourceTree = ""; }; - DAE6C34D1CC31E0400DB3429 /* MGLMapCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLMapCamera.h; sourceTree = ""; }; - DAE6C34E1CC31E0400DB3429 /* MGLMultiPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLMultiPoint.h; sourceTree = ""; }; - DAE6C34F1CC31E0400DB3429 /* MGLOfflinePack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLOfflinePack.h; sourceTree = ""; }; - DAE6C3501CC31E0400DB3429 /* MGLOfflineRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLOfflineRegion.h; sourceTree = ""; }; - DAE6C3511CC31E0400DB3429 /* MGLOfflineStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLOfflineStorage.h; sourceTree = ""; }; - DAE6C3521CC31E0400DB3429 /* MGLOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLOverlay.h; sourceTree = ""; }; - DAE6C3531CC31E0400DB3429 /* MGLPointAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLPointAnnotation.h; sourceTree = ""; }; - DAE6C3541CC31E0400DB3429 /* MGLPolygon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLPolygon.h; sourceTree = ""; }; - DAE6C3551CC31E0400DB3429 /* MGLPolyline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLPolyline.h; sourceTree = ""; }; - DAE6C3561CC31E0400DB3429 /* MGLShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLShape.h; sourceTree = ""; }; - DAE6C3571CC31E0400DB3429 /* MGLStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyle.h; sourceTree = ""; }; - DAE6C3581CC31E0400DB3429 /* MGLTilePyramidOfflineRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLTilePyramidOfflineRegion.h; sourceTree = ""; }; - DAE6C3591CC31E0400DB3429 /* MGLTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLTypes.h; sourceTree = ""; }; - DAE6C36A1CC31E2A00DB3429 /* MGLSettings_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLSettings_Private.h; sourceTree = ""; }; - DAE6C36B1CC31E2A00DB3429 /* MGLSettings.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLSettings.mm; sourceTree = ""; }; - DAE6C36C1CC31E2A00DB3429 /* MGLGeometry_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLGeometry_Private.h; sourceTree = ""; }; - DAE6C36D1CC31E2A00DB3429 /* MGLGeometry.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLGeometry.mm; sourceTree = ""; }; - DAE6C36E1CC31E2A00DB3429 /* MGLMapCamera.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLMapCamera.mm; sourceTree = ""; }; - DAE6C36F1CC31E2A00DB3429 /* MGLMultiPoint_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLMultiPoint_Private.h; sourceTree = ""; }; - DAE6C3701CC31E2A00DB3429 /* MGLMultiPoint.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLMultiPoint.mm; sourceTree = ""; }; - DAE6C3711CC31E2A00DB3429 /* MGLOfflinePack_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLOfflinePack_Private.h; sourceTree = ""; }; - DAE6C3721CC31E2A00DB3429 /* MGLOfflinePack.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLOfflinePack.mm; sourceTree = ""; }; - DAE6C3731CC31E2A00DB3429 /* MGLOfflineRegion_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLOfflineRegion_Private.h; sourceTree = ""; }; - DAE6C3741CC31E2A00DB3429 /* MGLOfflineStorage_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLOfflineStorage_Private.h; sourceTree = ""; }; - DAE6C3751CC31E2A00DB3429 /* MGLOfflineStorage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLOfflineStorage.mm; sourceTree = ""; }; - DAE6C3761CC31E2A00DB3429 /* MGLPointAnnotation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLPointAnnotation.mm; sourceTree = ""; }; - DAE6C3771CC31E2A00DB3429 /* MGLPolygon.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLPolygon.mm; sourceTree = ""; }; - DAE6C3781CC31E2A00DB3429 /* MGLPolyline.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLPolyline.mm; sourceTree = ""; }; - DAE6C3791CC31E2A00DB3429 /* MGLShape.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLShape.mm; sourceTree = ""; }; - DAE6C37A1CC31E2A00DB3429 /* MGLStyle.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLStyle.mm; sourceTree = ""; }; - DAE6C37B1CC31E2A00DB3429 /* MGLTilePyramidOfflineRegion.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLTilePyramidOfflineRegion.mm; sourceTree = ""; }; - DAE6C37C1CC31E2A00DB3429 /* MGLTypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLTypes.m; sourceTree = ""; }; - DAE6C37D1CC31E2A00DB3429 /* NSBundle+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+MGLAdditions.h"; sourceTree = ""; }; - DAE6C37E1CC31E2A00DB3429 /* NSBundle+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+MGLAdditions.mm"; sourceTree = ""; }; - DAE6C37F1CC31E2A00DB3429 /* NSException+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSException+MGLAdditions.h"; sourceTree = ""; }; - DAE6C3801CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSProcessInfo+MGLAdditions.h"; sourceTree = ""; }; - DAE6C3811CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSProcessInfo+MGLAdditions.m"; sourceTree = ""; }; - DAE6C3821CC31E2A00DB3429 /* NSString+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+MGLAdditions.h"; sourceTree = ""; }; - DAE6C3831CC31E2A00DB3429 /* NSString+MGLAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+MGLAdditions.m"; sourceTree = ""; }; - DAE6C39F1CC31E9400DB3429 /* MGLAnnotationImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAnnotationImage.h; sourceTree = ""; }; - DAE6C3A01CC31E9400DB3429 /* MGLMapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLMapView.h; sourceTree = ""; }; - DAE6C3A11CC31E9400DB3429 /* MGLMapView+IBAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MGLMapView+IBAdditions.h"; sourceTree = ""; }; - DAE6C3A21CC31E9400DB3429 /* MGLMapViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLMapViewDelegate.h; sourceTree = ""; }; - DAE6C3A71CC31EF300DB3429 /* MGLAnnotationImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLAnnotationImage.m; sourceTree = ""; }; - DAE6C3A81CC31EF300DB3429 /* MGLAttributionButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAttributionButton.h; sourceTree = ""; }; - DAE6C3A91CC31EF300DB3429 /* MGLAttributionButton.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLAttributionButton.mm; sourceTree = ""; }; - DAE6C3AA1CC31EF300DB3429 /* MGLCompassCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLCompassCell.h; sourceTree = ""; }; - DAE6C3AB1CC31EF300DB3429 /* MGLCompassCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLCompassCell.m; sourceTree = ""; }; - DAE6C3AC1CC31EF300DB3429 /* MGLMapView_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLMapView_Private.h; sourceTree = ""; }; - DAE6C3AD1CC31EF300DB3429 /* MGLMapView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLMapView.mm; sourceTree = ""; }; - DAE6C3AE1CC31EF300DB3429 /* MGLMapView+IBAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "MGLMapView+IBAdditions.mm"; sourceTree = ""; }; - DAE6C3AF1CC31EF300DB3429 /* MGLOpenGLLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLOpenGLLayer.h; sourceTree = ""; }; - DAE6C3B01CC31EF300DB3429 /* MGLOpenGLLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLOpenGLLayer.mm; sourceTree = ""; }; + DAE6C34A1CC31E0400DB3429 /* MLNSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNSettings.h; sourceTree = ""; }; + DAE6C34B1CC31E0400DB3429 /* MLNAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNAnnotation.h; sourceTree = ""; }; + DAE6C34C1CC31E0400DB3429 /* MLNGeometry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNGeometry.h; sourceTree = ""; }; + DAE6C34D1CC31E0400DB3429 /* MLNMapCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNMapCamera.h; sourceTree = ""; }; + DAE6C34E1CC31E0400DB3429 /* MLNMultiPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNMultiPoint.h; sourceTree = ""; }; + DAE6C34F1CC31E0400DB3429 /* MLNOfflinePack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNOfflinePack.h; sourceTree = ""; }; + DAE6C3501CC31E0400DB3429 /* MLNOfflineRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNOfflineRegion.h; sourceTree = ""; }; + DAE6C3511CC31E0400DB3429 /* MLNOfflineStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNOfflineStorage.h; sourceTree = ""; }; + DAE6C3521CC31E0400DB3429 /* MLNOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNOverlay.h; sourceTree = ""; }; + DAE6C3531CC31E0400DB3429 /* MLNPointAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNPointAnnotation.h; sourceTree = ""; }; + DAE6C3541CC31E0400DB3429 /* MLNPolygon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNPolygon.h; sourceTree = ""; }; + DAE6C3551CC31E0400DB3429 /* MLNPolyline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNPolyline.h; sourceTree = ""; }; + DAE6C3561CC31E0400DB3429 /* MLNShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNShape.h; sourceTree = ""; }; + DAE6C3571CC31E0400DB3429 /* MLNStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNStyle.h; sourceTree = ""; }; + DAE6C3581CC31E0400DB3429 /* MLNTilePyramidOfflineRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNTilePyramidOfflineRegion.h; sourceTree = ""; }; + DAE6C3591CC31E0400DB3429 /* MLNTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNTypes.h; sourceTree = ""; }; + DAE6C36A1CC31E2A00DB3429 /* MLNSettings_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNSettings_Private.h; sourceTree = ""; }; + DAE6C36B1CC31E2A00DB3429 /* MLNSettings.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNSettings.mm; sourceTree = ""; }; + DAE6C36C1CC31E2A00DB3429 /* MLNGeometry_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNGeometry_Private.h; sourceTree = ""; }; + DAE6C36D1CC31E2A00DB3429 /* MLNGeometry.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNGeometry.mm; sourceTree = ""; }; + DAE6C36E1CC31E2A00DB3429 /* MLNMapCamera.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNMapCamera.mm; sourceTree = ""; }; + DAE6C36F1CC31E2A00DB3429 /* MLNMultiPoint_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNMultiPoint_Private.h; sourceTree = ""; }; + DAE6C3701CC31E2A00DB3429 /* MLNMultiPoint.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNMultiPoint.mm; sourceTree = ""; }; + DAE6C3711CC31E2A00DB3429 /* MLNOfflinePack_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNOfflinePack_Private.h; sourceTree = ""; }; + DAE6C3721CC31E2A00DB3429 /* MLNOfflinePack.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNOfflinePack.mm; sourceTree = ""; }; + DAE6C3731CC31E2A00DB3429 /* MLNOfflineRegion_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNOfflineRegion_Private.h; sourceTree = ""; }; + DAE6C3741CC31E2A00DB3429 /* MLNOfflineStorage_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNOfflineStorage_Private.h; sourceTree = ""; }; + DAE6C3751CC31E2A00DB3429 /* MLNOfflineStorage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNOfflineStorage.mm; sourceTree = ""; }; + DAE6C3761CC31E2A00DB3429 /* MLNPointAnnotation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNPointAnnotation.mm; sourceTree = ""; }; + DAE6C3771CC31E2A00DB3429 /* MLNPolygon.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNPolygon.mm; sourceTree = ""; }; + DAE6C3781CC31E2A00DB3429 /* MLNPolyline.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNPolyline.mm; sourceTree = ""; }; + DAE6C3791CC31E2A00DB3429 /* MLNShape.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNShape.mm; sourceTree = ""; }; + DAE6C37A1CC31E2A00DB3429 /* MLNStyle.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNStyle.mm; sourceTree = ""; }; + DAE6C37B1CC31E2A00DB3429 /* MLNTilePyramidOfflineRegion.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNTilePyramidOfflineRegion.mm; sourceTree = ""; }; + DAE6C37C1CC31E2A00DB3429 /* MLNTypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLNTypes.m; sourceTree = ""; }; + DAE6C37D1CC31E2A00DB3429 /* NSBundle+MLNAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+MLNAdditions.h"; sourceTree = ""; }; + DAE6C37E1CC31E2A00DB3429 /* NSBundle+MLNAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+MLNAdditions.mm"; sourceTree = ""; }; + DAE6C37F1CC31E2A00DB3429 /* NSException+MLNAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSException+MLNAdditions.h"; sourceTree = ""; }; + DAE6C3801CC31E2A00DB3429 /* NSProcessInfo+MLNAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSProcessInfo+MLNAdditions.h"; sourceTree = ""; }; + DAE6C3811CC31E2A00DB3429 /* NSProcessInfo+MLNAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSProcessInfo+MLNAdditions.m"; sourceTree = ""; }; + DAE6C3821CC31E2A00DB3429 /* NSString+MLNAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+MLNAdditions.h"; sourceTree = ""; }; + DAE6C3831CC31E2A00DB3429 /* NSString+MLNAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+MLNAdditions.m"; sourceTree = ""; }; + DAE6C39F1CC31E9400DB3429 /* MLNAnnotationImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNAnnotationImage.h; sourceTree = ""; }; + DAE6C3A01CC31E9400DB3429 /* MLNMapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNMapView.h; sourceTree = ""; }; + DAE6C3A11CC31E9400DB3429 /* MLNMapView+IBAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MLNMapView+IBAdditions.h"; sourceTree = ""; }; + DAE6C3A21CC31E9400DB3429 /* MLNMapViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNMapViewDelegate.h; sourceTree = ""; }; + DAE6C3A71CC31EF300DB3429 /* MLNAnnotationImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLNAnnotationImage.m; sourceTree = ""; }; + DAE6C3A81CC31EF300DB3429 /* MLNAttributionButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNAttributionButton.h; sourceTree = ""; }; + DAE6C3A91CC31EF300DB3429 /* MLNAttributionButton.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNAttributionButton.mm; sourceTree = ""; }; + DAE6C3AA1CC31EF300DB3429 /* MLNCompassCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNCompassCell.h; sourceTree = ""; }; + DAE6C3AB1CC31EF300DB3429 /* MLNCompassCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLNCompassCell.m; sourceTree = ""; }; + DAE6C3AC1CC31EF300DB3429 /* MLNMapView_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNMapView_Private.h; sourceTree = ""; }; + DAE6C3AD1CC31EF300DB3429 /* MLNMapView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNMapView.mm; sourceTree = ""; }; + DAE6C3AE1CC31EF300DB3429 /* MLNMapView+IBAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "MLNMapView+IBAdditions.mm"; sourceTree = ""; }; + DAE6C3AF1CC31EF300DB3429 /* MLNOpenGLLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNOpenGLLayer.h; sourceTree = ""; }; + DAE6C3B01CC31EF300DB3429 /* MLNOpenGLLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNOpenGLLayer.mm; sourceTree = ""; }; DAE6C3BB1CC31F2E00DB3429 /* default_marker.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = default_marker.pdf; sourceTree = ""; }; DAE6C3BC1CC31F2E00DB3429 /* mapbox.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = mapbox.pdf; sourceTree = ""; }; DAE6C3C11CC31F4500DB3429 /* Mapbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Mapbox.h; path = src/Mapbox.h; sourceTree = SOURCE_ROOT; }; DAE6C3C61CC3499100DB3429 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; }; - DAE6C3C81CC34BD800DB3429 /* MGLGeometryTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLGeometryTests.mm; path = ../../darwin/test/MGLGeometryTests.mm; sourceTree = ""; }; - DAE6C3CA1CC34BD800DB3429 /* MGLOfflineRegionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLOfflineRegionTests.m; path = ../../darwin/test/MGLOfflineRegionTests.m; sourceTree = ""; }; - DAE6C3CC1CC34BD800DB3429 /* MGLStyleTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLStyleTests.mm; path = ../../darwin/test/MGLStyleTests.mm; sourceTree = ""; }; - DAE7DEC31E24549F007505A6 /* MGLNSStringAdditionsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLNSStringAdditionsTests.m; path = ../../darwin/test/MGLNSStringAdditionsTests.m; sourceTree = ""; }; + DAE6C3C81CC34BD800DB3429 /* MLNGeometryTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MLNGeometryTests.mm; path = ../../darwin/test/MLNGeometryTests.mm; sourceTree = ""; }; + DAE6C3CA1CC34BD800DB3429 /* MLNOfflineRegionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLNOfflineRegionTests.m; path = ../../darwin/test/MLNOfflineRegionTests.m; sourceTree = ""; }; + DAE6C3CC1CC34BD800DB3429 /* MLNStyleTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MLNStyleTests.mm; path = ../../darwin/test/MLNStyleTests.mm; sourceTree = ""; }; + DAE7DEC31E24549F007505A6 /* MLNNSStringAdditionsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLNNSStringAdditionsTests.m; path = ../../darwin/test/MLNNSStringAdditionsTests.m; sourceTree = ""; }; DAE8CCAA1E6E8605009B5CB0 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ru; path = ru.lproj/Foundation.stringsdict; sourceTree = ""; }; DAE8CCAB1E6E8B72009B5CB0 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; DAE8CCAC1E6E8B8D009B5CB0 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; @@ -725,23 +725,23 @@ DAE9ED54223897ED00C01291 /* gl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = gl; path = gl.lproj/Foundation.strings; sourceTree = ""; }; DAE9ED55223898B200C01291 /* gl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = gl; path = gl.lproj/Foundation.stringsdict; sourceTree = ""; }; DAE9ED56223898CF00C01291 /* gl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = gl; path = gl.lproj/Localizable.strings; sourceTree = ""; }; - DAED385D1D62CED700D7640F /* NSURL+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+MGLAdditions.h"; sourceTree = ""; }; - DAED385E1D62CED700D7640F /* NSURL+MGLAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+MGLAdditions.m"; sourceTree = ""; }; - DAEDC4311D6033F1000224FF /* MGLAttributionInfoTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLAttributionInfoTests.m; path = ../../darwin/test/MGLAttributionInfoTests.m; sourceTree = ""; }; - DAEDC4361D606291000224FF /* MGLAttributionButtonTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLAttributionButtonTests.m; sourceTree = ""; }; - DAF0D80D1DFE0E5D00B28378 /* MGLPointCollection_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLPointCollection_Private.h; sourceTree = ""; }; - DAF0D8151DFE6B1800B28378 /* MGLAttributionInfo_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAttributionInfo_Private.h; sourceTree = ""; }; - DAF25713201901C100367EF5 /* MGLHillshadeStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLHillshadeStyleLayer.mm; sourceTree = ""; }; - DAF25714201901C200367EF5 /* MGLHillshadeStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLHillshadeStyleLayer.h; sourceTree = ""; }; - DAF2571D201902A500367EF5 /* MGLHillshadeStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLHillshadeStyleLayerTests.mm; sourceTree = ""; }; + DAED385D1D62CED700D7640F /* NSURL+MLNAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+MLNAdditions.h"; sourceTree = ""; }; + DAED385E1D62CED700D7640F /* NSURL+MLNAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+MLNAdditions.m"; sourceTree = ""; }; + DAEDC4311D6033F1000224FF /* MLNAttributionInfoTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLNAttributionInfoTests.m; path = ../../darwin/test/MLNAttributionInfoTests.m; sourceTree = ""; }; + DAEDC4361D606291000224FF /* MLNAttributionButtonTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLNAttributionButtonTests.m; sourceTree = ""; }; + DAF0D80D1DFE0E5D00B28378 /* MLNPointCollection_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNPointCollection_Private.h; sourceTree = ""; }; + DAF0D8151DFE6B1800B28378 /* MLNAttributionInfo_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNAttributionInfo_Private.h; sourceTree = ""; }; + DAF25713201901C100367EF5 /* MLNHillshadeStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNHillshadeStyleLayer.mm; sourceTree = ""; }; + DAF25714201901C200367EF5 /* MLNHillshadeStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNHillshadeStyleLayer.h; sourceTree = ""; }; + DAF2571D201902A500367EF5 /* MLNHillshadeStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MLNHillshadeStyleLayerTests.mm; sourceTree = ""; }; DAFBD0D51E3FA969000CD6BF /* zh-Hant */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = ""; }; DAFBD0D61E3FA983000CD6BF /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Foundation.strings"; sourceTree = ""; }; DAFEB3702093ACBF00A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = ""; }; DAFEB3722093ACDA00A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Foundation.strings; sourceTree = ""; }; DAFEB3732093ACE400A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ko; path = ko.lproj/Foundation.stringsdict; sourceTree = ""; }; - DD0902AF1DB1AC6400C5BDCE /* MGLNetworkConfiguration.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLNetworkConfiguration.mm; sourceTree = ""; }; - DD0902B01DB1AC6400C5BDCE /* MGLNetworkConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLNetworkConfiguration.h; sourceTree = ""; }; - DD58A4C71D822C6200E1F038 /* MGLExpressionTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLExpressionTests.mm; path = ../../darwin/test/MGLExpressionTests.mm; sourceTree = ""; }; + DD0902AF1DB1AC6400C5BDCE /* MLNNetworkConfiguration.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLNNetworkConfiguration.mm; sourceTree = ""; }; + DD0902B01DB1AC6400C5BDCE /* MLNNetworkConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLNNetworkConfiguration.h; sourceTree = ""; }; + DD58A4C71D822C6200E1F038 /* MLNExpressionTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MLNExpressionTests.mm; path = ../../darwin/test/MLNExpressionTests.mm; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -782,45 +782,45 @@ 35136D471D42295400C20EFD /* Layers */ = { isa = PBXGroup; children = ( - 747ABE66219B2C3200523B67 /* MGLSymbolStyleLayer_Private.h */, - 747ABE62219B2C1700523B67 /* MGLOpenGLStyleLayer_Private.h */, - 747ABE63219B2C1700523B67 /* MGLRasterStyleLayer_Private.h */, - 747ABE60219B2C0000523B67 /* MGLLineStyleLayer_Private.h */, - 747ABE5E219B2BED00523B67 /* MGLHillshadeStyleLayer_Private.h */, - 747ABE56219B2BDB00523B67 /* MGLBackgroundStyleLayer_Private.h */, - 747ABE55219B2BDA00523B67 /* MGLCircleStyleLayer_Private.h */, - 747ABE54219B2BDA00523B67 /* MGLFillExtrusionStyleLayer_Private.h */, - 747ABE57219B2BDB00523B67 /* MGLFillStyleLayer_Private.h */, - 747ABE58219B2BDB00523B67 /* MGLHeatmapStyleLayer_Private.h */, - 749EC88F2199CCB8005608D7 /* MGLStyleLayerManager.h */, - 749EC8902199CCB9005608D7 /* MGLStyleLayerManager.mm */, - DA8F25851D51C9E10010E6B5 /* MGLBackgroundStyleLayer.h */, - DA8F25861D51C9E10010E6B5 /* MGLBackgroundStyleLayer.mm */, - 3527428B1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.h */, - 3527428C1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.mm */, - DAA998F91E9F545C002E6EA6 /* MGLFillExtrusionStyleLayer.h */, - DAA998FA1E9F545C002E6EA6 /* MGLFillExtrusionStyleLayer.mm */, - 35602BF81D3EA99F0050646F /* MGLFillStyleLayer.h */, - 35602BF91D3EA99F0050646F /* MGLFillStyleLayer.mm */, - 35602BFD1D3EA9B40050646F /* MGLForegroundStyleLayer.h */, - 35602BFE1D3EA9B40050646F /* MGLForegroundStyleLayer.mm */, - 8946239A200E73CA00DA8EF2 /* MGLHeatmapStyleLayer.h */, - 8946239B200E73CA00DA8EF2 /* MGLHeatmapStyleLayer.mm */, - DAF25714201901C200367EF5 /* MGLHillshadeStyleLayer.h */, - DAF25713201901C100367EF5 /* MGLHillshadeStyleLayer.mm */, - DA8F25891D51CA540010E6B5 /* MGLLineStyleLayer.h */, - DA8F258A1D51CA540010E6B5 /* MGLLineStyleLayer.mm */, - DA7262051DEEDD460043BB89 /* MGLOpenGLStyleLayer.h */, - DA7262061DEEDD460043BB89 /* MGLOpenGLStyleLayer.mm */, - DA8F258D1D51CA600010E6B5 /* MGLRasterStyleLayer.h */, - DA8F258E1D51CA600010E6B5 /* MGLRasterStyleLayer.mm */, - 3538AA211D542685008EC33D /* MGLStyleLayer.h */, - 35602BFC1D3EA9B40050646F /* MGLStyleLayer_Private.h */, - 3538AA221D542685008EC33D /* MGLStyleLayer.mm */, - DA8F25911D51CA750010E6B5 /* MGLSymbolStyleLayer.h */, - DA8F25921D51CA750010E6B5 /* MGLSymbolStyleLayer.mm */, - DA6408D51DA4E5DA00908C90 /* MGLVectorStyleLayer.h */, - DA6408D61DA4E5DA00908C90 /* MGLVectorStyleLayer.mm */, + 747ABE66219B2C3200523B67 /* MLNSymbolStyleLayer_Private.h */, + 747ABE62219B2C1700523B67 /* MLNOpenGLStyleLayer_Private.h */, + 747ABE63219B2C1700523B67 /* MLNRasterStyleLayer_Private.h */, + 747ABE60219B2C0000523B67 /* MLNLineStyleLayer_Private.h */, + 747ABE5E219B2BED00523B67 /* MLNHillshadeStyleLayer_Private.h */, + 747ABE56219B2BDB00523B67 /* MLNBackgroundStyleLayer_Private.h */, + 747ABE55219B2BDA00523B67 /* MLNCircleStyleLayer_Private.h */, + 747ABE54219B2BDA00523B67 /* MLNFillExtrusionStyleLayer_Private.h */, + 747ABE57219B2BDB00523B67 /* MLNFillStyleLayer_Private.h */, + 747ABE58219B2BDB00523B67 /* MLNHeatmapStyleLayer_Private.h */, + 749EC88F2199CCB8005608D7 /* MLNStyleLayerManager.h */, + 749EC8902199CCB9005608D7 /* MLNStyleLayerManager.mm */, + DA8F25851D51C9E10010E6B5 /* MLNBackgroundStyleLayer.h */, + DA8F25861D51C9E10010E6B5 /* MLNBackgroundStyleLayer.mm */, + 3527428B1D4C24AB00A1ECE6 /* MLNCircleStyleLayer.h */, + 3527428C1D4C24AB00A1ECE6 /* MLNCircleStyleLayer.mm */, + DAA998F91E9F545C002E6EA6 /* MLNFillExtrusionStyleLayer.h */, + DAA998FA1E9F545C002E6EA6 /* MLNFillExtrusionStyleLayer.mm */, + 35602BF81D3EA99F0050646F /* MLNFillStyleLayer.h */, + 35602BF91D3EA99F0050646F /* MLNFillStyleLayer.mm */, + 35602BFD1D3EA9B40050646F /* MLNForegroundStyleLayer.h */, + 35602BFE1D3EA9B40050646F /* MLNForegroundStyleLayer.mm */, + 8946239A200E73CA00DA8EF2 /* MLNHeatmapStyleLayer.h */, + 8946239B200E73CA00DA8EF2 /* MLNHeatmapStyleLayer.mm */, + DAF25714201901C200367EF5 /* MLNHillshadeStyleLayer.h */, + DAF25713201901C100367EF5 /* MLNHillshadeStyleLayer.mm */, + DA8F25891D51CA540010E6B5 /* MLNLineStyleLayer.h */, + DA8F258A1D51CA540010E6B5 /* MLNLineStyleLayer.mm */, + DA7262051DEEDD460043BB89 /* MLNOpenGLStyleLayer.h */, + DA7262061DEEDD460043BB89 /* MLNOpenGLStyleLayer.mm */, + DA8F258D1D51CA600010E6B5 /* MLNRasterStyleLayer.h */, + DA8F258E1D51CA600010E6B5 /* MLNRasterStyleLayer.mm */, + 3538AA211D542685008EC33D /* MLNStyleLayer.h */, + 35602BFC1D3EA9B40050646F /* MLNStyleLayer_Private.h */, + 3538AA221D542685008EC33D /* MLNStyleLayer.mm */, + DA8F25911D51CA750010E6B5 /* MLNSymbolStyleLayer.h */, + DA8F25921D51CA750010E6B5 /* MLNSymbolStyleLayer.mm */, + DA6408D51DA4E5DA00908C90 /* MLNVectorStyleLayer.h */, + DA6408D61DA4E5DA00908C90 /* MLNVectorStyleLayer.mm */, ); name = Layers; sourceTree = ""; @@ -828,8 +828,8 @@ 352742791D4C235C00A1ECE6 /* Categories */ = { isa = PBXGroup; children = ( - DA8F25A61D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h */, - DA8F25A71D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.mm */, + DA8F25A61D51CB270010E6B5 /* NSValue+MLNStyleAttributeAdditions.h */, + DA8F25A71D51CB270010E6B5 /* NSValue+MLNStyleAttributeAdditions.mm */, ); name = Categories; sourceTree = ""; @@ -837,28 +837,28 @@ 3527427E1D4C242B00A1ECE6 /* Sources */ = { isa = PBXGroup; children = ( - 07F8E2F41F674C8000F794BB /* MGLComputedShapeSource.h */, - 07D947471F6741F500E37934 /* MGLComputedShapeSource_Private.h */, - 07F8E2F51F674C8000F794BB /* MGLComputedShapeSource.mm */, - 352742831D4C244700A1ECE6 /* MGLRasterTileSource.h */, - DA7DC9821DED647F0027472F /* MGLRasterTileSource_Private.h */, - 352742841D4C244700A1ECE6 /* MGLRasterTileSource.mm */, - DACA8620201920BE00E9693A /* MGLRasterDEMSource.h */, - DACA8621201920BE00E9693A /* MGLRasterDEMSource.mm */, - 352742871D4C245800A1ECE6 /* MGLShapeSource.h */, - DA87A99B1DC9D8DD00810D09 /* MGLShapeSource_Private.h */, - 352742881D4C245800A1ECE6 /* MGLShapeSource.mm */, - 3527427F1D4C243B00A1ECE6 /* MGLSource.h */, - DA8F25991D51CAD00010E6B5 /* MGLSource_Private.h */, - 352742801D4C243B00A1ECE6 /* MGLSource.mm */, - DA551B7F1DB496AC0009AFAF /* MGLTileSource.h */, - DA551B801DB496AC0009AFAF /* MGLTileSource_Private.h */, - DA551B811DB496AC0009AFAF /* MGLTileSource.mm */, - DA8F25951D51CAC70010E6B5 /* MGLVectorTileSource.h */, - DA7DC9801DED5F5C0027472F /* MGLVectorTileSource_Private.h */, - DA8F25961D51CAC70010E6B5 /* MGLVectorTileSource.mm */, - 07A019EB1ED662D800ACD43E /* MGLImageSource.h */, - 07A019EC1ED662D800ACD43E /* MGLImageSource.mm */, + 07F8E2F41F674C8000F794BB /* MLNComputedShapeSource.h */, + 07D947471F6741F500E37934 /* MLNComputedShapeSource_Private.h */, + 07F8E2F51F674C8000F794BB /* MLNComputedShapeSource.mm */, + 352742831D4C244700A1ECE6 /* MLNRasterTileSource.h */, + DA7DC9821DED647F0027472F /* MLNRasterTileSource_Private.h */, + 352742841D4C244700A1ECE6 /* MLNRasterTileSource.mm */, + DACA8620201920BE00E9693A /* MLNRasterDEMSource.h */, + DACA8621201920BE00E9693A /* MLNRasterDEMSource.mm */, + 352742871D4C245800A1ECE6 /* MLNShapeSource.h */, + DA87A99B1DC9D8DD00810D09 /* MLNShapeSource_Private.h */, + 352742881D4C245800A1ECE6 /* MLNShapeSource.mm */, + 3527427F1D4C243B00A1ECE6 /* MLNSource.h */, + DA8F25991D51CAD00010E6B5 /* MLNSource_Private.h */, + 352742801D4C243B00A1ECE6 /* MLNSource.mm */, + DA551B7F1DB496AC0009AFAF /* MLNTileSource.h */, + DA551B801DB496AC0009AFAF /* MLNTileSource_Private.h */, + DA551B811DB496AC0009AFAF /* MLNTileSource.mm */, + DA8F25951D51CAC70010E6B5 /* MLNVectorTileSource.h */, + DA7DC9801DED5F5C0027472F /* MLNVectorTileSource_Private.h */, + DA8F25961D51CAC70010E6B5 /* MLNVectorTileSource.mm */, + 07A019EB1ED662D800ACD43E /* MLNImageSource.h */, + 07A019EC1ED662D800ACD43E /* MLNImageSource.mm */, ); name = Sources; sourceTree = ""; @@ -866,16 +866,16 @@ 3527429B1D4C259500A1ECE6 /* Styling */ = { isa = PBXGroup; children = ( - 1753ED3F1E53CE5200A9FD90 /* MGLConversion.h */, + 1753ED3F1E53CE5200A9FD90 /* MLNConversion.h */, 352742791D4C235C00A1ECE6 /* Categories */, 35136D471D42295400C20EFD /* Layers */, 3527427E1D4C242B00A1ECE6 /* Sources */, - 352742771D4C220900A1ECE6 /* MGLStyleValue.h */, - DA8F259B1D51CB000010E6B5 /* MGLStyleValue_Private.h */, - 3527429E1D4C25BD00A1ECE6 /* MGLStyleValue.mm */, - 1F7454A11ECFB00300021D39 /* MGLLight.h */, - 1F7454A21ECFB00300021D39 /* MGLLight.mm */, - 1F7454A01ECFB00300021D39 /* MGLLight_Private.h */, + 352742771D4C220900A1ECE6 /* MLNStyleValue.h */, + DA8F259B1D51CB000010E6B5 /* MLNStyleValue_Private.h */, + 3527429E1D4C25BD00A1ECE6 /* MLNStyleValue.mm */, + 1F7454A11ECFB00300021D39 /* MLNLight.h */, + 1F7454A21ECFB00300021D39 /* MLNLight.mm */, + 1F7454A01ECFB00300021D39 /* MLNLight_Private.h */, ); name = Styling; sourceTree = ""; @@ -883,7 +883,7 @@ 4031ACFA1E9EB39A00A3EA26 /* Swift Integration */ = { isa = PBXGroup; children = ( - 4031ACFB1E9EB3C100A3EA26 /* MGLMapViewDelegateIntegrationTests.swift */, + 4031ACFB1E9EB3C100A3EA26 /* MLNMapViewDelegateIntegrationTests.swift */, ); name = "Swift Integration"; sourceTree = ""; @@ -891,9 +891,9 @@ 4031AD001E9FD61000A3EA26 /* Test Helpers */ = { isa = PBXGroup; children = ( - CA0B3C042329F7E600E4B493 /* MGLTestAssertionHandler.h */, - CA0B3C052329F7E600E4B493 /* MGLTestAssertionHandler.m */, - 4031AD011E9FD6A300A3EA26 /* MGLSDKTestHelpers.swift */, + CA0B3C042329F7E600E4B493 /* MLNTestAssertionHandler.h */, + CA0B3C052329F7E600E4B493 /* MLNTestAssertionHandler.m */, + 4031AD011E9FD6A300A3EA26 /* MLNSDKTestHelpers.swift */, ); name = "Test Helpers"; sourceTree = ""; @@ -901,10 +901,10 @@ 4BBCDC5526526110004106C3 /* Configuration */ = { isa = PBXGroup; children = ( - 4BBCDC4C265260FF004106C3 /* MGLDefaultStyle.h */, - 4BBCDC4A265260FF004106C3 /* MGLDefaultStyle.mm */, - 4BBCDC4B265260FF004106C3 /* MGLTileServerOptions.h */, - 4BBCDC49265260FE004106C3 /* MGLTileServerOptions.mm */, + 4BBCDC4C265260FF004106C3 /* MLNDefaultStyle.h */, + 4BBCDC4A265260FF004106C3 /* MLNDefaultStyle.mm */, + 4BBCDC4B265260FF004106C3 /* MLNTileServerOptions.h */, + 4BBCDC49265260FE004106C3 /* MLNTileServerOptions.mm */, ); name = Configuration; sourceTree = ""; @@ -953,8 +953,8 @@ DA839E9B1CC2E3400062CAFB /* MapDocument.h */, DA839E9C1CC2E3400062CAFB /* MapDocument.m */, DA839E9E1CC2E3400062CAFB /* MapDocument.xib */, - DACB0C371E18DFFD005DDBEA /* MGLStyle+MBXAdditions.h */, - DACB0C381E18DFFD005DDBEA /* MGLStyle+MBXAdditions.m */, + DACB0C371E18DFFD005DDBEA /* MLNStyle+MBXAdditions.h */, + DACB0C381E18DFFD005DDBEA /* MLNStyle+MBXAdditions.m */, DAE6C2E91CC3050F00DB3429 /* OfflinePackNameValueTransformer.h */, DAE6C2EA1CC3050F00DB3429 /* OfflinePackNameValueTransformer.m */, DAA48EFB1D6A4731006A7E36 /* StyleLayerIconTransformer.h */, @@ -986,11 +986,11 @@ DA87A99A1DC9D88800810D09 /* Sources */ = { isa = PBXGroup; children = ( - 07A240921F67566F002C8210 /* MGLComputedShapeSourceTests.m */, - DA87A9961DC9D88400810D09 /* MGLShapeSourceTests.mm */, - DA87A9971DC9D88400810D09 /* MGLTileSetTests.mm */, - 920A3E581E6F859D00C16EFC /* MGLSourceQueryTests.m */, - 07BA4CAB1EE21887004528F5 /* MGLImageSourceTests.m */, + 07A240921F67566F002C8210 /* MLNComputedShapeSourceTests.m */, + DA87A9961DC9D88400810D09 /* MLNShapeSourceTests.mm */, + DA87A9971DC9D88400810D09 /* MLNTileSetTests.mm */, + 920A3E581E6F859D00C16EFC /* MLNSourceQueryTests.m */, + 07BA4CAB1EE21887004528F5 /* MLNImageSourceTests.m */, ); name = Sources; sourceTree = ""; @@ -1002,7 +1002,7 @@ DAE6C3BB1CC31F2E00DB3429 /* default_marker.pdf */, DAE6C3BC1CC31F2E00DB3429 /* mapbox.pdf */, 1F9EF4051FBA1B0D0063FBB0 /* mapbox_helmet.pdf */, - DA8933A71CCD287300E68420 /* MGLAnnotationCallout.xib */, + DA8933A71CCD287300E68420 /* MLNAnnotationCallout.xib */, ); name = "Kit Resources"; sourceTree = ""; @@ -1020,19 +1020,19 @@ DA8F257C1D51C5F40010E6B5 /* Layers */ = { isa = PBXGroup; children = ( - 170A82C2201FAFF800943087 /* MGLHeatmapColorTests.mm */, - 170A82BE201BDD1B00943087 /* MGLHeatmapStyleLayerTests.mm */, - 40E1601A1DF216E6005EA6D9 /* MGLStyleLayerTests.h */, - 40E1601B1DF216E6005EA6D9 /* MGLStyleLayerTests.m */, + 170A82C2201FAFF800943087 /* MLNHeatmapColorTests.mm */, + 170A82BE201BDD1B00943087 /* MLNHeatmapStyleLayerTests.mm */, + 40E1601A1DF216E6005EA6D9 /* MLNStyleLayerTests.h */, + 40E1601B1DF216E6005EA6D9 /* MLNStyleLayerTests.m */, DA2207BA1DC076930002F84D /* test-Bridging-Header.h */, - DAA999001E9F5EC5002E6EA6 /* MGLFillExtrusionStyleLayerTests.mm */, - DA8F25741D51C5F40010E6B5 /* MGLFillStyleLayerTests.mm */, - DAF2571D201902A500367EF5 /* MGLHillshadeStyleLayerTests.mm */, - DA8F25751D51C5F40010E6B5 /* MGLRasterStyleLayerTests.mm */, - DA8F25761D51C5F40010E6B5 /* MGLSymbolStyleLayerTests.mm */, - DA8F25771D51C5F40010E6B5 /* MGLLineStyleLayerTests.mm */, - DA8F25781D51C5F40010E6B5 /* MGLCircleStyleLayerTests.mm */, - DA8F25791D51C5F40010E6B5 /* MGLBackgroundStyleLayerTests.mm */, + DAA999001E9F5EC5002E6EA6 /* MLNFillExtrusionStyleLayerTests.mm */, + DA8F25741D51C5F40010E6B5 /* MLNFillStyleLayerTests.mm */, + DAF2571D201902A500367EF5 /* MLNHillshadeStyleLayerTests.mm */, + DA8F25751D51C5F40010E6B5 /* MLNRasterStyleLayerTests.mm */, + DA8F25761D51C5F40010E6B5 /* MLNSymbolStyleLayerTests.mm */, + DA8F25771D51C5F40010E6B5 /* MLNLineStyleLayerTests.mm */, + DA8F25781D51C5F40010E6B5 /* MLNCircleStyleLayerTests.mm */, + DA8F25791D51C5F40010E6B5 /* MLNBackgroundStyleLayerTests.mm */, ); name = Layers; sourceTree = ""; @@ -1042,7 +1042,7 @@ children = ( DA8F257C1D51C5F40010E6B5 /* Layers */, DA87A99A1DC9D88800810D09 /* Sources */, - 1F7454AA1ED1DDBD00021D39 /* MGLLightTest.mm */, + 1F7454AA1ED1DDBD00021D39 /* MLNLightTest.mm */, ); name = Styling; path = ../../darwin/test; @@ -1051,9 +1051,9 @@ DA8F25B81D51D2280010E6B5 /* Foundation Templates */ = { isa = PBXGroup; children = ( - DA8F25B61D51D2240010E6B5 /* MGLStyleLayer.h.ejs */, - DA8F25B71D51D2240010E6B5 /* MGLStyleLayer.mm.ejs */, - DA8F25B51D51D2240010E6B5 /* MGLStyleLayerTests.mm.ejs */, + DA8F25B61D51D2240010E6B5 /* MLNStyleLayer.h.ejs */, + DA8F25B71D51D2240010E6B5 /* MLNStyleLayer.mm.ejs */, + DA8F25B51D51D2240010E6B5 /* MLNStyleLayerTests.mm.ejs */, ); name = "Foundation Templates"; path = ../../darwin/src; @@ -1062,12 +1062,12 @@ DA90B12C1DB43B180073CF55 /* Categories */ = { isa = PBXGroup; children = ( - 355BA4EB1D41633E00CCC6D5 /* NSColor+MGLAdditions.h */, - 355BA4EC1D41633E00CCC6D5 /* NSColor+MGLAdditions.mm */, - 405C03961DB0004E001AC280 /* NSImage+MGLAdditions.h */, - 405C03971DB0004E001AC280 /* NSImage+MGLAdditions.mm */, - DAE6C3801CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.h */, - DAE6C3811CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.m */, + 355BA4EB1D41633E00CCC6D5 /* NSColor+MLNAdditions.h */, + 355BA4EC1D41633E00CCC6D5 /* NSColor+MLNAdditions.mm */, + 405C03961DB0004E001AC280 /* NSImage+MLNAdditions.h */, + 405C03971DB0004E001AC280 /* NSImage+MLNAdditions.mm */, + DAE6C3801CC31E2A00DB3429 /* NSProcessInfo+MLNAdditions.h */, + DAE6C3811CC31E2A00DB3429 /* NSProcessInfo+MLNAdditions.m */, ); name = Categories; sourceTree = ""; @@ -1075,14 +1075,14 @@ DAD1657C1CF4CE6B001FF4B9 /* Formatters */ = { isa = PBXGroup; children = ( - DA35A2BD1CCA9B1A00E826B2 /* MGLClockDirectionFormatter.h */, - DA35A2BE1CCA9B1A00E826B2 /* MGLClockDirectionFormatter.m */, - DA35A2AB1CCA091800E826B2 /* MGLCompassDirectionFormatter.h */, - DA35A2AC1CCA091800E826B2 /* MGLCompassDirectionFormatter.m */, - DA35A2A31CC9EB1A00E826B2 /* MGLCoordinateFormatter.h */, - DA35A2A51CC9EB2700E826B2 /* MGLCoordinateFormatter.m */, - 35C6DF821E214C0400ACA483 /* MGLDistanceFormatter.h */, - 35C6DF831E214C0400ACA483 /* MGLDistanceFormatter.m */, + DA35A2BD1CCA9B1A00E826B2 /* MLNClockDirectionFormatter.h */, + DA35A2BE1CCA9B1A00E826B2 /* MLNClockDirectionFormatter.m */, + DA35A2AB1CCA091800E826B2 /* MLNCompassDirectionFormatter.h */, + DA35A2AC1CCA091800E826B2 /* MLNCompassDirectionFormatter.m */, + DA35A2A31CC9EB1A00E826B2 /* MLNCoordinateFormatter.h */, + DA35A2A51CC9EB2700E826B2 /* MLNCoordinateFormatter.m */, + 35C6DF821E214C0400ACA483 /* MLNDistanceFormatter.h */, + 35C6DF831E214C0400ACA483 /* MLNDistanceFormatter.m */, ); name = Formatters; sourceTree = ""; @@ -1090,34 +1090,34 @@ DAD1657D1CF4CECB001FF4B9 /* Geometry */ = { isa = PBXGroup; children = ( - DAE6C34B1CC31E0400DB3429 /* MGLAnnotation.h */, - CA4045C4216720D700B356E1 /* MGLCluster.h */, - DACC22171CF3D4F700D220D9 /* MGLFeature_Private.h */, - DACC22121CF3D3E200D220D9 /* MGLFeature.h */, - DACC22131CF3D3E200D220D9 /* MGLFeature.mm */, - DAE6C36C1CC31E2A00DB3429 /* MGLGeometry_Private.h */, - DAE6C34C1CC31E0400DB3429 /* MGLGeometry.h */, - DAE6C36D1CC31E2A00DB3429 /* MGLGeometry.mm */, - DAE6C36F1CC31E2A00DB3429 /* MGLMultiPoint_Private.h */, - DAE6C34E1CC31E0400DB3429 /* MGLMultiPoint.h */, - DAE6C3701CC31E2A00DB3429 /* MGLMultiPoint.mm */, - DAE6C3521CC31E0400DB3429 /* MGLOverlay.h */, - DAE6C3531CC31E0400DB3429 /* MGLPointAnnotation.h */, - DAE6C3761CC31E2A00DB3429 /* MGLPointAnnotation.mm */, - DAF0D80D1DFE0E5D00B28378 /* MGLPointCollection_Private.h */, - 4049C2A11DB6CE7800B3F799 /* MGLPointCollection.h */, - 4049C2A71DB6D09B00B3F799 /* MGLPointCollection.mm */, - 9654C12C1FFC394700DB6A19 /* MGLPolygon_Private.h */, - DAE6C3541CC31E0400DB3429 /* MGLPolygon.h */, - DAE6C3771CC31E2A00DB3429 /* MGLPolygon.mm */, - 9654C12A1FFC38E000DB6A19 /* MGLPolyline_Private.h */, - DAE6C3551CC31E0400DB3429 /* MGLPolyline.h */, - DAE6C3781CC31E2A00DB3429 /* MGLPolyline.mm */, - 408AA85A1DAEECF100022900 /* MGLShape_Private.h */, - DAE6C3561CC31E0400DB3429 /* MGLShape.h */, - DAE6C3791CC31E2A00DB3429 /* MGLShape.mm */, - DAD165721CF4CD7A001FF4B9 /* MGLShapeCollection.h */, - DAD165731CF4CD7A001FF4B9 /* MGLShapeCollection.mm */, + DAE6C34B1CC31E0400DB3429 /* MLNAnnotation.h */, + CA4045C4216720D700B356E1 /* MLNCluster.h */, + DACC22171CF3D4F700D220D9 /* MLNFeature_Private.h */, + DACC22121CF3D3E200D220D9 /* MLNFeature.h */, + DACC22131CF3D3E200D220D9 /* MLNFeature.mm */, + DAE6C36C1CC31E2A00DB3429 /* MLNGeometry_Private.h */, + DAE6C34C1CC31E0400DB3429 /* MLNGeometry.h */, + DAE6C36D1CC31E2A00DB3429 /* MLNGeometry.mm */, + DAE6C36F1CC31E2A00DB3429 /* MLNMultiPoint_Private.h */, + DAE6C34E1CC31E0400DB3429 /* MLNMultiPoint.h */, + DAE6C3701CC31E2A00DB3429 /* MLNMultiPoint.mm */, + DAE6C3521CC31E0400DB3429 /* MLNOverlay.h */, + DAE6C3531CC31E0400DB3429 /* MLNPointAnnotation.h */, + DAE6C3761CC31E2A00DB3429 /* MLNPointAnnotation.mm */, + DAF0D80D1DFE0E5D00B28378 /* MLNPointCollection_Private.h */, + 4049C2A11DB6CE7800B3F799 /* MLNPointCollection.h */, + 4049C2A71DB6D09B00B3F799 /* MLNPointCollection.mm */, + 9654C12C1FFC394700DB6A19 /* MLNPolygon_Private.h */, + DAE6C3541CC31E0400DB3429 /* MLNPolygon.h */, + DAE6C3771CC31E2A00DB3429 /* MLNPolygon.mm */, + 9654C12A1FFC38E000DB6A19 /* MLNPolyline_Private.h */, + DAE6C3551CC31E0400DB3429 /* MLNPolyline.h */, + DAE6C3781CC31E2A00DB3429 /* MLNPolyline.mm */, + 408AA85A1DAEECF100022900 /* MLNShape_Private.h */, + DAE6C3561CC31E0400DB3429 /* MLNShape.h */, + DAE6C3791CC31E2A00DB3429 /* MLNShape.mm */, + DAD165721CF4CD7A001FF4B9 /* MLNShapeCollection.h */, + DAD165731CF4CD7A001FF4B9 /* MLNShapeCollection.mm */, ); name = Geometry; sourceTree = ""; @@ -1125,20 +1125,20 @@ DAD1657E1CF4CF04001FF4B9 /* Offline Maps */ = { isa = PBXGroup; children = ( - DAE6C34F1CC31E0400DB3429 /* MGLOfflinePack.h */, - DAE6C3711CC31E2A00DB3429 /* MGLOfflinePack_Private.h */, - DAE6C3721CC31E2A00DB3429 /* MGLOfflinePack.mm */, - DAE6C3501CC31E0400DB3429 /* MGLOfflineRegion.h */, - DAE6C3731CC31E2A00DB3429 /* MGLOfflineRegion_Private.h */, - DAE6C3511CC31E0400DB3429 /* MGLOfflineStorage.h */, - DAE6C3741CC31E2A00DB3429 /* MGLOfflineStorage_Private.h */, - DAE6C3751CC31E2A00DB3429 /* MGLOfflineStorage.mm */, - 9250B8C22073C69000EF338C /* MGLShapeOfflineRegion.h */, - 92FC0AE3207CC8DA007B6B54 /* MGLShapeOfflineRegion_Private.h */, - 92FC0AE5207CDD8D007B6B54 /* MGLShapeOfflineRegion.mm */, - DAE6C3581CC31E0400DB3429 /* MGLTilePyramidOfflineRegion.h */, - 9221BAAE20699CBA0054BDF4 /* MGLTilePyramidOfflineRegion_Private.h */, - DAE6C37B1CC31E2A00DB3429 /* MGLTilePyramidOfflineRegion.mm */, + DAE6C34F1CC31E0400DB3429 /* MLNOfflinePack.h */, + DAE6C3711CC31E2A00DB3429 /* MLNOfflinePack_Private.h */, + DAE6C3721CC31E2A00DB3429 /* MLNOfflinePack.mm */, + DAE6C3501CC31E0400DB3429 /* MLNOfflineRegion.h */, + DAE6C3731CC31E2A00DB3429 /* MLNOfflineRegion_Private.h */, + DAE6C3511CC31E0400DB3429 /* MLNOfflineStorage.h */, + DAE6C3741CC31E2A00DB3429 /* MLNOfflineStorage_Private.h */, + DAE6C3751CC31E2A00DB3429 /* MLNOfflineStorage.mm */, + 9250B8C22073C69000EF338C /* MLNShapeOfflineRegion.h */, + 92FC0AE3207CC8DA007B6B54 /* MLNShapeOfflineRegion_Private.h */, + 92FC0AE5207CDD8D007B6B54 /* MLNShapeOfflineRegion.mm */, + DAE6C3581CC31E0400DB3429 /* MLNTilePyramidOfflineRegion.h */, + 9221BAAE20699CBA0054BDF4 /* MLNTilePyramidOfflineRegion_Private.h */, + DAE6C37B1CC31E2A00DB3429 /* MLNTilePyramidOfflineRegion.mm */, ); name = "Offline Maps"; sourceTree = ""; @@ -1146,33 +1146,33 @@ DAD1657F1CF4CF50001FF4B9 /* Categories */ = { isa = PBXGroup; children = ( - 40B77E431DB11BB0003DA2FE /* NSArray+MGLAdditions.h */, - 40B77E421DB11BB0003DA2FE /* NSArray+MGLAdditions.mm */, - DAE6C37D1CC31E2A00DB3429 /* NSBundle+MGLAdditions.h */, - DAE6C37E1CC31E2A00DB3429 /* NSBundle+MGLAdditions.mm */, - 359819571E02F611008FC139 /* NSCoder+MGLAdditions.h */, - 359819581E02F611008FC139 /* NSCoder+MGLAdditions.mm */, - 35C5D8431D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.h */, - 35C5D8441D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.mm */, - 35C5D8451D6DD66D00E95907 /* NSCompoundPredicate+MGLAdditions.h */, - 35C5D8461D6DD66D00E95907 /* NSCompoundPredicate+MGLAdditions.mm */, - 35D65C581D65AD5500722C23 /* NSDate+MGLAdditions.h */, - 35D65C591D65AD5500722C23 /* NSDate+MGLAdditions.mm */, - 408AA85F1DAEED3300022900 /* NSDictionary+MGLAdditions.h */, - 408AA85E1DAEED3300022900 /* NSDictionary+MGLAdditions.mm */, - DAE6C37F1CC31E2A00DB3429 /* NSException+MGLAdditions.h */, - 3508EC621D749D39009B0EE4 /* NSExpression+MGLAdditions.h */, - DAC25FC9200FD5E2009BE98E /* NSExpression+MGLPrivateAdditions.h */, - 3508EC631D749D39009B0EE4 /* NSExpression+MGLAdditions.mm */, - 352903991D6C63B80002C7DF /* NSPredicate+MGLAdditions.h */, - 3529039A1D6C63B80002C7DF /* NSPredicate+MGLAdditions.mm */, - 1FC481842098F323000D09B4 /* NSPredicate+MGLPrivateAdditions.h */, - DAE6C3821CC31E2A00DB3429 /* NSString+MGLAdditions.h */, - DAE6C3831CC31E2A00DB3429 /* NSString+MGLAdditions.m */, - DAED385D1D62CED700D7640F /* NSURL+MGLAdditions.h */, - DAED385E1D62CED700D7640F /* NSURL+MGLAdditions.m */, - DA35A2CD1CCAAED300E826B2 /* NSValue+MGLAdditions.h */, - DA35A2CE1CCAAED300E826B2 /* NSValue+MGLAdditions.m */, + 40B77E431DB11BB0003DA2FE /* NSArray+MLNAdditions.h */, + 40B77E421DB11BB0003DA2FE /* NSArray+MLNAdditions.mm */, + DAE6C37D1CC31E2A00DB3429 /* NSBundle+MLNAdditions.h */, + DAE6C37E1CC31E2A00DB3429 /* NSBundle+MLNAdditions.mm */, + 359819571E02F611008FC139 /* NSCoder+MLNAdditions.h */, + 359819581E02F611008FC139 /* NSCoder+MLNAdditions.mm */, + 35C5D8431D6DD66D00E95907 /* NSComparisonPredicate+MLNAdditions.h */, + 35C5D8441D6DD66D00E95907 /* NSComparisonPredicate+MLNAdditions.mm */, + 35C5D8451D6DD66D00E95907 /* NSCompoundPredicate+MLNAdditions.h */, + 35C5D8461D6DD66D00E95907 /* NSCompoundPredicate+MLNAdditions.mm */, + 35D65C581D65AD5500722C23 /* NSDate+MLNAdditions.h */, + 35D65C591D65AD5500722C23 /* NSDate+MLNAdditions.mm */, + 408AA85F1DAEED3300022900 /* NSDictionary+MLNAdditions.h */, + 408AA85E1DAEED3300022900 /* NSDictionary+MLNAdditions.mm */, + DAE6C37F1CC31E2A00DB3429 /* NSException+MLNAdditions.h */, + 3508EC621D749D39009B0EE4 /* NSExpression+MLNAdditions.h */, + DAC25FC9200FD5E2009BE98E /* NSExpression+MLNPrivateAdditions.h */, + 3508EC631D749D39009B0EE4 /* NSExpression+MLNAdditions.mm */, + 352903991D6C63B80002C7DF /* NSPredicate+MLNAdditions.h */, + 3529039A1D6C63B80002C7DF /* NSPredicate+MLNAdditions.mm */, + 1FC481842098F323000D09B4 /* NSPredicate+MLNPrivateAdditions.h */, + DAE6C3821CC31E2A00DB3429 /* NSString+MLNAdditions.h */, + DAE6C3831CC31E2A00DB3429 /* NSString+MLNAdditions.m */, + DAED385D1D62CED700D7640F /* NSURL+MLNAdditions.h */, + DAED385E1D62CED700D7640F /* NSURL+MLNAdditions.m */, + DA35A2CD1CCAAED300E826B2 /* NSValue+MLNAdditions.h */, + DA35A2CE1CCAAED300E826B2 /* NSValue+MLNAdditions.m */, ); name = Categories; sourceTree = ""; @@ -1210,33 +1210,33 @@ children = ( DAE6C33A1CC30DB200DB3429 /* Info.plist */, DA2784FD1DF03060001D5B8D /* Media.xcassets */, - CA9461A520884CCB0015EB12 /* MGLAnnotationTests.m */, - DAEDC4361D606291000224FF /* MGLAttributionButtonTests.m */, - DAEDC4311D6033F1000224FF /* MGLAttributionInfoTests.m */, - DA35A2C11CCA9F4A00E826B2 /* MGLClockDirectionFormatterTests.m */, - 3526EABC1DF9B19800006B43 /* MGLCodingTests.mm */, - DA35A2B51CCA14D700E826B2 /* MGLCompassDirectionFormatterTests.m */, - DA35A2A71CC9F41600E826B2 /* MGLCoordinateFormatterTests.m */, - 35C6DF861E214C1800ACA483 /* MGLDistanceFormatterTests.m */, - DA2987591E1A4290002299F5 /* MGLDocumentationExampleTests.swift */, - DA57D4B01EBC699800793288 /* MGLDocumentationGuideTests.swift */, - DD58A4C71D822C6200E1F038 /* MGLExpressionTests.mm */, - DA0CD58D1CF56F5800A5F5A5 /* MGLFeatureTests.mm */, - DAE6C3C81CC34BD800DB3429 /* MGLGeometryTests.mm */, - DA0E9F3A24119F6B007C75D4 /* MGLImageTests.mm */, - DA695423215B1E6C002041A4 /* MGLMapCameraTests.m */, - DAA4227B24294137008457DB /* MGLMapSnapshotterTests.m */, - 076171C4213A0DC200668A35 /* MGLMapViewTests.m */, - 1F95931A1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm */, - DAE7DEC31E24549F007505A6 /* MGLNSStringAdditionsTests.m */, - CA0B3C082329FB4800E4B493 /* MGLOfflinePackTests.mm */, - DAE6C3CA1CC34BD800DB3429 /* MGLOfflineRegionTests.m */, - 55E2AD101E5B0A6900E8C587 /* MGLOfflineStorageTests.mm */, - 35C5D84B1D6DD75B00E95907 /* MGLPredicateTests.mm */, - CA8FBC0C21A4A74300D1203C /* MGLRendererConfigurationTests.m */, - CAD9D0AB22A88A32001B25EE /* MGLResourceTests.mm */, - DAE6C3CC1CC34BD800DB3429 /* MGLStyleTests.mm */, - 556660D51E1D07E400E2C41B /* MGLVersionNumber.m */, + CA9461A520884CCB0015EB12 /* MLNAnnotationTests.m */, + DAEDC4361D606291000224FF /* MLNAttributionButtonTests.m */, + DAEDC4311D6033F1000224FF /* MLNAttributionInfoTests.m */, + DA35A2C11CCA9F4A00E826B2 /* MLNClockDirectionFormatterTests.m */, + 3526EABC1DF9B19800006B43 /* MLNCodingTests.mm */, + DA35A2B51CCA14D700E826B2 /* MLNCompassDirectionFormatterTests.m */, + DA35A2A71CC9F41600E826B2 /* MLNCoordinateFormatterTests.m */, + 35C6DF861E214C1800ACA483 /* MLNDistanceFormatterTests.m */, + DA2987591E1A4290002299F5 /* MLNDocumentationExampleTests.swift */, + DA57D4B01EBC699800793288 /* MLNDocumentationGuideTests.swift */, + DD58A4C71D822C6200E1F038 /* MLNExpressionTests.mm */, + DA0CD58D1CF56F5800A5F5A5 /* MLNFeatureTests.mm */, + DAE6C3C81CC34BD800DB3429 /* MLNGeometryTests.mm */, + DA0E9F3A24119F6B007C75D4 /* MLNImageTests.mm */, + DA695423215B1E6C002041A4 /* MLNMapCameraTests.m */, + DAA4227B24294137008457DB /* MLNMapSnapshotterTests.m */, + 076171C4213A0DC200668A35 /* MLNMapViewTests.m */, + 1F95931A1E6DE2B600D5B294 /* MLNNSDateAdditionsTests.mm */, + DAE7DEC31E24549F007505A6 /* MLNNSStringAdditionsTests.m */, + CA0B3C082329FB4800E4B493 /* MLNOfflinePackTests.mm */, + DAE6C3CA1CC34BD800DB3429 /* MLNOfflineRegionTests.m */, + 55E2AD101E5B0A6900E8C587 /* MLNOfflineStorageTests.mm */, + 35C5D84B1D6DD75B00E95907 /* MLNPredicateTests.mm */, + CA8FBC0C21A4A74300D1203C /* MLNRendererConfigurationTests.m */, + CAD9D0AB22A88A32001B25EE /* MLNResourceTests.mm */, + DAE6C3CC1CC34BD800DB3429 /* MLNStyleTests.mm */, + 556660D51E1D07E400E2C41B /* MLNVersionNumber.m */, DA35D0891E1A631B007DED41 /* one-liner.json */, DAC8A4832452972F00C795BB /* mixed.json */, DAC8A47D24527EBB00C795BB /* glyphs.pbf */, @@ -1258,38 +1258,38 @@ DAD1657C1CF4CE6B001FF4B9 /* Formatters */, DAD1657D1CF4CECB001FF4B9 /* Geometry */, DAD1657E1CF4CF04001FF4B9 /* Offline Maps */, - DAE6C34A1CC31E0400DB3429 /* MGLSettings.h */, - DAE6C36A1CC31E2A00DB3429 /* MGLSettings_Private.h */, - DAE6C36B1CC31E2A00DB3429 /* MGLSettings.mm */, - DA00FC881D5EEAC3009AABC8 /* MGLAttributionInfo.h */, - DAF0D8151DFE6B1800B28378 /* MGLAttributionInfo_Private.h */, - DA00FC891D5EEAC3009AABC8 /* MGLAttributionInfo.mm */, - 1FF4858C2237235200F19727 /* MGLAttributedExpression.h */, - 1FF4858B2237235200F19727 /* MGLAttributedExpression.m */, - 556660C51E1BEA0100E2C41B /* MGLFoundation.h */, - 558DE7A41E56161C00C7916D /* MGLFoundation_Private.h */, - 558DE7A51E56161C00C7916D /* MGLFoundation.mm */, - DAE6C34D1CC31E0400DB3429 /* MGLMapCamera.h */, - DAE6C36E1CC31E2A00DB3429 /* MGLMapCamera.mm */, - 92092EEE1F5EB10E00AF5130 /* MGLMapSnapshotter.h */, - 92092EEF1F5EB10E00AF5130 /* MGLMapSnapshotter.mm */, - DD0902B01DB1AC6400C5BDCE /* MGLNetworkConfiguration.h */, - 1F2B94C2221E22E500210640 /* MGLNetworkConfiguration_Private.h */, - DD0902AF1DB1AC6400C5BDCE /* MGLNetworkConfiguration.mm */, - DA35D9C4240916370013ECB0 /* MGLReachability.h */, - DA35D9C5240916380013ECB0 /* MGLReachability.m */, - 3EA9369A4C46957566058822 /* MGLRendererConfiguration.h */, - 3EA93B1B0864609938506E12 /* MGLRendererConfiguration.m */, - 92F2C3EA1F0E3A1900268EC0 /* MGLRendererFrontend.h */, - DAE6C3571CC31E0400DB3429 /* MGLStyle.h */, - 3537CA731D3F93A600380318 /* MGLStyle_Private.h */, - DAE6C37A1CC31E2A00DB3429 /* MGLStyle.mm */, - DAE6C3591CC31E0400DB3429 /* MGLTypes.h */, - DAE6C37C1CC31E2A00DB3429 /* MGLTypes.m */, - DA87A99F1DC9DC6200810D09 /* MGLValueEvaluator.h */, - 1F8A5A03216D4696004DFE75 /* MGLLoggingConfiguration.h */, - 1F8A5A01216D4695004DFE75 /* MGLLoggingConfiguration_Private.h */, - CF762DEE22DC7EFF00338472 /* MGLLoggingConfiguration.mm */, + DAE6C34A1CC31E0400DB3429 /* MLNSettings.h */, + DAE6C36A1CC31E2A00DB3429 /* MLNSettings_Private.h */, + DAE6C36B1CC31E2A00DB3429 /* MLNSettings.mm */, + DA00FC881D5EEAC3009AABC8 /* MLNAttributionInfo.h */, + DAF0D8151DFE6B1800B28378 /* MLNAttributionInfo_Private.h */, + DA00FC891D5EEAC3009AABC8 /* MLNAttributionInfo.mm */, + 1FF4858C2237235200F19727 /* MLNAttributedExpression.h */, + 1FF4858B2237235200F19727 /* MLNAttributedExpression.m */, + 556660C51E1BEA0100E2C41B /* MLNFoundation.h */, + 558DE7A41E56161C00C7916D /* MLNFoundation_Private.h */, + 558DE7A51E56161C00C7916D /* MLNFoundation.mm */, + DAE6C34D1CC31E0400DB3429 /* MLNMapCamera.h */, + DAE6C36E1CC31E2A00DB3429 /* MLNMapCamera.mm */, + 92092EEE1F5EB10E00AF5130 /* MLNMapSnapshotter.h */, + 92092EEF1F5EB10E00AF5130 /* MLNMapSnapshotter.mm */, + DD0902B01DB1AC6400C5BDCE /* MLNNetworkConfiguration.h */, + 1F2B94C2221E22E500210640 /* MLNNetworkConfiguration_Private.h */, + DD0902AF1DB1AC6400C5BDCE /* MLNNetworkConfiguration.mm */, + DA35D9C4240916370013ECB0 /* MLNReachability.h */, + DA35D9C5240916380013ECB0 /* MLNReachability.m */, + 3EA9369A4C46957566058822 /* MLNRendererConfiguration.h */, + 3EA93B1B0864609938506E12 /* MLNRendererConfiguration.m */, + 92F2C3EA1F0E3A1900268EC0 /* MLNRendererFrontend.h */, + DAE6C3571CC31E0400DB3429 /* MLNStyle.h */, + 3537CA731D3F93A600380318 /* MLNStyle_Private.h */, + DAE6C37A1CC31E2A00DB3429 /* MLNStyle.mm */, + DAE6C3591CC31E0400DB3429 /* MLNTypes.h */, + DAE6C37C1CC31E2A00DB3429 /* MLNTypes.m */, + DA87A99F1DC9DC6200810D09 /* MLNValueEvaluator.h */, + 1F8A5A03216D4696004DFE75 /* MLNLoggingConfiguration.h */, + 1F8A5A01216D4695004DFE75 /* MLNLoggingConfiguration_Private.h */, + CF762DEE22DC7EFF00338472 /* MLNLoggingConfiguration.mm */, ); name = Foundation; path = ../darwin/src; @@ -1299,25 +1299,25 @@ isa = PBXGroup; children = ( DA90B12C1DB43B180073CF55 /* Categories */, - DAE6C39F1CC31E9400DB3429 /* MGLAnnotationImage.h */, - DAC2ABC41CC6D343006D18C4 /* MGLAnnotationImage_Private.h */, - DAE6C3A71CC31EF300DB3429 /* MGLAnnotationImage.m */, - DAE6C3A81CC31EF300DB3429 /* MGLAttributionButton.h */, - DAE6C3A91CC31EF300DB3429 /* MGLAttributionButton.mm */, - DAE6C3AA1CC31EF300DB3429 /* MGLCompassCell.h */, - DAE6C3AB1CC31EF300DB3429 /* MGLCompassCell.m */, - DAE6C3A01CC31E9400DB3429 /* MGLMapView.h */, - DAE6C3AC1CC31EF300DB3429 /* MGLMapView_Private.h */, - DAE6C3AD1CC31EF300DB3429 /* MGLMapView.mm */, - 5591AC682298361600FF9ADF /* MGLMapView+Impl.h */, - 5591AC692298361600FF9ADF /* MGLMapView+Impl.mm */, - 55CAF6332294409B00F17770 /* MGLMapView+OpenGL.mm */, - 55CAF6312294407F00F17770 /* MGLMapView+OpenGL.h */, - DAE6C3A11CC31E9400DB3429 /* MGLMapView+IBAdditions.h */, - DAE6C3AE1CC31EF300DB3429 /* MGLMapView+IBAdditions.mm */, - DAE6C3A21CC31E9400DB3429 /* MGLMapViewDelegate.h */, - DAE6C3AF1CC31EF300DB3429 /* MGLOpenGLLayer.h */, - DAE6C3B01CC31EF300DB3429 /* MGLOpenGLLayer.mm */, + DAE6C39F1CC31E9400DB3429 /* MLNAnnotationImage.h */, + DAC2ABC41CC6D343006D18C4 /* MLNAnnotationImage_Private.h */, + DAE6C3A71CC31EF300DB3429 /* MLNAnnotationImage.m */, + DAE6C3A81CC31EF300DB3429 /* MLNAttributionButton.h */, + DAE6C3A91CC31EF300DB3429 /* MLNAttributionButton.mm */, + DAE6C3AA1CC31EF300DB3429 /* MLNCompassCell.h */, + DAE6C3AB1CC31EF300DB3429 /* MLNCompassCell.m */, + DAE6C3A01CC31E9400DB3429 /* MLNMapView.h */, + DAE6C3AC1CC31EF300DB3429 /* MLNMapView_Private.h */, + DAE6C3AD1CC31EF300DB3429 /* MLNMapView.mm */, + 5591AC682298361600FF9ADF /* MLNMapView+Impl.h */, + 5591AC692298361600FF9ADF /* MLNMapView+Impl.mm */, + 55CAF6332294409B00F17770 /* MLNMapView+OpenGL.mm */, + 55CAF6312294407F00F17770 /* MLNMapView+OpenGL.h */, + DAE6C3A11CC31E9400DB3429 /* MLNMapView+IBAdditions.h */, + DAE6C3AE1CC31EF300DB3429 /* MLNMapView+IBAdditions.mm */, + DAE6C3A21CC31E9400DB3429 /* MLNMapViewDelegate.h */, + DAE6C3AF1CC31EF300DB3429 /* MLNOpenGLLayer.h */, + DAE6C3B01CC31EF300DB3429 /* MLNOpenGLLayer.mm */, ); name = Kit; path = src; @@ -1342,136 +1342,136 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 4BBCDC50265260FF004106C3 /* MGLDefaultStyle.h in Headers */, - 556660C61E1BEA0100E2C41B /* MGLFoundation.h in Headers */, - 4BBCDC4F265260FF004106C3 /* MGLTileServerOptions.h in Headers */, - 07F8E2F71F674C8800F794BB /* MGLComputedShapeSource.h in Headers */, - DA8F258F1D51CA600010E6B5 /* MGLRasterStyleLayer.h in Headers */, - 3508EC641D749D39009B0EE4 /* NSExpression+MGLAdditions.h in Headers */, - DAE6C38D1CC31E2A00DB3429 /* MGLOfflineRegion_Private.h in Headers */, - DA7DC9831DED647F0027472F /* MGLRasterTileSource_Private.h in Headers */, - 747ABE5B219B2BDB00523B67 /* MGLBackgroundStyleLayer_Private.h in Headers */, - 1FF4858E2237235300F19727 /* MGLAttributedExpression.h in Headers */, - 1753ED401E53CE6100A9FD90 /* MGLConversion.h in Headers */, - 747ABE59219B2BDB00523B67 /* MGLFillExtrusionStyleLayer_Private.h in Headers */, - DA8F259C1D51CB000010E6B5 /* MGLStyleValue_Private.h in Headers */, - DAE6C35B1CC31E0400DB3429 /* MGLAnnotation.h in Headers */, - DAE6C3B61CC31EF300DB3429 /* MGLMapView_Private.h in Headers */, - 747ABE65219B2C1800523B67 /* MGLRasterStyleLayer_Private.h in Headers */, - 747ABE5D219B2BDB00523B67 /* MGLHeatmapStyleLayer_Private.h in Headers */, - DAF25716201901C200367EF5 /* MGLHillshadeStyleLayer.h in Headers */, - 92092EF01F5EB10E00AF5130 /* MGLMapSnapshotter.h in Headers */, - 3527428D1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.h in Headers */, - DA00FC8A1D5EEAC3009AABC8 /* MGLAttributionInfo.h in Headers */, - DAE6C3B21CC31EF300DB3429 /* MGLAttributionButton.h in Headers */, - DAA998FB1E9F545C002E6EA6 /* MGLFillExtrusionStyleLayer.h in Headers */, - 40B77E451DB11BC9003DA2FE /* NSArray+MGLAdditions.h in Headers */, - 35C5D8471D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.h in Headers */, - DAE6C3A31CC31E9400DB3429 /* MGLAnnotationImage.h in Headers */, - DAE6C3A41CC31E9400DB3429 /* MGLMapView.h in Headers */, - DAE6C3611CC31E0400DB3429 /* MGLOfflineStorage.h in Headers */, - 749EC8912199CCB9005608D7 /* MGLStyleLayerManager.h in Headers */, - 352742781D4C220900A1ECE6 /* MGLStyleValue.h in Headers */, - DAE6C35E1CC31E0400DB3429 /* MGLMultiPoint.h in Headers */, - 35602BFF1D3EA9B40050646F /* MGLStyleLayer_Private.h in Headers */, - 92FC0AE4207CC8DA007B6B54 /* MGLShapeOfflineRegion_Private.h in Headers */, - DAF0D8161DFE6B1800B28378 /* MGLAttributionInfo_Private.h in Headers */, - DAE6C3971CC31E2A00DB3429 /* NSBundle+MGLAdditions.h in Headers */, - DAED385F1D62CED700D7640F /* NSURL+MGLAdditions.h in Headers */, - DAD165741CF4CD7A001FF4B9 /* MGLShapeCollection.h in Headers */, - DAE6C3631CC31E0400DB3429 /* MGLPointAnnotation.h in Headers */, - DAC2ABC51CC6D343006D18C4 /* MGLAnnotationImage_Private.h in Headers */, - DAE6C35F1CC31E0400DB3429 /* MGLOfflinePack.h in Headers */, - 1F8A5A04216D4696004DFE75 /* MGLLoggingConfiguration_Private.h in Headers */, - 1FC481852098F323000D09B4 /* NSPredicate+MGLPrivateAdditions.h in Headers */, - DAE6C39C1CC31E2A00DB3429 /* NSString+MGLAdditions.h in Headers */, - 1F8A5A06216D4696004DFE75 /* MGLLoggingConfiguration.h in Headers */, - 3529039B1D6C63B80002C7DF /* NSPredicate+MGLAdditions.h in Headers */, - 747ABE5A219B2BDB00523B67 /* MGLCircleStyleLayer_Private.h in Headers */, - DA8F25971D51CAC70010E6B5 /* MGLVectorTileSource.h in Headers */, - DA7DC9811DED5F5C0027472F /* MGLVectorTileSource_Private.h in Headers */, - DAE6C3861CC31E2A00DB3429 /* MGLGeometry_Private.h in Headers */, - DAE6C3841CC31E2A00DB3429 /* MGLSettings_Private.h in Headers */, - DACA8622201920BE00E9693A /* MGLRasterDEMSource.h in Headers */, - DAE6C3691CC31E0400DB3429 /* MGLTypes.h in Headers */, - 07D9474D1F67441B00E37934 /* MGLComputedShapeSource_Private.h in Headers */, - DAE6C3991CC31E2A00DB3429 /* NSException+MGLAdditions.h in Headers */, - DA8F25871D51C9E10010E6B5 /* MGLBackgroundStyleLayer.h in Headers */, - 4049C2A51DB6CE7F00B3F799 /* MGLPointCollection.h in Headers */, - DAE6C3661CC31E0400DB3429 /* MGLShape.h in Headers */, - DA551B831DB496AC0009AFAF /* MGLTileSource_Private.h in Headers */, - DAC25FCA200FD5E2009BE98E /* NSExpression+MGLPrivateAdditions.h in Headers */, - DA7262071DEEDD460043BB89 /* MGLOpenGLStyleLayer.h in Headers */, - 352742811D4C243B00A1ECE6 /* MGLSource.h in Headers */, + 4BBCDC50265260FF004106C3 /* MLNDefaultStyle.h in Headers */, + 556660C61E1BEA0100E2C41B /* MLNFoundation.h in Headers */, + 4BBCDC4F265260FF004106C3 /* MLNTileServerOptions.h in Headers */, + 07F8E2F71F674C8800F794BB /* MLNComputedShapeSource.h in Headers */, + DA8F258F1D51CA600010E6B5 /* MLNRasterStyleLayer.h in Headers */, + 3508EC641D749D39009B0EE4 /* NSExpression+MLNAdditions.h in Headers */, + DAE6C38D1CC31E2A00DB3429 /* MLNOfflineRegion_Private.h in Headers */, + DA7DC9831DED647F0027472F /* MLNRasterTileSource_Private.h in Headers */, + 747ABE5B219B2BDB00523B67 /* MLNBackgroundStyleLayer_Private.h in Headers */, + 1FF4858E2237235300F19727 /* MLNAttributedExpression.h in Headers */, + 1753ED401E53CE6100A9FD90 /* MLNConversion.h in Headers */, + 747ABE59219B2BDB00523B67 /* MLNFillExtrusionStyleLayer_Private.h in Headers */, + DA8F259C1D51CB000010E6B5 /* MLNStyleValue_Private.h in Headers */, + DAE6C35B1CC31E0400DB3429 /* MLNAnnotation.h in Headers */, + DAE6C3B61CC31EF300DB3429 /* MLNMapView_Private.h in Headers */, + 747ABE65219B2C1800523B67 /* MLNRasterStyleLayer_Private.h in Headers */, + 747ABE5D219B2BDB00523B67 /* MLNHeatmapStyleLayer_Private.h in Headers */, + DAF25716201901C200367EF5 /* MLNHillshadeStyleLayer.h in Headers */, + 92092EF01F5EB10E00AF5130 /* MLNMapSnapshotter.h in Headers */, + 3527428D1D4C24AB00A1ECE6 /* MLNCircleStyleLayer.h in Headers */, + DA00FC8A1D5EEAC3009AABC8 /* MLNAttributionInfo.h in Headers */, + DAE6C3B21CC31EF300DB3429 /* MLNAttributionButton.h in Headers */, + DAA998FB1E9F545C002E6EA6 /* MLNFillExtrusionStyleLayer.h in Headers */, + 40B77E451DB11BC9003DA2FE /* NSArray+MLNAdditions.h in Headers */, + 35C5D8471D6DD66D00E95907 /* NSComparisonPredicate+MLNAdditions.h in Headers */, + DAE6C3A31CC31E9400DB3429 /* MLNAnnotationImage.h in Headers */, + DAE6C3A41CC31E9400DB3429 /* MLNMapView.h in Headers */, + DAE6C3611CC31E0400DB3429 /* MLNOfflineStorage.h in Headers */, + 749EC8912199CCB9005608D7 /* MLNStyleLayerManager.h in Headers */, + 352742781D4C220900A1ECE6 /* MLNStyleValue.h in Headers */, + DAE6C35E1CC31E0400DB3429 /* MLNMultiPoint.h in Headers */, + 35602BFF1D3EA9B40050646F /* MLNStyleLayer_Private.h in Headers */, + 92FC0AE4207CC8DA007B6B54 /* MLNShapeOfflineRegion_Private.h in Headers */, + DAF0D8161DFE6B1800B28378 /* MLNAttributionInfo_Private.h in Headers */, + DAE6C3971CC31E2A00DB3429 /* NSBundle+MLNAdditions.h in Headers */, + DAED385F1D62CED700D7640F /* NSURL+MLNAdditions.h in Headers */, + DAD165741CF4CD7A001FF4B9 /* MLNShapeCollection.h in Headers */, + DAE6C3631CC31E0400DB3429 /* MLNPointAnnotation.h in Headers */, + DAC2ABC51CC6D343006D18C4 /* MLNAnnotationImage_Private.h in Headers */, + DAE6C35F1CC31E0400DB3429 /* MLNOfflinePack.h in Headers */, + 1F8A5A04216D4696004DFE75 /* MLNLoggingConfiguration_Private.h in Headers */, + 1FC481852098F323000D09B4 /* NSPredicate+MLNPrivateAdditions.h in Headers */, + DAE6C39C1CC31E2A00DB3429 /* NSString+MLNAdditions.h in Headers */, + 1F8A5A06216D4696004DFE75 /* MLNLoggingConfiguration.h in Headers */, + 3529039B1D6C63B80002C7DF /* NSPredicate+MLNAdditions.h in Headers */, + 747ABE5A219B2BDB00523B67 /* MLNCircleStyleLayer_Private.h in Headers */, + DA8F25971D51CAC70010E6B5 /* MLNVectorTileSource.h in Headers */, + DA7DC9811DED5F5C0027472F /* MLNVectorTileSource_Private.h in Headers */, + DAE6C3861CC31E2A00DB3429 /* MLNGeometry_Private.h in Headers */, + DAE6C3841CC31E2A00DB3429 /* MLNSettings_Private.h in Headers */, + DACA8622201920BE00E9693A /* MLNRasterDEMSource.h in Headers */, + DAE6C3691CC31E0400DB3429 /* MLNTypes.h in Headers */, + 07D9474D1F67441B00E37934 /* MLNComputedShapeSource_Private.h in Headers */, + DAE6C3991CC31E2A00DB3429 /* NSException+MLNAdditions.h in Headers */, + DA8F25871D51C9E10010E6B5 /* MLNBackgroundStyleLayer.h in Headers */, + 4049C2A51DB6CE7F00B3F799 /* MLNPointCollection.h in Headers */, + DAE6C3661CC31E0400DB3429 /* MLNShape.h in Headers */, + DA551B831DB496AC0009AFAF /* MLNTileSource_Private.h in Headers */, + DAC25FCA200FD5E2009BE98E /* NSExpression+MLNPrivateAdditions.h in Headers */, + DA7262071DEEDD460043BB89 /* MLNOpenGLStyleLayer.h in Headers */, + 352742811D4C243B00A1ECE6 /* MLNSource.h in Headers */, DAE6C3C21CC31F4500DB3429 /* Mapbox.h in Headers */, - DAE6C3641CC31E0400DB3429 /* MGLPolygon.h in Headers */, - DA35A2BF1CCA9B1A00E826B2 /* MGLClockDirectionFormatter.h in Headers */, - 1F2B94C3221E22E600210640 /* MGLNetworkConfiguration_Private.h in Headers */, - 35602BFA1D3EA99F0050646F /* MGLFillStyleLayer.h in Headers */, - DA35A2A41CC9EB1A00E826B2 /* MGLCoordinateFormatter.h in Headers */, - 35C5D8491D6DD66D00E95907 /* NSCompoundPredicate+MGLAdditions.h in Headers */, - 9250B8C32073C69100EF338C /* MGLShapeOfflineRegion.h in Headers */, - 747ABE67219B2C3200523B67 /* MGLSymbolStyleLayer_Private.h in Headers */, - 55CAF6322294407F00F17770 /* MGLMapView+OpenGL.h in Headers */, - DD0902B31DB1AC6400C5BDCE /* MGLNetworkConfiguration.h in Headers */, - DAE6C3621CC31E0400DB3429 /* MGLOverlay.h in Headers */, - DAE6C3651CC31E0400DB3429 /* MGLPolyline.h in Headers */, - DAE6C39A1CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.h in Headers */, - 92F2C3EB1F0E3A1900268EC0 /* MGLRendererFrontend.h in Headers */, - DA8F258B1D51CA540010E6B5 /* MGLLineStyleLayer.h in Headers */, - 35C6DF841E214C0400ACA483 /* MGLDistanceFormatter.h in Headers */, - DA8F25B21D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h in Headers */, - 55335DF9212EC542000CE5F8 /* NSImage+MGLAdditions.h in Headers */, - 1F7454A31ECFB00300021D39 /* MGLLight_Private.h in Headers */, - 5591AC6A2298361600FF9ADF /* MGLMapView+Impl.h in Headers */, - 359819591E02F611008FC139 /* NSCoder+MGLAdditions.h in Headers */, - DAE6C38E1CC31E2A00DB3429 /* MGLOfflineStorage_Private.h in Headers */, - 747ABE61219B2C0000523B67 /* MGLLineStyleLayer_Private.h in Headers */, - 747ABE5F219B2BED00523B67 /* MGLHillshadeStyleLayer_Private.h in Headers */, - DA87A9A01DC9DC6200810D09 /* MGLValueEvaluator.h in Headers */, - 8946239D200E744800DA8EF2 /* MGLHeatmapStyleLayer.h in Headers */, - DAE6C3601CC31E0400DB3429 /* MGLOfflineRegion.h in Headers */, - DAE6C3681CC31E0400DB3429 /* MGLTilePyramidOfflineRegion.h in Headers */, - DA35A2CF1CCAAED300E826B2 /* NSValue+MGLAdditions.h in Headers */, - DAE6C3A61CC31E9400DB3429 /* MGLMapViewDelegate.h in Headers */, - DAE6C38B1CC31E2A00DB3429 /* MGLOfflinePack_Private.h in Headers */, - 558DE7A61E56161C00C7916D /* MGLFoundation_Private.h in Headers */, - CA4045C7216720D700B356E1 /* MGLCluster.h in Headers */, - DACC22141CF3D3E200D220D9 /* MGLFeature.h in Headers */, - 3538AA231D542685008EC33D /* MGLStyleLayer.h in Headers */, - DAE6C35C1CC31E0400DB3429 /* MGLGeometry.h in Headers */, - DAE6C35A1CC31E0400DB3429 /* MGLSettings.h in Headers */, - DA551B821DB496AC0009AFAF /* MGLTileSource.h in Headers */, - 35602C001D3EA9B40050646F /* MGLForegroundStyleLayer.h in Headers */, - DAE6C35D1CC31E0400DB3429 /* MGLMapCamera.h in Headers */, - DAE6C3B41CC31EF300DB3429 /* MGLCompassCell.h in Headers */, - DA87A99C1DC9D8DD00810D09 /* MGLShapeSource_Private.h in Headers */, - 3537CA741D3F93A600380318 /* MGLStyle_Private.h in Headers */, - 0721493F1EE200E900085505 /* MGLImageSource.h in Headers */, - DA8F259A1D51CAD00010E6B5 /* MGLSource_Private.h in Headers */, - DA8F25931D51CA750010E6B5 /* MGLSymbolStyleLayer.h in Headers */, - DAE6C3B91CC31EF300DB3429 /* MGLOpenGLLayer.h in Headers */, - DAF0D80E1DFE0E5D00B28378 /* MGLPointCollection_Private.h in Headers */, - 35D65C5A1D65AD5500722C23 /* NSDate+MGLAdditions.h in Headers */, - 355BA4ED1D41633E00CCC6D5 /* NSColor+MGLAdditions.h in Headers */, - DAE6C3891CC31E2A00DB3429 /* MGLMultiPoint_Private.h in Headers */, - 747ABE64219B2C1800523B67 /* MGLOpenGLStyleLayer_Private.h in Headers */, - DAE6C3A51CC31E9400DB3429 /* MGLMapView+IBAdditions.h in Headers */, - DA35A2AD1CCA091800E826B2 /* MGLCompassDirectionFormatter.h in Headers */, - 352742851D4C244700A1ECE6 /* MGLRasterTileSource.h in Headers */, - 9654C12D1FFC394700DB6A19 /* MGLPolygon_Private.h in Headers */, - 408AA85B1DAEECFE00022900 /* MGLShape_Private.h in Headers */, - 9221BAAF20699CBB0054BDF4 /* MGLTilePyramidOfflineRegion_Private.h in Headers */, - DACC22181CF3D4F700D220D9 /* MGLFeature_Private.h in Headers */, - 9654C12B1FFC38E000DB6A19 /* MGLPolyline_Private.h in Headers */, - DA6408D71DA4E5DA00908C90 /* MGLVectorStyleLayer.h in Headers */, - 352742891D4C245800A1ECE6 /* MGLShapeSource.h in Headers */, - 1F7454A41ECFB00300021D39 /* MGLLight.h in Headers */, - 747ABE5C219B2BDB00523B67 /* MGLFillStyleLayer_Private.h in Headers */, - 408AA8671DAEEE3900022900 /* NSDictionary+MGLAdditions.h in Headers */, - DAE6C3671CC31E0400DB3429 /* MGLStyle.h in Headers */, - DA35D9C6240916380013ECB0 /* MGLReachability.h in Headers */, - 3EA9317388DC9A0BF46B7674 /* MGLRendererConfiguration.h in Headers */, + DAE6C3641CC31E0400DB3429 /* MLNPolygon.h in Headers */, + DA35A2BF1CCA9B1A00E826B2 /* MLNClockDirectionFormatter.h in Headers */, + 1F2B94C3221E22E600210640 /* MLNNetworkConfiguration_Private.h in Headers */, + 35602BFA1D3EA99F0050646F /* MLNFillStyleLayer.h in Headers */, + DA35A2A41CC9EB1A00E826B2 /* MLNCoordinateFormatter.h in Headers */, + 35C5D8491D6DD66D00E95907 /* NSCompoundPredicate+MLNAdditions.h in Headers */, + 9250B8C32073C69100EF338C /* MLNShapeOfflineRegion.h in Headers */, + 747ABE67219B2C3200523B67 /* MLNSymbolStyleLayer_Private.h in Headers */, + 55CAF6322294407F00F17770 /* MLNMapView+OpenGL.h in Headers */, + DD0902B31DB1AC6400C5BDCE /* MLNNetworkConfiguration.h in Headers */, + DAE6C3621CC31E0400DB3429 /* MLNOverlay.h in Headers */, + DAE6C3651CC31E0400DB3429 /* MLNPolyline.h in Headers */, + DAE6C39A1CC31E2A00DB3429 /* NSProcessInfo+MLNAdditions.h in Headers */, + 92F2C3EB1F0E3A1900268EC0 /* MLNRendererFrontend.h in Headers */, + DA8F258B1D51CA540010E6B5 /* MLNLineStyleLayer.h in Headers */, + 35C6DF841E214C0400ACA483 /* MLNDistanceFormatter.h in Headers */, + DA8F25B21D51CB270010E6B5 /* NSValue+MLNStyleAttributeAdditions.h in Headers */, + 55335DF9212EC542000CE5F8 /* NSImage+MLNAdditions.h in Headers */, + 1F7454A31ECFB00300021D39 /* MLNLight_Private.h in Headers */, + 5591AC6A2298361600FF9ADF /* MLNMapView+Impl.h in Headers */, + 359819591E02F611008FC139 /* NSCoder+MLNAdditions.h in Headers */, + DAE6C38E1CC31E2A00DB3429 /* MLNOfflineStorage_Private.h in Headers */, + 747ABE61219B2C0000523B67 /* MLNLineStyleLayer_Private.h in Headers */, + 747ABE5F219B2BED00523B67 /* MLNHillshadeStyleLayer_Private.h in Headers */, + DA87A9A01DC9DC6200810D09 /* MLNValueEvaluator.h in Headers */, + 8946239D200E744800DA8EF2 /* MLNHeatmapStyleLayer.h in Headers */, + DAE6C3601CC31E0400DB3429 /* MLNOfflineRegion.h in Headers */, + DAE6C3681CC31E0400DB3429 /* MLNTilePyramidOfflineRegion.h in Headers */, + DA35A2CF1CCAAED300E826B2 /* NSValue+MLNAdditions.h in Headers */, + DAE6C3A61CC31E9400DB3429 /* MLNMapViewDelegate.h in Headers */, + DAE6C38B1CC31E2A00DB3429 /* MLNOfflinePack_Private.h in Headers */, + 558DE7A61E56161C00C7916D /* MLNFoundation_Private.h in Headers */, + CA4045C7216720D700B356E1 /* MLNCluster.h in Headers */, + DACC22141CF3D3E200D220D9 /* MLNFeature.h in Headers */, + 3538AA231D542685008EC33D /* MLNStyleLayer.h in Headers */, + DAE6C35C1CC31E0400DB3429 /* MLNGeometry.h in Headers */, + DAE6C35A1CC31E0400DB3429 /* MLNSettings.h in Headers */, + DA551B821DB496AC0009AFAF /* MLNTileSource.h in Headers */, + 35602C001D3EA9B40050646F /* MLNForegroundStyleLayer.h in Headers */, + DAE6C35D1CC31E0400DB3429 /* MLNMapCamera.h in Headers */, + DAE6C3B41CC31EF300DB3429 /* MLNCompassCell.h in Headers */, + DA87A99C1DC9D8DD00810D09 /* MLNShapeSource_Private.h in Headers */, + 3537CA741D3F93A600380318 /* MLNStyle_Private.h in Headers */, + 0721493F1EE200E900085505 /* MLNImageSource.h in Headers */, + DA8F259A1D51CAD00010E6B5 /* MLNSource_Private.h in Headers */, + DA8F25931D51CA750010E6B5 /* MLNSymbolStyleLayer.h in Headers */, + DAE6C3B91CC31EF300DB3429 /* MLNOpenGLLayer.h in Headers */, + DAF0D80E1DFE0E5D00B28378 /* MLNPointCollection_Private.h in Headers */, + 35D65C5A1D65AD5500722C23 /* NSDate+MLNAdditions.h in Headers */, + 355BA4ED1D41633E00CCC6D5 /* NSColor+MLNAdditions.h in Headers */, + DAE6C3891CC31E2A00DB3429 /* MLNMultiPoint_Private.h in Headers */, + 747ABE64219B2C1800523B67 /* MLNOpenGLStyleLayer_Private.h in Headers */, + DAE6C3A51CC31E9400DB3429 /* MLNMapView+IBAdditions.h in Headers */, + DA35A2AD1CCA091800E826B2 /* MLNCompassDirectionFormatter.h in Headers */, + 352742851D4C244700A1ECE6 /* MLNRasterTileSource.h in Headers */, + 9654C12D1FFC394700DB6A19 /* MLNPolygon_Private.h in Headers */, + 408AA85B1DAEECFE00022900 /* MLNShape_Private.h in Headers */, + 9221BAAF20699CBB0054BDF4 /* MLNTilePyramidOfflineRegion_Private.h in Headers */, + DACC22181CF3D4F700D220D9 /* MLNFeature_Private.h in Headers */, + 9654C12B1FFC38E000DB6A19 /* MLNPolyline_Private.h in Headers */, + DA6408D71DA4E5DA00908C90 /* MLNVectorStyleLayer.h in Headers */, + 352742891D4C245800A1ECE6 /* MLNShapeSource.h in Headers */, + 1F7454A41ECFB00300021D39 /* MLNLight.h in Headers */, + 747ABE5C219B2BDB00523B67 /* MLNFillStyleLayer_Private.h in Headers */, + 408AA8671DAEEE3900022900 /* NSDictionary+MLNAdditions.h in Headers */, + DAE6C3671CC31E0400DB3429 /* MLNStyle.h in Headers */, + DA35D9C6240916380013ECB0 /* MLNReachability.h in Headers */, + 3EA9317388DC9A0BF46B7674 /* MLNRendererConfiguration.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1647,7 +1647,7 @@ DA8933AE1CCD290700E68420 /* Localizable.strings in Resources */, DAE6C3BE1CC31F2E00DB3429 /* default_marker.pdf in Resources */, DAE6C3BF1CC31F2E00DB3429 /* mapbox.pdf in Resources */, - DA8933A51CCD287300E68420 /* MGLAnnotationCallout.xib in Resources */, + DA8933A51CCD287300E68420 /* MLNAnnotationCallout.xib in Resources */, DA8933B51CCD2C2500E68420 /* Foundation.strings in Resources */, DA8933B81CCD2C2D00E68420 /* Foundation.stringsdict in Resources */, 1F9EF4061FBA1B0E0063FBB0 /* mapbox_helmet.pdf in Resources */, @@ -1679,7 +1679,7 @@ DAE6C2ED1CC3050F00DB3429 /* DroppedPinAnnotation.m in Sources */, DAE6C2EE1CC3050F00DB3429 /* LocationCoordinate2DTransformer.m in Sources */, DAE6C2F11CC3050F00DB3429 /* TimeIntervalTransformer.m in Sources */, - DACB0C391E18DFFD005DDBEA /* MGLStyle+MBXAdditions.m in Sources */, + DACB0C391E18DFFD005DDBEA /* MLNStyle+MBXAdditions.m in Sources */, DA839E9A1CC2E3400062CAFB /* main.m in Sources */, DA839E971CC2E3400062CAFB /* AppDelegate.m in Sources */, 3E6465D9206576A900685536 /* LimeGreenStyleLayer.m in Sources */, @@ -1691,85 +1691,85 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 07A019EF1ED665CD00ACD43E /* MGLImageSource.mm in Sources */, - 92092EF11F5EB10E00AF5130 /* MGLMapSnapshotter.mm in Sources */, - 40ABDB561DB0022100372083 /* NSImage+MGLAdditions.mm in Sources */, - DAF25715201901C200367EF5 /* MGLHillshadeStyleLayer.mm in Sources */, - DAE6C3901CC31E2A00DB3429 /* MGLPointAnnotation.mm in Sources */, - DAE6C3981CC31E2A00DB3429 /* NSBundle+MGLAdditions.mm in Sources */, - DAE6C3B71CC31EF300DB3429 /* MGLMapView.mm in Sources */, - 55CAF6342294409B00F17770 /* MGLMapView+OpenGL.mm in Sources */, - 40B77E461DB11BCD003DA2FE /* NSArray+MGLAdditions.mm in Sources */, - DAE6C38C1CC31E2A00DB3429 /* MGLOfflinePack.mm in Sources */, - 35D65C5B1D65AD5500722C23 /* NSDate+MGLAdditions.mm in Sources */, - CF762DEF22DC7EFF00338472 /* MGLLoggingConfiguration.mm in Sources */, - DD0902B21DB1AC6400C5BDCE /* MGLNetworkConfiguration.mm in Sources */, - 1F7454A51ECFB00300021D39 /* MGLLight.mm in Sources */, - DAE6C3B11CC31EF300DB3429 /* MGLAnnotationImage.m in Sources */, - 3508EC651D749D39009B0EE4 /* NSExpression+MGLAdditions.mm in Sources */, - DACC22151CF3D3E200D220D9 /* MGLFeature.mm in Sources */, - DA7262081DEEDD460043BB89 /* MGLOpenGLStyleLayer.mm in Sources */, - 355BA4EE1D41633E00CCC6D5 /* NSColor+MGLAdditions.mm in Sources */, - DAE6C3B31CC31EF300DB3429 /* MGLAttributionButton.mm in Sources */, - 35602BFB1D3EA99F0050646F /* MGLFillStyleLayer.mm in Sources */, - DAE6C3931CC31E2A00DB3429 /* MGLShape.mm in Sources */, - 352742861D4C244700A1ECE6 /* MGLRasterTileSource.mm in Sources */, - 558DE7A71E56161C00C7916D /* MGLFoundation.mm in Sources */, - 4BBCDC4E265260FF004106C3 /* MGLDefaultStyle.mm in Sources */, - DAE6C39D1CC31E2A00DB3429 /* NSString+MGLAdditions.m in Sources */, - 3598195A1E02F611008FC139 /* NSCoder+MGLAdditions.mm in Sources */, - 749EC8932199CCB9005608D7 /* MGLStyleLayerManager.mm in Sources */, - DAE6C3941CC31E2A00DB3429 /* MGLStyle.mm in Sources */, - DAE6C3871CC31E2A00DB3429 /* MGLGeometry.mm in Sources */, - 894623A0200E748000DA8EF2 /* MGLHeatmapStyleLayer.mm in Sources */, - 3527428E1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.mm in Sources */, - 35602C011D3EA9B40050646F /* MGLForegroundStyleLayer.mm in Sources */, - 408AA86A1DAEEE5D00022900 /* NSDictionary+MGLAdditions.mm in Sources */, - DA8F25881D51C9E10010E6B5 /* MGLBackgroundStyleLayer.mm in Sources */, - DA551B841DB496AC0009AFAF /* MGLTileSource.mm in Sources */, - DAE6C3B81CC31EF300DB3429 /* MGLMapView+IBAdditions.mm in Sources */, - DA35A2D01CCAAED300E826B2 /* NSValue+MGLAdditions.m in Sources */, - 3538AA241D542685008EC33D /* MGLStyleLayer.mm in Sources */, - DA35A2C01CCA9B1A00E826B2 /* MGLClockDirectionFormatter.m in Sources */, - 07F8E2F81F674C9000F794BB /* MGLComputedShapeSource.mm in Sources */, - DAE6C3BA1CC31EF300DB3429 /* MGLOpenGLLayer.mm in Sources */, - DA35D9C7240916380013ECB0 /* MGLReachability.m in Sources */, - DAE6C38A1CC31E2A00DB3429 /* MGLMultiPoint.mm in Sources */, - DAE6C3961CC31E2A00DB3429 /* MGLTypes.m in Sources */, - 4049C2AD1DB8020600B3F799 /* MGLPointCollection.mm in Sources */, - DA35A2A61CC9EB2700E826B2 /* MGLCoordinateFormatter.m in Sources */, - 352742821D4C243B00A1ECE6 /* MGLSource.mm in Sources */, - DAE6C3881CC31E2A00DB3429 /* MGLMapCamera.mm in Sources */, - DA6408D81DA4E5DA00908C90 /* MGLVectorStyleLayer.mm in Sources */, - 1FF4858D2237235300F19727 /* MGLAttributedExpression.m in Sources */, - DA8F25B31D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.mm in Sources */, - DAE6C3911CC31E2A00DB3429 /* MGLPolygon.mm in Sources */, - 35C6DF851E214C0400ACA483 /* MGLDistanceFormatter.m in Sources */, - DAE6C39B1CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.m in Sources */, - DAA998FC1E9F545C002E6EA6 /* MGLFillExtrusionStyleLayer.mm in Sources */, - DAE6C38F1CC31E2A00DB3429 /* MGLOfflineStorage.mm in Sources */, - DAED38601D62CED700D7640F /* NSURL+MGLAdditions.m in Sources */, - 35C5D84A1D6DD66D00E95907 /* NSCompoundPredicate+MGLAdditions.mm in Sources */, - DAE6C3951CC31E2A00DB3429 /* MGLTilePyramidOfflineRegion.mm in Sources */, - DAE6C3851CC31E2A00DB3429 /* MGLSettings.mm in Sources */, - DA00FC8B1D5EEAC3009AABC8 /* MGLAttributionInfo.mm in Sources */, - DAE6C3921CC31E2A00DB3429 /* MGLPolyline.mm in Sources */, - 3527428A1D4C245800A1ECE6 /* MGLShapeSource.mm in Sources */, - DAE6C3B51CC31EF300DB3429 /* MGLCompassCell.m in Sources */, - DA8F25901D51CA600010E6B5 /* MGLRasterStyleLayer.mm in Sources */, - DAD165751CF4CD7A001FF4B9 /* MGLShapeCollection.mm in Sources */, - 92FC0AE6207CDD8D007B6B54 /* MGLShapeOfflineRegion.mm in Sources */, - 35C5D8481D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.mm in Sources */, - 5591AC6B2298361600FF9ADF /* MGLMapView+Impl.mm in Sources */, - DA35A2AE1CCA091800E826B2 /* MGLCompassDirectionFormatter.m in Sources */, - DACA8623201920BE00E9693A /* MGLRasterDEMSource.mm in Sources */, - DA8F258C1D51CA540010E6B5 /* MGLLineStyleLayer.mm in Sources */, - DA8F25941D51CA750010E6B5 /* MGLSymbolStyleLayer.mm in Sources */, - 3529039C1D6C63B80002C7DF /* NSPredicate+MGLAdditions.mm in Sources */, - DA8F25981D51CAC70010E6B5 /* MGLVectorTileSource.mm in Sources */, - 352742A11D4C25BD00A1ECE6 /* MGLStyleValue.mm in Sources */, - 4BBCDC4D265260FF004106C3 /* MGLTileServerOptions.mm in Sources */, - 3EA93BA38DBB4B814B6C1FCC /* MGLRendererConfiguration.m in Sources */, + 07A019EF1ED665CD00ACD43E /* MLNImageSource.mm in Sources */, + 92092EF11F5EB10E00AF5130 /* MLNMapSnapshotter.mm in Sources */, + 40ABDB561DB0022100372083 /* NSImage+MLNAdditions.mm in Sources */, + DAF25715201901C200367EF5 /* MLNHillshadeStyleLayer.mm in Sources */, + DAE6C3901CC31E2A00DB3429 /* MLNPointAnnotation.mm in Sources */, + DAE6C3981CC31E2A00DB3429 /* NSBundle+MLNAdditions.mm in Sources */, + DAE6C3B71CC31EF300DB3429 /* MLNMapView.mm in Sources */, + 55CAF6342294409B00F17770 /* MLNMapView+OpenGL.mm in Sources */, + 40B77E461DB11BCD003DA2FE /* NSArray+MLNAdditions.mm in Sources */, + DAE6C38C1CC31E2A00DB3429 /* MLNOfflinePack.mm in Sources */, + 35D65C5B1D65AD5500722C23 /* NSDate+MLNAdditions.mm in Sources */, + CF762DEF22DC7EFF00338472 /* MLNLoggingConfiguration.mm in Sources */, + DD0902B21DB1AC6400C5BDCE /* MLNNetworkConfiguration.mm in Sources */, + 1F7454A51ECFB00300021D39 /* MLNLight.mm in Sources */, + DAE6C3B11CC31EF300DB3429 /* MLNAnnotationImage.m in Sources */, + 3508EC651D749D39009B0EE4 /* NSExpression+MLNAdditions.mm in Sources */, + DACC22151CF3D3E200D220D9 /* MLNFeature.mm in Sources */, + DA7262081DEEDD460043BB89 /* MLNOpenGLStyleLayer.mm in Sources */, + 355BA4EE1D41633E00CCC6D5 /* NSColor+MLNAdditions.mm in Sources */, + DAE6C3B31CC31EF300DB3429 /* MLNAttributionButton.mm in Sources */, + 35602BFB1D3EA99F0050646F /* MLNFillStyleLayer.mm in Sources */, + DAE6C3931CC31E2A00DB3429 /* MLNShape.mm in Sources */, + 352742861D4C244700A1ECE6 /* MLNRasterTileSource.mm in Sources */, + 558DE7A71E56161C00C7916D /* MLNFoundation.mm in Sources */, + 4BBCDC4E265260FF004106C3 /* MLNDefaultStyle.mm in Sources */, + DAE6C39D1CC31E2A00DB3429 /* NSString+MLNAdditions.m in Sources */, + 3598195A1E02F611008FC139 /* NSCoder+MLNAdditions.mm in Sources */, + 749EC8932199CCB9005608D7 /* MLNStyleLayerManager.mm in Sources */, + DAE6C3941CC31E2A00DB3429 /* MLNStyle.mm in Sources */, + DAE6C3871CC31E2A00DB3429 /* MLNGeometry.mm in Sources */, + 894623A0200E748000DA8EF2 /* MLNHeatmapStyleLayer.mm in Sources */, + 3527428E1D4C24AB00A1ECE6 /* MLNCircleStyleLayer.mm in Sources */, + 35602C011D3EA9B40050646F /* MLNForegroundStyleLayer.mm in Sources */, + 408AA86A1DAEEE5D00022900 /* NSDictionary+MLNAdditions.mm in Sources */, + DA8F25881D51C9E10010E6B5 /* MLNBackgroundStyleLayer.mm in Sources */, + DA551B841DB496AC0009AFAF /* MLNTileSource.mm in Sources */, + DAE6C3B81CC31EF300DB3429 /* MLNMapView+IBAdditions.mm in Sources */, + DA35A2D01CCAAED300E826B2 /* NSValue+MLNAdditions.m in Sources */, + 3538AA241D542685008EC33D /* MLNStyleLayer.mm in Sources */, + DA35A2C01CCA9B1A00E826B2 /* MLNClockDirectionFormatter.m in Sources */, + 07F8E2F81F674C9000F794BB /* MLNComputedShapeSource.mm in Sources */, + DAE6C3BA1CC31EF300DB3429 /* MLNOpenGLLayer.mm in Sources */, + DA35D9C7240916380013ECB0 /* MLNReachability.m in Sources */, + DAE6C38A1CC31E2A00DB3429 /* MLNMultiPoint.mm in Sources */, + DAE6C3961CC31E2A00DB3429 /* MLNTypes.m in Sources */, + 4049C2AD1DB8020600B3F799 /* MLNPointCollection.mm in Sources */, + DA35A2A61CC9EB2700E826B2 /* MLNCoordinateFormatter.m in Sources */, + 352742821D4C243B00A1ECE6 /* MLNSource.mm in Sources */, + DAE6C3881CC31E2A00DB3429 /* MLNMapCamera.mm in Sources */, + DA6408D81DA4E5DA00908C90 /* MLNVectorStyleLayer.mm in Sources */, + 1FF4858D2237235300F19727 /* MLNAttributedExpression.m in Sources */, + DA8F25B31D51CB270010E6B5 /* NSValue+MLNStyleAttributeAdditions.mm in Sources */, + DAE6C3911CC31E2A00DB3429 /* MLNPolygon.mm in Sources */, + 35C6DF851E214C0400ACA483 /* MLNDistanceFormatter.m in Sources */, + DAE6C39B1CC31E2A00DB3429 /* NSProcessInfo+MLNAdditions.m in Sources */, + DAA998FC1E9F545C002E6EA6 /* MLNFillExtrusionStyleLayer.mm in Sources */, + DAE6C38F1CC31E2A00DB3429 /* MLNOfflineStorage.mm in Sources */, + DAED38601D62CED700D7640F /* NSURL+MLNAdditions.m in Sources */, + 35C5D84A1D6DD66D00E95907 /* NSCompoundPredicate+MLNAdditions.mm in Sources */, + DAE6C3951CC31E2A00DB3429 /* MLNTilePyramidOfflineRegion.mm in Sources */, + DAE6C3851CC31E2A00DB3429 /* MLNSettings.mm in Sources */, + DA00FC8B1D5EEAC3009AABC8 /* MLNAttributionInfo.mm in Sources */, + DAE6C3921CC31E2A00DB3429 /* MLNPolyline.mm in Sources */, + 3527428A1D4C245800A1ECE6 /* MLNShapeSource.mm in Sources */, + DAE6C3B51CC31EF300DB3429 /* MLNCompassCell.m in Sources */, + DA8F25901D51CA600010E6B5 /* MLNRasterStyleLayer.mm in Sources */, + DAD165751CF4CD7A001FF4B9 /* MLNShapeCollection.mm in Sources */, + 92FC0AE6207CDD8D007B6B54 /* MLNShapeOfflineRegion.mm in Sources */, + 35C5D8481D6DD66D00E95907 /* NSComparisonPredicate+MLNAdditions.mm in Sources */, + 5591AC6B2298361600FF9ADF /* MLNMapView+Impl.mm in Sources */, + DA35A2AE1CCA091800E826B2 /* MLNCompassDirectionFormatter.m in Sources */, + DACA8623201920BE00E9693A /* MLNRasterDEMSource.mm in Sources */, + DA8F258C1D51CA540010E6B5 /* MLNLineStyleLayer.mm in Sources */, + DA8F25941D51CA750010E6B5 /* MLNSymbolStyleLayer.mm in Sources */, + 3529039C1D6C63B80002C7DF /* NSPredicate+MLNAdditions.mm in Sources */, + DA8F25981D51CAC70010E6B5 /* MLNVectorTileSource.mm in Sources */, + 352742A11D4C25BD00A1ECE6 /* MLNStyleValue.mm in Sources */, + 4BBCDC4D265260FF004106C3 /* MLNTileServerOptions.mm in Sources */, + 3EA93BA38DBB4B814B6C1FCC /* MLNRendererConfiguration.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1777,53 +1777,53 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - DA35A2C21CCA9F4A00E826B2 /* MGLClockDirectionFormatterTests.m in Sources */, - DAE6C3D41CC34C9900DB3429 /* MGLOfflineRegionTests.m in Sources */, - DAE6C3D61CC34C9900DB3429 /* MGLStyleTests.mm in Sources */, - 1F7454AB1ED1DDBD00021D39 /* MGLLightTest.mm in Sources */, - 07A240941F675674002C8210 /* MGLComputedShapeSourceTests.m in Sources */, - DAEDC4371D606291000224FF /* MGLAttributionButtonTests.m in Sources */, - CA0B3C072329F7E700E4B493 /* MGLTestAssertionHandler.m in Sources */, - DA695424215B1E6C002041A4 /* MGLMapCameraTests.m in Sources */, - 920A3E591E6F859D00C16EFC /* MGLSourceQueryTests.m in Sources */, - DA35A2B61CCA14D700E826B2 /* MGLCompassDirectionFormatterTests.m in Sources */, - DA0E9F3B24119F6B007C75D4 /* MGLImageTests.mm in Sources */, - 35C6DF871E214C1800ACA483 /* MGLDistanceFormatterTests.m in Sources */, - CAD9D0AC22A88A32001B25EE /* MGLResourceTests.mm in Sources */, - DAE6C3D21CC34C9900DB3429 /* MGLGeometryTests.mm in Sources */, - DA87A9A41DCACC5000810D09 /* MGLSymbolStyleLayerTests.mm in Sources */, - 40E1601D1DF217D6005EA6D9 /* MGLStyleLayerTests.m in Sources */, - 076171C5213A0DC200668A35 /* MGLMapViewTests.m in Sources */, - 170A82BF201BDD1B00943087 /* MGLHeatmapStyleLayerTests.mm in Sources */, - 1F95931B1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm in Sources */, - DAF25721201902C100367EF5 /* MGLHillshadeStyleLayerTests.mm in Sources */, - DA87A9A61DCACC5000810D09 /* MGLCircleStyleLayerTests.mm in Sources */, - DA87A99E1DC9DC2100810D09 /* MGLPredicateTests.mm in Sources */, - DD58A4C91D822C6700E1F038 /* MGLExpressionTests.mm in Sources */, - CA0B3C092329FB4800E4B493 /* MGLOfflinePackTests.mm in Sources */, - 170A82C4201FB6EC00943087 /* MGLHeatmapColorTests.mm in Sources */, - 4031ACFC1E9EB3C100A3EA26 /* MGLMapViewDelegateIntegrationTests.swift in Sources */, - CA8FBC0D21A4A74300D1203C /* MGLRendererConfigurationTests.m in Sources */, - 4031AD031E9FD6AA00A3EA26 /* MGLSDKTestHelpers.swift in Sources */, - DAA4227C24294137008457DB /* MGLMapSnapshotterTests.m in Sources */, - DA87A9A71DCACC5000810D09 /* MGLBackgroundStyleLayerTests.mm in Sources */, - DAA999011E9F5EC5002E6EA6 /* MGLFillExtrusionStyleLayerTests.mm in Sources */, - DA29875A1E1A4290002299F5 /* MGLDocumentationExampleTests.swift in Sources */, - 07BA4CAC1EE21887004528F5 /* MGLImageSourceTests.m in Sources */, - DA87A9A51DCACC5000810D09 /* MGLLineStyleLayerTests.mm in Sources */, - DA87A9A31DCACC5000810D09 /* MGLRasterStyleLayerTests.mm in Sources */, - CA9461A620884CCB0015EB12 /* MGLAnnotationTests.m in Sources */, - DA87A9991DC9D88400810D09 /* MGLTileSetTests.mm in Sources */, - DA35A2A81CC9F41600E826B2 /* MGLCoordinateFormatterTests.m in Sources */, - DAE7DEC41E24549F007505A6 /* MGLNSStringAdditionsTests.m in Sources */, - DA87A9981DC9D88400810D09 /* MGLShapeSourceTests.mm in Sources */, - 55E2AD111E5B0A6900E8C587 /* MGLOfflineStorageTests.mm in Sources */, - 3526EABD1DF9B19800006B43 /* MGLCodingTests.mm in Sources */, - DA87A9A21DC9DCF100810D09 /* MGLFillStyleLayerTests.mm in Sources */, - DA57D4B11EBC699800793288 /* MGLDocumentationGuideTests.swift in Sources */, - DAEDC4321D6033F1000224FF /* MGLAttributionInfoTests.m in Sources */, - DA0CD58E1CF56F5800A5F5A5 /* MGLFeatureTests.mm in Sources */, - 556660D61E1D07E400E2C41B /* MGLVersionNumber.m in Sources */, + DA35A2C21CCA9F4A00E826B2 /* MLNClockDirectionFormatterTests.m in Sources */, + DAE6C3D41CC34C9900DB3429 /* MLNOfflineRegionTests.m in Sources */, + DAE6C3D61CC34C9900DB3429 /* MLNStyleTests.mm in Sources */, + 1F7454AB1ED1DDBD00021D39 /* MLNLightTest.mm in Sources */, + 07A240941F675674002C8210 /* MLNComputedShapeSourceTests.m in Sources */, + DAEDC4371D606291000224FF /* MLNAttributionButtonTests.m in Sources */, + CA0B3C072329F7E700E4B493 /* MLNTestAssertionHandler.m in Sources */, + DA695424215B1E6C002041A4 /* MLNMapCameraTests.m in Sources */, + 920A3E591E6F859D00C16EFC /* MLNSourceQueryTests.m in Sources */, + DA35A2B61CCA14D700E826B2 /* MLNCompassDirectionFormatterTests.m in Sources */, + DA0E9F3B24119F6B007C75D4 /* MLNImageTests.mm in Sources */, + 35C6DF871E214C1800ACA483 /* MLNDistanceFormatterTests.m in Sources */, + CAD9D0AC22A88A32001B25EE /* MLNResourceTests.mm in Sources */, + DAE6C3D21CC34C9900DB3429 /* MLNGeometryTests.mm in Sources */, + DA87A9A41DCACC5000810D09 /* MLNSymbolStyleLayerTests.mm in Sources */, + 40E1601D1DF217D6005EA6D9 /* MLNStyleLayerTests.m in Sources */, + 076171C5213A0DC200668A35 /* MLNMapViewTests.m in Sources */, + 170A82BF201BDD1B00943087 /* MLNHeatmapStyleLayerTests.mm in Sources */, + 1F95931B1E6DE2B600D5B294 /* MLNNSDateAdditionsTests.mm in Sources */, + DAF25721201902C100367EF5 /* MLNHillshadeStyleLayerTests.mm in Sources */, + DA87A9A61DCACC5000810D09 /* MLNCircleStyleLayerTests.mm in Sources */, + DA87A99E1DC9DC2100810D09 /* MLNPredicateTests.mm in Sources */, + DD58A4C91D822C6700E1F038 /* MLNExpressionTests.mm in Sources */, + CA0B3C092329FB4800E4B493 /* MLNOfflinePackTests.mm in Sources */, + 170A82C4201FB6EC00943087 /* MLNHeatmapColorTests.mm in Sources */, + 4031ACFC1E9EB3C100A3EA26 /* MLNMapViewDelegateIntegrationTests.swift in Sources */, + CA8FBC0D21A4A74300D1203C /* MLNRendererConfigurationTests.m in Sources */, + 4031AD031E9FD6AA00A3EA26 /* MLNSDKTestHelpers.swift in Sources */, + DAA4227C24294137008457DB /* MLNMapSnapshotterTests.m in Sources */, + DA87A9A71DCACC5000810D09 /* MLNBackgroundStyleLayerTests.mm in Sources */, + DAA999011E9F5EC5002E6EA6 /* MLNFillExtrusionStyleLayerTests.mm in Sources */, + DA29875A1E1A4290002299F5 /* MLNDocumentationExampleTests.swift in Sources */, + 07BA4CAC1EE21887004528F5 /* MLNImageSourceTests.m in Sources */, + DA87A9A51DCACC5000810D09 /* MLNLineStyleLayerTests.mm in Sources */, + DA87A9A31DCACC5000810D09 /* MLNRasterStyleLayerTests.mm in Sources */, + CA9461A620884CCB0015EB12 /* MLNAnnotationTests.m in Sources */, + DA87A9991DC9D88400810D09 /* MLNTileSetTests.mm in Sources */, + DA35A2A81CC9F41600E826B2 /* MLNCoordinateFormatterTests.m in Sources */, + DAE7DEC41E24549F007505A6 /* MLNNSStringAdditionsTests.m in Sources */, + DA87A9981DC9D88400810D09 /* MLNShapeSourceTests.mm in Sources */, + 55E2AD111E5B0A6900E8C587 /* MLNOfflineStorageTests.mm in Sources */, + 3526EABD1DF9B19800006B43 /* MLNCodingTests.mm in Sources */, + DA87A9A21DC9DCF100810D09 /* MLNFillStyleLayerTests.mm in Sources */, + DA57D4B11EBC699800793288 /* MLNDocumentationGuideTests.swift in Sources */, + DAEDC4321D6033F1000224FF /* MLNAttributionInfoTests.m in Sources */, + DA0CD58E1CF56F5800A5F5A5 /* MLNFeatureTests.mm in Sources */, + 556660D61E1D07E400E2C41B /* MLNVersionNumber.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1892,12 +1892,12 @@ name = MainMenu.xib; sourceTree = ""; }; - DA8933A71CCD287300E68420 /* MGLAnnotationCallout.xib */ = { + DA8933A71CCD287300E68420 /* MLNAnnotationCallout.xib */ = { isa = PBXVariantGroup; children = ( DA8933A61CCD287300E68420 /* Base */, ); - name = MGLAnnotationCallout.xib; + name = MLNAnnotationCallout.xib; sourceTree = ""; }; DA8933AB1CCD290700E68420 /* Localizable.strings */ = { diff --git a/platform/ios/platform/macos/macos.xcodeproj/xcshareddata/xcschemes/CI.xcscheme b/platform/ios/platform/macos/macos.xcodeproj/xcshareddata/xcschemes/CI.xcscheme index 997977472..77fe6a64c 100644 --- a/platform/ios/platform/macos/macos.xcodeproj/xcshareddata/xcschemes/CI.xcscheme +++ b/platform/ios/platform/macos/macos.xcodeproj/xcshareddata/xcschemes/CI.xcscheme @@ -70,7 +70,7 @@ + Identifier = "MLNMapSnapshotterTests/testLocalGlyphRendering"> diff --git a/platform/ios/platform/macos/macos.xcodeproj/xcshareddata/xcschemes/dynamic.xcscheme b/platform/ios/platform/macos/macos.xcodeproj/xcshareddata/xcschemes/dynamic.xcscheme index 5c8f95f9d..a0e4794af 100644 --- a/platform/ios/platform/macos/macos.xcodeproj/xcshareddata/xcschemes/dynamic.xcscheme +++ b/platform/ios/platform/macos/macos.xcodeproj/xcshareddata/xcschemes/dynamic.xcscheme @@ -64,7 +64,7 @@ + Identifier = "MLNMapSnapshotterTests/testLocalGlyphRendering"> diff --git a/platform/ios/platform/macos/macos.xcodeproj/xcshareddata/xcschemes/macosapp.xcscheme b/platform/ios/platform/macos/macos.xcodeproj/xcshareddata/xcschemes/macosapp.xcscheme index e94969afa..207b25db8 100644 --- a/platform/ios/platform/macos/macos.xcodeproj/xcshareddata/xcschemes/macosapp.xcscheme +++ b/platform/ios/platform/macos/macos.xcodeproj/xcshareddata/xcschemes/macosapp.xcscheme @@ -50,7 +50,7 @@ + Identifier = "MLNMapSnapshotterTests/testLocalGlyphRendering"> diff --git a/platform/ios/platform/macos/sdk-files.json b/platform/ios/platform/macos/sdk-files.json index 82a740018..609902500 100644 --- a/platform/ios/platform/macos/sdk-files.json +++ b/platform/ios/platform/macos/sdk-files.json @@ -1,215 +1,215 @@ { "//": "This file is generated. Do not edit. Regenerate it with scripts/generate-file-lists.js", "sources": [ - "platform/darwin/src/MGLImageSource.mm", - "platform/darwin/src/MGLMapSnapshotter.mm", - "platform/macos/src/NSImage+MGLAdditions.mm", - "platform/darwin/src/MGLHillshadeStyleLayer.mm", - "platform/darwin/src/MGLPointAnnotation.mm", - "platform/darwin/src/MGLSDKMetricsManager.m", - "platform/darwin/src/NSBundle+MGLAdditions.mm", - "platform/macos/src/MGLMapView.mm", - "platform/macos/src/MGLMapView+OpenGL.mm", - "platform/darwin/src/NSArray+MGLAdditions.mm", - "platform/darwin/src/MGLOfflinePack.mm", - "platform/darwin/src/NSDate+MGLAdditions.mm", - "platform/darwin/src/MGLLoggingConfiguration.mm", - "platform/darwin/src/MGLNetworkConfiguration.mm", - "platform/darwin/src/MGLLight.mm", - "platform/macos/src/MGLAnnotationImage.m", - "platform/darwin/src/NSExpression+MGLAdditions.mm", - "platform/darwin/src/MGLFeature.mm", - "platform/darwin/src/MGLOpenGLStyleLayer.mm", - "platform/macos/src/NSColor+MGLAdditions.mm", - "platform/macos/src/MGLAttributionButton.mm", - "platform/darwin/src/MGLFillStyleLayer.mm", - "platform/darwin/src/MGLShape.mm", - "platform/darwin/src/MGLRasterTileSource.mm", - "platform/darwin/src/MGLFoundation.mm", - "platform/darwin/src/NSString+MGLAdditions.m", - "platform/darwin/src/NSCoder+MGLAdditions.mm", - "platform/darwin/src/MGLStyleLayerManager.mm", - "platform/darwin/src/MGLStyle.mm", - "platform/darwin/src/MGLGeometry.mm", - "platform/darwin/src/MGLHeatmapStyleLayer.mm", - "platform/darwin/src/MGLCircleStyleLayer.mm", - "platform/darwin/src/MGLForegroundStyleLayer.mm", - "platform/darwin/src/NSDictionary+MGLAdditions.mm", - "platform/darwin/src/MGLBackgroundStyleLayer.mm", - "platform/darwin/src/MGLTileSource.mm", - "platform/macos/src/MGLMapView+IBAdditions.mm", - "platform/darwin/src/NSValue+MGLAdditions.m", - "platform/darwin/src/MGLStyleLayer.mm", - "platform/darwin/src/MGLClockDirectionFormatter.m", - "platform/darwin/src/MGLComputedShapeSource.mm", - "platform/macos/src/MGLOpenGLLayer.mm", - "platform/darwin/src/MGLMultiPoint.mm", - "platform/darwin/src/MGLTypes.m", - "platform/darwin/src/MGLPointCollection.mm", - "platform/darwin/src/MGLCoordinateFormatter.m", - "platform/darwin/src/MGLSource.mm", - "platform/darwin/src/MGLMapCamera.mm", - "platform/darwin/src/MGLVectorStyleLayer.mm", - "platform/darwin/src/MGLAttributedExpression.m", - "platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm", - "platform/darwin/src/MGLPolygon.mm", - "platform/darwin/src/MGLDistanceFormatter.m", - "platform/macos/src/NSProcessInfo+MGLAdditions.m", - "platform/darwin/src/MGLFillExtrusionStyleLayer.mm", - "platform/darwin/src/MGLOfflineStorage.mm", - "platform/darwin/src/NSURL+MGLAdditions.m", - "platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm", - "platform/darwin/src/MGLTilePyramidOfflineRegion.mm", - "platform/darwin/src/MGLSettings.mm", - "platform/darwin/src/MGLAttributionInfo.mm", - "platform/darwin/src/MGLPolyline.mm", - "platform/darwin/src/MGLShapeSource.mm", - "platform/macos/src/MGLCompassCell.m", - "platform/darwin/src/MGLRasterStyleLayer.mm", - "platform/darwin/src/MGLShapeCollection.mm", - "platform/darwin/src/MGLShapeOfflineRegion.mm", - "platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm", - "platform/macos/src/MGLMapView+Impl.mm", - "platform/darwin/src/MGLCompassDirectionFormatter.m", - "platform/darwin/src/MGLRasterDEMSource.mm", - "platform/darwin/src/MGLLineStyleLayer.mm", - "platform/darwin/src/MGLSymbolStyleLayer.mm", - "platform/darwin/src/NSPredicate+MGLAdditions.mm", - "platform/darwin/src/MGLVectorTileSource.mm", - "platform/darwin/src/MGLStyleValue.mm", - "platform/darwin/src/MGLRendererConfiguration.mm" + "platform/darwin/src/MLNImageSource.mm", + "platform/darwin/src/MLNMapSnapshotter.mm", + "platform/macos/src/NSImage+MLNAdditions.mm", + "platform/darwin/src/MLNHillshadeStyleLayer.mm", + "platform/darwin/src/MLNPointAnnotation.mm", + "platform/darwin/src/MLNSDKMetricsManager.m", + "platform/darwin/src/NSBundle+MLNAdditions.mm", + "platform/macos/src/MLNMapView.mm", + "platform/macos/src/MLNMapView+OpenGL.mm", + "platform/darwin/src/NSArray+MLNAdditions.mm", + "platform/darwin/src/MLNOfflinePack.mm", + "platform/darwin/src/NSDate+MLNAdditions.mm", + "platform/darwin/src/MLNLoggingConfiguration.mm", + "platform/darwin/src/MLNNetworkConfiguration.mm", + "platform/darwin/src/MLNLight.mm", + "platform/macos/src/MLNAnnotationImage.m", + "platform/darwin/src/NSExpression+MLNAdditions.mm", + "platform/darwin/src/MLNFeature.mm", + "platform/darwin/src/MLNOpenGLStyleLayer.mm", + "platform/macos/src/NSColor+MLNAdditions.mm", + "platform/macos/src/MLNAttributionButton.mm", + "platform/darwin/src/MLNFillStyleLayer.mm", + "platform/darwin/src/MLNShape.mm", + "platform/darwin/src/MLNRasterTileSource.mm", + "platform/darwin/src/MLNFoundation.mm", + "platform/darwin/src/NSString+MLNAdditions.m", + "platform/darwin/src/NSCoder+MLNAdditions.mm", + "platform/darwin/src/MLNStyleLayerManager.mm", + "platform/darwin/src/MLNStyle.mm", + "platform/darwin/src/MLNGeometry.mm", + "platform/darwin/src/MLNHeatmapStyleLayer.mm", + "platform/darwin/src/MLNCircleStyleLayer.mm", + "platform/darwin/src/MLNForegroundStyleLayer.mm", + "platform/darwin/src/NSDictionary+MLNAdditions.mm", + "platform/darwin/src/MLNBackgroundStyleLayer.mm", + "platform/darwin/src/MLNTileSource.mm", + "platform/macos/src/MLNMapView+IBAdditions.mm", + "platform/darwin/src/NSValue+MLNAdditions.m", + "platform/darwin/src/MLNStyleLayer.mm", + "platform/darwin/src/MLNClockDirectionFormatter.m", + "platform/darwin/src/MLNComputedShapeSource.mm", + "platform/macos/src/MLNOpenGLLayer.mm", + "platform/darwin/src/MLNMultiPoint.mm", + "platform/darwin/src/MLNTypes.m", + "platform/darwin/src/MLNPointCollection.mm", + "platform/darwin/src/MLNCoordinateFormatter.m", + "platform/darwin/src/MLNSource.mm", + "platform/darwin/src/MLNMapCamera.mm", + "platform/darwin/src/MLNVectorStyleLayer.mm", + "platform/darwin/src/MLNAttributedExpression.m", + "platform/darwin/src/NSValue+MLNStyleAttributeAdditions.mm", + "platform/darwin/src/MLNPolygon.mm", + "platform/darwin/src/MLNDistanceFormatter.m", + "platform/macos/src/NSProcessInfo+MLNAdditions.m", + "platform/darwin/src/MLNFillExtrusionStyleLayer.mm", + "platform/darwin/src/MLNOfflineStorage.mm", + "platform/darwin/src/NSURL+MLNAdditions.m", + "platform/darwin/src/NSCompoundPredicate+MLNAdditions.mm", + "platform/darwin/src/MLNTilePyramidOfflineRegion.mm", + "platform/darwin/src/MLNSettings.mm", + "platform/darwin/src/MLNAttributionInfo.mm", + "platform/darwin/src/MLNPolyline.mm", + "platform/darwin/src/MLNShapeSource.mm", + "platform/macos/src/MLNCompassCell.m", + "platform/darwin/src/MLNRasterStyleLayer.mm", + "platform/darwin/src/MLNShapeCollection.mm", + "platform/darwin/src/MLNShapeOfflineRegion.mm", + "platform/darwin/src/NSComparisonPredicate+MLNAdditions.mm", + "platform/macos/src/MLNMapView+Impl.mm", + "platform/darwin/src/MLNCompassDirectionFormatter.m", + "platform/darwin/src/MLNRasterDEMSource.mm", + "platform/darwin/src/MLNLineStyleLayer.mm", + "platform/darwin/src/MLNSymbolStyleLayer.mm", + "platform/darwin/src/NSPredicate+MLNAdditions.mm", + "platform/darwin/src/MLNVectorTileSource.mm", + "platform/darwin/src/MLNStyleValue.mm", + "platform/darwin/src/MLNRendererConfiguration.mm" ], "public_headers": { - "MGLFoundation.h": "platform/darwin/src/MGLFoundation.h", - "MGLComputedShapeSource.h": "platform/darwin/src/MGLComputedShapeSource.h", - "MGLRasterStyleLayer.h": "platform/darwin/src/MGLRasterStyleLayer.h", - "NSExpression+MGLAdditions.h": "platform/darwin/src/NSExpression+MGLAdditions.h", - "MGLAttributedExpression.h": "platform/darwin/src/MGLAttributedExpression.h", - "MGLAnnotation.h": "platform/darwin/src/MGLAnnotation.h", - "MGLHillshadeStyleLayer.h": "platform/darwin/src/MGLHillshadeStyleLayer.h", - "MGLMapSnapshotter.h": "platform/darwin/src/MGLMapSnapshotter.h", - "MGLCircleStyleLayer.h": "platform/darwin/src/MGLCircleStyleLayer.h", - "MGLAttributionInfo.h": "platform/darwin/src/MGLAttributionInfo.h", - "MGLFillExtrusionStyleLayer.h": "platform/darwin/src/MGLFillExtrusionStyleLayer.h", - "MGLAnnotationImage.h": "platform/macos/src/MGLAnnotationImage.h", - "MGLMapView.h": "platform/macos/src/MGLMapView.h", - "MGLOfflineStorage.h": "platform/darwin/src/MGLOfflineStorage.h", - "MGLStyleValue.h": "platform/darwin/src/MGLStyleValue.h", - "MGLSDKMetricsManager.h": "platform/darwin/src/MGLSDKMetricsManager.h", - "MGLMultiPoint.h": "platform/darwin/src/MGLMultiPoint.h", - "MGLShapeCollection.h": "platform/darwin/src/MGLShapeCollection.h", - "MGLPointAnnotation.h": "platform/darwin/src/MGLPointAnnotation.h", - "MGLOfflinePack.h": "platform/darwin/src/MGLOfflinePack.h", - "MGLLoggingConfiguration.h": "platform/darwin/src/MGLLoggingConfiguration.h", - "NSPredicate+MGLAdditions.h": "platform/darwin/src/NSPredicate+MGLAdditions.h", - "MGLVectorTileSource.h": "platform/darwin/src/MGLVectorTileSource.h", - "MGLRasterDEMSource.h": "platform/darwin/src/MGLRasterDEMSource.h", - "MGLTypes.h": "platform/darwin/src/MGLTypes.h", - "MGLBackgroundStyleLayer.h": "platform/darwin/src/MGLBackgroundStyleLayer.h", - "MGLPointCollection.h": "platform/darwin/src/MGLPointCollection.h", - "MGLShape.h": "platform/darwin/src/MGLShape.h", - "MGLOpenGLStyleLayer.h": "platform/darwin/src/MGLOpenGLStyleLayer.h", - "MGLSource.h": "platform/darwin/src/MGLSource.h", - "MGLPolygon.h": "platform/darwin/src/MGLPolygon.h", - "MGLClockDirectionFormatter.h": "platform/darwin/src/MGLClockDirectionFormatter.h", - "MGLFillStyleLayer.h": "platform/darwin/src/MGLFillStyleLayer.h", - "MGLCoordinateFormatter.h": "platform/darwin/src/MGLCoordinateFormatter.h", - "MGLShapeOfflineRegion.h": "platform/darwin/src/MGLShapeOfflineRegion.h", - "MGLNetworkConfiguration.h": "platform/darwin/src/MGLNetworkConfiguration.h", - "MGLOverlay.h": "platform/darwin/src/MGLOverlay.h", - "MGLPolyline.h": "platform/darwin/src/MGLPolyline.h", - "MGLLineStyleLayer.h": "platform/darwin/src/MGLLineStyleLayer.h", - "MGLDistanceFormatter.h": "platform/darwin/src/MGLDistanceFormatter.h", - "MGLHeatmapStyleLayer.h": "platform/darwin/src/MGLHeatmapStyleLayer.h", - "MGLOfflineRegion.h": "platform/darwin/src/MGLOfflineRegion.h", - "MGLTilePyramidOfflineRegion.h": "platform/darwin/src/MGLTilePyramidOfflineRegion.h", - "NSValue+MGLAdditions.h": "platform/darwin/src/NSValue+MGLAdditions.h", - "MGLMapViewDelegate.h": "platform/macos/src/MGLMapViewDelegate.h", - "MGLCluster.h": "platform/darwin/src/MGLCluster.h", - "MGLFeature.h": "platform/darwin/src/MGLFeature.h", - "MGLStyleLayer.h": "platform/darwin/src/MGLStyleLayer.h", - "MGLGeometry.h": "platform/darwin/src/MGLGeometry.h", - "MGLSettings.h": "platform/darwin/src/MGLSettings.h", - "MGLTileSource.h": "platform/darwin/src/MGLTileSource.h", - "MGLForegroundStyleLayer.h": "platform/darwin/src/MGLForegroundStyleLayer.h", - "MGLMapCamera.h": "platform/darwin/src/MGLMapCamera.h", - "MGLImageSource.h": "platform/darwin/src/MGLImageSource.h", - "MGLSymbolStyleLayer.h": "platform/darwin/src/MGLSymbolStyleLayer.h", - "MGLMapView+IBAdditions.h": "platform/macos/src/MGLMapView+IBAdditions.h", - "MGLCompassDirectionFormatter.h": "platform/darwin/src/MGLCompassDirectionFormatter.h", - "MGLRasterTileSource.h": "platform/darwin/src/MGLRasterTileSource.h", - "MGLVectorStyleLayer.h": "platform/darwin/src/MGLVectorStyleLayer.h", - "MGLShapeSource.h": "platform/darwin/src/MGLShapeSource.h", - "MGLLight.h": "platform/darwin/src/MGLLight.h", - "MGLStyle.h": "platform/darwin/src/MGLStyle.h", + "MLNFoundation.h": "platform/darwin/src/MLNFoundation.h", + "MLNComputedShapeSource.h": "platform/darwin/src/MLNComputedShapeSource.h", + "MLNRasterStyleLayer.h": "platform/darwin/src/MLNRasterStyleLayer.h", + "NSExpression+MLNAdditions.h": "platform/darwin/src/NSExpression+MLNAdditions.h", + "MLNAttributedExpression.h": "platform/darwin/src/MLNAttributedExpression.h", + "MLNAnnotation.h": "platform/darwin/src/MLNAnnotation.h", + "MLNHillshadeStyleLayer.h": "platform/darwin/src/MLNHillshadeStyleLayer.h", + "MLNMapSnapshotter.h": "platform/darwin/src/MLNMapSnapshotter.h", + "MLNCircleStyleLayer.h": "platform/darwin/src/MLNCircleStyleLayer.h", + "MLNAttributionInfo.h": "platform/darwin/src/MLNAttributionInfo.h", + "MLNFillExtrusionStyleLayer.h": "platform/darwin/src/MLNFillExtrusionStyleLayer.h", + "MLNAnnotationImage.h": "platform/macos/src/MLNAnnotationImage.h", + "MLNMapView.h": "platform/macos/src/MLNMapView.h", + "MLNOfflineStorage.h": "platform/darwin/src/MLNOfflineStorage.h", + "MLNStyleValue.h": "platform/darwin/src/MLNStyleValue.h", + "MLNSDKMetricsManager.h": "platform/darwin/src/MLNSDKMetricsManager.h", + "MLNMultiPoint.h": "platform/darwin/src/MLNMultiPoint.h", + "MLNShapeCollection.h": "platform/darwin/src/MLNShapeCollection.h", + "MLNPointAnnotation.h": "platform/darwin/src/MLNPointAnnotation.h", + "MLNOfflinePack.h": "platform/darwin/src/MLNOfflinePack.h", + "MLNLoggingConfiguration.h": "platform/darwin/src/MLNLoggingConfiguration.h", + "NSPredicate+MLNAdditions.h": "platform/darwin/src/NSPredicate+MLNAdditions.h", + "MLNVectorTileSource.h": "platform/darwin/src/MLNVectorTileSource.h", + "MLNRasterDEMSource.h": "platform/darwin/src/MLNRasterDEMSource.h", + "MLNTypes.h": "platform/darwin/src/MLNTypes.h", + "MLNBackgroundStyleLayer.h": "platform/darwin/src/MLNBackgroundStyleLayer.h", + "MLNPointCollection.h": "platform/darwin/src/MLNPointCollection.h", + "MLNShape.h": "platform/darwin/src/MLNShape.h", + "MLNOpenGLStyleLayer.h": "platform/darwin/src/MLNOpenGLStyleLayer.h", + "MLNSource.h": "platform/darwin/src/MLNSource.h", + "MLNPolygon.h": "platform/darwin/src/MLNPolygon.h", + "MLNClockDirectionFormatter.h": "platform/darwin/src/MLNClockDirectionFormatter.h", + "MLNFillStyleLayer.h": "platform/darwin/src/MLNFillStyleLayer.h", + "MLNCoordinateFormatter.h": "platform/darwin/src/MLNCoordinateFormatter.h", + "MLNShapeOfflineRegion.h": "platform/darwin/src/MLNShapeOfflineRegion.h", + "MLNNetworkConfiguration.h": "platform/darwin/src/MLNNetworkConfiguration.h", + "MLNOverlay.h": "platform/darwin/src/MLNOverlay.h", + "MLNPolyline.h": "platform/darwin/src/MLNPolyline.h", + "MLNLineStyleLayer.h": "platform/darwin/src/MLNLineStyleLayer.h", + "MLNDistanceFormatter.h": "platform/darwin/src/MLNDistanceFormatter.h", + "MLNHeatmapStyleLayer.h": "platform/darwin/src/MLNHeatmapStyleLayer.h", + "MLNOfflineRegion.h": "platform/darwin/src/MLNOfflineRegion.h", + "MLNTilePyramidOfflineRegion.h": "platform/darwin/src/MLNTilePyramidOfflineRegion.h", + "NSValue+MLNAdditions.h": "platform/darwin/src/NSValue+MLNAdditions.h", + "MLNMapViewDelegate.h": "platform/macos/src/MLNMapViewDelegate.h", + "MLNCluster.h": "platform/darwin/src/MLNCluster.h", + "MLNFeature.h": "platform/darwin/src/MLNFeature.h", + "MLNStyleLayer.h": "platform/darwin/src/MLNStyleLayer.h", + "MLNGeometry.h": "platform/darwin/src/MLNGeometry.h", + "MLNSettings.h": "platform/darwin/src/MLNSettings.h", + "MLNTileSource.h": "platform/darwin/src/MLNTileSource.h", + "MLNForegroundStyleLayer.h": "platform/darwin/src/MLNForegroundStyleLayer.h", + "MLNMapCamera.h": "platform/darwin/src/MLNMapCamera.h", + "MLNImageSource.h": "platform/darwin/src/MLNImageSource.h", + "MLNSymbolStyleLayer.h": "platform/darwin/src/MLNSymbolStyleLayer.h", + "MLNMapView+IBAdditions.h": "platform/macos/src/MLNMapView+IBAdditions.h", + "MLNCompassDirectionFormatter.h": "platform/darwin/src/MLNCompassDirectionFormatter.h", + "MLNRasterTileSource.h": "platform/darwin/src/MLNRasterTileSource.h", + "MLNVectorStyleLayer.h": "platform/darwin/src/MLNVectorStyleLayer.h", + "MLNShapeSource.h": "platform/darwin/src/MLNShapeSource.h", + "MLNLight.h": "platform/darwin/src/MLNLight.h", + "MLNStyle.h": "platform/darwin/src/MLNStyle.h", "Mapbox/Mapbox.h": "platform/macos/src/Mapbox.h" }, "private_headers": { - "MGLOfflineRegion_Private.h": "platform/darwin/src/MGLOfflineRegion_Private.h", - "MGLRasterTileSource_Private.h": "platform/darwin/src/MGLRasterTileSource_Private.h", - "MGLBackgroundStyleLayer_Private.h": "platform/darwin/src/MGLBackgroundStyleLayer_Private.h", - "MGLConversion.h": "platform/darwin/src/MGLConversion.h", - "MGLFillExtrusionStyleLayer_Private.h": "platform/darwin/src/MGLFillExtrusionStyleLayer_Private.h", - "MGLStyleValue_Private.h": "platform/darwin/src/MGLStyleValue_Private.h", - "MGLMapView_Private.h": "platform/macos/src/MGLMapView_Private.h", - "MGLRasterStyleLayer_Private.h": "platform/darwin/src/MGLRasterStyleLayer_Private.h", - "MGLHeatmapStyleLayer_Private.h": "platform/darwin/src/MGLHeatmapStyleLayer_Private.h", - "MGLAttributionButton.h": "platform/macos/src/MGLAttributionButton.h", - "NSArray+MGLAdditions.h": "platform/darwin/src/NSArray+MGLAdditions.h", - "NSComparisonPredicate+MGLAdditions.h": "platform/darwin/src/NSComparisonPredicate+MGLAdditions.h", - "MGLStyleLayerManager.h": "platform/darwin/src/MGLStyleLayerManager.h", - "MGLStyleLayer_Private.h": "platform/darwin/src/MGLStyleLayer_Private.h", - "MGLShapeOfflineRegion_Private.h": "platform/darwin/src/MGLShapeOfflineRegion_Private.h", - "MGLAttributionInfo_Private.h": "platform/darwin/src/MGLAttributionInfo_Private.h", - "NSBundle+MGLAdditions.h": "platform/darwin/src/NSBundle+MGLAdditions.h", - "NSURL+MGLAdditions.h": "platform/darwin/src/NSURL+MGLAdditions.h", - "MGLAnnotationImage_Private.h": "platform/macos/src/MGLAnnotationImage_Private.h", - "MGLLoggingConfiguration_Private.h": "platform/darwin/src/MGLLoggingConfiguration_Private.h", - "NSPredicate+MGLPrivateAdditions.h": "platform/darwin/src/NSPredicate+MGLPrivateAdditions.h", - "NSString+MGLAdditions.h": "platform/darwin/src/NSString+MGLAdditions.h", - "MGLCircleStyleLayer_Private.h": "platform/darwin/src/MGLCircleStyleLayer_Private.h", - "MGLVectorTileSource_Private.h": "platform/darwin/src/MGLVectorTileSource_Private.h", - "MGLGeometry_Private.h": "platform/darwin/src/MGLGeometry_Private.h", - "MGLSettings_Private.h": "platform/darwin/src/MGLSettings_Private.h", - "MGLComputedShapeSource_Private.h": "platform/darwin/src/MGLComputedShapeSource_Private.h", - "NSException+MGLAdditions.h": "platform/darwin/src/NSException+MGLAdditions.h", - "MGLTileSource_Private.h": "platform/darwin/src/MGLTileSource_Private.h", - "NSExpression+MGLPrivateAdditions.h": "platform/darwin/src/NSExpression+MGLPrivateAdditions.h", - "MGLSDKMetricsManager_Private.h": "platform/darwin/src/MGLSDKMetricsManager_Private.h", - "MGLNetworkConfiguration_Private.h": "platform/darwin/src/MGLNetworkConfiguration_Private.h", - "NSCompoundPredicate+MGLAdditions.h": "platform/darwin/src/NSCompoundPredicate+MGLAdditions.h", - "MGLSymbolStyleLayer_Private.h": "platform/darwin/src/MGLSymbolStyleLayer_Private.h", - "MGLMapView+OpenGL.h": "platform/macos/src/MGLMapView+OpenGL.h", - "NSProcessInfo+MGLAdditions.h": "platform/macos/src/NSProcessInfo+MGLAdditions.h", - "MGLRendererFrontend.h": "platform/darwin/src/MGLRendererFrontend.h", - "NSValue+MGLStyleAttributeAdditions.h": "platform/darwin/src/NSValue+MGLStyleAttributeAdditions.h", - "NSImage+MGLAdditions.h": "platform/macos/src/NSImage+MGLAdditions.h", - "MGLLight_Private.h": "platform/darwin/src/MGLLight_Private.h", - "MGLMapView+Impl.h": "platform/macos/src/MGLMapView+Impl.h", - "NSCoder+MGLAdditions.h": "platform/darwin/src/NSCoder+MGLAdditions.h", - "MGLOfflineStorage_Private.h": "platform/darwin/src/MGLOfflineStorage_Private.h", - "MGLLineStyleLayer_Private.h": "platform/darwin/src/MGLLineStyleLayer_Private.h", - "MGLHillshadeStyleLayer_Private.h": "platform/darwin/src/MGLHillshadeStyleLayer_Private.h", - "MGLValueEvaluator.h": "platform/darwin/src/MGLValueEvaluator.h", - "MGLOfflinePack_Private.h": "platform/darwin/src/MGLOfflinePack_Private.h", - "MGLFoundation_Private.h": "platform/darwin/src/MGLFoundation_Private.h", - "MGLCompassCell.h": "platform/macos/src/MGLCompassCell.h", - "MGLShapeSource_Private.h": "platform/darwin/src/MGLShapeSource_Private.h", - "MGLStyle_Private.h": "platform/darwin/src/MGLStyle_Private.h", - "MGLSource_Private.h": "platform/darwin/src/MGLSource_Private.h", - "MGLOpenGLLayer.h": "platform/macos/src/MGLOpenGLLayer.h", - "MGLPointCollection_Private.h": "platform/darwin/src/MGLPointCollection_Private.h", - "NSDate+MGLAdditions.h": "platform/darwin/src/NSDate+MGLAdditions.h", - "NSColor+MGLAdditions.h": "platform/macos/src/NSColor+MGLAdditions.h", - "MGLMultiPoint_Private.h": "platform/darwin/src/MGLMultiPoint_Private.h", - "MGLOpenGLStyleLayer_Private.h": "platform/darwin/src/MGLOpenGLStyleLayer_Private.h", - "MGLPolygon_Private.h": "platform/darwin/src/MGLPolygon_Private.h", - "MGLShape_Private.h": "platform/darwin/src/MGLShape_Private.h", - "MGLTilePyramidOfflineRegion_Private.h": "platform/darwin/src/MGLTilePyramidOfflineRegion_Private.h", - "MGLFeature_Private.h": "platform/darwin/src/MGLFeature_Private.h", - "MGLPolyline_Private.h": "platform/darwin/src/MGLPolyline_Private.h", - "MGLFillStyleLayer_Private.h": "platform/darwin/src/MGLFillStyleLayer_Private.h", - "NSDictionary+MGLAdditions.h": "platform/darwin/src/NSDictionary+MGLAdditions.h", - "MGLRendererConfiguration.h": "platform/darwin/src/MGLRendererConfiguration.h" + "MLNOfflineRegion_Private.h": "platform/darwin/src/MLNOfflineRegion_Private.h", + "MLNRasterTileSource_Private.h": "platform/darwin/src/MLNRasterTileSource_Private.h", + "MLNBackgroundStyleLayer_Private.h": "platform/darwin/src/MLNBackgroundStyleLayer_Private.h", + "MLNConversion.h": "platform/darwin/src/MLNConversion.h", + "MLNFillExtrusionStyleLayer_Private.h": "platform/darwin/src/MLNFillExtrusionStyleLayer_Private.h", + "MLNStyleValue_Private.h": "platform/darwin/src/MLNStyleValue_Private.h", + "MLNMapView_Private.h": "platform/macos/src/MLNMapView_Private.h", + "MLNRasterStyleLayer_Private.h": "platform/darwin/src/MLNRasterStyleLayer_Private.h", + "MLNHeatmapStyleLayer_Private.h": "platform/darwin/src/MLNHeatmapStyleLayer_Private.h", + "MLNAttributionButton.h": "platform/macos/src/MLNAttributionButton.h", + "NSArray+MLNAdditions.h": "platform/darwin/src/NSArray+MLNAdditions.h", + "NSComparisonPredicate+MLNAdditions.h": "platform/darwin/src/NSComparisonPredicate+MLNAdditions.h", + "MLNStyleLayerManager.h": "platform/darwin/src/MLNStyleLayerManager.h", + "MLNStyleLayer_Private.h": "platform/darwin/src/MLNStyleLayer_Private.h", + "MLNShapeOfflineRegion_Private.h": "platform/darwin/src/MLNShapeOfflineRegion_Private.h", + "MLNAttributionInfo_Private.h": "platform/darwin/src/MLNAttributionInfo_Private.h", + "NSBundle+MLNAdditions.h": "platform/darwin/src/NSBundle+MLNAdditions.h", + "NSURL+MLNAdditions.h": "platform/darwin/src/NSURL+MLNAdditions.h", + "MLNAnnotationImage_Private.h": "platform/macos/src/MLNAnnotationImage_Private.h", + "MLNLoggingConfiguration_Private.h": "platform/darwin/src/MLNLoggingConfiguration_Private.h", + "NSPredicate+MLNPrivateAdditions.h": "platform/darwin/src/NSPredicate+MLNPrivateAdditions.h", + "NSString+MLNAdditions.h": "platform/darwin/src/NSString+MLNAdditions.h", + "MLNCircleStyleLayer_Private.h": "platform/darwin/src/MLNCircleStyleLayer_Private.h", + "MLNVectorTileSource_Private.h": "platform/darwin/src/MLNVectorTileSource_Private.h", + "MLNGeometry_Private.h": "platform/darwin/src/MLNGeometry_Private.h", + "MLNSettings_Private.h": "platform/darwin/src/MLNSettings_Private.h", + "MLNComputedShapeSource_Private.h": "platform/darwin/src/MLNComputedShapeSource_Private.h", + "NSException+MLNAdditions.h": "platform/darwin/src/NSException+MLNAdditions.h", + "MLNTileSource_Private.h": "platform/darwin/src/MLNTileSource_Private.h", + "NSExpression+MLNPrivateAdditions.h": "platform/darwin/src/NSExpression+MLNPrivateAdditions.h", + "MLNSDKMetricsManager_Private.h": "platform/darwin/src/MLNSDKMetricsManager_Private.h", + "MLNNetworkConfiguration_Private.h": "platform/darwin/src/MLNNetworkConfiguration_Private.h", + "NSCompoundPredicate+MLNAdditions.h": "platform/darwin/src/NSCompoundPredicate+MLNAdditions.h", + "MLNSymbolStyleLayer_Private.h": "platform/darwin/src/MLNSymbolStyleLayer_Private.h", + "MLNMapView+OpenGL.h": "platform/macos/src/MLNMapView+OpenGL.h", + "NSProcessInfo+MLNAdditions.h": "platform/macos/src/NSProcessInfo+MLNAdditions.h", + "MLNRendererFrontend.h": "platform/darwin/src/MLNRendererFrontend.h", + "NSValue+MLNStyleAttributeAdditions.h": "platform/darwin/src/NSValue+MLNStyleAttributeAdditions.h", + "NSImage+MLNAdditions.h": "platform/macos/src/NSImage+MLNAdditions.h", + "MLNLight_Private.h": "platform/darwin/src/MLNLight_Private.h", + "MLNMapView+Impl.h": "platform/macos/src/MLNMapView+Impl.h", + "NSCoder+MLNAdditions.h": "platform/darwin/src/NSCoder+MLNAdditions.h", + "MLNOfflineStorage_Private.h": "platform/darwin/src/MLNOfflineStorage_Private.h", + "MLNLineStyleLayer_Private.h": "platform/darwin/src/MLNLineStyleLayer_Private.h", + "MLNHillshadeStyleLayer_Private.h": "platform/darwin/src/MLNHillshadeStyleLayer_Private.h", + "MLNValueEvaluator.h": "platform/darwin/src/MLNValueEvaluator.h", + "MLNOfflinePack_Private.h": "platform/darwin/src/MLNOfflinePack_Private.h", + "MLNFoundation_Private.h": "platform/darwin/src/MLNFoundation_Private.h", + "MLNCompassCell.h": "platform/macos/src/MLNCompassCell.h", + "MLNShapeSource_Private.h": "platform/darwin/src/MLNShapeSource_Private.h", + "MLNStyle_Private.h": "platform/darwin/src/MLNStyle_Private.h", + "MLNSource_Private.h": "platform/darwin/src/MLNSource_Private.h", + "MLNOpenGLLayer.h": "platform/macos/src/MLNOpenGLLayer.h", + "MLNPointCollection_Private.h": "platform/darwin/src/MLNPointCollection_Private.h", + "NSDate+MLNAdditions.h": "platform/darwin/src/NSDate+MLNAdditions.h", + "NSColor+MLNAdditions.h": "platform/macos/src/NSColor+MLNAdditions.h", + "MLNMultiPoint_Private.h": "platform/darwin/src/MLNMultiPoint_Private.h", + "MLNOpenGLStyleLayer_Private.h": "platform/darwin/src/MLNOpenGLStyleLayer_Private.h", + "MLNPolygon_Private.h": "platform/darwin/src/MLNPolygon_Private.h", + "MLNShape_Private.h": "platform/darwin/src/MLNShape_Private.h", + "MLNTilePyramidOfflineRegion_Private.h": "platform/darwin/src/MLNTilePyramidOfflineRegion_Private.h", + "MLNFeature_Private.h": "platform/darwin/src/MLNFeature_Private.h", + "MLNPolyline_Private.h": "platform/darwin/src/MLNPolyline_Private.h", + "MLNFillStyleLayer_Private.h": "platform/darwin/src/MLNFillStyleLayer_Private.h", + "NSDictionary+MLNAdditions.h": "platform/darwin/src/NSDictionary+MLNAdditions.h", + "MLNRendererConfiguration.h": "platform/darwin/src/MLNRendererConfiguration.h" } } diff --git a/platform/ios/platform/macos/sdk/Base.lproj/MGLAnnotationCallout.xib b/platform/ios/platform/macos/sdk/Base.lproj/MLNAnnotationCallout.xib similarity index 100% rename from platform/ios/platform/macos/sdk/Base.lproj/MGLAnnotationCallout.xib rename to platform/ios/platform/macos/sdk/Base.lproj/MLNAnnotationCallout.xib diff --git a/platform/ios/platform/macos/sdk/Info.plist b/platform/ios/platform/macos/sdk/Info.plist index 72e0deeee..e75c3db96 100644 --- a/platform/ios/platform/macos/sdk/Info.plist +++ b/platform/ios/platform/macos/sdk/Info.plist @@ -20,9 +20,9 @@ ???? CFBundleVersion 15256 - MGLCommitHash + MLNCommitHash $(CURRENT_COMMIT_HASH) - MGLSemanticVersionString + MLNSemanticVersionString $(CURRENT_SEMANTIC_VERSION) diff --git a/platform/ios/platform/macos/src/MGLAnnotationImage.h b/platform/ios/platform/macos/src/MLNAnnotationImage.h similarity index 89% rename from platform/ios/platform/macos/src/MGLAnnotationImage.h rename to platform/ios/platform/macos/src/MLNAnnotationImage.h index a00301fa0..5159eabfe 100644 --- a/platform/ios/platform/macos/src/MGLAnnotationImage.h +++ b/platform/ios/platform/macos/src/MLNAnnotationImage.h @@ -1,17 +1,17 @@ #import -#import "MGLFoundation.h" +#import "MLNFoundation.h" NS_ASSUME_NONNULL_BEGIN /** - The `MGLAnnotationImage` class is responsible for presenting point-based - annotations visually on an `MGLMapView` instance. Annotation image objects pair + The `MLNAnnotationImage` class is responsible for presenting point-based + annotations visually on an `MLNMapView` instance. Annotation image objects pair `NSImage` objects with annotation-related metadata. They may be recycled later and put into a reuse queue that is maintained by the map view. */ -MGL_EXPORT -@interface MGLAnnotationImage : NSObject +MLN_EXPORT +@interface MLNAnnotationImage : NSObject // MARK: Initializing and Preparing the Image Object diff --git a/platform/ios/platform/macos/src/MGLAnnotationImage.m b/platform/ios/platform/macos/src/MLNAnnotationImage.m similarity index 89% rename from platform/ios/platform/macos/src/MGLAnnotationImage.m rename to platform/ios/platform/macos/src/MLNAnnotationImage.m index 8d715b427..54e204e81 100644 --- a/platform/ios/platform/macos/src/MGLAnnotationImage.m +++ b/platform/ios/platform/macos/src/MLNAnnotationImage.m @@ -1,6 +1,6 @@ -#import "MGLAnnotationImage_Private.h" +#import "MLNAnnotationImage_Private.h" -@interface MGLAnnotationImage () +@interface MLNAnnotationImage () @property (nonatomic) NSImage *image; @property (nonatomic) NSString *reuseIdentifier; @@ -8,7 +8,7 @@ @end -@implementation MGLAnnotationImage +@implementation MLNAnnotationImage + (instancetype)annotationImageWithImage:(NSImage *)image reuseIdentifier:(NSString *)reuseIdentifier { return [[self alloc] initWithImage:image reuseIdentifier:reuseIdentifier]; @@ -46,9 +46,9 @@ - (BOOL)isEqual:(id)other { if (self == other) return YES; - if (![other isKindOfClass:[MGLAnnotationImage class]]) return NO; + if (![other isKindOfClass:[MLNAnnotationImage class]]) return NO; - MGLAnnotationImage *otherAnnotationImage = other; + MLNAnnotationImage *otherAnnotationImage = other; return ((!_reuseIdentifier && !otherAnnotationImage.reuseIdentifier) || [_reuseIdentifier isEqualToString:otherAnnotationImage.reuseIdentifier]) && _selectable == otherAnnotationImage.selectable diff --git a/platform/ios/platform/macos/src/MGLAnnotationImage_Private.h b/platform/ios/platform/macos/src/MLNAnnotationImage_Private.h similarity index 83% rename from platform/ios/platform/macos/src/MGLAnnotationImage_Private.h rename to platform/ios/platform/macos/src/MLNAnnotationImage_Private.h index 428f1db5d..849568d33 100644 --- a/platform/ios/platform/macos/src/MGLAnnotationImage_Private.h +++ b/platform/ios/platform/macos/src/MLNAnnotationImage_Private.h @@ -1,6 +1,6 @@ #import "Mapbox.h" -@interface MGLAnnotationImage (Private) +@interface MLNAnnotationImage (Private) /// Unique identifier of the sprite image used by the style to represent the receiver’s `image`. @property (nonatomic, strong, nullable) NSString *styleIconIdentifier; diff --git a/platform/ios/platform/macos/src/MGLAttributionButton.h b/platform/ios/platform/macos/src/MLNAttributionButton.h similarity index 54% rename from platform/ios/platform/macos/src/MGLAttributionButton.h rename to platform/ios/platform/macos/src/MLNAttributionButton.h index 3e0b53a6d..73005ddba 100644 --- a/platform/ios/platform/macos/src/MGLAttributionButton.h +++ b/platform/ios/platform/macos/src/MLNAttributionButton.h @@ -1,18 +1,18 @@ #import -#import "MGLFoundation.h" -#import "MGLTypes.h" +#import "MLNFoundation.h" +#import "MLNTypes.h" NS_ASSUME_NONNULL_BEGIN -@class MGLAttributionInfo; +@class MLNAttributionInfo; /// Button that looks like a hyperlink and opens a URL. -MGL_EXPORT -@interface MGLAttributionButton : NSButton +MLN_EXPORT +@interface MLNAttributionButton : NSButton -/// Returns an `MGLAttributionButton` instance with the given info. -- (instancetype)initWithAttributionInfo:(MGLAttributionInfo *)info; +/// Returns an `MLNAttributionButton` instance with the given info. +- (instancetype)initWithAttributionInfo:(MLNAttributionInfo *)info; /// The URL to open and display as a tooltip. @property (nonatomic, readonly, nullable) NSURL *URL; diff --git a/platform/ios/platform/macos/src/MGLAttributionButton.mm b/platform/ios/platform/macos/src/MLNAttributionButton.mm similarity index 85% rename from platform/ios/platform/macos/src/MGLAttributionButton.mm rename to platform/ios/platform/macos/src/MLNAttributionButton.mm index 3df415f60..54fae4b85 100644 --- a/platform/ios/platform/macos/src/MGLAttributionButton.mm +++ b/platform/ios/platform/macos/src/MLNAttributionButton.mm @@ -1,12 +1,12 @@ -#import "MGLAttributionButton.h" -#import "MGLAttributionInfo.h" +#import "MLNAttributionButton.h" +#import "MLNAttributionInfo.h" -#import "NSBundle+MGLAdditions.h" -#import "NSString+MGLAdditions.h" +#import "NSBundle+MLNAdditions.h" +#import "NSString+MLNAdditions.h" -@implementation MGLAttributionButton +@implementation MLNAttributionButton -- (instancetype)initWithAttributionInfo:(MGLAttributionInfo *)info { +- (instancetype)initWithAttributionInfo:(MLNAttributionInfo *)info { if (self = [super initWithFrame:NSZeroRect]) { self.bordered = NO; self.bezelStyle = NSRegularSquareBezelStyle; diff --git a/platform/ios/platform/macos/src/MGLCompassCell.h b/platform/ios/platform/macos/src/MLNCompassCell.h similarity index 66% rename from platform/ios/platform/macos/src/MGLCompassCell.h rename to platform/ios/platform/macos/src/MLNCompassCell.h index 5ed70dcb0..99b7e3442 100644 --- a/platform/ios/platform/macos/src/MGLCompassCell.h +++ b/platform/ios/platform/macos/src/MLNCompassCell.h @@ -1,5 +1,5 @@ #import /// Circular slider with an arrow pointing north. -@interface MGLCompassCell : NSSliderCell +@interface MLNCompassCell : NSSliderCell @end diff --git a/platform/ios/platform/macos/src/MGLCompassCell.m b/platform/ios/platform/macos/src/MLNCompassCell.m similarity index 95% rename from platform/ios/platform/macos/src/MGLCompassCell.m rename to platform/ios/platform/macos/src/MLNCompassCell.m index 44c2fec44..f8cb24b54 100644 --- a/platform/ios/platform/macos/src/MGLCompassCell.m +++ b/platform/ios/platform/macos/src/MLNCompassCell.m @@ -1,6 +1,6 @@ -#import "MGLCompassCell.h" +#import "MLNCompassCell.h" -@implementation MGLCompassCell +@implementation MLNCompassCell - (instancetype)init { if (self = [super init]) { diff --git a/platform/ios/platform/macos/src/MGLMapView+IBAdditions.h b/platform/ios/platform/macos/src/MLNMapView+IBAdditions.h similarity index 93% rename from platform/ios/platform/macos/src/MGLMapView+IBAdditions.h rename to platform/ios/platform/macos/src/MLNMapView+IBAdditions.h index 749603f4b..c41d81e97 100644 --- a/platform/ios/platform/macos/src/MGLMapView+IBAdditions.h +++ b/platform/ios/platform/macos/src/MLNMapView+IBAdditions.h @@ -1,18 +1,18 @@ #import -#import "MGLMapView.h" +#import "MLNMapView.h" NS_ASSUME_NONNULL_BEGIN -@interface MGLMapView (IBAdditions) +@interface MLNMapView (IBAdditions) #if TARGET_INTERFACE_BUILDER // Core properties that can be manipulated in the Attributes inspector in // Interface Builder. These redeclarations merely add the IBInspectable keyword. // They appear here to ensure that they appear above the convenience properties; -// inspectables declared in MGLMapView.h are always sorted before those in -// MGLMapView+IBAdditions.h, due to ASCII sort order. +// inspectables declared in MLNMapView.h are always sorted before those in +// MLNMapView+IBAdditions.h, due to ASCII sort order. // We want this property to look like a URL bar in the Attributes inspector, but // just calling it styleURL would violate Cocoa naming conventions and conflict diff --git a/platform/ios/platform/macos/src/MGLMapView+IBAdditions.mm b/platform/ios/platform/macos/src/MLNMapView+IBAdditions.mm similarity index 94% rename from platform/ios/platform/macos/src/MGLMapView+IBAdditions.mm rename to platform/ios/platform/macos/src/MLNMapView+IBAdditions.mm index 0c65abc03..bf8bcfab0 100644 --- a/platform/ios/platform/macos/src/MGLMapView+IBAdditions.mm +++ b/platform/ios/platform/macos/src/MLNMapView+IBAdditions.mm @@ -1,10 +1,10 @@ -#import "MGLMapView+IBAdditions.h" +#import "MLNMapView+IBAdditions.h" -#import "MGLStyle.h" +#import "MLNStyle.h" -#import "MGLMapView_Private.h" +#import "MLNMapView_Private.h" -@implementation MGLMapView (IBAdditions) +@implementation MLNMapView (IBAdditions) + (NSSet *)keyPathsForValuesAffectingStyleURL__ { return [NSSet setWithObject:@"styleURL"]; @@ -19,7 +19,7 @@ [NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSURL *url = URLString.length ? [NSURL URLWithString:URLString] : nil; if (URLString.length && !url) { - [NSException raise:MGLInvalidStyleURLException + [NSException raise:MLNInvalidStyleURLException format:@"“%@” is not a valid style URL.", URLString]; } self.styleURL = url; diff --git a/platform/ios/platform/macos/src/MGLMapView+Impl.h b/platform/ios/platform/macos/src/MLNMapView+Impl.h similarity index 84% rename from platform/ios/platform/macos/src/MGLMapView+Impl.h rename to platform/ios/platform/macos/src/MLNMapView+Impl.h index d33a19dba..f385900ae 100644 --- a/platform/ios/platform/macos/src/MGLMapView+Impl.h +++ b/platform/ios/platform/macos/src/MLNMapView+Impl.h @@ -2,16 +2,16 @@ #import #import -@class MGLMapView; +@class MLNMapView; typedef struct _CGLContextObject* CGLContextObj; -class MGLMapViewImpl : public mbgl::MapObserver { +class MLNMapViewImpl : public mbgl::MapObserver { public: - static std::unique_ptr Create(MGLMapView*); + static std::unique_ptr Create(MLNMapView*); - MGLMapViewImpl(MGLMapView*); - virtual ~MGLMapViewImpl() = default; + MLNMapViewImpl(MLNMapView*); + virtual ~MLNMapViewImpl() = default; virtual mbgl::gfx::RendererBackend& getRendererBackend() = 0; @@ -40,5 +40,5 @@ public: protected: /// Cocoa map view that this adapter bridges to. - __weak MGLMapView *mapView = nullptr; + __weak MLNMapView *mapView = nullptr; }; diff --git a/platform/ios/platform/macos/src/MGLMapView+Impl.mm b/platform/ios/platform/macos/src/MLNMapView+Impl.mm similarity index 65% rename from platform/ios/platform/macos/src/MGLMapView+Impl.mm rename to platform/ios/platform/macos/src/MLNMapView+Impl.mm index c00f85815..0ba217d7c 100644 --- a/platform/ios/platform/macos/src/MGLMapView+Impl.mm +++ b/platform/ios/platform/macos/src/MLNMapView+Impl.mm @@ -1,101 +1,101 @@ -#import "MGLMapView+Impl.h" -#import "MGLMapView+OpenGL.h" -#import "MGLStyle_Private.h" -#import "NSBundle+MGLAdditions.h" +#import "MLNMapView+Impl.h" +#import "MLNMapView+OpenGL.h" +#import "MLNStyle_Private.h" +#import "NSBundle+MLNAdditions.h" #include #include -std::unique_ptr MGLMapViewImpl::Create(MGLMapView* nativeView) { - return std::make_unique(nativeView); +std::unique_ptr MLNMapViewImpl::Create(MLNMapView* nativeView) { + return std::make_unique(nativeView); } -MGLMapViewImpl::MGLMapViewImpl(MGLMapView* nativeView_) : mapView(nativeView_) { +MLNMapViewImpl::MLNMapViewImpl(MLNMapView* nativeView_) : mapView(nativeView_) { } -void MGLMapViewImpl::onCameraWillChange(mbgl::MapObserver::CameraChangeMode mode) { +void MLNMapViewImpl::onCameraWillChange(mbgl::MapObserver::CameraChangeMode mode) { bool animated = mode == mbgl::MapObserver::CameraChangeMode::Animated; [mapView cameraWillChangeAnimated:animated]; } -void MGLMapViewImpl::onCameraIsChanging() { +void MLNMapViewImpl::onCameraIsChanging() { [mapView cameraIsChanging]; } -void MGLMapViewImpl::onCameraDidChange(mbgl::MapObserver::CameraChangeMode mode) { +void MLNMapViewImpl::onCameraDidChange(mbgl::MapObserver::CameraChangeMode mode) { bool animated = mode == mbgl::MapObserver::CameraChangeMode::Animated; [mapView cameraDidChangeAnimated:animated]; } -void MGLMapViewImpl::onWillStartLoadingMap() { +void MLNMapViewImpl::onWillStartLoadingMap() { [mapView mapViewWillStartLoadingMap]; } -void MGLMapViewImpl::onDidFinishLoadingMap() { +void MLNMapViewImpl::onDidFinishLoadingMap() { [mapView mapViewDidFinishLoadingMap]; } -void MGLMapViewImpl::onDidFailLoadingMap(mbgl::MapLoadError mapError, const std::string& what) { +void MLNMapViewImpl::onDidFailLoadingMap(mbgl::MapLoadError mapError, const std::string& what) { NSString *description; - MGLErrorCode code; + MLNErrorCode code; switch (mapError) { case mbgl::MapLoadError::StyleParseError: - code = MGLErrorCodeParseStyleFailed; + code = MLNErrorCodeParseStyleFailed; description = NSLocalizedStringWithDefaultValue(@"PARSE_STYLE_FAILED_DESC", nil, nil, @"The map failed to load because the style is corrupted.", @"User-friendly error description"); break; case mbgl::MapLoadError::StyleLoadError: - code = MGLErrorCodeLoadStyleFailed; + code = MLNErrorCodeLoadStyleFailed; description = NSLocalizedStringWithDefaultValue(@"LOAD_STYLE_FAILED_DESC", nil, nil, @"The map failed to load because the style can't be loaded.", @"User-friendly error description"); break; case mbgl::MapLoadError::NotFoundError: - code = MGLErrorCodeNotFound; + code = MLNErrorCodeNotFound; description = NSLocalizedStringWithDefaultValue(@"STYLE_NOT_FOUND_DESC", nil, nil, @"The map failed to load because the style can’t be found or is incompatible.", @"User-friendly error description"); break; default: - code = MGLErrorCodeUnknown; + code = MLNErrorCodeUnknown; description = NSLocalizedStringWithDefaultValue(@"LOAD_MAP_FAILED_DESC", nil, nil, @"The map failed to load because an unknown error occurred.", @"User-friendly error description"); } NSDictionary *userInfo = @{ NSLocalizedDescriptionKey: description, NSLocalizedFailureReasonErrorKey: @(what.c_str()), }; - NSError *error = [NSError errorWithDomain:MGLErrorDomain code:code userInfo:userInfo]; + NSError *error = [NSError errorWithDomain:MLNErrorDomain code:code userInfo:userInfo]; [mapView mapViewDidFailLoadingMapWithError:error]; } -void MGLMapViewImpl::onWillStartRenderingFrame() { +void MLNMapViewImpl::onWillStartRenderingFrame() { [mapView mapViewWillStartRenderingFrame]; } -void MGLMapViewImpl::onDidFinishRenderingFrame(mbgl::MapObserver::RenderFrameStatus status) { +void MLNMapViewImpl::onDidFinishRenderingFrame(mbgl::MapObserver::RenderFrameStatus status) { bool fullyRendered = status.mode == mbgl::MapObserver::RenderMode::Full; [mapView mapViewDidFinishRenderingFrameFullyRendered:fullyRendered]; } -void MGLMapViewImpl::onWillStartRenderingMap() { +void MLNMapViewImpl::onWillStartRenderingMap() { [mapView mapViewWillStartRenderingMap]; } -void MGLMapViewImpl::onDidFinishRenderingMap(mbgl::MapObserver::RenderMode mode) { +void MLNMapViewImpl::onDidFinishRenderingMap(mbgl::MapObserver::RenderMode mode) { bool fullyRendered = mode == mbgl::MapObserver::RenderMode::Full; [mapView mapViewDidFinishRenderingMapFullyRendered:fullyRendered]; } -void MGLMapViewImpl::onDidBecomeIdle() { +void MLNMapViewImpl::onDidBecomeIdle() { [mapView mapViewDidBecomeIdle]; } -void MGLMapViewImpl::onDidFinishLoadingStyle() { +void MLNMapViewImpl::onDidFinishLoadingStyle() { [mapView mapViewDidFinishLoadingStyle]; } -void MGLMapViewImpl::onSourceChanged(mbgl::style::Source& source) { +void MLNMapViewImpl::onSourceChanged(mbgl::style::Source& source) { NSString *identifier = @(source.getID().c_str()); - MGLSource * nativeSource = [mapView.style sourceWithIdentifier:identifier]; + MLNSource * nativeSource = [mapView.style sourceWithIdentifier:identifier]; [mapView sourceDidChange:nativeSource]; } -bool MGLMapViewImpl::onCanRemoveUnusedStyleImage(const std::string &imageIdentifier) { +bool MLNMapViewImpl::onCanRemoveUnusedStyleImage(const std::string &imageIdentifier) { NSString *imageName = [NSString stringWithUTF8String:imageIdentifier.c_str()]; return [mapView shouldRemoveStyleImage:imageName]; } diff --git a/platform/ios/platform/macos/src/MGLMapView+OpenGL.h b/platform/ios/platform/macos/src/MLNMapView+OpenGL.h similarity index 76% rename from platform/ios/platform/macos/src/MGLMapView+OpenGL.h rename to platform/ios/platform/macos/src/MLNMapView+OpenGL.h index d4c6a448c..e81c58d62 100644 --- a/platform/ios/platform/macos/src/MGLMapView+OpenGL.h +++ b/platform/ios/platform/macos/src/MLNMapView+OpenGL.h @@ -1,16 +1,16 @@ -#import "MGLMapView+Impl.h" -#import "MGLMapView_Private.h" +#import "MLNMapView+Impl.h" +#import "MLNMapView_Private.h" #include #include -/// Adapter responsible for bridging calls from mbgl to MGLMapView and Cocoa. -class MGLMapViewOpenGLImpl final : public MGLMapViewImpl, +/// Adapter responsible for bridging calls from mbgl to MLNMapView and Cocoa. +class MLNMapViewOpenGLImpl final : public MLNMapViewImpl, public mbgl::gl::RendererBackend, public mbgl::gfx::Renderable { public: - MGLMapViewOpenGLImpl(MGLMapView*); - ~MGLMapViewOpenGLImpl() override = default; + MLNMapViewOpenGLImpl(MLNMapView*); + ~MLNMapViewOpenGLImpl() override = default; public: void restoreFramebufferBinding(); @@ -34,7 +34,7 @@ private: mbgl::gl::ProcAddress getExtensionFunctionPointer(const char* name) override; // End implementation of mbgl::gl::Rendererbackend - // Implementation of MGLMapViewImpl + // Implementation of MLNMapViewImpl public: mbgl::gfx::RendererBackend& getRendererBackend() override { return *this; diff --git a/platform/ios/platform/macos/src/MGLMapView+OpenGL.mm b/platform/ios/platform/macos/src/MLNMapView+OpenGL.mm similarity index 61% rename from platform/ios/platform/macos/src/MGLMapView+OpenGL.mm rename to platform/ios/platform/macos/src/MLNMapView+OpenGL.mm index f6168a4b8..de747afbc 100644 --- a/platform/ios/platform/macos/src/MGLMapView+OpenGL.mm +++ b/platform/ios/platform/macos/src/MLNMapView+OpenGL.mm @@ -1,13 +1,13 @@ -#import "MGLMapView+OpenGL.h" -#import "MGLOpenGLLayer.h" +#import "MLNMapView+OpenGL.h" +#import "MLNOpenGLLayer.h" #include #import -class MGLMapViewOpenGLRenderableResource final : public mbgl::gl::RenderableResource { +class MLNMapViewOpenGLRenderableResource final : public mbgl::gl::RenderableResource { public: - MGLMapViewOpenGLRenderableResource(MGLMapViewOpenGLImpl& backend_) : backend(backend_) { + MLNMapViewOpenGLRenderableResource(MLNMapViewOpenGLImpl& backend_) : backend(backend_) { } void bind() override { @@ -15,7 +15,7 @@ public: } private: - MGLMapViewOpenGLImpl& backend; + MLNMapViewOpenGLImpl& backend; public: // The current framebuffer of the NSOpenGLLayer we are painting to. @@ -25,19 +25,19 @@ public: NSUInteger activationCount = 0; }; -MGLMapViewOpenGLImpl::MGLMapViewOpenGLImpl(MGLMapView* nativeView_) - : MGLMapViewImpl(nativeView_), +MLNMapViewOpenGLImpl::MLNMapViewOpenGLImpl(MLNMapView* nativeView_) + : MLNMapViewImpl(nativeView_), mbgl::gl::RendererBackend(mbgl::gfx::ContextMode::Unique), mbgl::gfx::Renderable(mapView.framebufferSize, - std::make_unique(*this)) { + std::make_unique(*this)) { // Install the OpenGL layer. Interface Builder’s synchronous drawing means // we can’t display a map, so don’t even bother to have a map layer. mapView.layer = - mapView.isTargetingInterfaceBuilder ? [CALayer layer] : [MGLOpenGLLayer layer]; + mapView.isTargetingInterfaceBuilder ? [CALayer layer] : [MLNOpenGLLayer layer]; } -mbgl::gl::ProcAddress MGLMapViewOpenGLImpl::getExtensionFunctionPointer(const char* name) { +mbgl::gl::ProcAddress MLNMapViewOpenGLImpl::getExtensionFunctionPointer(const char* name) { static CFBundleRef framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl")); if (!framework) { throw std::runtime_error("Failed to load OpenGL framework."); @@ -47,18 +47,18 @@ mbgl::gl::ProcAddress MGLMapViewOpenGLImpl::getExtensionFunctionPointer(const ch framework, (__bridge CFStringRef)[NSString stringWithUTF8String:name])); } -void MGLMapViewOpenGLImpl::activate() { - auto& resource = getResource(); +void MLNMapViewOpenGLImpl::activate() { + auto& resource = getResource(); if (resource.activationCount++) { return; } - MGLOpenGLLayer* layer = (MGLOpenGLLayer*)mapView.layer; + MLNOpenGLLayer* layer = (MLNOpenGLLayer*)mapView.layer; [layer.openGLContext makeCurrentContext]; } -void MGLMapViewOpenGLImpl::deactivate() { - auto& resource = getResource(); +void MLNMapViewOpenGLImpl::deactivate() { + auto& resource = getResource(); if (--resource.activationCount) { return; } @@ -66,24 +66,24 @@ void MGLMapViewOpenGLImpl::deactivate() { [NSOpenGLContext clearCurrentContext]; } -void MGLMapViewOpenGLImpl::updateAssumedState() { - auto& resource = getResource(); +void MLNMapViewOpenGLImpl::updateAssumedState() { + auto& resource = getResource(); glGetIntegerv(GL_FRAMEBUFFER_BINDING, &resource.fbo); assumeFramebufferBinding(resource.fbo); assumeViewport(0, 0, mapView.framebufferSize); } -void MGLMapViewOpenGLImpl::restoreFramebufferBinding() { - auto& resource = getResource(); +void MLNMapViewOpenGLImpl::restoreFramebufferBinding() { + auto& resource = getResource(); setFramebufferBinding(resource.fbo); setViewport(0, 0, mapView.framebufferSize); } -mbgl::PremultipliedImage MGLMapViewOpenGLImpl::readStillImage() { +mbgl::PremultipliedImage MLNMapViewOpenGLImpl::readStillImage() { return readFramebuffer(mapView.framebufferSize); } -CGLContextObj MGLMapViewOpenGLImpl::getCGLContextObj() { - MGLOpenGLLayer* layer = (MGLOpenGLLayer*)mapView.layer; +CGLContextObj MLNMapViewOpenGLImpl::getCGLContextObj() { + MLNOpenGLLayer* layer = (MLNOpenGLLayer*)mapView.layer; return layer.openGLContext.CGLContextObj; } diff --git a/platform/ios/platform/macos/src/MGLMapView.h b/platform/ios/platform/macos/src/MLNMapView.h similarity index 89% rename from platform/ios/platform/macos/src/MGLMapView.h rename to platform/ios/platform/macos/src/MLNMapView.h index 446334cc9..05696fea8 100644 --- a/platform/ios/platform/macos/src/MGLMapView.h +++ b/platform/ios/platform/macos/src/MLNMapView.h @@ -1,27 +1,27 @@ #import #import -#import "MGLFoundation.h" -#import "MGLTypes.h" -#import "MGLGeometry.h" -#import "MGLStyle.h" +#import "MLNFoundation.h" +#import "MLNTypes.h" +#import "MLNGeometry.h" +#import "MLNStyle.h" NS_ASSUME_NONNULL_BEGIN -@class MGLAnnotationImage; -@class MGLMapCamera; -@class MGLShape; +@class MLNAnnotationImage; +@class MLNMapCamera; +@class MLNShape; -@protocol MGLAnnotation; -@protocol MGLMapViewDelegate; -@protocol MGLOverlay; -@protocol MGLFeature; +@protocol MLNAnnotation; +@protocol MLNMapViewDelegate; +@protocol MLNOverlay; +@protocol MLNFeature; /** An interactive, customizable map view with an interface similar to the one provided by Apple’s MapKit. - Using `MGLMapView`, you can embed the map inside a view, allow users to + Using `MLNMapView`, you can embed the map inside a view, allow users to manipulate it with standard gestures, animate the map between different viewpoints, and present information in the form of annotations and overlays. @@ -33,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN Mapbox Studio and hosted on mapbox.com. - A collection of Mapbox-hosted styles is available through the `MGLStyle` class. + A collection of Mapbox-hosted styles is available through the `MLNStyle` class. These basic styles use Mapbox Streets or Mapbox Satellite data @@ -46,11 +46,11 @@ NS_ASSUME_NONNULL_BEGIN your Mapbox account. They also deter other developers from using your styles without your permission. - Adding your own gesture recognizer to `MGLMapView` will block the corresponding - gesture recognizer built into `MGLMapView`. To avoid conflicts, define which + Adding your own gesture recognizer to `MLNMapView` will block the corresponding + gesture recognizer built into `MLNMapView`. To avoid conflicts, define which gesture recognizer takes precedence. For example, you can subclass `NSClickGestureRecognizer` and override `-[NSGestureRecognizer shouldRequireFailureOfGestureRecognizer:]`, - so that your subclass will be invoked only if the default `MGLMapView` click + so that your subclass will be invoked only if the default `MLNMapView` click gesture recognizer fails: ```swift @@ -64,8 +64,8 @@ NS_ASSUME_NONNULL_BEGIN @note You are responsible for getting permission to use the map data and for ensuring that your use adheres to the relevant terms of use. */ -MGL_EXPORT IB_DESIGNABLE -@interface MGLMapView : NSView +MLN_EXPORT IB_DESIGNABLE +@interface MLNMapView : NSView // MARK: Creating Instances @@ -100,7 +100,7 @@ MGL_EXPORT IB_DESIGNABLE annotations displayed on the map, such as the styles to apply to individual annotations. */ -@property (nonatomic, weak, nullable) IBOutlet id delegate; +@property (nonatomic, weak, nullable) IBOutlet id delegate; // MARK: Configuring the Map’s Appearance @@ -113,18 +113,18 @@ MGL_EXPORT IB_DESIGNABLE If the style is loading, this property is set to `nil` until the style finishes loading. If the style has failed to load, this property is set to `nil`. Because the style loads asynchronously, you should manipulate it in the - `-[MGLMapViewDelegate mapView:didFinishLoadingStyle:]` or - `-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]` method. It is not possible + `-[MLNMapViewDelegate mapView:didFinishLoadingStyle:]` or + `-[MLNMapViewDelegate mapViewDidFinishLoadingMap:]` method. It is not possible to manipulate the style before it has finished loading. @note The default styles provided by Mapbox contain sources and layers with identifiers that will change over time. Applications that use APIs that manipulate a style's sources and layers must first set the style URL to an explicitly versioned style using a convenience method like - `+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL” + `+[MLNStyle outdoorsStyleURLWithVersion:]`, `MLNMapView`’s “Style URL” inspectable in Interface Builder, or a manually constructed `NSURL`. */ -@property (nonatomic, readonly, nullable) MGLStyle *style; +@property (nonatomic, readonly, nullable) MLNStyle *style; /** URL of the style currently displayed in the receiver. @@ -329,7 +329,7 @@ MGL_EXPORT IB_DESIGNABLE /** A camera representing the current viewpoint of the map. */ -@property (nonatomic, copy) MGLMapCamera *camera; +@property (nonatomic, copy) MLNMapCamera *camera; /** Moves the viewpoint to a different location with respect to the map with an @@ -340,7 +340,7 @@ MGL_EXPORT IB_DESIGNABLE the new viewpoint or `NO` if you want the map to display the new viewpoint immediately. */ -- (void)setCamera:(MGLMapCamera *)camera animated:(BOOL)animated; +- (void)setCamera:(MLNMapCamera *)camera animated:(BOOL)animated; /** Moves the viewpoint to a different location with respect to the map with an @@ -355,7 +355,7 @@ MGL_EXPORT IB_DESIGNABLE is `0`, this parameter is ignored. @param completion The block to execute after the animation finishes. */ -- (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion; +- (void)setCamera:(MLNMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion; /** Moves the viewpoint to a different location with respect to the map with an @@ -373,7 +373,7 @@ MGL_EXPORT IB_DESIGNABLE around the returned camera object if it were set as the receiver’s camera. @param completion The block to execute after the animation finishes. */ -- (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function edgePadding:(NSEdgeInsets)edgePadding completionHandler:(nullable void (^)(void))completion; +- (void)setCamera:(MLNMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function edgePadding:(NSEdgeInsets)edgePadding completionHandler:(nullable void (^)(void))completion; /** @@ -387,7 +387,7 @@ MGL_EXPORT IB_DESIGNABLE @param camera The new viewpoint. @param completion The block to execute after the animation finishes. */ -- (void)flyToCamera:(MGLMapCamera *)camera completionHandler:(nullable void (^)(void))completion; +- (void)flyToCamera:(MLNMapCamera *)camera completionHandler:(nullable void (^)(void))completion; /** Moves the viewpoint to a different location using a transition animation that @@ -403,7 +403,7 @@ MGL_EXPORT IB_DESIGNABLE is based on the length of the flight path. @param completion The block to execute after the animation finishes. */ -- (void)flyToCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration completionHandler:(nullable void (^)(void))completion; +- (void)flyToCamera:(MLNMapCamera *)camera withDuration:(NSTimeInterval)duration completionHandler:(nullable void (^)(void))completion; /** Moves the viewpoint to a different location using a transition animation that @@ -423,7 +423,7 @@ MGL_EXPORT IB_DESIGNABLE `-setCamera:animated:` would have a midpoint at a higher altitude. @param completion The block to execute after the animation finishes. */ -- (void)flyToCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration peakAltitude:(CLLocationDistance)peakAltitude completionHandler:(nullable void (^)(void))completion; +- (void)flyToCamera:(MLNMapCamera *)camera withDuration:(NSTimeInterval)duration peakAltitude:(CLLocationDistance)peakAltitude completionHandler:(nullable void (^)(void))completion; /** The geographic coordinate bounds visible in the receiver’s viewport. @@ -437,7 +437,7 @@ MGL_EXPORT IB_DESIGNABLE example, if both Tokyo and San Francisco are visible, the visible bounds might extend from (35.68476, −220.24257) to (37.78428, −122.41310). */ -@property (nonatomic) MGLCoordinateBounds visibleCoordinateBounds; +@property (nonatomic) MLNCoordinateBounds visibleCoordinateBounds; /** Changes the receiver’s viewport to fit the given coordinate bounds, optionally @@ -452,7 +452,7 @@ MGL_EXPORT IB_DESIGNABLE @param animated Specify `YES` to animate the change by smoothly scrolling and zooming or `NO` to immediately display the given bounds. */ -- (void)setVisibleCoordinateBounds:(MGLCoordinateBounds)bounds animated:(BOOL)animated; +- (void)setVisibleCoordinateBounds:(MLNCoordinateBounds)bounds animated:(BOOL)animated; /** Changes the receiver’s viewport to fit the given coordinate bounds with some @@ -472,7 +472,7 @@ MGL_EXPORT IB_DESIGNABLE @param animated Specify `YES` to animate the change by smoothly scrolling and zooming or `NO` to immediately display the given bounds. */ -- (void)setVisibleCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated; +- (void)setVisibleCoordinateBounds:(MLNCoordinateBounds)bounds edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated; /** Changes the receiver’s viewport to fit the given coordinate bounds with some @@ -490,7 +490,7 @@ MGL_EXPORT IB_DESIGNABLE zooming or `NO` to immediately display the given bounds. @param completion The block executed after the animation finishes. */ -- (void)setVisibleCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion; +- (void)setVisibleCoordinateBounds:(MLNCoordinateBounds)bounds edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion; /** Sets the visible region so that the map displays the specified annotations. @@ -504,7 +504,7 @@ MGL_EXPORT IB_DESIGNABLE @param animated `YES` if you want the map region change to be animated, or `NO` if you want the map to display the new region immediately without animations. */ -- (void)showAnnotations:(NSArray> *)annotations animated:(BOOL)animated; +- (void)showAnnotations:(NSArray> *)annotations animated:(BOOL)animated; /** Sets the visible region so that the map displays the specified annotations with @@ -522,7 +522,7 @@ MGL_EXPORT IB_DESIGNABLE @param animated `YES` if you want the map region change to be animated, or `NO` if you want the map to display the new region immediately without animations. */ -- (void)showAnnotations:(NSArray> *)annotations edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated; +- (void)showAnnotations:(NSArray> *)annotations edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated; /** Sets the visible region so that the map displays the specified annotations with @@ -539,7 +539,7 @@ MGL_EXPORT IB_DESIGNABLE if you want the map to display the new region immediately without animations. @param completion The block executed after the animation finishes. */ -- (void)showAnnotations:(NSArray> *)annotations edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion; +- (void)showAnnotations:(NSArray> *)annotations edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion; /** Returns the camera that best fits the given coordinate bounds. @@ -550,7 +550,7 @@ MGL_EXPORT IB_DESIGNABLE including the entire coordinate bounds. The camera object uses the current direction and pitch. */ -- (MGLMapCamera *)cameraThatFitsCoordinateBounds:(MGLCoordinateBounds)bounds; +- (MLNMapCamera *)cameraThatFitsCoordinateBounds:(MLNCoordinateBounds)bounds; /** Returns the camera that best fits the given coordinate bounds with some @@ -564,7 +564,7 @@ MGL_EXPORT IB_DESIGNABLE including the entire coordinate bounds. The camera object uses the current direction and pitch. */ -- (MGLMapCamera *)cameraThatFitsCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(NSEdgeInsets)insets; +- (MLNMapCamera *)cameraThatFitsCoordinateBounds:(MLNCoordinateBounds)bounds edgePadding:(NSEdgeInsets)insets; /** Returns the camera that best fits the given coordinate bounds with some @@ -581,7 +581,7 @@ MGL_EXPORT IB_DESIGNABLE including the entire coordinate bounds. The initial camera's pitch and direction will be honored. */ -- (MGLMapCamera *)camera:(MGLMapCamera *)camera fittingCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(NSEdgeInsets)insets; +- (MLNMapCamera *)camera:(MLNMapCamera *)camera fittingCoordinateBounds:(MLNCoordinateBounds)bounds edgePadding:(NSEdgeInsets)insets; /** Returns the camera that best fits the given shape with some additional padding @@ -596,7 +596,7 @@ MGL_EXPORT IB_DESIGNABLE (close to the ground) as possible while still including the entire shape. The initial camera's pitch and direction will be honored. */ -- (MGLMapCamera *)camera:(MGLMapCamera *)camera fittingShape:(MGLShape *)shape edgePadding:(NSEdgeInsets)insets; +- (MLNMapCamera *)camera:(MLNMapCamera *)camera fittingShape:(MLNShape *)shape edgePadding:(NSEdgeInsets)insets; /** Returns the camera that best fits the given shape with some additional padding @@ -611,7 +611,7 @@ MGL_EXPORT IB_DESIGNABLE (close to the ground) as possible while still including the entire shape. The camera object uses the current pitch. */ -- (MGLMapCamera *)cameraThatFitsShape:(MGLShape *)shape direction:(CLLocationDirection)direction edgePadding:(NSEdgeInsets)insets; +- (MLNMapCamera *)cameraThatFitsShape:(MLNShape *)shape direction:(CLLocationDirection)direction edgePadding:(NSEdgeInsets)insets; /** A Boolean value indicating whether the receiver automatically adjusts its @@ -756,51 +756,51 @@ MGL_EXPORT IB_DESIGNABLE /** The complete list of annotations associated with the receiver. (read-only) - The objects in this array must adopt the `MGLAnnotation` protocol. If no + The objects in this array must adopt the `MLNAnnotation` protocol. If no annotations are associated with the map view, the value of this property is `nil`. */ -@property (nonatomic, readonly, nullable) NSArray> *annotations; +@property (nonatomic, readonly, nullable) NSArray> *annotations; /** Adds an annotation to the map view. - @note `MGLMultiPolyline`, `MGLMultiPolygon`, and `MGLShapeCollection` objects - cannot be added to the map view at this time. Nor can `MGLMultiPoint` - objects that are not instances of `MGLPolyline` or `MGLPolygon`. Any + @note `MLNMultiPolyline`, `MLNMultiPolygon`, and `MLNShapeCollection` objects + cannot be added to the map view at this time. Nor can `MLNMultiPoint` + objects that are not instances of `MLNPolyline` or `MLNPolygon`. Any multipoint, multipolyline, multipolygon, or shape collection object that is specified is silently ignored. @param annotation The annotation object to add to the receiver. This object - must conform to the `MGLAnnotation` protocol. The map view retains the + must conform to the `MLNAnnotation` protocol. The map view retains the annotation object. */ -- (void)addAnnotation:(id )annotation; +- (void)addAnnotation:(id )annotation; /** Adds an array of annotations to the map view. - @note `MGLMultiPolyline`, `MGLMultiPolygon`, and `MGLShapeCollection` objects - cannot be added to the map view at this time. Nor can `MGLMultiPoint` - objects that are not instances of `MGLPolyline` or `MGLPolygon`. Any + @note `MLNMultiPolyline`, `MLNMultiPolygon`, and `MLNShapeCollection` objects + cannot be added to the map view at this time. Nor can `MLNMultiPoint` + objects that are not instances of `MLNPolyline` or `MLNPolygon`. Any multipoint, multipolyline, multipolygon, or shape collection objects that are specified are silently ignored. @param annotations An array of annotation objects. Each object in the array - must conform to the `MGLAnnotation` protocol. The map view retains each + must conform to the `MLNAnnotation` protocol. The map view retains each individual annotation object. */ -- (void)addAnnotations:(NSArray> *)annotations; +- (void)addAnnotations:(NSArray> *)annotations; /** The complete list of annotations associated with the receiver that are currently visible. - The objects in this array must adopt the `MGLAnnotation` protocol. If no + The objects in this array must adopt the `MLNAnnotation` protocol. If no annotations are associated with the map view or if no annotations associated with the map view are currently visible, the value of this property is `nil`. */ -@property (nonatomic, readonly, nullable) NSArray> *visibleAnnotations; +@property (nonatomic, readonly, nullable) NSArray> *visibleAnnotations; /** Removes an annotation from the map view, deselecting it if it is selected. @@ -810,9 +810,9 @@ MGL_EXPORT IB_DESIGNABLE this method only when you want to hide or delete a given annotation. @param annotation The annotation object to remove. This object must conform to - the `MGLAnnotation` protocol. + the `MLNAnnotation` protocol. */ -- (void)removeAnnotation:(id )annotation; +- (void)removeAnnotation:(id )annotation; /** Removes an array of annotations from the map view, deselecting any selected @@ -823,14 +823,14 @@ MGL_EXPORT IB_DESIGNABLE this method only when you want to hide or delete the given annotations. @param annotations The array of annotation objects to remove. Objects in the - array must conform to the `MGLAnnotation` protocol. + array must conform to the `MLNAnnotation` protocol. */ -- (void)removeAnnotations:(NSArray> *)annotations; +- (void)removeAnnotations:(NSArray> *)annotations; /** Returns a reusable annotation image object associated with its identifier. - For performance reasons, you should generally reuse `MGLAnnotationImage` + For performance reasons, you should generally reuse `MLNAnnotationImage` objects for identical-looking annotations in your map views. Dequeueing saves time and memory during performance-critical operations such as scrolling. @@ -840,18 +840,18 @@ MGL_EXPORT IB_DESIGNABLE @return An annotation image object with the given identifier, or `nil` if no such object exists in the reuse queue. */ -- (nullable MGLAnnotationImage *)dequeueReusableAnnotationImageWithIdentifier:(NSString *)identifier; +- (nullable MLNAnnotationImage *)dequeueReusableAnnotationImageWithIdentifier:(NSString *)identifier; /** Returns the list of annotations associated with the receiver that intersect with the given rectangle. @param rect A rectangle expressed in the map view’s coordinate system. - @return An array of objects that adopt the `MGLAnnotation` protocol or `nil` if + @return An array of objects that adopt the `MLNAnnotation` protocol or `nil` if no annotations associated with the map view are currently visible in the rectangle. */ -- (nullable NSArray> *)visibleAnnotationsInRect:(CGRect)rect; +- (nullable NSArray> *)visibleAnnotationsInRect:(CGRect)rect; // MARK: Managing Annotation Selections @@ -861,32 +861,32 @@ MGL_EXPORT IB_DESIGNABLE Assigning a new array to this property selects only the first annotation in the array. - If the annotation is of type `MGLPointAnnotation` and is offscreen, the map is + If the annotation is of type `MLNPointAnnotation` and is offscreen, the map is panned so that the annotation and its callout are brought just onscreen. The annotation is *not* centered within the viewport. @note In versions prior to `4.0.0` if the annotation was offscreen it was not selected. */ -@property (nonatomic, copy) NSArray> *selectedAnnotations; +@property (nonatomic, copy) NSArray> *selectedAnnotations; /** Selects an annotation and displays a callout popover for it. - If the annotation is of type `MGLPointAnnotation` and is offscreen, the map is + If the annotation is of type `MLNPointAnnotation` and is offscreen, the map is panned so that the annotation and its callout are brought just onscreen. The annotation is *not* centered within the viewport. @param annotation The annotation object to select. */ -- (void)selectAnnotation:(id )annotation; +- (void)selectAnnotation:(id )annotation; /** Deselects an annotation and hides its callout popover. @param annotation The annotation object to deselect. */ -- (void)deselectAnnotation:(nullable id )annotation; +- (void)deselectAnnotation:(nullable id )annotation; /** A common view controller for managing a callout popover’s content view. @@ -916,18 +916,18 @@ MGL_EXPORT IB_DESIGNABLE multiple point annotations coincide with the point, the return value is the annotation that would be selected if the user clicks at this point. */ -- (id )annotationAtPoint:(NSPoint)point; +- (id )annotationAtPoint:(NSPoint)point; // MARK: Overlaying the Map /** The complete list of overlays associated with the receiver. (read-only) - The objects in this array must adopt the `MGLOverlay` protocol. If no + The objects in this array must adopt the `MLNOverlay` protocol. If no overlays are associated with the map view, the value of this property is empty array. */ -@property (nonatomic, readonly, nonnull) NSArray> *overlays; +@property (nonatomic, readonly, nonnull) NSArray> *overlays; /** Adds a single overlay to the map. @@ -935,9 +935,9 @@ MGL_EXPORT IB_DESIGNABLE To remove an overlay from a map, use the `-removeOverlay:` method. @param overlay The overlay object to add. This object must conform to the - `MGLOverlay` protocol. + `MLNOverlay` protocol. */ -- (void)addOverlay:(id )overlay; +- (void)addOverlay:(id )overlay; /** Adds an array of overlays to the map. @@ -945,9 +945,9 @@ MGL_EXPORT IB_DESIGNABLE To remove multiple overlays from a map, use the `-removeOverlays:` method. @param overlays An array of objects, each of which must conform to the - `MGLOverlay` protocol. + `MLNOverlay` protocol. */ -- (void)addOverlays:(NSArray> *)overlays; +- (void)addOverlays:(NSArray> *)overlays; /** Removes a single overlay from the map. @@ -957,17 +957,17 @@ MGL_EXPORT IB_DESIGNABLE @param overlay The overlay object to remove. */ -- (void)removeOverlay:(id )overlay; +- (void)removeOverlay:(id )overlay; /** Removes an array of overlays from the map. If a given overlay object is not associated with the map view, it is ignored. - @param overlays An array of objects, each of which conforms to the `MGLOverlay` + @param overlays An array of objects, each of which conforms to the `MLNOverlay` protocol. */ -- (void)removeOverlays:(NSArray> *)overlays; +- (void)removeOverlays:(NSArray> *)overlays; // MARK: Accessing the Underlying Map Data @@ -980,10 +980,10 @@ MGL_EXPORT IB_DESIGNABLE information about searching for map features, see that method’s documentation. @param point A point expressed in the map view’s coordinate system. - @return An array of objects conforming to the `MGLFeature` protocol that + @return An array of objects conforming to the `MLNFeature` protocol that represent features in the sources used by the current style. */ -- (NSArray> *)visibleFeaturesAtPoint:(NSPoint)point NS_SWIFT_NAME(visibleFeatures(at:)); +- (NSArray> *)visibleFeaturesAtPoint:(NSPoint)point NS_SWIFT_NAME(visibleFeatures(at:)); /** Returns an array of rendered map features that intersect with a given point, @@ -999,10 +999,10 @@ MGL_EXPORT IB_DESIGNABLE @param styleLayerIdentifiers A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array. - @return An array of objects conforming to the `MGLFeature` protocol that + @return An array of objects conforming to the `MLNFeature` protocol that represent features in the sources used by the current style. */ -- (NSArray> *)visibleFeaturesAtPoint:(NSPoint)point inStyleLayersWithIdentifiers:(nullable NSSet *)styleLayerIdentifiers NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:)); +- (NSArray> *)visibleFeaturesAtPoint:(NSPoint)point inStyleLayersWithIdentifiers:(nullable NSSet *)styleLayerIdentifiers NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:)); /** Returns an array of rendered map features that intersect with a given point, @@ -1011,8 +1011,8 @@ MGL_EXPORT IB_DESIGNABLE Each object in the returned array represents a feature rendered by the current style and provides access to attributes specified by the relevant map content sources. The returned array includes features loaded by - `MGLShapeSource` and `MGLVectorTileSource` objects but does not include - anything from `MGLRasterTileSource` objects, or from video or canvas sources, + `MLNShapeSource` and `MLNVectorTileSource` objects but does not include + anything from `MLNRasterTileSource` objects, or from video or canvas sources, which are unsupported by this SDK. The returned features are drawn by a style layer in the current style. For @@ -1022,7 +1022,7 @@ MGL_EXPORT IB_DESIGNABLE property set to `bus`. If you pass a point corresponding to the location of a bus stop into this method, the bus stop feature does not appear in the resulting array. On the other hand, if the style does include bus stops, an - `MGLFeature` object representing that bus stop is returned and its + `MLNFeature` object representing that bus stop is returned and its `attributes` dictionary has the `maki` key set to `bus` (along with other attributes). The dictionary contains only the attributes provided by the tile source; it does not include computed attribute values or rules about how @@ -1045,13 +1045,13 @@ MGL_EXPORT IB_DESIGNABLE Only visible features are returned. To obtain features regardless of visibility, use the - `-[MGLVectorTileSource featuresInSourceLayersWithIdentifiers:predicate:]` and - `-[MGLShapeSource featuresMatchingPredicate:]` methods on the relevant sources. + `-[MLNVectorTileSource featuresInSourceLayersWithIdentifiers:predicate:]` and + `-[MLNShapeSource featuresMatchingPredicate:]` methods on the relevant sources. @note Layer identifiers are not guaranteed to exist across styles or different versions of the same style. Applications that use this API must first set the style URL to an explicitly versioned style using a convenience method - like `+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL” + like `+[MLNStyle outdoorsStyleURLWithVersion:]`, `MLNMapView`’s “Style URL” inspectable in Interface Builder, or a manually constructed `NSURL`. This approach also avoids layer identifer name changes that will occur in the default style’s layers over time. @@ -1061,10 +1061,10 @@ MGL_EXPORT IB_DESIGNABLE layers defined in the current style. Only the features contained in these layers are included in the returned array. @param predicate A predicate to filter the returned features. - @return An array of objects conforming to the `MGLFeature` protocol that + @return An array of objects conforming to the `MLNFeature` protocol that represent features in the sources used by the current style. */ -- (NSArray> *)visibleFeaturesAtPoint:(NSPoint)point inStyleLayersWithIdentifiers:(nullable NSSet *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:predicate:)); +- (NSArray> *)visibleFeaturesAtPoint:(NSPoint)point inStyleLayersWithIdentifiers:(nullable NSSet *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:predicate:)); /** Returns an array of rendered map features that intersect with the given @@ -1076,10 +1076,10 @@ MGL_EXPORT IB_DESIGNABLE information about searching for map features, see that method’s documentation. @param rect A rectangle expressed in the map view’s coordinate system. - @return An array of objects conforming to the `MGLFeature` protocol that + @return An array of objects conforming to the `MLNFeature` protocol that represent features in the sources used by the current style. */ -- (NSArray> *)visibleFeaturesInRect:(NSRect)rect NS_SWIFT_NAME(visibleFeatures(in:)); +- (NSArray> *)visibleFeaturesInRect:(NSRect)rect NS_SWIFT_NAME(visibleFeatures(in:)); /** Returns an array of rendered map features that intersect with the given @@ -1095,10 +1095,10 @@ MGL_EXPORT IB_DESIGNABLE @param styleLayerIdentifiers A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array. - @return An array of objects conforming to the `MGLFeature` protocol that + @return An array of objects conforming to the `MLNFeature` protocol that represent features in the sources used by the current style. */ -- (NSArray> *)visibleFeaturesInRect:(NSRect)rect inStyleLayersWithIdentifiers:(nullable NSSet *)styleLayerIdentifiers NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:)); +- (NSArray> *)visibleFeaturesInRect:(NSRect)rect inStyleLayersWithIdentifiers:(nullable NSSet *)styleLayerIdentifiers NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:)); /** Returns an array of rendered map features that intersect with the given @@ -1108,8 +1108,8 @@ MGL_EXPORT IB_DESIGNABLE Each object in the returned array represents a feature rendered by the current style and provides access to attributes specified by the relevant map content sources. The returned array includes features loaded by - `MGLShapeSource` and `MGLVectorTileSource` objects but does not include - anything from `MGLRasterTileSource` objects, or from video or canvas sources, + `MLNShapeSource` and `MLNVectorTileSource` objects but does not include + anything from `MLNRasterTileSource` objects, or from video or canvas sources, which are unsupported by this SDK. The returned features are drawn by a style layer in the current style. For @@ -1118,7 +1118,7 @@ MGL_EXPORT IB_DESIGNABLE but none of the specified style layers includes features that have the `maki` property set to `bus`. If you pass a rectangle containing the location of a bus stop into this method, the bus stop feature does not appear in the resulting - array. On the other hand, if the style does include bus stops, an `MGLFeature` + array. On the other hand, if the style does include bus stops, an `MLNFeature` object representing that bus stop is returned and its `attributes` dictionary has the `maki` key set to `bus` (along with other attributes). The dictionary contains only the attributes provided by the tile source; it does not include @@ -1143,13 +1143,13 @@ MGL_EXPORT IB_DESIGNABLE Only visible features are returned. To obtain features regardless of visibility, use the - `-[MGLVectorTileSource featuresInSourceLayersWithIdentifiers:predicate:]` and - `-[MGLShapeSource featuresMatchingPredicate:]` methods on the relevant sources. + `-[MLNVectorTileSource featuresInSourceLayersWithIdentifiers:predicate:]` and + `-[MLNShapeSource featuresMatchingPredicate:]` methods on the relevant sources. @note Layer identifiers are not guaranteed to exist across styles or different versions of the same style. Applications that use this API must first set the style URL to an explicitly versioned style using a convenience method - like `+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL” + like `+[MLNStyle outdoorsStyleURLWithVersion:]`, `MLNMapView`’s “Style URL” inspectable in Interface Builder, or a manually constructed `NSURL`. This approach also avoids layer identifer name changes that will occur in the default style’s layers over time. @@ -1159,10 +1159,10 @@ MGL_EXPORT IB_DESIGNABLE layers defined in the current style. Only the features contained in these layers are included in the returned array. @param predicate A predicate to filter the returned features. - @return An array of objects conforming to the `MGLFeature` protocol that + @return An array of objects conforming to the `MLNFeature` protocol that represent features in the sources used by the current style. */ -- (NSArray> *)visibleFeaturesInRect:(NSRect)rect inStyleLayersWithIdentifiers:(nullable NSSet *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:predicate:)); +- (NSArray> *)visibleFeaturesInRect:(NSRect)rect inStyleLayersWithIdentifiers:(nullable NSSet *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:predicate:)); // MARK: Converting Geographic Coordinates @@ -1205,7 +1205,7 @@ MGL_EXPORT IB_DESIGNABLE expressed in the window’s coordinate system. If `view` is not `nil`, it must belong to the same window as the map view. */ -- (NSRect)convertCoordinateBounds:(MGLCoordinateBounds)bounds toRectToView:(nullable NSView *)view; +- (NSRect)convertCoordinateBounds:(MLNCoordinateBounds)bounds toRectToView:(nullable NSView *)view; /** Converts a rectangle in the given view’s coordinate system to a geographic @@ -1218,7 +1218,7 @@ MGL_EXPORT IB_DESIGNABLE @param view The view in whose coordinate system the rectangle is expressed. @return The geographic bounding box coextensive with the given rectangle. */ -- (MGLCoordinateBounds)convertRect:(NSRect)rect toCoordinateBoundsFromView:(nullable NSView *)view; +- (MLNCoordinateBounds)convertRect:(NSRect)rect toCoordinateBoundsFromView:(nullable NSView *)view; /** Returns the distance spanned by one point in the map view’s coordinate system @@ -1242,7 +1242,7 @@ MGL_EXPORT IB_DESIGNABLE These options are all disabled by default and should remain disabled in released software for performance and aesthetic reasons. */ -@property (nonatomic) MGLMapDebugMaskOptions debugMask; +@property (nonatomic) MLNMapDebugMaskOptions debugMask; @end diff --git a/platform/ios/platform/macos/src/MGLMapView.mm b/platform/ios/platform/macos/src/MLNMapView.mm similarity index 81% rename from platform/ios/platform/macos/src/MGLMapView.mm rename to platform/ios/platform/macos/src/MLNMapView.mm index 776638b76..21ddd1ba8 100644 --- a/platform/ios/platform/macos/src/MGLMapView.mm +++ b/platform/ios/platform/macos/src/MLNMapView.mm @@ -1,28 +1,28 @@ -#import "MGLMapView_Private.h" +#import "MLNMapView_Private.h" -#import "MGLAttributionButton.h" -#import "MGLCompassCell.h" -#import "MGLStyle.h" -#import "MGLRendererFrontend.h" -#import "MGLRendererConfiguration.h" +#import "MLNAttributionButton.h" +#import "MLNCompassCell.h" +#import "MLNStyle.h" +#import "MLNRendererFrontend.h" +#import "MLNRendererConfiguration.h" -#import "MGLAnnotationImage_Private.h" -#import "MGLAttributionInfo_Private.h" -#import "MGLFeature_Private.h" -#import "MGLFoundation_Private.h" -#import "MGLGeometry_Private.h" -#import "MGLMultiPoint_Private.h" -#import "MGLOfflineStorage_Private.h" -#import "MGLStyle_Private.h" -#import "MGLShape_Private.h" +#import "MLNAnnotationImage_Private.h" +#import "MLNAttributionInfo_Private.h" +#import "MLNFeature_Private.h" +#import "MLNFoundation_Private.h" +#import "MLNGeometry_Private.h" +#import "MLNMultiPoint_Private.h" +#import "MLNOfflineStorage_Private.h" +#import "MLNStyle_Private.h" +#import "MLNShape_Private.h" -#import "MGLSettings.h" -#import "MGLMapCamera.h" -#import "MGLPolygon.h" -#import "MGLPolyline.h" -#import "MGLAnnotationImage.h" -#import "MGLMapViewDelegate.h" -#import "MGLImageSource.h" +#import "MLNSettings.h" +#import "MLNMapCamera.h" +#import "MLNPolygon.h" +#import "MLNPolyline.h" +#import "MLNAnnotationImage.h" +#import "MLNMapViewDelegate.h" +#import "MLNImageSource.h" #import #import @@ -46,81 +46,81 @@ #import #import -#import "MGLMapView+Impl.h" -#import "NSBundle+MGLAdditions.h" -#import "NSDate+MGLAdditions.h" -#import "NSProcessInfo+MGLAdditions.h" -#import "NSException+MGLAdditions.h" -#import "NSString+MGLAdditions.h" -#import "NSURL+MGLAdditions.h" -#import "NSColor+MGLAdditions.h" -#import "NSImage+MGLAdditions.h" -#import "NSPredicate+MGLPrivateAdditions.h" -#import "MGLNetworkConfiguration_Private.h" -#import "MGLLoggingConfiguration_Private.h" -#import "MGLReachability.h" -#import "MGLSettings_Private.h" +#import "MLNMapView+Impl.h" +#import "NSBundle+MLNAdditions.h" +#import "NSDate+MLNAdditions.h" +#import "NSProcessInfo+MLNAdditions.h" +#import "NSException+MLNAdditions.h" +#import "NSString+MLNAdditions.h" +#import "NSURL+MLNAdditions.h" +#import "NSColor+MLNAdditions.h" +#import "NSImage+MLNAdditions.h" +#import "NSPredicate+MLNPrivateAdditions.h" +#import "MLNNetworkConfiguration_Private.h" +#import "MLNLoggingConfiguration_Private.h" +#import "MLNReachability.h" +#import "MLNSettings_Private.h" #import -class MGLAnnotationContext; +class MLNAnnotationContext; /// Distance from the edge of the view to ornament views (logo, attribution, etc.). -const CGFloat MGLOrnamentPadding = 12; +const CGFloat MLNOrnamentPadding = 12; /// Alpha value of the ornament views (logo, attribution, etc.). -const CGFloat MGLOrnamentOpacity = 0.9; +const CGFloat MLNOrnamentOpacity = 0.9; /// Default duration for programmatic animations. -const NSTimeInterval MGLAnimationDuration = 0.3; +const NSTimeInterval MLNAnimationDuration = 0.3; /// Distance in points that a single press of the panning keyboard shortcut pans the map by. -const CGFloat MGLKeyPanningIncrement = 150; +const CGFloat MLNKeyPanningIncrement = 150; /// Degrees that a single press of the rotation keyboard shortcut rotates the map by. -const CLLocationDegrees MGLKeyRotationIncrement = 25; +const CLLocationDegrees MLNKeyRotationIncrement = 25; /// Key for the user default that, when true, causes the map view to zoom in and out on scroll wheel events. -NSString * const MGLScrollWheelZoomsMapViewDefaultKey = @"MGLScrollWheelZoomsMapView"; +NSString * const MLNScrollWheelZoomsMapViewDefaultKey = @"MLNScrollWheelZoomsMapView"; /// Reuse identifier and file name of the default point annotation image. -static NSString * const MGLDefaultStyleMarkerSymbolName = @"default_marker"; +static NSString * const MLNDefaultStyleMarkerSymbolName = @"default_marker"; -/// Prefix that denotes a sprite installed by MGLMapView, to avoid collisions +/// Prefix that denotes a sprite installed by MLNMapView, to avoid collisions /// with style-defined sprites. -static NSString * const MGLAnnotationSpritePrefix = @"com.mapbox.sprites."; +static NSString * const MLNAnnotationSpritePrefix = @"com.mapbox.sprites."; /// Slop area around the hit testing point, allowing for imprecise annotation selection. -const CGFloat MGLAnnotationImagePaddingForHitTest = 4; +const CGFloat MLNAnnotationImagePaddingForHitTest = 4; /// Distance from the callout’s anchor point to the annotation it points to. -const CGFloat MGLAnnotationImagePaddingForCallout = 4; +const CGFloat MLNAnnotationImagePaddingForCallout = 4; /// Padding to edge of view that an offscreen annotation must have when being brought onscreen (by being selected) -const NSEdgeInsets MGLMapViewOffscreenAnnotationPadding = NSEdgeInsetsMake(-30.0f, -30.0f, -30.0f, -30.0f); +const NSEdgeInsets MLNMapViewOffscreenAnnotationPadding = NSEdgeInsetsMake(-30.0f, -30.0f, -30.0f, -30.0f); /// Unique identifier representing a single annotation in mbgl. -typedef uint64_t MGLAnnotationTag; +typedef uint64_t MLNAnnotationTag; /// An indication that the requested annotation was not found or is nonexistent. -enum { MGLAnnotationTagNotFound = UINT64_MAX }; +enum { MLNAnnotationTagNotFound = UINT64_MAX }; /// Mapping from an annotation tag to metadata about that annotation, including /// the annotation itself. -typedef std::unordered_map MGLAnnotationTagContextMap; +typedef std::unordered_map MLNAnnotationTagContextMap; /// Mapping from an annotation object to an annotation tag. -typedef std::map, MGLAnnotationTag> MGLAnnotationObjectTagMap; +typedef std::map, MLNAnnotationTag> MLNAnnotationObjectTagMap; /// Returns an NSImage for the default marker image. -NSImage *MGLDefaultMarkerImage() { - NSString *path = [[NSBundle mgl_frameworkBundle] pathForResource:MGLDefaultStyleMarkerSymbolName +NSImage *MLNDefaultMarkerImage() { + NSString *path = [[NSBundle mgl_frameworkBundle] pathForResource:MLNDefaultStyleMarkerSymbolName ofType:@"pdf"]; return [[NSImage alloc] initWithContentsOfFile:path]; } /// Converts a media timing function into a unit bezier object usable in mbgl. -mbgl::util::UnitBezier MGLUnitBezierForMediaTimingFunction(CAMediaTimingFunction *function) { +mbgl::util::UnitBezier MLNUnitBezierForMediaTimingFunction(CAMediaTimingFunction *function) { if (!function) { function = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; } @@ -131,24 +131,24 @@ mbgl::util::UnitBezier MGLUnitBezierForMediaTimingFunction(CAMediaTimingFunction } /// Lightweight container for metadata about an annotation, including the annotation itself. -class MGLAnnotationContext { +class MLNAnnotationContext { public: - id annotation; + id annotation; /// The annotation’s image’s reuse identifier. NSString *imageReuseIdentifier; }; -@interface MGLMapView () +@interface MLNMapView () @property (nonatomic, readwrite) NSSegmentedControl *zoomControls; @property (nonatomic, readwrite) NSSlider *compass; @property (nonatomic, readwrite) NSImageView *logoView; @property (nonatomic, readwrite) NSView *attributionView; -@property (nonatomic, readwrite) MGLStyle *style; +@property (nonatomic, readwrite) MLNStyle *style; /// Mapping from reusable identifiers to annotation images. -@property (nonatomic) NSMutableDictionary *annotationImagesByIdentifier; +@property (nonatomic) NSMutableDictionary *annotationImagesByIdentifier; /// Currently shown popover representing the selected annotation. @property (nonatomic) NSPopover *calloutForSelectedAnnotation; @@ -156,11 +156,11 @@ public: @end -@implementation MGLMapView { +@implementation MLNMapView { /// Cross-platform map view controller. std::unique_ptr _mbglMap; - std::unique_ptr _mbglView; - std::unique_ptr _rendererFrontend; + std::unique_ptr _mbglView; + std::unique_ptr _rendererFrontend; NSPanGestureRecognizer *_panGestureRecognizer; NSMagnificationGestureRecognizer *_magnificationGestureRecognizer; @@ -171,13 +171,13 @@ public: CGFloat _pitchAtBeginningOfGesture; BOOL _didHideCursorDuringGesture; - MGLAnnotationTagContextMap _annotationContextsByAnnotationTag; - MGLAnnotationObjectTagMap _annotationTagsByAnnotation; - MGLAnnotationTag _selectedAnnotationTag; - MGLAnnotationTag _lastSelectedAnnotationTag; + MLNAnnotationTagContextMap _annotationContextsByAnnotationTag; + MLNAnnotationObjectTagMap _annotationTagsByAnnotation; + MLNAnnotationTag _selectedAnnotationTag; + MLNAnnotationTag _lastSelectedAnnotationTag; /// Size of the rectangle formed by unioning the maximum slop area around every annotation image. NSSize _unionedAnnotationImageSize; - std::vector _annotationsNearbyLastClick; + std::vector _annotationsNearbyLastClick; /// True if any annotations that have tooltips have been installed. BOOL _wantsToolTipRects; /// True if any annotation images that have custom cursors have been installed. @@ -186,7 +186,7 @@ public: BOOL _isChangingAnnotationLayers; // Cached checks for delegate method implementations that may be called from - // MGLMultiPointDelegate methods. + // MLNMultiPointDelegate methods. BOOL _delegateHasAlphasForShapeAnnotations; BOOL _delegateHasStrokeColorsForShapeAnnotations; @@ -204,46 +204,46 @@ public: BOOL _isPrinting; /// reachability instance - MGLReachability *_reachability; + MLNReachability *_reachability; } // MARK: Lifecycle + (void)initialize { - if (self == [MGLMapView class]) { + if (self == [MLNMapView class]) { [[NSUserDefaults standardUserDefaults] registerDefaults:@{ - MGLScrollWheelZoomsMapViewDefaultKey: @NO, + MLNScrollWheelZoomsMapViewDefaultKey: @NO, }]; } } - (instancetype)initWithFrame:(NSRect)frameRect { if (self = [super initWithFrame:frameRect]) { - MGLLogInfo(@"Starting %@ initialization.", NSStringFromClass([self class])); - MGLLogDebug(@"Initializing frame: %@", NSStringFromRect(frameRect)); + MLNLogInfo(@"Starting %@ initialization.", NSStringFromClass([self class])); + MLNLogDebug(@"Initializing frame: %@", NSStringFromRect(frameRect)); [self commonInit]; self.styleURL = nil; - MGLLogInfo(@"Finalizing %@ initialization.", NSStringFromClass([self class])); + MLNLogInfo(@"Finalizing %@ initialization.", NSStringFromClass([self class])); } return self; } - (instancetype)initWithFrame:(NSRect)frame styleURL:(nullable NSURL *)styleURL { if (self = [super initWithFrame:frame]) { - MGLLogInfo(@"Starting %@ initialization.", NSStringFromClass([self class])); - MGLLogDebug(@"Initializing frame: %@ styleURL: %@", NSStringFromRect(frame), styleURL); + MLNLogInfo(@"Starting %@ initialization.", NSStringFromClass([self class])); + MLNLogDebug(@"Initializing frame: %@ styleURL: %@", NSStringFromRect(frame), styleURL); [self commonInit]; self.styleURL = styleURL; - MGLLogInfo(@"Finalizing %@ initialization.", NSStringFromClass([self class])); + MLNLogInfo(@"Finalizing %@ initialization.", NSStringFromClass([self class])); } return self; } - (instancetype)initWithCoder:(nonnull NSCoder *)decoder { if (self = [super initWithCoder:decoder]) { - MGLLogInfo(@"Starting %@ initialization.", NSStringFromClass([self class])); + MLNLogInfo(@"Starting %@ initialization.", NSStringFromClass([self class])); [self commonInit]; - MGLLogInfo(@"Finalizing %@ initialization.", NSStringFromClass([self class])); + MLNLogInfo(@"Finalizing %@ initialization.", NSStringFromClass([self class])); } return self; } @@ -263,12 +263,12 @@ public: } - (void)commonInit { - [MGLNetworkConfiguration sharedManager]; + [MLNNetworkConfiguration sharedManager]; _isTargetingInterfaceBuilder = NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent; // Set up cross-platform controllers and resources. - _mbglView = MGLMapViewImpl::Create(self); + _mbglView = MLNMapViewImpl::Create(self); // Delete the pre-offline ambient cache at // ~/Library/Caches/com.mapbox.MapboxGL/cache.db. @@ -281,12 +281,12 @@ public: NSURL *legacyCacheURL = [cachesDirectoryURL URLByAppendingPathComponent:@"cache.db"]; [[NSFileManager defaultManager] removeItemAtURL:legacyCacheURL error:NULL]; - MGLRendererConfiguration *config = [MGLRendererConfiguration currentConfiguration]; + MLNRendererConfiguration *config = [MLNRendererConfiguration currentConfiguration]; auto localFontFamilyName = config.localFontFamilyName ? std::string(config.localFontFamilyName.UTF8String) : nullptr; auto renderer = std::make_unique(_mbglView->getRendererBackend(), config.scaleFactor, localFontFamilyName); BOOL enableCrossSourceCollisions = !config.perSourceCollisions; - _rendererFrontend = std::make_unique(std::move(renderer), self, _mbglView->getRendererBackend(), true); + _rendererFrontend = std::make_unique(std::move(renderer), self, _mbglView->getRendererBackend(), true); mbgl::MapOptions mapOptions; mapOptions.withMapMode(mbgl::MapMode::Continuous) @@ -296,14 +296,14 @@ public: .withViewportMode(mbgl::ViewportMode::Default) .withCrossSourceCollisions(enableCrossSourceCollisions); - auto tileServerOptions = [[MGLSettings sharedSettings] tileServerOptionsInternal]; + auto tileServerOptions = [[MLNSettings sharedSettings] tileServerOptionsInternal]; mbgl::ResourceOptions resourceOptions; resourceOptions.withTileServerOptions(*tileServerOptions) - .withCachePath(MGLOfflineStorage.sharedOfflineStorage.databasePath.UTF8String) + .withCachePath(MLNOfflineStorage.sharedOfflineStorage.databasePath.UTF8String) .withAssetPath([NSBundle mainBundle].resourceURL.path.UTF8String); mbgl::ClientOptions clientOptions; - auto apiKey = [[MGLSettings sharedSettings] apiKey]; + auto apiKey = [[MLNSettings sharedSettings] apiKey]; if (apiKey) { resourceOptions.withApiKey([apiKey UTF8String]); } @@ -311,8 +311,8 @@ public: _mbglMap = std::make_unique(*_rendererFrontend, *_mbglView, mapOptions, resourceOptions, clientOptions); // Notify map object when network reachability status changes. - _reachability = [MGLReachability reachabilityForInternetConnection]; - _reachability.reachableBlock = ^(MGLReachability *) { + _reachability = [MLNReachability reachabilityForInternetConnection]; + _reachability.reachableBlock = ^(MLNReachability *) { mbgl::NetworkStatus::Reachable(); }; [_reachability startNotifier]; @@ -328,15 +328,15 @@ public: _annotationImagesByIdentifier = [NSMutableDictionary dictionary]; _annotationContextsByAnnotationTag = {}; _annotationTagsByAnnotation = {}; - _selectedAnnotationTag = MGLAnnotationTagNotFound; - _lastSelectedAnnotationTag = MGLAnnotationTagNotFound; + _selectedAnnotationTag = MLNAnnotationTagNotFound; + _lastSelectedAnnotationTag = MLNAnnotationTagNotFound; _annotationsNearbyLastClick = {}; // Jump to Null Island initially. self.automaticallyAdjustsContentInsets = YES; mbgl::CameraOptions options; options.center = mbgl::LatLng(0, 0); - options.padding = MGLEdgeInsetsFromNSEdgeInsets(self.contentInsets); + options.padding = MLNEdgeInsetsFromNSEdgeInsets(self.contentInsets); options.zoom = *_mbglMap->getBounds().minZoom; _mbglMap->jumpTo(options); _pendingLatitude = NAN; @@ -360,7 +360,7 @@ public: - (void)installZoomControls { _zoomControls = [[NSSegmentedControl alloc] initWithFrame:NSZeroRect]; _zoomControls.wantsLayer = YES; - _zoomControls.layer.opacity = MGLOrnamentOpacity; + _zoomControls.layer.opacity = MLNOrnamentOpacity; [(NSSegmentedCell *)_zoomControls.cell setTrackingMode:NSSegmentSwitchTrackingMomentary]; _zoomControls.continuous = YES; _zoomControls.segmentCount = 2; @@ -382,8 +382,8 @@ public: - (void)installCompass { _compass = [[NSSlider alloc] initWithFrame:NSZeroRect]; _compass.wantsLayer = YES; - _compass.layer.opacity = MGLOrnamentOpacity; - _compass.cell = [[MGLCompassCell alloc] init]; + _compass.layer.opacity = MLNOrnamentOpacity; + _compass.cell = [[MLNCompassCell alloc] init]; _compass.continuous = YES; _compass.target = self; _compass.action = @selector(rotate:); @@ -482,7 +482,7 @@ public: // Force links to be black, because the default blue is distracting. CGFloat miniSize = [NSFont systemFontSizeForControlSize:NSControlSizeMini]; NSArray *attributionInfos = [self.style attributionInfosWithFontSize:miniSize linkColor:[NSColor blackColor]]; - for (MGLAttributionInfo *info in attributionInfos) { + for (MLNAttributionInfo *info in attributionInfos) { // Feedback links are added to the Help menu. if (info.feedbackLink) { continue; @@ -490,7 +490,7 @@ public: // For each attribution, add a borderless button that responds to clicks // and feels like a hyperlink. - NSButton *button = [[MGLAttributionButton alloc] initWithAttributionInfo:info]; + NSButton *button = [[MLNAttributionButton alloc] initWithAttributionInfo:info]; button.controlSize = NSControlSizeMini; button.translatesAutoresizingMaskIntoConstraints = NO; @@ -561,10 +561,10 @@ public: [keyPath isEqualToString:@"titlebarAppearsTransparent"]) { [self adjustContentInsets]; } else if ([keyPath isEqualToString:@"coordinate"] && - [object conformsToProtocol:@protocol(MGLAnnotation)] && - ![object isKindOfClass:[MGLMultiPoint class]]) { - id annotation = object; - MGLAnnotationTag annotationTag = (MGLAnnotationTag)(NSUInteger)context; + [object conformsToProtocol:@protocol(MLNAnnotation)] && + ![object isKindOfClass:[MLNMultiPoint class]]) { + id annotation = object; + MLNAnnotationTag annotationTag = (MLNAnnotationTag)(NSUInteger)context; // We can get here because a subclass registered itself as an observer // of the coordinate key path of a non-multipoint annotation but failed // to handle the change. This check deters us from treating the @@ -572,15 +572,15 @@ public: // match a valid annotation tag, the annotation will be unnecessarily // but safely updated. if (annotation == [self annotationWithTag:annotationTag]) { - const mbgl::Point point = MGLPointFromLocationCoordinate2D(annotation.coordinate); - MGLAnnotationImage *annotationImage = [self imageOfAnnotationWithTag:annotationTag]; + const mbgl::Point point = MLNPointFromLocationCoordinate2D(annotation.coordinate); + MLNAnnotationImage *annotationImage = [self imageOfAnnotationWithTag:annotationTag]; _mbglMap->updateAnnotation(annotationTag, mbgl::SymbolAnnotation { point, annotationImage.styleIconIdentifier.UTF8String ?: "" }); [self updateAnnotationCallouts]; } } else if ([keyPath isEqualToString:@"coordinates"] && - [object isKindOfClass:[MGLMultiPoint class]]) { - MGLMultiPoint *annotation = object; - MGLAnnotationTag annotationTag = (MGLAnnotationTag)(NSUInteger)context; + [object isKindOfClass:[MLNMultiPoint class]]) { + MLNMultiPoint *annotation = object; + MLNAnnotationTag annotationTag = (MLNAnnotationTag)(NSUInteger)context; // We can get here because a subclass registered itself as an observer // of the coordinates key path of a multipoint annotation but failed // to handle the change. This check deters us from treating the @@ -598,7 +598,7 @@ public: return [key isEqualToString:@"annotations"] ? YES : [super automaticallyNotifiesObserversForKey:key]; } -- (void)setDelegate:(id)delegate { +- (void)setDelegate:(id)delegate { _delegate = delegate; // Cache checks for delegate method implementations that may be called in a @@ -636,7 +636,7 @@ public: - (nonnull NSURL *)styleURL { NSString *styleURLString = @(_mbglMap->getStyle().getURL().c_str()).mgl_stringOrNilIfEmpty; - return styleURLString ? [NSURL URLWithString:styleURLString] : [MGLStyle defaultStyleURL]; + return styleURLString ? [NSURL URLWithString:styleURLString] : [MLNStyle defaultStyleURL]; } - (void)setStyleURL:(nullable NSURL *)styleURL { @@ -645,12 +645,12 @@ public: } if (!styleURL) { - styleURL = [MGLStyle defaultStyleURL]; + styleURL = [MLNStyle defaultStyleURL]; } - MGLLogDebug(@"Setting styleURL: %@", styleURL); + MLNLogDebug(@"Setting styleURL: %@", styleURL); // An access token is required to load any default style, including Streets. - if ([[MGLSettings sharedSettings] tileServerOptionsInternal]->requiresApiKey() && ![MGLSettings apiKey]) { + if ([[MLNSettings sharedSettings] tileServerOptionsInternal]->requiresApiKey() && ![MLNSettings apiKey]) { NSLog(@"Cannot set the style URL to %@ because no API key has been specified.", styleURL); return; } @@ -661,7 +661,7 @@ public: } - (IBAction)reloadStyle:(__unused id)sender { - MGLLogInfo(@"Reloading style."); + MLNLogInfo(@"Reloading style."); NSURL *styleURL = self.styleURL; _mbglMap->getStyle().loadURL(""); self.styleURL = styleURL; @@ -738,7 +738,7 @@ public: toItem:_zoomControls attribute:NSLayoutAttributeBottom multiplier:1 - constant:MGLOrnamentPadding]]; + constant:MLNOrnamentPadding]]; [self addConstraint: [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeTrailing @@ -746,7 +746,7 @@ public: toItem:_zoomControls attribute:NSLayoutAttributeTrailing multiplier:1 - constant:MGLOrnamentPadding]]; + constant:MLNOrnamentPadding]]; // Center the compass above the zoom controls, assuming that the compass is // narrower than the zoom controls. @@ -776,7 +776,7 @@ public: toItem:_logoView attribute:NSLayoutAttributeBottom multiplier:1 - constant:MGLOrnamentPadding - _logoView.image.alignmentRect.origin.y]]; + constant:MLNOrnamentPadding - _logoView.image.alignmentRect.origin.y]]; [self addConstraint: [NSLayoutConstraint constraintWithItem:_logoView attribute:NSLayoutAttributeLeading @@ -784,7 +784,7 @@ public: toItem:self attribute:NSLayoutAttributeLeading multiplier:1 - constant:MGLOrnamentPadding - _logoView.image.alignmentRect.origin.x]]; + constant:MLNOrnamentPadding - _logoView.image.alignmentRect.origin.x]]; // Place the attribution view to the right of the logo view and size it to // fit the buttons inside. @@ -812,7 +812,7 @@ public: if (_isPrinting) { _isPrinting = NO; - NSImage *image = [[NSImage alloc] initWithMGLPremultipliedImage:_mbglView->readStillImage()]; + NSImage *image = [[NSImage alloc] initWithMLNPremultipliedImage:_mbglView->readStillImage()]; [self performSelector:@selector(printWithImage:) withObject:image afterDelay:0]; } @@ -825,7 +825,7 @@ public: } - (void)setNeedsRerender { - MGLAssertIsMainThread(); + MLNAssertIsMainThread(); [self.layer setNeedsDisplay]; } @@ -968,19 +968,19 @@ public: return; } - self.style = [[MGLStyle alloc] initWithRawStyle:&_mbglMap->getStyle() stylable:self]; + self.style = [[MLNStyle alloc] initWithRawStyle:&_mbglMap->getStyle() stylable:self]; if ([self.delegate respondsToSelector:@selector(mapView:didFinishLoadingStyle:)]) { [self.delegate mapView:self didFinishLoadingStyle:self.style]; } } -- (void)sourceDidChange:(MGLSource *)source { +- (void)sourceDidChange:(MLNSource *)source { if (!_mbglMap) { return; } // Attribution only applies to tiled sources - if ([source isKindOfClass:[MGLTileSource class]]) { + if ([source isKindOfClass:[MLNTileSource class]]) { [self installAttributionView]; } self.needsUpdateConstraints = YES; @@ -1017,12 +1017,12 @@ public: } - (CLLocationCoordinate2D)centerCoordinate { - mbgl::EdgeInsets padding = MGLEdgeInsetsFromNSEdgeInsets(self.contentInsets); - return MGLLocationCoordinate2DFromLatLng(*_mbglMap->getCameraOptions(padding).center); + mbgl::EdgeInsets padding = MLNEdgeInsetsFromNSEdgeInsets(self.contentInsets); + return MLNLocationCoordinate2DFromLatLng(*_mbglMap->getCameraOptions(padding).center); } - (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate { - MGLLogDebug(@"Setting centerCoordinate: %@", MGLStringFromCLLocationCoordinate2D(centerCoordinate)); + MLNLogDebug(@"Setting centerCoordinate: %@", MLNStringFromCLLocationCoordinate2D(centerCoordinate)); [self setCenterCoordinate:centerCoordinate animated:NO]; } @@ -1031,8 +1031,8 @@ public: } - (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion { - MGLLogDebug(@"Setting centerCoordinate: %@ animated: %@", MGLStringFromCLLocationCoordinate2D(centerCoordinate), MGLStringFromBOOL(animated)); - mbgl::AnimationOptions animationOptions = MGLDurationFromTimeInterval(animated ? MGLAnimationDuration : 0); + MLNLogDebug(@"Setting centerCoordinate: %@ animated: %@", MLNStringFromCLLocationCoordinate2D(centerCoordinate), MLNStringFromBOOL(animated)); + mbgl::AnimationOptions animationOptions = MLNDurationFromTimeInterval(animated ? MLNAnimationDuration : 0); animationOptions.transitionFinishFn = ^() { [self didChangeValueForKey:@"centerCoordinate"]; if (completion) { @@ -1044,17 +1044,17 @@ public: [self willChangeValueForKey:@"centerCoordinate"]; _mbglMap->easeTo(mbgl::CameraOptions() - .withCenter(MGLLatLngFromLocationCoordinate2D(centerCoordinate)) - .withPadding(MGLEdgeInsetsFromNSEdgeInsets(self.contentInsets)), + .withCenter(MLNLatLngFromLocationCoordinate2D(centerCoordinate)) + .withPadding(MLNEdgeInsetsFromNSEdgeInsets(self.contentInsets)), animationOptions); } - (void)offsetCenterCoordinateBy:(NSPoint)delta animated:(BOOL)animated { [self willChangeValueForKey:@"centerCoordinate"]; _mbglMap->cancelTransitions(); - MGLMapCamera *oldCamera = self.camera; + MLNMapCamera *oldCamera = self.camera; _mbglMap->moveBy({ delta.x, delta.y }, - MGLDurationFromTimeInterval(animated ? MGLAnimationDuration : 0)); + MLNDurationFromTimeInterval(animated ? MLNAnimationDuration : 0)); if ([self.delegate respondsToSelector:@selector(mapView:shouldChangeFromCamera:toCamera:)] && ![self.delegate mapView:self shouldChangeFromCamera:oldCamera toCamera:self.camera]) { self.camera = oldCamera; @@ -1083,34 +1083,34 @@ public: } - (double)zoomLevel { - mbgl::EdgeInsets padding = MGLEdgeInsetsFromNSEdgeInsets(self.contentInsets); + mbgl::EdgeInsets padding = MLNEdgeInsetsFromNSEdgeInsets(self.contentInsets); return *_mbglMap->getCameraOptions(padding).zoom; } - (void)setZoomLevel:(double)zoomLevel { - MGLLogDebug(@"Setting zoomLevel: %f", zoomLevel); + MLNLogDebug(@"Setting zoomLevel: %f", zoomLevel); [self setZoomLevel:zoomLevel animated:NO]; } - (void)setZoomLevel:(double)zoomLevel animated:(BOOL)animated { - MGLLogDebug(@"Setting zoomLevel: %f animated: %@", zoomLevel, MGLStringFromBOOL(animated)); + MLNLogDebug(@"Setting zoomLevel: %f animated: %@", zoomLevel, MLNStringFromBOOL(animated)); [self willChangeValueForKey:@"zoomLevel"]; _mbglMap->easeTo(mbgl::CameraOptions() .withZoom(zoomLevel) - .withPadding(MGLEdgeInsetsFromNSEdgeInsets(self.contentInsets)), - MGLDurationFromTimeInterval(animated ? MGLAnimationDuration : 0)); + .withPadding(MLNEdgeInsetsFromNSEdgeInsets(self.contentInsets)), + MLNDurationFromTimeInterval(animated ? MLNAnimationDuration : 0)); [self didChangeValueForKey:@"zoomLevel"]; } - (void)setZoomLevel:(double)zoomLevel atPoint:(NSPoint)point animated:(BOOL)animated { [self willChangeValueForKey:@"centerCoordinate"]; [self willChangeValueForKey:@"zoomLevel"]; - MGLMapCamera *oldCamera = self.camera; + MLNMapCamera *oldCamera = self.camera; mbgl::ScreenCoordinate center(point.x, self.bounds.size.height - point.y); _mbglMap->easeTo(mbgl::CameraOptions() .withZoom(zoomLevel) .withAnchor(center), - MGLDurationFromTimeInterval(animated ? MGLAnimationDuration : 0)); + MLNDurationFromTimeInterval(animated ? MLNAnimationDuration : 0)); if ([self.delegate respondsToSelector:@selector(mapView:shouldChangeFromCamera:toCamera:)] && ![self.delegate mapView:self shouldChangeFromCamera:oldCamera toCamera:self.camera]) { self.camera = oldCamera; @@ -1121,13 +1121,13 @@ public: - (void)setMinimumZoomLevel:(double)minimumZoomLevel { - MGLLogDebug(@"Setting minimumZoomLevel: %f", minimumZoomLevel); + MLNLogDebug(@"Setting minimumZoomLevel: %f", minimumZoomLevel); _mbglMap->setBounds(mbgl::BoundOptions().withMinZoom(minimumZoomLevel)); } - (void)setMaximumZoomLevel:(double)maximumZoomLevel { - MGLLogDebug(@"Setting maximumZoomLevel: %f", maximumZoomLevel); + MLNLogDebug(@"Setting maximumZoomLevel: %f", maximumZoomLevel); _mbglMap->setBounds(mbgl::BoundOptions().withMaxZoom(maximumZoomLevel)); } @@ -1164,17 +1164,17 @@ public: } - (void)setDirection:(CLLocationDirection)direction { - MGLLogDebug(@"Setting direction: %f", direction); + MLNLogDebug(@"Setting direction: %f", direction); [self setDirection:direction animated:NO]; } - (void)setDirection:(CLLocationDirection)direction animated:(BOOL)animated { - MGLLogDebug(@"Setting direction: %f animated: %@", direction, MGLStringFromBOOL(animated)); + MLNLogDebug(@"Setting direction: %f animated: %@", direction, MLNStringFromBOOL(animated)); [self willChangeValueForKey:@"direction"]; _mbglMap->easeTo(mbgl::CameraOptions() .withBearing(direction) - .withPadding(MGLEdgeInsetsFromNSEdgeInsets(self.contentInsets)), - MGLDurationFromTimeInterval(animated ? MGLAnimationDuration : 0)); + .withPadding(MLNEdgeInsetsFromNSEdgeInsets(self.contentInsets)), + MLNDurationFromTimeInterval(animated ? MLNAnimationDuration : 0)); [self didChangeValueForKey:@"direction"]; } @@ -1187,7 +1187,7 @@ public: } - (void)setMinimumPitch:(CGFloat)minimumPitch { - MGLLogDebug(@"Setting minimumPitch: %f", minimumPitch); + MLNLogDebug(@"Setting minimumPitch: %f", minimumPitch); _mbglMap->setBounds(mbgl::BoundOptions().withMinPitch(minimumPitch)); } @@ -1196,7 +1196,7 @@ public: } - (void)setMaximumPitch:(CGFloat)maximumPitch { - MGLLogDebug(@"Setting maximumPitch: %f", maximumPitch); + MLNLogDebug(@"Setting maximumPitch: %f", maximumPitch); _mbglMap->setBounds(mbgl::BoundOptions().withMaxPitch(maximumPitch)); } @@ -1204,32 +1204,32 @@ public: return [NSSet setWithObjects:@"latitude", @"longitude", @"centerCoordinate", @"zoomLevel", @"direction", nil]; } -- (MGLMapCamera *)camera { - mbgl::EdgeInsets padding = MGLEdgeInsetsFromNSEdgeInsets(self.contentInsets); +- (MLNMapCamera *)camera { + mbgl::EdgeInsets padding = MLNEdgeInsetsFromNSEdgeInsets(self.contentInsets); return [self cameraForCameraOptions:_mbglMap->getCameraOptions(padding)]; } -- (void)setCamera:(MGLMapCamera *)camera { - MGLLogDebug(@"Setting camera: %@", camera); +- (void)setCamera:(MLNMapCamera *)camera { + MLNLogDebug(@"Setting camera: %@", camera); [self setCamera:camera animated:NO]; } -- (void)setCamera:(MGLMapCamera *)camera animated:(BOOL)animated { - MGLLogDebug(@"Setting camera: %@ animated: %@", camera, MGLStringFromBOOL(animated)); - [self setCamera:camera withDuration:animated ? MGLAnimationDuration : 0 animationTimingFunction:nil completionHandler:NULL]; +- (void)setCamera:(MLNMapCamera *)camera animated:(BOOL)animated { + MLNLogDebug(@"Setting camera: %@ animated: %@", camera, MLNStringFromBOOL(animated)); + [self setCamera:camera withDuration:animated ? MLNAnimationDuration : 0 animationTimingFunction:nil completionHandler:NULL]; } -- (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion { - MGLLogDebug(@"Setting camera: %@ duration: %f animationTimingFunction: %@", camera, duration, function); +- (void)setCamera:(MLNMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion { + MLNLogDebug(@"Setting camera: %@ duration: %f animationTimingFunction: %@", camera, duration, function); [self setCamera:camera withDuration:duration animationTimingFunction:function edgePadding:NSEdgeInsetsZero completionHandler:completion]; } -- (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function edgePadding:(NSEdgeInsets)edgePadding completionHandler:(nullable void (^)(void))completion { - edgePadding = MGLEdgeInsetsInsetEdgeInset(edgePadding, self.contentInsets); +- (void)setCamera:(MLNMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function edgePadding:(NSEdgeInsets)edgePadding completionHandler:(nullable void (^)(void))completion { + edgePadding = MLNEdgeInsetsInsetEdgeInset(edgePadding, self.contentInsets); mbgl::AnimationOptions animationOptions; if (duration > 0) { - animationOptions.duration.emplace(MGLDurationFromTimeInterval(duration)); - animationOptions.easing.emplace(MGLUnitBezierForMediaTimingFunction(function)); + animationOptions.duration.emplace(MLNDurationFromTimeInterval(duration)); + animationOptions.easing.emplace(MLNUnitBezierForMediaTimingFunction(function)); } if (completion) { animationOptions.transitionFinishFn = [completion]() { @@ -1258,26 +1258,26 @@ public: [self didChangeValueForKey:@"camera"]; } -- (void)flyToCamera:(MGLMapCamera *)camera completionHandler:(nullable void (^)(void))completion { - MGLLogDebug(@"Setting flyToCamera: %@ completionHandler: %@", camera, completion); +- (void)flyToCamera:(MLNMapCamera *)camera completionHandler:(nullable void (^)(void))completion { + MLNLogDebug(@"Setting flyToCamera: %@ completionHandler: %@", camera, completion); [self flyToCamera:camera withDuration:-1 completionHandler:completion]; } -- (void)flyToCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration completionHandler:(nullable void (^)(void))completion { - MGLLogDebug(@"Setting flyToCamera: %@ withDuration: %f completionHandler: %@", camera, duration, completion); +- (void)flyToCamera:(MLNMapCamera *)camera withDuration:(NSTimeInterval)duration completionHandler:(nullable void (^)(void))completion { + MLNLogDebug(@"Setting flyToCamera: %@ withDuration: %f completionHandler: %@", camera, duration, completion); [self flyToCamera:camera withDuration:duration peakAltitude:-1 completionHandler:completion]; } -- (void)flyToCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration peakAltitude:(CLLocationDistance)peakAltitude completionHandler:(nullable void (^)(void))completion { - MGLLogDebug(@"Setting flyToCamera: %@ withDuration: %f peakAltitude: %f completionHandler: %@", camera, duration, peakAltitude, completion); +- (void)flyToCamera:(MLNMapCamera *)camera withDuration:(NSTimeInterval)duration peakAltitude:(CLLocationDistance)peakAltitude completionHandler:(nullable void (^)(void))completion { + MLNLogDebug(@"Setting flyToCamera: %@ withDuration: %f peakAltitude: %f completionHandler: %@", camera, duration, peakAltitude, completion); mbgl::AnimationOptions animationOptions; if (duration >= 0) { - animationOptions.duration = MGLDurationFromTimeInterval(duration); + animationOptions.duration = MLNDurationFromTimeInterval(duration); } if (peakAltitude >= 0) { CLLocationDegrees peakLatitude = (self.centerCoordinate.latitude + camera.centerCoordinate.latitude) / 2; CLLocationDegrees peakPitch = (self.camera.pitch + camera.pitch) / 2; - animationOptions.minZoom = MGLZoomLevelForAltitude(peakAltitude, peakPitch, + animationOptions.minZoom = MLNZoomLevelForAltitude(peakAltitude, peakPitch, peakLatitude, self.frame.size); } if (completion) { @@ -1309,11 +1309,11 @@ public: /// Returns a CameraOptions object that specifies parameters for animating to /// the given camera. -- (mbgl::CameraOptions)cameraOptionsObjectForAnimatingToCamera:(MGLMapCamera *)camera edgePadding:(NSEdgeInsets) edgePadding { +- (mbgl::CameraOptions)cameraOptionsObjectForAnimatingToCamera:(MLNMapCamera *)camera edgePadding:(NSEdgeInsets) edgePadding { mbgl::CameraOptions options; - options.center = MGLLatLngFromLocationCoordinate2D(camera.centerCoordinate); - options.padding = MGLEdgeInsetsFromNSEdgeInsets(edgePadding); - options.zoom = MGLZoomLevelForAltitude(camera.altitude, camera.pitch, + options.center = MLNLatLngFromLocationCoordinate2D(camera.centerCoordinate); + options.padding = MLNEdgeInsetsFromNSEdgeInsets(edgePadding); + options.zoom = MLNZoomLevelForAltitude(camera.altitude, camera.pitch, camera.centerCoordinate.latitude, self.frame.size); if (camera.heading >= 0) { @@ -1329,36 +1329,36 @@ public: return [NSSet setWithObjects:@"centerCoordinate", @"zoomLevel", @"direction", @"bounds", nil]; } -- (MGLCoordinateBounds)visibleCoordinateBounds { +- (MLNCoordinateBounds)visibleCoordinateBounds { return [self convertRect:self.bounds toCoordinateBoundsFromView:self]; } -- (void)setVisibleCoordinateBounds:(MGLCoordinateBounds)bounds { - MGLLogDebug(@"Setting visibleCoordinateBounds: %@", MGLStringFromCoordinateBounds(bounds)); +- (void)setVisibleCoordinateBounds:(MLNCoordinateBounds)bounds { + MLNLogDebug(@"Setting visibleCoordinateBounds: %@", MLNStringFromCoordinateBounds(bounds)); [self setVisibleCoordinateBounds:bounds animated:NO]; } -- (void)setVisibleCoordinateBounds:(MGLCoordinateBounds)bounds animated:(BOOL)animated { - MGLLogDebug(@"Setting visibleCoordinateBounds: %@ animated: %@", MGLStringFromCoordinateBounds(bounds), MGLStringFromBOOL(animated)); +- (void)setVisibleCoordinateBounds:(MLNCoordinateBounds)bounds animated:(BOOL)animated { + MLNLogDebug(@"Setting visibleCoordinateBounds: %@ animated: %@", MLNStringFromCoordinateBounds(bounds), MLNStringFromBOOL(animated)); [self setVisibleCoordinateBounds:bounds edgePadding:NSEdgeInsetsZero animated:animated]; } -- (void)setVisibleCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated { +- (void)setVisibleCoordinateBounds:(MLNCoordinateBounds)bounds edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated { [self setVisibleCoordinateBounds:bounds edgePadding:insets animated:animated completionHandler:nil]; } -- (void)setVisibleCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion { +- (void)setVisibleCoordinateBounds:(MLNCoordinateBounds)bounds edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion { _mbglMap->cancelTransitions(); - mbgl::EdgeInsets padding = MGLEdgeInsetsFromNSEdgeInsets(insets); - padding += MGLEdgeInsetsFromNSEdgeInsets(self.contentInsets); - mbgl::CameraOptions cameraOptions = _mbglMap->cameraForLatLngBounds(MGLLatLngBoundsFromCoordinateBounds(bounds), padding); + mbgl::EdgeInsets padding = MLNEdgeInsetsFromNSEdgeInsets(insets); + padding += MLNEdgeInsetsFromNSEdgeInsets(self.contentInsets); + mbgl::CameraOptions cameraOptions = _mbglMap->cameraForLatLngBounds(MLNLatLngBoundsFromCoordinateBounds(bounds), padding); mbgl::AnimationOptions animationOptions; if (animated) { - animationOptions.duration = MGLDurationFromTimeInterval(MGLAnimationDuration); + animationOptions.duration = MLNDurationFromTimeInterval(MLNAnimationDuration); } - MGLMapCamera *camera = [self cameraForCameraOptions:cameraOptions]; + MLNMapCamera *camera = [self cameraForCameraOptions:cameraOptions]; if ([self.camera isEqualToMapCamera:camera]) { completion(); return; @@ -1376,35 +1376,35 @@ public: _mbglMap->easeTo(cameraOptions, animationOptions); } -- (MGLMapCamera *)cameraThatFitsCoordinateBounds:(MGLCoordinateBounds)bounds { +- (MLNMapCamera *)cameraThatFitsCoordinateBounds:(MLNCoordinateBounds)bounds { return [self cameraThatFitsCoordinateBounds:bounds edgePadding:NSEdgeInsetsZero]; } -- (MGLMapCamera *)cameraThatFitsCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(NSEdgeInsets)insets { - mbgl::EdgeInsets padding = MGLEdgeInsetsFromNSEdgeInsets(insets); - padding += MGLEdgeInsetsFromNSEdgeInsets(self.contentInsets); - mbgl::CameraOptions cameraOptions = _mbglMap->cameraForLatLngBounds(MGLLatLngBoundsFromCoordinateBounds(bounds), padding); +- (MLNMapCamera *)cameraThatFitsCoordinateBounds:(MLNCoordinateBounds)bounds edgePadding:(NSEdgeInsets)insets { + mbgl::EdgeInsets padding = MLNEdgeInsetsFromNSEdgeInsets(insets); + padding += MLNEdgeInsetsFromNSEdgeInsets(self.contentInsets); + mbgl::CameraOptions cameraOptions = _mbglMap->cameraForLatLngBounds(MLNLatLngBoundsFromCoordinateBounds(bounds), padding); return [self cameraForCameraOptions:cameraOptions]; } -- (MGLMapCamera *)camera:(MGLMapCamera *)camera fittingCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(NSEdgeInsets)insets +- (MLNMapCamera *)camera:(MLNMapCamera *)camera fittingCoordinateBounds:(MLNCoordinateBounds)bounds edgePadding:(NSEdgeInsets)insets { - mbgl::EdgeInsets padding = MGLEdgeInsetsFromNSEdgeInsets(insets); - padding += MGLEdgeInsetsFromNSEdgeInsets(self.contentInsets); + mbgl::EdgeInsets padding = MLNEdgeInsetsFromNSEdgeInsets(insets); + padding += MLNEdgeInsetsFromNSEdgeInsets(self.contentInsets); - MGLMapCamera *currentCamera = self.camera; + MLNMapCamera *currentCamera = self.camera; CGFloat pitch = camera.pitch < 0 ? currentCamera.pitch : camera.pitch; CLLocationDirection direction = camera.heading < 0 ? currentCamera.heading : camera.heading; - mbgl::CameraOptions cameraOptions = _mbglMap->cameraForLatLngBounds(MGLLatLngBoundsFromCoordinateBounds(bounds), padding, direction, pitch); + mbgl::CameraOptions cameraOptions = _mbglMap->cameraForLatLngBounds(MLNLatLngBoundsFromCoordinateBounds(bounds), padding, direction, pitch); return [self cameraForCameraOptions:cameraOptions]; } -- (MGLMapCamera *)camera:(MGLMapCamera *)camera fittingShape:(MGLShape *)shape edgePadding:(NSEdgeInsets)insets { - mbgl::EdgeInsets padding = MGLEdgeInsetsFromNSEdgeInsets(insets); - padding += MGLEdgeInsetsFromNSEdgeInsets(self.contentInsets); +- (MLNMapCamera *)camera:(MLNMapCamera *)camera fittingShape:(MLNShape *)shape edgePadding:(NSEdgeInsets)insets { + mbgl::EdgeInsets padding = MLNEdgeInsetsFromNSEdgeInsets(insets); + padding += MLNEdgeInsetsFromNSEdgeInsets(self.contentInsets); - MGLMapCamera *currentCamera = self.camera; + MLNMapCamera *currentCamera = self.camera; CGFloat pitch = camera.pitch < 0 ? currentCamera.pitch : camera.pitch; CLLocationDirection direction = camera.heading < 0 ? currentCamera.heading : camera.heading; @@ -1413,25 +1413,25 @@ public: return [self cameraForCameraOptions: cameraOptions]; } -- (MGLMapCamera *)cameraThatFitsShape:(MGLShape *)shape direction:(CLLocationDirection)direction edgePadding:(NSEdgeInsets)insets { - mbgl::EdgeInsets padding = MGLEdgeInsetsFromNSEdgeInsets(insets); - padding += MGLEdgeInsetsFromNSEdgeInsets(self.contentInsets); +- (MLNMapCamera *)cameraThatFitsShape:(MLNShape *)shape direction:(CLLocationDirection)direction edgePadding:(NSEdgeInsets)insets { + mbgl::EdgeInsets padding = MLNEdgeInsetsFromNSEdgeInsets(insets); + padding += MLNEdgeInsetsFromNSEdgeInsets(self.contentInsets); mbgl::CameraOptions cameraOptions = _mbglMap->cameraForGeometry([shape geometryObject], padding, direction); return [self cameraForCameraOptions:cameraOptions]; } -- (MGLMapCamera *)cameraForCameraOptions:(const mbgl::CameraOptions &)cameraOptions { +- (MLNMapCamera *)cameraForCameraOptions:(const mbgl::CameraOptions &)cameraOptions { mbgl::CameraOptions mapCamera = _mbglMap->getCameraOptions(); - CLLocationCoordinate2D centerCoordinate = MGLLocationCoordinate2DFromLatLng(cameraOptions.center ? *cameraOptions.center : *mapCamera.center); + CLLocationCoordinate2D centerCoordinate = MLNLocationCoordinate2DFromLatLng(cameraOptions.center ? *cameraOptions.center : *mapCamera.center); double zoomLevel = cameraOptions.zoom ? *cameraOptions.zoom : self.zoomLevel; CLLocationDirection direction = cameraOptions.bearing ? mbgl::util::wrap(*cameraOptions.bearing, 0., 360.) : self.direction; CGFloat pitch = cameraOptions.pitch ? *cameraOptions.pitch : *mapCamera.pitch; - CLLocationDistance altitude = MGLAltitudeForZoomLevel(zoomLevel, pitch, + CLLocationDistance altitude = MLNAltitudeForZoomLevel(zoomLevel, pitch, centerCoordinate.latitude, self.frame.size); - return [MGLMapCamera cameraLookingAtCenterCoordinate:centerCoordinate + return [MLNMapCamera cameraLookingAtCenterCoordinate:centerCoordinate altitude:altitude pitch:pitch heading:direction]; @@ -1480,7 +1480,7 @@ public: } return; } - MGLLogDebug(@"Setting contentInset: %@ animated:", MGLStringFromNSEdgeInsets(contentInsets), MGLStringFromBOOL(animated)); + MLNLogDebug(@"Setting contentInset: %@ animated:", MLNStringFromNSEdgeInsets(contentInsets), MLNStringFromBOOL(animated)); // After adjusting the content insets, move the center coordinate from the // old frame of reference to the new one represented by the newly set // content insets. @@ -1550,7 +1550,7 @@ public: _directionAtBeginningOfGesture = self.direction; _pitchAtBeginningOfGesture = *_mbglMap->getCameraOptions().pitch; } else if (gestureRecognizer.state == NSGestureRecognizerStateChanged) { - MGLMapCamera *oldCamera = self.camera; + MLNMapCamera *oldCamera = self.camera; BOOL didChangeCamera = NO; mbgl::ScreenCoordinate center(startPoint.x, self.bounds.size.height - startPoint.y); if (self.rotateEnabled) { @@ -1608,7 +1608,7 @@ public: if (gestureRecognizer.magnification > -1) { [self willChangeValueForKey:@"zoomLevel"]; [self willChangeValueForKey:@"centerCoordinate"]; - MGLMapCamera *oldCamera = self.camera; + MLNMapCamera *oldCamera = self.camera; _mbglMap->jumpTo(mbgl::CameraOptions() .withZoom(_zoomAtBeginningOfGesture + log2(1 + gestureRecognizer.magnification)) .withAnchor(center)); @@ -1633,10 +1633,10 @@ public: } NSPoint gesturePoint = [gestureRecognizer locationInView:self]; - MGLAnnotationTag hitAnnotationTag = [self annotationTagAtPoint:gesturePoint persistingResults:YES]; - if (hitAnnotationTag != MGLAnnotationTagNotFound) { + MLNAnnotationTag hitAnnotationTag = [self annotationTagAtPoint:gesturePoint persistingResults:YES]; + if (hitAnnotationTag != MLNAnnotationTagNotFound) { if (hitAnnotationTag != _selectedAnnotationTag) { - id annotation = [self annotationWithTag:hitAnnotationTag]; + id annotation = [self annotationWithTag:hitAnnotationTag]; NSAssert(annotation, @"Cannot select nonexistent annotation with tag %llu", hitAnnotationTag); [self selectAnnotation:annotation atPoint:gesturePoint]; } @@ -1690,7 +1690,7 @@ public: _mbglMap->setGestureInProgress(true); _directionAtBeginningOfGesture = self.direction; } else if (gestureRecognizer.state == NSGestureRecognizerStateChanged) { - MGLMapCamera *oldCamera = self.camera; + MLNMapCamera *oldCamera = self.camera; NSPoint rotationPoint = [gestureRecognizer locationInView:self]; mbgl::ScreenCoordinate anchor(rotationPoint.x, self.bounds.size.height - rotationPoint.y); @@ -1716,7 +1716,7 @@ public: - (void)scrollWheel:(NSEvent *)event { // https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKitOlderNotes/#10_7Dragging BOOL isScrollWheel = event.phase == NSEventPhaseNone && event.momentumPhase == NSEventPhaseNone && !event.hasPreciseScrollingDeltas; - if (isScrollWheel || [[NSUserDefaults standardUserDefaults] boolForKey:MGLScrollWheelZoomsMapViewDefaultKey]) { + if (isScrollWheel || [[NSUserDefaults standardUserDefaults] boolForKey:MLNScrollWheelZoomsMapViewDefaultKey]) { // A traditional, vertical scroll wheel zooms instead of panning. if (self.zoomEnabled) { const double delta = @@ -1771,8 +1771,8 @@ public: if (gestureRecognizer == _singleClickRecognizer) { if (!self.selectedAnnotation) { NSPoint gesturePoint = [self convertPoint:[event locationInWindow] fromView:nil]; - MGLAnnotationTag hitAnnotationTag = [self annotationTagAtPoint:gesturePoint persistingResults:NO]; - if (hitAnnotationTag == MGLAnnotationTagNotFound) { + MLNAnnotationTag hitAnnotationTag = [self annotationTagAtPoint:gesturePoint persistingResults:NO]; + if (hitAnnotationTag == MLNAnnotationTagNotFound) { return NO; } } @@ -1821,19 +1821,19 @@ public: } - (IBAction)moveUp:(__unused id)sender { - [self offsetCenterCoordinateBy:NSMakePoint(0, MGLKeyPanningIncrement) animated:YES]; + [self offsetCenterCoordinateBy:NSMakePoint(0, MLNKeyPanningIncrement) animated:YES]; } - (IBAction)moveDown:(__unused id)sender { - [self offsetCenterCoordinateBy:NSMakePoint(0, -MGLKeyPanningIncrement) animated:YES]; + [self offsetCenterCoordinateBy:NSMakePoint(0, -MLNKeyPanningIncrement) animated:YES]; } - (IBAction)moveLeft:(__unused id)sender { - [self offsetCenterCoordinateBy:NSMakePoint(MGLKeyPanningIncrement, 0) animated:YES]; + [self offsetCenterCoordinateBy:NSMakePoint(MLNKeyPanningIncrement, 0) animated:YES]; } - (IBAction)moveRight:(__unused id)sender { - [self offsetCenterCoordinateBy:NSMakePoint(-MGLKeyPanningIncrement, 0) animated:YES]; + [self offsetCenterCoordinateBy:NSMakePoint(-MLNKeyPanningIncrement, 0) animated:YES]; } - (IBAction)moveToBeginningOfParagraph:(__unused id)sender { @@ -1850,13 +1850,13 @@ public: - (IBAction)moveWordLeft:(__unused id)sender { if (self.rotateEnabled) { - [self offsetDirectionBy:MGLKeyRotationIncrement animated:YES]; + [self offsetDirectionBy:MLNKeyRotationIncrement animated:YES]; } } - (IBAction)moveWordRight:(__unused id)sender { if (self.rotateEnabled) { - [self offsetDirectionBy:-MGLKeyRotationIncrement animated:YES]; + [self offsetDirectionBy:-MLNKeyRotationIncrement animated:YES]; } } @@ -1893,36 +1893,36 @@ public: // MARK: Annotations -- (nullable NSArray> *)annotations { +- (nullable NSArray> *)annotations { if (_annotationContextsByAnnotationTag.empty()) { return nil; } // Map all the annotation tags to the annotations themselves. - std::vector> annotations; + std::vector> annotations; std::transform(_annotationContextsByAnnotationTag.begin(), _annotationContextsByAnnotationTag.end(), std::back_inserter(annotations), - ^ id (const std::pair &pair) { + ^ id (const std::pair &pair) { return pair.second.annotation; }); return [NSArray arrayWithObjects:&annotations[0] count:annotations.size()]; } -- (nullable NSArray> *)visibleAnnotations +- (nullable NSArray> *)visibleAnnotations { return [self visibleAnnotationsInRect:self.bounds]; } -- (nullable NSArray> *)visibleAnnotationsInRect:(CGRect)rect +- (nullable NSArray> *)visibleAnnotationsInRect:(CGRect)rect { if (_annotationContextsByAnnotationTag.empty()) { return nil; } - std::vector annotationTags = [self annotationTagsInRect:rect]; - std::vector shapeAnnotationTags = [self shapeAnnotationTagsInRect:rect]; + std::vector annotationTags = [self annotationTagsInRect:rect]; + std::vector shapeAnnotationTags = [self shapeAnnotationTagsInRect:rect]; if (shapeAnnotationTags.size()) { annotationTags.insert(annotationTags.end(), shapeAnnotationTags.begin(), shapeAnnotationTags.end()); @@ -1935,12 +1935,12 @@ public: for (auto const& annotationTag: annotationTags) { if (!_annotationContextsByAnnotationTag.count(annotationTag) || - annotationTag == MGLAnnotationTagNotFound) + annotationTag == MLNAnnotationTagNotFound) { continue; } - MGLAnnotationContext annotationContext = _annotationContextsByAnnotationTag.at(annotationTag); + MLNAnnotationContext annotationContext = _annotationContextsByAnnotationTag.at(annotationTag); NSAssert(annotationContext.annotation, @"Missing annotation for tag %llu.", annotationTag); if (annotationContext.annotation) { @@ -1955,32 +1955,32 @@ public: } /// Returns the annotation assigned the given tag. Cheap. -- (id )annotationWithTag:(MGLAnnotationTag)tag { +- (id )annotationWithTag:(MLNAnnotationTag)tag { if ( ! _annotationContextsByAnnotationTag.count(tag) || - tag == MGLAnnotationTagNotFound) { + tag == MLNAnnotationTagNotFound) { return nil; } - MGLAnnotationContext &annotationContext = _annotationContextsByAnnotationTag.at(tag); + MLNAnnotationContext &annotationContext = _annotationContextsByAnnotationTag.at(tag); return annotationContext.annotation; } /// Returns the annotation tag assigned to the given annotation. -- (MGLAnnotationTag)annotationTagForAnnotation:(id )annotation { +- (MLNAnnotationTag)annotationTagForAnnotation:(id )annotation { if (!annotation || _annotationTagsByAnnotation.count(annotation) == 0) { - return MGLAnnotationTagNotFound; + return MLNAnnotationTagNotFound; } return _annotationTagsByAnnotation.at(annotation); } -- (void)addAnnotation:(id )annotation { +- (void)addAnnotation:(id )annotation { if (annotation) { [self addAnnotations:@[annotation]]; } } -- (void)addAnnotations:(NSArray> *)annotations { +- (void)addAnnotations:(NSArray> *)annotations { if (!annotations) { return; } @@ -1989,39 +1989,39 @@ public: BOOL delegateHasImagesForAnnotations = [self.delegate respondsToSelector:@selector(mapView:imageForAnnotation:)]; - for (id annotation in annotations) { - NSAssert([annotation conformsToProtocol:@protocol(MGLAnnotation)], @"Annotation does not conform to MGLAnnotation"); + for (id annotation in annotations) { + NSAssert([annotation conformsToProtocol:@protocol(MLNAnnotation)], @"Annotation does not conform to MLNAnnotation"); // adding the same annotation object twice is a no-op if (_annotationTagsByAnnotation.count(annotation) != 0) { continue; } - if ([annotation isKindOfClass:[MGLMultiPoint class]]) { + if ([annotation isKindOfClass:[MLNMultiPoint class]]) { // The multipoint knows how to style itself (with the map view’s help). - MGLMultiPoint *multiPoint = (MGLMultiPoint *)annotation; + MLNMultiPoint *multiPoint = (MLNMultiPoint *)annotation; if (!multiPoint.pointCount) { continue; } _isChangingAnnotationLayers = YES; - MGLAnnotationTag annotationTag = _mbglMap->addAnnotation([multiPoint annotationObjectWithDelegate:self]); - MGLAnnotationContext context; + MLNAnnotationTag annotationTag = _mbglMap->addAnnotation([multiPoint annotationObjectWithDelegate:self]); + MLNAnnotationContext context; context.annotation = annotation; _annotationContextsByAnnotationTag[annotationTag] = context; _annotationTagsByAnnotation[annotation] = annotationTag; [(NSObject *)annotation addObserver:self forKeyPath:@"coordinates" options:0 context:(void *)(NSUInteger)annotationTag]; - } else if (![annotation isKindOfClass:[MGLMultiPolyline class]] - && ![annotation isKindOfClass:[MGLMultiPolygon class]] - && ![annotation isKindOfClass:[MGLShapeCollection class]] - && ![annotation isKindOfClass:[MGLPointCollection class]]) { - MGLAnnotationImage *annotationImage = nil; + } else if (![annotation isKindOfClass:[MLNMultiPolyline class]] + && ![annotation isKindOfClass:[MLNMultiPolygon class]] + && ![annotation isKindOfClass:[MLNShapeCollection class]] + && ![annotation isKindOfClass:[MLNPointCollection class]]) { + MLNAnnotationImage *annotationImage = nil; if (delegateHasImagesForAnnotations) { annotationImage = [self.delegate mapView:self imageForAnnotation:annotation]; } if (!annotationImage) { - annotationImage = [self dequeueReusableAnnotationImageWithIdentifier:MGLDefaultStyleMarkerSymbolName]; + annotationImage = [self dequeueReusableAnnotationImageWithIdentifier:MLNDefaultStyleMarkerSymbolName]; } if (!annotationImage) { annotationImage = self.defaultAnnotationImage; @@ -2029,7 +2029,7 @@ public: NSString *symbolName = annotationImage.styleIconIdentifier; if (!symbolName) { - symbolName = [MGLAnnotationSpritePrefix stringByAppendingString:annotationImage.reuseIdentifier]; + symbolName = [MLNAnnotationSpritePrefix stringByAppendingString:annotationImage.reuseIdentifier]; annotationImage.styleIconIdentifier = symbolName; } @@ -2038,19 +2038,19 @@ public: [self installAnnotationImage:annotationImage]; } - MGLAnnotationTag annotationTag = _mbglMap->addAnnotation(mbgl::SymbolAnnotation { - MGLPointFromLocationCoordinate2D(annotation.coordinate), + MLNAnnotationTag annotationTag = _mbglMap->addAnnotation(mbgl::SymbolAnnotation { + MLNPointFromLocationCoordinate2D(annotation.coordinate), symbolName.UTF8String ?: "" }); - MGLAnnotationContext context; + MLNAnnotationContext context; context.annotation = annotation; context.imageReuseIdentifier = annotationImage.reuseIdentifier; _annotationContextsByAnnotationTag[annotationTag] = context; _annotationTagsByAnnotation[annotation] = annotationTag; if ([annotation isKindOfClass:[NSObject class]]) { - NSAssert(![annotation isKindOfClass:[MGLMultiPoint class]], @"Point annotation should not be MGLMultiPoint."); + NSAssert(![annotation isKindOfClass:[MLNMultiPoint class]], @"Point annotation should not be MLNMultiPoint."); [(NSObject *)annotation addObserver:self forKeyPath:@"coordinate" options:0 context:(void *)(NSUInteger)annotationTag]; } @@ -2072,19 +2072,19 @@ public: /// Initializes and returns a default annotation image that depicts a round pin /// rising from the center, with a shadow slightly below center. The alignment /// rect therefore excludes the bottom half. -- (MGLAnnotationImage *)defaultAnnotationImage { - NSImage *image = MGLDefaultMarkerImage(); +- (MLNAnnotationImage *)defaultAnnotationImage { + NSImage *image = MLNDefaultMarkerImage(); NSRect alignmentRect = image.alignmentRect; alignmentRect.origin.y = NSMidY(alignmentRect); alignmentRect.size.height /= 2; image.alignmentRect = alignmentRect; - return [MGLAnnotationImage annotationImageWithImage:image - reuseIdentifier:MGLDefaultStyleMarkerSymbolName]; + return [MLNAnnotationImage annotationImageWithImage:image + reuseIdentifier:MLNDefaultStyleMarkerSymbolName]; } /// Sends the raw pixel data of the annotation image’s image to mbgl and /// calculates state needed for hit testing later. -- (void)installAnnotationImage:(MGLAnnotationImage *)annotationImage { +- (void)installAnnotationImage:(MLNAnnotationImage *)annotationImage { NSString *iconIdentifier = annotationImage.styleIconIdentifier; self.annotationImagesByIdentifier[annotationImage.reuseIdentifier] = annotationImage; @@ -2109,39 +2109,39 @@ public: } } -- (void)removeAnnotation:(id )annotation { +- (void)removeAnnotation:(id )annotation { if (annotation) { [self removeAnnotations:@[annotation]]; } } -- (void)removeAnnotations:(NSArray> *)annotations { +- (void)removeAnnotations:(NSArray> *)annotations { if (!annotations) { return; } [self willChangeValueForKey:@"annotations"]; - for (id annotation in annotations) { - NSAssert([annotation conformsToProtocol:@protocol(MGLAnnotation)], @"Annotation does not conform to MGLAnnotation"); + for (id annotation in annotations) { + NSAssert([annotation conformsToProtocol:@protocol(MLNAnnotation)], @"Annotation does not conform to MLNAnnotation"); - MGLAnnotationTag annotationTag = [self annotationTagForAnnotation:annotation]; - NSAssert(annotationTag != MGLAnnotationTagNotFound, @"No ID for annotation %@", annotation); + MLNAnnotationTag annotationTag = [self annotationTagForAnnotation:annotation]; + NSAssert(annotationTag != MLNAnnotationTagNotFound, @"No ID for annotation %@", annotation); if (annotationTag == _selectedAnnotationTag) { [self deselectAnnotation:annotation]; } if (annotationTag == _lastSelectedAnnotationTag) { - _lastSelectedAnnotationTag = MGLAnnotationTagNotFound; + _lastSelectedAnnotationTag = MLNAnnotationTagNotFound; } _annotationContextsByAnnotationTag.erase(annotationTag); _annotationTagsByAnnotation.erase(annotation); if ([annotation isKindOfClass:[NSObject class]] && - ![annotation isKindOfClass:[MGLMultiPoint class]]) { + ![annotation isKindOfClass:[MLNMultiPoint class]]) { [(NSObject *)annotation removeObserver:self forKeyPath:@"coordinate" context:(void *)(NSUInteger)annotationTag]; - } else if ([annotation isKindOfClass:[MGLMultiPoint class]]) { + } else if ([annotation isKindOfClass:[MLNMultiPoint class]]) { [(NSObject *)annotation removeObserver:self forKeyPath:@"coordinates" context:(void *)(NSUInteger)annotationTag]; } @@ -2157,11 +2157,11 @@ public: [self updateAnnotationTrackingAreas]; } -- (nullable MGLAnnotationImage *)dequeueReusableAnnotationImageWithIdentifier:(NSString *)identifier { +- (nullable MLNAnnotationImage *)dequeueReusableAnnotationImageWithIdentifier:(NSString *)identifier { return self.annotationImagesByIdentifier[identifier]; } -- (id )annotationAtPoint:(NSPoint)point { +- (id )annotationAtPoint:(NSPoint)point { return [self annotationWithTag:[self annotationTagAtPoint:point persistingResults:NO]]; } @@ -2177,17 +2177,17 @@ public: with the same point. Setting this parameter to false is useful for asking “what if?” */ -- (MGLAnnotationTag)annotationTagAtPoint:(NSPoint)point persistingResults:(BOOL)persist { +- (MLNAnnotationTag)annotationTagAtPoint:(NSPoint)point persistingResults:(BOOL)persist { // Look for any annotation near the click. An annotation is “near” if the // distance between its center and the click is less than the maximum height // or width of an installed annotation image. NSRect queryRect = NSInsetRect({ point, NSZeroSize }, -_unionedAnnotationImageSize.width / 2, -_unionedAnnotationImageSize.height / 2); - queryRect = NSInsetRect(queryRect, -MGLAnnotationImagePaddingForHitTest, - -MGLAnnotationImagePaddingForHitTest); - std::vector nearbyAnnotations = [self annotationTagsInRect:queryRect]; - std::vector nearbyShapeAnnotations = [self shapeAnnotationTagsInRect:queryRect]; + queryRect = NSInsetRect(queryRect, -MLNAnnotationImagePaddingForHitTest, + -MLNAnnotationImagePaddingForHitTest); + std::vector nearbyAnnotations = [self annotationTagsInRect:queryRect]; + std::vector nearbyShapeAnnotations = [self shapeAnnotationTagsInRect:queryRect]; if (nearbyShapeAnnotations.size()) { nearbyAnnotations.insert(nearbyAnnotations.end(), nearbyShapeAnnotations.begin(), nearbyShapeAnnotations.end()); @@ -2196,28 +2196,28 @@ public: if (nearbyAnnotations.size()) { // Assume that the user is fat-fingering an annotation. NSRect hitRect = NSInsetRect({ point, NSZeroSize }, - -MGLAnnotationImagePaddingForHitTest, - -MGLAnnotationImagePaddingForHitTest); + -MLNAnnotationImagePaddingForHitTest, + -MLNAnnotationImagePaddingForHitTest); // Filter out any annotation whose image is unselectable or for which // hit testing fails. - auto end = std::remove_if(nearbyAnnotations.begin(), nearbyAnnotations.end(), [&](const MGLAnnotationTag annotationTag) { - id annotation = [self annotationWithTag:annotationTag]; + auto end = std::remove_if(nearbyAnnotations.begin(), nearbyAnnotations.end(), [&](const MLNAnnotationTag annotationTag) { + id annotation = [self annotationWithTag:annotationTag]; NSAssert(annotation, @"Unknown annotation found nearby click"); if (!annotation) { return true; } - if ([annotation isKindOfClass:[MGLMultiPoint class]]) + if ([annotation isKindOfClass:[MLNMultiPoint class]]) { if ([self.delegate respondsToSelector:@selector(mapView:shapeAnnotationIsEnabled:)]) { - return !!(![self.delegate mapView:self shapeAnnotationIsEnabled:(MGLMultiPoint *)annotation]); + return !!(![self.delegate mapView:self shapeAnnotationIsEnabled:(MLNMultiPoint *)annotation]); } else { return false; } } - MGLAnnotationImage *annotationImage = [self imageOfAnnotationWithTag:annotationTag]; + MLNAnnotationImage *annotationImage = [self imageOfAnnotationWithTag:annotationTag]; if (!annotationImage.selectable) { return true; } @@ -2232,13 +2232,13 @@ public: nearbyAnnotations.resize(std::distance(nearbyAnnotations.begin(), end)); } - MGLAnnotationTag hitAnnotationTag = MGLAnnotationTagNotFound; + MLNAnnotationTag hitAnnotationTag = MLNAnnotationTagNotFound; if (nearbyAnnotations.size()) { // The first selection in the cycle should be the one nearest to the // tap. Also the annotation tags need to be stable in order to compare them with // the remembered tags _annotationsNearbyLastClick. CLLocationCoordinate2D currentCoordinate = [self convertPoint:point toCoordinateFromView:self]; - std::sort(nearbyAnnotations.begin(), nearbyAnnotations.end(), [&](const MGLAnnotationTag tagA, const MGLAnnotationTag tagB) { + std::sort(nearbyAnnotations.begin(), nearbyAnnotations.end(), [&](const MLNAnnotationTag tagA, const MLNAnnotationTag tagB) { CLLocationCoordinate2D coordinateA = [[self annotationWithTag:tagA] coordinate]; CLLocationCoordinate2D coordinateB = [[self annotationWithTag:tagB] coordinate]; CLLocationDegrees deltaA = hypot(coordinateA.latitude - currentCoordinate.latitude, @@ -2251,7 +2251,7 @@ public: if (nearbyAnnotations == _annotationsNearbyLastClick) { // The last time we persisted a set of annotations, we had the same // set of annotations as we do now. Cycle through them. - if (_lastSelectedAnnotationTag == MGLAnnotationTagNotFound + if (_lastSelectedAnnotationTag == MLNAnnotationTagNotFound || _lastSelectedAnnotationTag == nearbyAnnotations.back()) { // Either no annotation is selected or the last annotation in // the set was selected. Wrap around to the first annotation in @@ -2289,7 +2289,7 @@ public: } /// Returns the tags of the annotations coincident with the given rectangle. -- (std::vector)annotationTagsInRect:(NSRect)rect { +- (std::vector)annotationTagsInRect:(NSRect)rect { // Cocoa origin is at the lower-left corner. return self.renderer->queryPointAnnotations({ { NSMinX(rect), NSHeight(self.bounds) - NSMaxY(rect) }, @@ -2297,7 +2297,7 @@ public: }); } -- (std::vector)shapeAnnotationTagsInRect:(NSRect)rect { +- (std::vector)shapeAnnotationTagsInRect:(NSRect)rect { // Cocoa origin is at the lower-left corner. return _rendererFrontend->getRenderer()->queryShapeAnnotations({ { NSMinX(rect), NSHeight(self.bounds) - NSMaxY(rect) }, @@ -2305,67 +2305,67 @@ public: }); } -- (id )selectedAnnotation { +- (id )selectedAnnotation { if ( ! _annotationContextsByAnnotationTag.count(_selectedAnnotationTag) || - _selectedAnnotationTag == MGLAnnotationTagNotFound) { + _selectedAnnotationTag == MLNAnnotationTagNotFound) { return nil; } - MGLAnnotationContext &annotationContext = _annotationContextsByAnnotationTag.at(_selectedAnnotationTag); + MLNAnnotationContext &annotationContext = _annotationContextsByAnnotationTag.at(_selectedAnnotationTag); return annotationContext.annotation; } -- (void)setSelectedAnnotation:(id )annotation { - MGLLogDebug(@"Selecting annotation: %@", annotation); +- (void)setSelectedAnnotation:(id )annotation { + MLNLogDebug(@"Selecting annotation: %@", annotation); [self willChangeValueForKey:@"selectedAnnotations"]; _selectedAnnotationTag = [self annotationTagForAnnotation:annotation]; - if (_selectedAnnotationTag != MGLAnnotationTagNotFound) { + if (_selectedAnnotationTag != MLNAnnotationTagNotFound) { _lastSelectedAnnotationTag = _selectedAnnotationTag; } [self didChangeValueForKey:@"selectedAnnotations"]; } -- (NSArray> *)selectedAnnotations { - id selectedAnnotation = self.selectedAnnotation; +- (NSArray> *)selectedAnnotations { + id selectedAnnotation = self.selectedAnnotation; return selectedAnnotation ? @[selectedAnnotation] : @[]; } -- (void)setSelectedAnnotations:(NSArray> *)selectedAnnotations { - MGLLogDebug(@"Selecting: %lu annotations", selectedAnnotations.count); +- (void)setSelectedAnnotations:(NSArray> *)selectedAnnotations { + MLNLogDebug(@"Selecting: %lu annotations", selectedAnnotations.count); if (!selectedAnnotations.count) { return; } - id firstAnnotation = selectedAnnotations[0]; - NSAssert([firstAnnotation conformsToProtocol:@protocol(MGLAnnotation)], @"Annotation does not conform to MGLAnnotation"); - if ([firstAnnotation isKindOfClass:[MGLMultiPoint class]]) { + id firstAnnotation = selectedAnnotations[0]; + NSAssert([firstAnnotation conformsToProtocol:@protocol(MLNAnnotation)], @"Annotation does not conform to MLNAnnotation"); + if ([firstAnnotation isKindOfClass:[MLNMultiPoint class]]) { return; } [self selectAnnotation:firstAnnotation]; } -- (BOOL)isMovingAnnotationIntoViewSupportedForAnnotation:(id)annotation animated:(BOOL)animated { +- (BOOL)isMovingAnnotationIntoViewSupportedForAnnotation:(id)annotation animated:(BOOL)animated { // Consider delegating - return [annotation isKindOfClass:[MGLPointAnnotation class]]; + return [annotation isKindOfClass:[MLNPointAnnotation class]]; } -- (void)selectAnnotation:(id )annotation +- (void)selectAnnotation:(id )annotation { - MGLLogDebug(@"Selecting annotation: %@", annotation); + MLNLogDebug(@"Selecting annotation: %@", annotation); [self selectAnnotation:annotation atPoint:NSZeroPoint]; } -- (void)selectAnnotation:(id )annotation atPoint:(NSPoint)gesturePoint +- (void)selectAnnotation:(id )annotation atPoint:(NSPoint)gesturePoint { - MGLLogDebug(@"Selecting annotation: %@ atPoint: %@", annotation, NSStringFromPoint(gesturePoint)); + MLNLogDebug(@"Selecting annotation: %@ atPoint: %@", annotation, NSStringFromPoint(gesturePoint)); [self selectAnnotation:annotation atPoint:gesturePoint moveIntoView:YES animateSelection:YES]; } -- (void)selectAnnotation:(id )annotation atPoint:(NSPoint)gesturePoint moveIntoView:(BOOL)moveIntoView animateSelection:(BOOL)animateSelection +- (void)selectAnnotation:(id )annotation atPoint:(NSPoint)gesturePoint moveIntoView:(BOOL)moveIntoView animateSelection:(BOOL)animateSelection { - MGLLogDebug(@"Selecting annotation: %@ atPoint: %@ moveIntoView: %@ animateSelection: %@", annotation, NSStringFromPoint(gesturePoint), MGLStringFromBOOL(moveIntoView), MGLStringFromBOOL(animateSelection)); - id selectedAnnotation = self.selectedAnnotation; + MLNLogDebug(@"Selecting annotation: %@ atPoint: %@ moveIntoView: %@ animateSelection: %@", annotation, NSStringFromPoint(gesturePoint), MLNStringFromBOOL(moveIntoView), MLNStringFromBOOL(animateSelection)); + id selectedAnnotation = self.selectedAnnotation; if (annotation == selectedAnnotation) { return; } @@ -2374,8 +2374,8 @@ public: [self deselectAnnotation:selectedAnnotation]; // Add the annotation to the map if it hasn’t been added yet. - MGLAnnotationTag annotationTag = [self annotationTagForAnnotation:annotation]; - if (annotationTag == MGLAnnotationTagNotFound) { + MLNAnnotationTag annotationTag = [self annotationTagForAnnotation:annotation]; + if (annotationTag == MLNAnnotationTagNotFound) { [self addAnnotation:annotation]; } @@ -2426,7 +2426,7 @@ public: : NSMaxXEdge); // The following will do nothing if the positioning rect is not on-screen. See - // `-[MGLMapView updateAnnotationCallouts]` for presenting the callout when the selected + // `-[MLNMapView updateAnnotationCallouts]` for presenting the callout when the selected // annotation comes back on-screen. [callout showRelativeToRect:positioningRect ofView:self preferredEdge:edge]; } @@ -2447,7 +2447,7 @@ public: if (shouldShowCallout) { // If we have a callout, expand this rect to include a buffer - expandedPositioningRect = edgeInsetsInsetRect(positioningRect, MGLMapViewOffscreenAnnotationPadding); + expandedPositioningRect = edgeInsetsInsetRect(positioningRect, MLNMapViewOffscreenAnnotationPadding); } // Used for callout positioning, and moving offscreen annotations onscreen. @@ -2494,8 +2494,8 @@ public: } } -- (void)showAnnotations:(NSArray> *)annotations animated:(BOOL)animated { - MGLLogDebug(@"Showing: %lu annotations animated: %@", annotations.count, MGLStringFromBOOL(animated)); +- (void)showAnnotations:(NSArray> *)annotations animated:(BOOL)animated { + MLNLogDebug(@"Showing: %lu annotations animated: %@", annotations.count, MLNStringFromBOOL(animated)); CGFloat maximumPadding = 100; CGFloat yPadding = (NSHeight(self.bounds) / 5 <= maximumPadding) ? (NSHeight(self.bounds) / 5) : maximumPadding; CGFloat xPadding = (NSWidth(self.bounds) / 5 <= maximumPadding) ? (NSWidth(self.bounds) / 5) : maximumPadding; @@ -2505,11 +2505,11 @@ public: [self showAnnotations:annotations edgePadding:edgeInsets animated:animated]; } -- (void)showAnnotations:(NSArray> *)annotations edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated { +- (void)showAnnotations:(NSArray> *)annotations edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated { [self showAnnotations:annotations edgePadding:insets animated:animated completionHandler:nil]; } -- (void)showAnnotations:(NSArray> *)annotations edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion { +- (void)showAnnotations:(NSArray> *)annotations edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion { if (!annotations.count) { if (completion) { completion(); @@ -2519,22 +2519,22 @@ public: mbgl::LatLngBounds bounds = mbgl::LatLngBounds::empty(); - for (id annotation in annotations) { - if ([annotation conformsToProtocol:@protocol(MGLOverlay)]) { - bounds.extend(MGLLatLngBoundsFromCoordinateBounds(((id )annotation).overlayBounds)); + for (id annotation in annotations) { + if ([annotation conformsToProtocol:@protocol(MLNOverlay)]) { + bounds.extend(MLNLatLngBoundsFromCoordinateBounds(((id )annotation).overlayBounds)); } else { - bounds.extend(MGLLatLngFromLocationCoordinate2D(annotation.coordinate)); + bounds.extend(MLNLatLngFromLocationCoordinate2D(annotation.coordinate)); } } - [self setVisibleCoordinateBounds:MGLCoordinateBoundsFromLatLngBounds(bounds) + [self setVisibleCoordinateBounds:MLNCoordinateBoundsFromLatLngBounds(bounds) edgePadding:insets animated:animated completionHandler:completion]; } /// Returns a popover detailing the annotation. -- (NSPopover *)calloutForAnnotation:(id )annotation { +- (NSPopover *)calloutForAnnotation:(id )annotation { NSPopover *callout = [[NSPopover alloc] init]; callout.behavior = NSPopoverBehaviorTransient; @@ -2549,7 +2549,7 @@ public: if (!viewController) { viewController = self.calloutViewController; } - NSAssert(viewController, @"Unable to load MGLAnnotationCallout view controller"); + NSAssert(viewController, @"Unable to load MLNAnnotationCallout view controller"); // The popover’s view controller can bind to KVO-compliant key paths of the // annotation. viewController.representedObject = annotation; @@ -2561,7 +2561,7 @@ public: - (NSViewController *)calloutViewController { // Lazily load a default view controller. if (!_calloutViewController) { - _calloutViewController = [[NSViewController alloc] initWithNibName:@"MGLAnnotationCallout" + _calloutViewController = [[NSViewController alloc] initWithNibName:@"MLNAnnotationCallout" bundle:[NSBundle mgl_frameworkBundle]]; } return _calloutViewController; @@ -2570,21 +2570,21 @@ public: /// Returns the rectangle that represents the annotation image of the annotation /// with the given tag. This rectangle is fitted to the image’s alignment rect /// and is appropriate for positioning a popover. -- (NSRect)positioningRectForCalloutForAnnotationWithTag:(MGLAnnotationTag)annotationTag { - id annotation = [self annotationWithTag:annotationTag]; +- (NSRect)positioningRectForCalloutForAnnotationWithTag:(MLNAnnotationTag)annotationTag { + id annotation = [self annotationWithTag:annotationTag]; if (!annotation) { return NSZeroRect; } - if ([annotation isKindOfClass:[MGLMultiPoint class]]) { + if ([annotation isKindOfClass:[MLNMultiPoint class]]) { CLLocationCoordinate2D origin = annotation.coordinate; CGPoint originPoint = [self convertCoordinate:origin toPointToView:self]; - return CGRectMake(originPoint.x, originPoint.y, MGLAnnotationImagePaddingForHitTest, MGLAnnotationImagePaddingForHitTest); + return CGRectMake(originPoint.x, originPoint.y, MLNAnnotationImagePaddingForHitTest, MLNAnnotationImagePaddingForHitTest); } NSImage *image = [self imageOfAnnotationWithTag:annotationTag].image; if (!image) { - image = [self dequeueReusableAnnotationImageWithIdentifier:MGLDefaultStyleMarkerSymbolName].image; + image = [self dequeueReusableAnnotationImageWithIdentifier:MLNDefaultStyleMarkerSymbolName].image; } if (!image) { return NSZeroRect; @@ -2592,8 +2592,8 @@ public: NSRect positioningRect = [self frameOfImage:image centeredAtCoordinate:annotation.coordinate]; positioningRect = NSOffsetRect(image.alignmentRect, positioningRect.origin.x, positioningRect.origin.y); - return NSInsetRect(positioningRect, -MGLAnnotationImagePaddingForCallout, - -MGLAnnotationImagePaddingForCallout); + return NSInsetRect(positioningRect, -MLNAnnotationImagePaddingForCallout, + -MLNAnnotationImagePaddingForCallout); } /// Returns the rectangle relative to the viewport that represents the given @@ -2604,19 +2604,19 @@ public: } /// Returns the annotation image assigned to the annotation with the given tag. -- (MGLAnnotationImage *)imageOfAnnotationWithTag:(MGLAnnotationTag)annotationTag { - if (annotationTag == MGLAnnotationTagNotFound +- (MLNAnnotationImage *)imageOfAnnotationWithTag:(MLNAnnotationTag)annotationTag { + if (annotationTag == MLNAnnotationTagNotFound || _annotationContextsByAnnotationTag.count(annotationTag) == 0) { return nil; } NSString *customSymbol = _annotationContextsByAnnotationTag.at(annotationTag).imageReuseIdentifier; - NSString *symbolName = customSymbol.length ? customSymbol : MGLDefaultStyleMarkerSymbolName; + NSString *symbolName = customSymbol.length ? customSymbol : MLNDefaultStyleMarkerSymbolName; return [self dequeueReusableAnnotationImageWithIdentifier:symbolName]; } -- (void)deselectAnnotation:(id )annotation { +- (void)deselectAnnotation:(id )annotation { if (!annotation || self.selectedAnnotation != annotation) { return; } @@ -2657,40 +2657,40 @@ public: } } -// MARK: MGLMultiPointDelegate methods +// MARK: MLNMultiPointDelegate methods -- (double)alphaForShapeAnnotation:(MGLShape *)annotation { +- (double)alphaForShapeAnnotation:(MLNShape *)annotation { if (_delegateHasAlphasForShapeAnnotations) { return [self.delegate mapView:self alphaForShapeAnnotation:annotation]; } return 1.0; } -- (mbgl::Color)strokeColorForShapeAnnotation:(MGLShape *)annotation { +- (mbgl::Color)strokeColorForShapeAnnotation:(MLNShape *)annotation { NSColor *color = (_delegateHasStrokeColorsForShapeAnnotations ? [self.delegate mapView:self strokeColorForShapeAnnotation:annotation] : [NSColor selectedMenuItemColor]); return color.mgl_color; } -- (mbgl::Color)fillColorForPolygonAnnotation:(MGLPolygon *)annotation { +- (mbgl::Color)fillColorForPolygonAnnotation:(MLNPolygon *)annotation { NSColor *color = (_delegateHasFillColorsForShapeAnnotations ? [self.delegate mapView:self fillColorForPolygonAnnotation:annotation] : [NSColor selectedMenuItemColor]); return color.mgl_color; } -- (CGFloat)lineWidthForPolylineAnnotation:(MGLPolyline *)annotation { +- (CGFloat)lineWidthForPolylineAnnotation:(MLNPolyline *)annotation { if (_delegateHasLineWidthsForShapeAnnotations) { - return [self.delegate mapView:self lineWidthForPolylineAnnotation:(MGLPolyline *)annotation]; + return [self.delegate mapView:self lineWidthForPolylineAnnotation:(MLNPolyline *)annotation]; } return 3.0; } -// MARK: MGLPopoverDelegate methods +// MARK: MLNPopoverDelegate methods - (void)popoverDidShow:(__unused NSNotification *)notification { - id annotation = self.selectedAnnotation; + id annotation = self.selectedAnnotation; if (annotation && [self.delegate respondsToSelector:@selector(mapView:didSelectAnnotation:)]) { [self.delegate mapView:self didSelectAnnotation:annotation]; } @@ -2699,7 +2699,7 @@ public: - (void)popoverDidClose:(__unused NSNotification *)notification { // Deselect the closed popover, in case the popover was closed due to user // action. - id annotation = self.calloutForSelectedAnnotation.contentViewController.representedObject; + id annotation = self.calloutForSelectedAnnotation.contentViewController.representedObject; self.calloutForSelectedAnnotation = nil; self.selectedAnnotation = nil; @@ -2710,48 +2710,48 @@ public: // MARK: Overlays -- (nonnull NSArray> *)overlays +- (nonnull NSArray> *)overlays { if (self.annotations == nil) { return @[]; } - NSMutableArray> *mutableOverlays = [NSMutableArray array]; + NSMutableArray> *mutableOverlays = [NSMutableArray array]; - [self.annotations enumerateObjectsUsingBlock:^(id _Nonnull annotation, NSUInteger idx, BOOL * _Nonnull stop) { - if ([annotation conformsToProtocol:@protocol(MGLOverlay)]) + [self.annotations enumerateObjectsUsingBlock:^(id _Nonnull annotation, NSUInteger idx, BOOL * _Nonnull stop) { + if ([annotation conformsToProtocol:@protocol(MLNOverlay)]) { - [mutableOverlays addObject:(id)annotation]; + [mutableOverlays addObject:(id)annotation]; } }]; return [NSArray arrayWithArray:mutableOverlays]; } -- (void)addOverlay:(id )overlay { - MGLLogDebug(@"Adding overlay: %@", overlay); +- (void)addOverlay:(id )overlay { + MLNLogDebug(@"Adding overlay: %@", overlay); [self addOverlays:@[overlay]]; } -- (void)addOverlays:(NSArray> *)overlays +- (void)addOverlays:(NSArray> *)overlays { - MGLLogDebug(@"Adding: %lu overlays", overlays.count); + MLNLogDebug(@"Adding: %lu overlays", overlays.count); #if DEBUG - for (id overlay in overlays) { - NSAssert([overlay conformsToProtocol:@protocol(MGLOverlay)], @"Overlay does not conform to MGLOverlay"); + for (id overlay in overlays) { + NSAssert([overlay conformsToProtocol:@protocol(MLNOverlay)], @"Overlay does not conform to MLNOverlay"); } #endif [self addAnnotations:overlays]; } -- (void)removeOverlay:(id )overlay { - MGLLogDebug(@"Removing overlay: %@", overlay); +- (void)removeOverlay:(id )overlay { + MLNLogDebug(@"Removing overlay: %@", overlay); [self removeOverlays:@[overlay]]; } -- (void)removeOverlays:(NSArray> *)overlays { - MGLLogDebug(@"Removing: %lu overlays", overlays.count); +- (void)removeOverlays:(NSArray> *)overlays { + MLNLogDebug(@"Removing: %lu overlays", overlays.count); #if DEBUG - for (id overlay in overlays) { - NSAssert([overlay conformsToProtocol:@protocol(MGLOverlay)], @"Overlay does not conform to MGLOverlay"); + for (id overlay in overlays) { + NSAssert([overlay conformsToProtocol:@protocol(MLNOverlay)], @"Overlay does not conform to MLNOverlay"); } #endif [self removeAnnotations:overlays]; @@ -2762,10 +2762,10 @@ public: - (void)updateAnnotationTrackingAreas { if (_wantsToolTipRects) { [self removeAllToolTips]; - std::vector annotationTags = [self annotationTagsInRect:self.bounds]; - for (MGLAnnotationTag annotationTag : annotationTags) { - MGLAnnotationImage *annotationImage = [self imageOfAnnotationWithTag:annotationTag]; - id annotation = [self annotationWithTag:annotationTag]; + std::vector annotationTags = [self annotationTagsInRect:self.bounds]; + for (MLNAnnotationTag annotationTag : annotationTags) { + MLNAnnotationImage *annotationImage = [self imageOfAnnotationWithTag:annotationTag]; + id annotation = [self annotationWithTag:annotationTag]; if ([annotation respondsToSelector:@selector(toolTip)] && annotation.toolTip.length) { // Add a tooltip tracking area over the annotation image’s // frame, accounting for the image’s alignment rect. @@ -2792,9 +2792,9 @@ public: } - (NSString *)view:(__unused NSView *)view stringForToolTip:(__unused NSToolTipTag)tag point:(__unused NSPoint)point userData:(void *)data { - NSAssert((NSUInteger)data < MGLAnnotationTagNotFound, @"Invalid annotation tag in tooltip rect user data."); - MGLAnnotationTag annotationTag = (MGLAnnotationTag)MIN((NSUInteger)data, MGLAnnotationTagNotFound); - id annotation = [self annotationWithTag:annotationTag]; + NSAssert((NSUInteger)data < MLNAnnotationTagNotFound, @"Invalid annotation tag in tooltip rect user data."); + MLNAnnotationTag annotationTag = (MLNAnnotationTag)MIN((NSUInteger)data, MLNAnnotationTagNotFound); + id annotation = [self annotationWithTag:annotationTag]; return annotation.toolTip; } @@ -2811,10 +2811,10 @@ public: return; } - std::vector annotationTags = [self annotationTagsInRect:self.bounds]; - for (MGLAnnotationTag annotationTag : annotationTags) { - id annotation = [self annotationWithTag:annotationTag]; - MGLAnnotationImage *annotationImage = [self imageOfAnnotationWithTag:annotationTag]; + std::vector annotationTags = [self annotationTagsInRect:self.bounds]; + for (MLNAnnotationTag annotationTag : annotationTags) { + id annotation = [self annotationWithTag:annotationTag]; + MLNAnnotationImage *annotationImage = [self imageOfAnnotationWithTag:annotationTag]; if (annotationImage.cursor) { // Add a cursor tracking area over the annotation image, respecting // the image’s alignment rect. @@ -2829,18 +2829,18 @@ public: // MARK: Data -- (NSArray> *)visibleFeaturesAtPoint:(NSPoint)point { - MGLLogDebug(@"Querying visibleFeaturesAtPoint: %@", NSStringFromPoint(point)); +- (NSArray> *)visibleFeaturesAtPoint:(NSPoint)point { + MLNLogDebug(@"Querying visibleFeaturesAtPoint: %@", NSStringFromPoint(point)); return [self visibleFeaturesAtPoint:point inStyleLayersWithIdentifiers:nil]; } -- (NSArray> *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(NSSet *)styleLayerIdentifiers { - MGLLogDebug(@"Querying visibleFeaturesAtPoint: %@ inStyleLayersWithIdentifiers: %@", NSStringFromPoint(point), styleLayerIdentifiers); +- (NSArray> *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(NSSet *)styleLayerIdentifiers { + MLNLogDebug(@"Querying visibleFeaturesAtPoint: %@ inStyleLayersWithIdentifiers: %@", NSStringFromPoint(point), styleLayerIdentifiers); return [self visibleFeaturesAtPoint:point inStyleLayersWithIdentifiers:styleLayerIdentifiers predicate:nil]; } -- (NSArray> *)visibleFeaturesAtPoint:(NSPoint)point inStyleLayersWithIdentifiers:(NSSet *)styleLayerIdentifiers predicate:(NSPredicate *)predicate { - MGLLogDebug(@"Querying visibleFeaturesAtPoint: %@ inStyleLayersWithIdentifiers: %@ predicate: %@", NSStringFromPoint(point), styleLayerIdentifiers, predicate); +- (NSArray> *)visibleFeaturesAtPoint:(NSPoint)point inStyleLayersWithIdentifiers:(NSSet *)styleLayerIdentifiers predicate:(NSPredicate *)predicate { + MLNLogDebug(@"Querying visibleFeaturesAtPoint: %@ inStyleLayersWithIdentifiers: %@ predicate: %@", NSStringFromPoint(point), styleLayerIdentifiers, predicate); // Cocoa origin is at the lower-left corner. mbgl::ScreenCoordinate screenCoordinate = { point.x, NSHeight(self.bounds) - point.y }; @@ -2860,21 +2860,21 @@ public: } std::vector features = _rendererFrontend->getRenderer()->queryRenderedFeatures(screenCoordinate, { optionalLayerIDs, optionalFilter }); - return MGLFeaturesFromMBGLFeatures(features); + return MLNFeaturesFromMBGLFeatures(features); } -- (NSArray> *)visibleFeaturesInRect:(NSRect)rect { - MGLLogDebug(@"Querying visibleFeaturesInRect: %@", NSStringFromRect(rect)); +- (NSArray> *)visibleFeaturesInRect:(NSRect)rect { + MLNLogDebug(@"Querying visibleFeaturesInRect: %@", NSStringFromRect(rect)); return [self visibleFeaturesInRect:rect inStyleLayersWithIdentifiers:nil]; } -- (NSArray> *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(NSSet *)styleLayerIdentifiers { - MGLLogDebug(@"Querying visibleFeaturesInRect: %@ inStyleLayersWithIdentifiers: %@", NSStringFromRect(rect), styleLayerIdentifiers); +- (NSArray> *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(NSSet *)styleLayerIdentifiers { + MLNLogDebug(@"Querying visibleFeaturesInRect: %@ inStyleLayersWithIdentifiers: %@", NSStringFromRect(rect), styleLayerIdentifiers); return [self visibleFeaturesInRect:rect inStyleLayersWithIdentifiers:styleLayerIdentifiers predicate:nil]; } -- (NSArray> *)visibleFeaturesInRect:(NSRect)rect inStyleLayersWithIdentifiers:(NSSet *)styleLayerIdentifiers predicate:(NSPredicate *)predicate { - MGLLogDebug(@"Querying visibleFeaturesInRect: %@ inStyleLayersWithIdentifiers: %@ predicate: %@", NSStringFromRect(rect), styleLayerIdentifiers, predicate); +- (NSArray> *)visibleFeaturesInRect:(NSRect)rect inStyleLayersWithIdentifiers:(NSSet *)styleLayerIdentifiers predicate:(NSPredicate *)predicate { + MLNLogDebug(@"Querying visibleFeaturesInRect: %@ inStyleLayersWithIdentifiers: %@ predicate: %@", NSStringFromRect(rect), styleLayerIdentifiers, predicate); // Cocoa origin is at the lower-left corner. mbgl::ScreenBox screenBox = { { NSMinX(rect), NSHeight(self.bounds) - NSMaxY(rect) }, @@ -2897,7 +2897,7 @@ public: } std::vector features = _rendererFrontend->getRenderer()->queryRenderedFeatures(screenBox, { optionalLayerIDs, optionalFilter }); - return MGLFeaturesFromMBGLFeatures(features); + return MLNFeaturesFromMBGLFeatures(features); } // MARK: User interface validation @@ -2923,7 +2923,7 @@ public: alpha:0.6].CGColor; // Place a playful marker right smack dab in the middle. - self.layer.contents = MGLDefaultMarkerImage(); + self.layer.contents = MLNDefaultMarkerImage(); self.layer.contentsGravity = kCAGravityCenter; self.layer.contentsScale = [NSScreen mainScreen].backingScaleFactor; } @@ -2934,7 +2934,7 @@ public: if (!CLLocationCoordinate2DIsValid(coordinate)) { return NSMakePoint(NAN, NAN); } - return [self convertLatLng:MGLLatLngFromLocationCoordinate2D(coordinate) toPointToView:view]; + return [self convertLatLng:MLNLatLngFromLocationCoordinate2D(coordinate) toPointToView:view]; } /// Converts a geographic coordinate to a point in the view’s coordinate system. @@ -2946,7 +2946,7 @@ public: } - (CLLocationCoordinate2D)convertPoint:(NSPoint)point toCoordinateFromView:(nullable NSView *)view { - return MGLLocationCoordinate2DFromLatLng([self convertPoint:point toLatLngFromView:view]); + return MLNLocationCoordinate2DFromLatLng([self convertPoint:point toLatLngFromView:view]); } /// Converts a point in the view’s coordinate system to a geographic coordinate. @@ -2959,8 +2959,8 @@ public: }).wrapped(); } -- (NSRect)convertCoordinateBounds:(MGLCoordinateBounds)bounds toRectToView:(nullable NSView *)view { - return [self convertLatLngBounds:MGLLatLngBoundsFromCoordinateBounds(bounds) toRectToView:view]; +- (NSRect)convertCoordinateBounds:(MLNCoordinateBounds)bounds toRectToView:(nullable NSView *)view { + return [self convertLatLngBounds:MLNLatLngBoundsFromCoordinateBounds(bounds) toRectToView:view]; } /// Converts a geographic bounding box to a rectangle in the view’s coordinate @@ -2986,12 +2986,12 @@ public: correctedLatLngBounds.extend(southeast); NSRect rect = { [self convertLatLng:correctedLatLngBounds.southwest() toPointToView:view], CGSizeZero }; - rect = MGLExtendRect(rect, [self convertLatLng:correctedLatLngBounds.northeast() toPointToView:view]); + rect = MLNExtendRect(rect, [self convertLatLng:correctedLatLngBounds.northeast() toPointToView:view]); return rect; } -- (MGLCoordinateBounds)convertRect:(NSRect)rect toCoordinateBoundsFromView:(nullable NSView *)view { - return MGLCoordinateBoundsFromLatLngBounds([self convertRect:rect toLatLngBoundsFromView:view]); +- (MLNCoordinateBounds)convertRect:(NSRect)rect toCoordinateBoundsFromView:(nullable NSView *)view { + return MLNCoordinateBoundsFromLatLngBounds([self convertRect:rect toLatLngBoundsFromView:view]); } /// Converts a rectangle in the given view’s coordinate system to a geographic @@ -3025,54 +3025,54 @@ public: // MARK: Debugging -- (MGLMapDebugMaskOptions)debugMask { +- (MLNMapDebugMaskOptions)debugMask { mbgl::MapDebugOptions options = _mbglMap->getDebug(); - MGLMapDebugMaskOptions mask = 0; + MLNMapDebugMaskOptions mask = 0; if (options & mbgl::MapDebugOptions::TileBorders) { - mask |= MGLMapDebugTileBoundariesMask; + mask |= MLNMapDebugTileBoundariesMask; } if (options & mbgl::MapDebugOptions::ParseStatus) { - mask |= MGLMapDebugTileInfoMask; + mask |= MLNMapDebugTileInfoMask; } if (options & mbgl::MapDebugOptions::Timestamps) { - mask |= MGLMapDebugTimestampsMask; + mask |= MLNMapDebugTimestampsMask; } if (options & mbgl::MapDebugOptions::Collision) { - mask |= MGLMapDebugCollisionBoxesMask; + mask |= MLNMapDebugCollisionBoxesMask; } if (options & mbgl::MapDebugOptions::Overdraw) { - mask |= MGLMapDebugOverdrawVisualizationMask; + mask |= MLNMapDebugOverdrawVisualizationMask; } if (options & mbgl::MapDebugOptions::StencilClip) { - mask |= MGLMapDebugStencilBufferMask; + mask |= MLNMapDebugStencilBufferMask; } if (options & mbgl::MapDebugOptions::DepthBuffer) { - mask |= MGLMapDebugDepthBufferMask; + mask |= MLNMapDebugDepthBufferMask; } return mask; } -- (void)setDebugMask:(MGLMapDebugMaskOptions)debugMask { +- (void)setDebugMask:(MLNMapDebugMaskOptions)debugMask { mbgl::MapDebugOptions options = mbgl::MapDebugOptions::NoDebug; - if (debugMask & MGLMapDebugTileBoundariesMask) { + if (debugMask & MLNMapDebugTileBoundariesMask) { options |= mbgl::MapDebugOptions::TileBorders; } - if (debugMask & MGLMapDebugTileInfoMask) { + if (debugMask & MLNMapDebugTileInfoMask) { options |= mbgl::MapDebugOptions::ParseStatus; } - if (debugMask & MGLMapDebugTimestampsMask) { + if (debugMask & MLNMapDebugTimestampsMask) { options |= mbgl::MapDebugOptions::Timestamps; } - if (debugMask & MGLMapDebugCollisionBoxesMask) { + if (debugMask & MLNMapDebugCollisionBoxesMask) { options |= mbgl::MapDebugOptions::Collision; } - if (debugMask & MGLMapDebugOverdrawVisualizationMask) { + if (debugMask & MLNMapDebugOverdrawVisualizationMask) { options |= mbgl::MapDebugOptions::Overdraw; } - if (debugMask & MGLMapDebugStencilBufferMask) { + if (debugMask & MLNMapDebugStencilBufferMask) { options |= mbgl::MapDebugOptions::StencilClip; } - if (debugMask & MGLMapDebugDepthBufferMask) { + if (debugMask & MLNMapDebugDepthBufferMask) { options |= mbgl::MapDebugOptions::DepthBuffer; } _mbglMap->setDebug(options); diff --git a/platform/ios/platform/macos/src/MGLMapViewDelegate.h b/platform/ios/platform/macos/src/MLNMapViewDelegate.h similarity index 82% rename from platform/ios/platform/macos/src/MGLMapViewDelegate.h rename to platform/ios/platform/macos/src/MLNMapViewDelegate.h index dc17bec90..4cfaf8b7f 100644 --- a/platform/ios/platform/macos/src/MGLMapViewDelegate.h +++ b/platform/ios/platform/macos/src/MLNMapViewDelegate.h @@ -2,22 +2,22 @@ NS_ASSUME_NONNULL_BEGIN -@class MGLMapView; -@class MGLAnnotationImage; -@class MGLPolygon; -@class MGLPolyline; -@class MGLShape; +@class MLNMapView; +@class MLNAnnotationImage; +@class MLNPolygon; +@class MLNPolyline; +@class MLNShape; /** - The `MGLMapViewDelegate` protocol defines a set of optional methods that you - can use to receive messages from an `MGLMapView` instance. Because many map - operations require the `MGLMapView` class to load data asynchronously, the map + The `MLNMapViewDelegate` protocol defines a set of optional methods that you + can use to receive messages from an `MLNMapView` instance. Because many map + operations require the `MLNMapView` class to load data asynchronously, the map view calls these methods to notify your application when specific operations complete. The map view also uses these methods to request information about annotations displayed on the map, such as the styles and interaction modes to apply to individual annotations. */ -@protocol MGLMapViewDelegate +@protocol MLNMapViewDelegate @optional @@ -33,14 +33,14 @@ NS_ASSUME_NONNULL_BEGIN @param mapView The map view whose viewpoint will change. @param animated Whether the change will cause an animated effect on the map. */ -- (void)mapView:(MGLMapView *)mapView cameraWillChangeAnimated:(BOOL)animated; +- (void)mapView:(MLNMapView *)mapView cameraWillChangeAnimated:(BOOL)animated; /** Tells the delegate that the viewpoint depicted by the map view is changing. This method is called as the currently displayed map camera changes as part of an animation, whether due to a user gesture or due to a call to a method such - as `-[MGLMapView setCamera:animated:]`. This method can be called before + as `-[MLNMapView setCamera:animated:]`. This method can be called before `-mapViewDidFinishLoadingMap:` is called. During the animation, this method may be called many times to report updates @@ -49,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN @param mapView The map view whose viewpoint is changing. */ -- (void)mapViewCameraIsChanging:(MGLMapView *)mapView; +- (void)mapViewCameraIsChanging:(MLNMapView *)mapView; /** Tells the delegate that the viewpoint depicted by the map view has finished @@ -63,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN @param mapView The map view whose viewpoint has changed. @param animated Whether the change caused an animated effect on the map. */ -- (void)mapView:(MGLMapView *)mapView cameraDidChangeAnimated:(BOOL)animated; +- (void)mapView:(MLNMapView *)mapView cameraDidChangeAnimated:(BOOL)animated; /** Asks the delegate whether the map view should be allowed to change from the @@ -85,7 +85,7 @@ NS_ASSUME_NONNULL_BEGIN @return A Boolean value indicating whether the map view should stay at `oldCamera` or change to `newCamera`. */ -- (BOOL)mapView:(MGLMapView *)mapView shouldChangeFromCamera:(MGLMapCamera *)oldCamera toCamera:(MGLMapCamera *)newCamera; +- (BOOL)mapView:(MLNMapView *)mapView shouldChangeFromCamera:(MLNMapCamera *)oldCamera toCamera:(MLNMapCamera *)newCamera; // MARK: Loading the Map @@ -97,7 +97,7 @@ NS_ASSUME_NONNULL_BEGIN @param mapView The map view that is starting to load. */ -- (void)mapViewWillStartLoadingMap:(MGLMapView *)mapView; +- (void)mapViewWillStartLoadingMap:(MLNMapView *)mapView; /** Tells the delegate that the map view has finished loading. @@ -107,7 +107,7 @@ NS_ASSUME_NONNULL_BEGIN @param mapView The map view that has finished loading. */ -- (void)mapViewDidFinishLoadingMap:(MGLMapView *)mapView; +- (void)mapViewDidFinishLoadingMap:(MLNMapView *)mapView; /** Tells the delegate that the map view was unable to load data needed for @@ -120,10 +120,10 @@ NS_ASSUME_NONNULL_BEGIN @param mapView The map view that is unable to load the data. @param error The reason the data could not be loaded. */ -- (void)mapViewDidFailLoadingMap:(MGLMapView *)mapView withError:(NSError *)error; +- (void)mapViewDidFailLoadingMap:(MLNMapView *)mapView withError:(NSError *)error; -- (void)mapViewWillStartRenderingMap:(MGLMapView *)mapView; -- (void)mapViewDidFinishRenderingMap:(MGLMapView *)mapView fullyRendered:(BOOL)fullyRendered; +- (void)mapViewWillStartRenderingMap:(MLNMapView *)mapView; +- (void)mapViewDidFinishRenderingMap:(MLNMapView *)mapView fullyRendered:(BOOL)fullyRendered; /** Tells the delegate that the map view is about to redraw. @@ -136,7 +136,7 @@ NS_ASSUME_NONNULL_BEGIN @param mapView The map view that is about to redraw. */ -- (void)mapViewWillStartRenderingFrame:(MGLMapView *)mapView; +- (void)mapViewWillStartRenderingFrame:(MLNMapView *)mapView; /** Tells the delegate that the map view has just redrawn. @@ -149,7 +149,7 @@ NS_ASSUME_NONNULL_BEGIN @param mapView The map view that has just redrawn. */ -- (void)mapViewDidFinishRenderingFrame:(MGLMapView *)mapView fullyRendered:(BOOL)fullyRendered; +- (void)mapViewDidFinishRenderingFrame:(MLNMapView *)mapView fullyRendered:(BOOL)fullyRendered; /** Tells the delegate that the map view is entering an idle state, and no more @@ -162,7 +162,7 @@ NS_ASSUME_NONNULL_BEGIN @param mapView The map view that has just entered the idle state. */ -- (void)mapViewDidBecomeIdle:(MGLMapView *)mapView; +- (void)mapViewDidBecomeIdle:(MLNMapView *)mapView; /** Tells the delegate that the map has just finished loading a style. @@ -179,9 +179,9 @@ NS_ASSUME_NONNULL_BEGIN @param mapView The map view that has just loaded a style. @param style The style that was loaded. */ -- (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style; +- (void)mapView:(MLNMapView *)mapView didFinishLoadingStyle:(MLNStyle *)style; -- (nullable NSImage *)mapView:(MGLMapView *)mapView didFailToLoadImage:(NSString *)imageName; +- (nullable NSImage *)mapView:(MLNMapView *)mapView didFailToLoadImage:(NSString *)imageName; /** Asks the delegate whether the map view should evict cached images. @@ -195,7 +195,7 @@ NS_ASSUME_NONNULL_BEGIN @return A Boolean value indicating whether the map view should evict the cached image. */ -- (BOOL)mapView:(MGLMapView *)mapView shouldRemoveStyleImage:(NSString *)imageName; +- (BOOL)mapView:(MLNMapView *)mapView shouldRemoveStyleImage:(NSString *)imageName; // MARK: Managing the Appearance of Annotations @@ -209,7 +209,7 @@ NS_ASSUME_NONNULL_BEGIN @return The image object to display for the given annotation or `nil` if you want to display the default marker image. */ -- (nullable MGLAnnotationImage *)mapView:(MGLMapView *)mapView imageForAnnotation:(id )annotation; +- (nullable MLNAnnotationImage *)mapView:(MLNMapView *)mapView imageForAnnotation:(id )annotation; /** Returns the alpha value to use when rendering a shape annotation. @@ -226,7 +226,7 @@ NS_ASSUME_NONNULL_BEGIN @param annotation The annotation being rendered. @return An alpha value between 0 and 1.0. */ -- (CGFloat)mapView:(MGLMapView *)mapView alphaForShapeAnnotation:(MGLShape *)annotation; +- (CGFloat)mapView:(MLNMapView *)mapView alphaForShapeAnnotation:(MLNShape *)annotation; /** Returns the color to use when rendering the outline of a shape annotation. @@ -241,7 +241,7 @@ NS_ASSUME_NONNULL_BEGIN @param annotation The annotation being rendered. @return A color to use for the shape outline. */ -- (NSColor *)mapView:(MGLMapView *)mapView strokeColorForShapeAnnotation:(MGLShape *)annotation; +- (NSColor *)mapView:(MLNMapView *)mapView strokeColorForShapeAnnotation:(MLNShape *)annotation; /** Returns the color to use when rendering the fill of a polygon annotation. @@ -256,7 +256,7 @@ NS_ASSUME_NONNULL_BEGIN @param annotation The annotation being rendered. @return The polygon’s interior fill color. */ -- (NSColor *)mapView:(MGLMapView *)mapView fillColorForPolygonAnnotation:(MGLPolygon *)annotation; +- (NSColor *)mapView:(MLNMapView *)mapView fillColorForPolygonAnnotation:(MLNPolygon *)annotation; /** Returns the line width in points to use when rendering the outline of a @@ -268,7 +268,7 @@ NS_ASSUME_NONNULL_BEGIN @param annotation The annotation being rendered. @return A line width for the polyline, measured in points. */ -- (CGFloat)mapView:(MGLMapView *)mapView lineWidthForPolylineAnnotation:(MGLPolyline *)annotation; +- (CGFloat)mapView:(MLNMapView *)mapView lineWidthForPolylineAnnotation:(MLNPolyline *)annotation; // MARK: Selecting Annotations @@ -282,7 +282,7 @@ NS_ASSUME_NONNULL_BEGIN @param annotation The object representing the shape annotation. @return A Boolean value indicating whether the annotation can be selected. */ -- (BOOL)mapView:(MGLMapView *)mapView shapeAnnotationIsEnabled:(MGLShape *)annotation; +- (BOOL)mapView:(MLNMapView *)mapView shapeAnnotationIsEnabled:(MLNShape *)annotation; /** Tells the delegate that one of its annotations has been selected. @@ -292,7 +292,7 @@ NS_ASSUME_NONNULL_BEGIN @param mapView The map view containing the annotation. @param annotation The annotation that was selected. */ -- (void)mapView:(MGLMapView *)mapView didSelectAnnotation:(id )annotation; +- (void)mapView:(MLNMapView *)mapView didSelectAnnotation:(id )annotation; /** Tells the delegate that one of its annotations has been deselected. @@ -302,7 +302,7 @@ NS_ASSUME_NONNULL_BEGIN @param mapView The map view containing the annotation. @param annotation The annotation that was deselected. */ -- (void)mapView:(MGLMapView *)mapView didDeselectAnnotation:(id )annotation; +- (void)mapView:(MLNMapView *)mapView didDeselectAnnotation:(id )annotation; // MARK: Managing Callout Popovers @@ -327,7 +327,7 @@ NS_ASSUME_NONNULL_BEGIN @return A Boolean value indicating whether the annotation should show a callout. */ -- (BOOL)mapView:(MGLMapView *)mapView annotationCanShowCallout:(id )annotation; +- (BOOL)mapView:(MLNMapView *)mapView annotationCanShowCallout:(id )annotation; /** Returns a view controller to manage the callout popover’s content view. @@ -339,13 +339,13 @@ NS_ASSUME_NONNULL_BEGIN such as `title` and `subtitle`. If each annotation should have an identical callout, you can set the - `MGLMapView.calloutViewController` property instead. + `MLNMapView.calloutViewController` property instead. @param mapView The map view that is requesting a callout view controller. @param annotation The object representing the annotation. @return A view controller for the given annotation. */ -- (nullable NSViewController *)mapView:(MGLMapView *)mapView calloutViewControllerForAnnotation:(id )annotation; +- (nullable NSViewController *)mapView:(MLNMapView *)mapView calloutViewControllerForAnnotation:(id )annotation; @end diff --git a/platform/ios/platform/macos/src/MGLMapView_Private.h b/platform/ios/platform/macos/src/MLNMapView_Private.h similarity index 93% rename from platform/ios/platform/macos/src/MGLMapView_Private.h rename to platform/ios/platform/macos/src/MLNMapView_Private.h index 05e932d84..490d42ef6 100644 --- a/platform/ios/platform/macos/src/MGLMapView_Private.h +++ b/platform/ios/platform/macos/src/MLNMapView_Private.h @@ -1,4 +1,4 @@ -#import "MGLMapView.h" +#import "MLNMapView.h" #include @@ -7,9 +7,9 @@ namespace mbgl { class Renderer; } -@class MGLSource; +@class MLNSource; -@interface MGLMapView (Private) +@interface MLNMapView (Private) /// True if the view or application is in a state where it is not expected to be /// actively drawing. @@ -44,7 +44,7 @@ namespace mbgl { - (void)mapViewDidFinishRenderingMapFullyRendered:(BOOL)fullyRendered; - (void)mapViewDidBecomeIdle; - (void)mapViewDidFinishLoadingStyle; -- (void)sourceDidChange:(nonnull MGLSource *)source; +- (void)sourceDidChange:(nonnull MLNSource *)source; - (BOOL)shouldRemoveStyleImage:(nonnull NSString *)imageName; /// Asynchronously render a frame of the map. diff --git a/platform/ios/platform/macos/src/MGLOpenGLLayer.h b/platform/ios/platform/macos/src/MLNOpenGLLayer.h similarity index 81% rename from platform/ios/platform/macos/src/MGLOpenGLLayer.h rename to platform/ios/platform/macos/src/MLNOpenGLLayer.h index 832664f39..a54fb8592 100644 --- a/platform/ios/platform/macos/src/MGLOpenGLLayer.h +++ b/platform/ios/platform/macos/src/MLNOpenGLLayer.h @@ -4,7 +4,7 @@ NS_ASSUME_NONNULL_BEGIN /// A subclass of NSOpenGLLayer that creates the environment mbgl needs to /// render good-looking maps. -@interface MGLOpenGLLayer : NSOpenGLLayer +@interface MLNOpenGLLayer : NSOpenGLLayer @end NS_ASSUME_NONNULL_END diff --git a/platform/ios/platform/macos/src/MGLOpenGLLayer.mm b/platform/ios/platform/macos/src/MLNOpenGLLayer.mm similarity index 91% rename from platform/ios/platform/macos/src/MGLOpenGLLayer.mm rename to platform/ios/platform/macos/src/MLNOpenGLLayer.mm index fde2b5240..412e9339d 100644 --- a/platform/ios/platform/macos/src/MGLOpenGLLayer.mm +++ b/platform/ios/platform/macos/src/MLNOpenGLLayer.mm @@ -1,13 +1,13 @@ -#import "MGLOpenGLLayer.h" +#import "MLNOpenGLLayer.h" -#import "MGLMapView_Private.h" +#import "MLNMapView_Private.h" -@implementation MGLOpenGLLayer { +@implementation MLNOpenGLLayer { NSOpenGLContext *_context; } -- (MGLMapView *)mapView { - return (MGLMapView *)super.view; +- (MLNMapView *)mapView { + return (MLNMapView *)super.view; } // - (BOOL)isAsynchronous { diff --git a/platform/ios/platform/macos/src/Mapbox.h b/platform/ios/platform/macos/src/Mapbox.h index a0dd84bac..0ae1f1de2 100644 --- a/platform/ios/platform/macos/src/Mapbox.h +++ b/platform/ios/platform/macos/src/Mapbox.h @@ -1,70 +1,70 @@ #import -#import "MGLFoundation.h" +#import "MLNFoundation.h" /// Project version number for Mapbox. -FOUNDATION_EXPORT MGL_EXPORT double MapboxVersionNumber; +FOUNDATION_EXPORT MLN_EXPORT double MapboxVersionNumber; /// Project version string for Mapbox. -FOUNDATION_EXPORT MGL_EXPORT const unsigned char MapboxVersionString[]; +FOUNDATION_EXPORT MLN_EXPORT const unsigned char MapboxVersionString[]; -#import "MGLSettings.h" -#import "MGLAnnotation.h" -#import "MGLAnnotationImage.h" -#import "MGLClockDirectionFormatter.h" -#import "MGLCluster.h" -#import "MGLCompassDirectionFormatter.h" -#import "MGLCoordinateFormatter.h" -#import "MGLDistanceFormatter.h" -#import "MGLFeature.h" -#import "MGLGeometry.h" -#import "MGLLight.h" -#import "MGLMapCamera.h" -#import "MGLMapView.h" -#import "MGLMapView+IBAdditions.h" -#import "MGLMapViewDelegate.h" -#import "MGLMultiPoint.h" -#import "MGLOfflinePack.h" -#import "MGLOfflineRegion.h" -#import "MGLOfflineStorage.h" -#import "MGLOverlay.h" -#import "MGLPointAnnotation.h" -#import "MGLPointCollection.h" -#import "MGLPolygon.h" -#import "MGLPolyline.h" -#import "MGLShape.h" -#import "MGLShapeCollection.h" -#import "MGLStyle.h" -#import "MGLStyleLayer.h" -#import "MGLForegroundStyleLayer.h" -#import "MGLVectorStyleLayer.h" -#import "MGLFillStyleLayer.h" -#import "MGLFillExtrusionStyleLayer.h" -#import "MGLLineStyleLayer.h" -#import "MGLSymbolStyleLayer.h" -#import "MGLRasterStyleLayer.h" -#import "MGLCircleStyleLayer.h" -#import "MGLBackgroundStyleLayer.h" -#import "MGLHeatmapStyleLayer.h" -#import "MGLHillshadeStyleLayer.h" -#import "MGLOpenGLStyleLayer.h" -#import "MGLSource.h" -#import "MGLTileSource.h" -#import "MGLVectorTileSource.h" -#import "MGLShapeSource.h" -#import "MGLComputedShapeSource.h" -#import "MGLRasterTileSource.h" -#import "MGLRasterDEMSource.h" -#import "MGLImageSource.h" -#import "MGLTilePyramidOfflineRegion.h" -#import "MGLShapeOfflineRegion.h" -#import "MGLTypes.h" -#import "NSValue+MGLAdditions.h" -#import "MGLStyleValue.h" -#import "MGLAttributionInfo.h" -#import "MGLMapSnapshotter.h" -#import "NSExpression+MGLAdditions.h" -#import "NSPredicate+MGLAdditions.h" -#import "MGLLoggingConfiguration.h" -#import "MGLNetworkConfiguration.h" -#import "MGLAttributedExpression.h" +#import "MLNSettings.h" +#import "MLNAnnotation.h" +#import "MLNAnnotationImage.h" +#import "MLNClockDirectionFormatter.h" +#import "MLNCluster.h" +#import "MLNCompassDirectionFormatter.h" +#import "MLNCoordinateFormatter.h" +#import "MLNDistanceFormatter.h" +#import "MLNFeature.h" +#import "MLNGeometry.h" +#import "MLNLight.h" +#import "MLNMapCamera.h" +#import "MLNMapView.h" +#import "MLNMapView+IBAdditions.h" +#import "MLNMapViewDelegate.h" +#import "MLNMultiPoint.h" +#import "MLNOfflinePack.h" +#import "MLNOfflineRegion.h" +#import "MLNOfflineStorage.h" +#import "MLNOverlay.h" +#import "MLNPointAnnotation.h" +#import "MLNPointCollection.h" +#import "MLNPolygon.h" +#import "MLNPolyline.h" +#import "MLNShape.h" +#import "MLNShapeCollection.h" +#import "MLNStyle.h" +#import "MLNStyleLayer.h" +#import "MLNForegroundStyleLayer.h" +#import "MLNVectorStyleLayer.h" +#import "MLNFillStyleLayer.h" +#import "MLNFillExtrusionStyleLayer.h" +#import "MLNLineStyleLayer.h" +#import "MLNSymbolStyleLayer.h" +#import "MLNRasterStyleLayer.h" +#import "MLNCircleStyleLayer.h" +#import "MLNBackgroundStyleLayer.h" +#import "MLNHeatmapStyleLayer.h" +#import "MLNHillshadeStyleLayer.h" +#import "MLNOpenGLStyleLayer.h" +#import "MLNSource.h" +#import "MLNTileSource.h" +#import "MLNVectorTileSource.h" +#import "MLNShapeSource.h" +#import "MLNComputedShapeSource.h" +#import "MLNRasterTileSource.h" +#import "MLNRasterDEMSource.h" +#import "MLNImageSource.h" +#import "MLNTilePyramidOfflineRegion.h" +#import "MLNShapeOfflineRegion.h" +#import "MLNTypes.h" +#import "NSValue+MLNAdditions.h" +#import "MLNStyleValue.h" +#import "MLNAttributionInfo.h" +#import "MLNMapSnapshotter.h" +#import "NSExpression+MLNAdditions.h" +#import "NSPredicate+MLNAdditions.h" +#import "MLNLoggingConfiguration.h" +#import "MLNNetworkConfiguration.h" +#import "MLNAttributedExpression.h" diff --git a/platform/ios/platform/macos/src/NSColor+MGLAdditions.h b/platform/ios/platform/macos/src/NSColor+MLNAdditions.h similarity index 89% rename from platform/ios/platform/macos/src/NSColor+MGLAdditions.h rename to platform/ios/platform/macos/src/NSColor+MLNAdditions.h index 7de843362..f18771f13 100644 --- a/platform/ios/platform/macos/src/NSColor+MGLAdditions.h +++ b/platform/ios/platform/macos/src/NSColor+MLNAdditions.h @@ -3,7 +3,7 @@ #include #include -@interface NSColor (MGLAdditions) +@interface NSColor (MLNAdditions) /** Converts the color into an mbgl::Color in sRGB space. @@ -21,7 +21,7 @@ @end -@interface NSExpression (MGLColorAdditions) +@interface NSExpression (MLNColorAdditions) + (NSExpression *)mgl_expressionForRGBComponents:(NSArray *)components; + (NSExpression *)mgl_expressionForRGBAComponents:(NSArray *)components; diff --git a/platform/ios/platform/macos/src/NSColor+MGLAdditions.mm b/platform/ios/platform/macos/src/NSColor+MLNAdditions.mm similarity index 97% rename from platform/ios/platform/macos/src/NSColor+MGLAdditions.mm rename to platform/ios/platform/macos/src/NSColor+MLNAdditions.mm index 8029d8912..58b657135 100644 --- a/platform/ios/platform/macos/src/NSColor+MGLAdditions.mm +++ b/platform/ios/platform/macos/src/NSColor+MLNAdditions.mm @@ -1,6 +1,6 @@ -#import "NSColor+MGLAdditions.h" +#import "NSColor+MLNAdditions.h" -@implementation NSColor (MGLAdditions) +@implementation NSColor (MLNAdditions) - (mbgl::Color)mgl_color { CGFloat r, g, b, a; @@ -69,7 +69,7 @@ @end -@implementation NSExpression (MGLColorAdditions) +@implementation NSExpression (MLNColorAdditions) + (NSExpression *)mgl_expressionForRGBComponents:(NSArray *)components { if (NSColor *color = [self mgl_colorWithRGBComponents:components]) { diff --git a/platform/ios/platform/macos/src/NSImage+MGLAdditions.h b/platform/ios/platform/macos/src/NSImage+MLNAdditions.h similarity index 65% rename from platform/ios/platform/macos/src/NSImage+MGLAdditions.h rename to platform/ios/platform/macos/src/NSImage+MLNAdditions.h index 22451fe4b..d1ff83e21 100644 --- a/platform/ios/platform/macos/src/NSImage+MGLAdditions.h +++ b/platform/ios/platform/macos/src/NSImage+MLNAdditions.h @@ -4,11 +4,11 @@ NS_ASSUME_NONNULL_BEGIN -@interface NSImage (MGLAdditions) +@interface NSImage (MLNAdditions) -- (nullable instancetype)initWithMGLPremultipliedImage:(mbgl::PremultipliedImage&&)image; +- (nullable instancetype)initWithMLNPremultipliedImage:(mbgl::PremultipliedImage&&)image; -- (nullable instancetype)initWithMGLStyleImage:(const mbgl::style::Image &)image; +- (nullable instancetype)initWithMLNStyleImage:(const mbgl::style::Image &)image; - (std::unique_ptr)mgl_styleImageWithIdentifier:(NSString *)identifier; diff --git a/platform/ios/platform/macos/src/NSImage+MGLAdditions.mm b/platform/ios/platform/macos/src/NSImage+MLNAdditions.mm similarity index 85% rename from platform/ios/platform/macos/src/NSImage+MGLAdditions.mm rename to platform/ios/platform/macos/src/NSImage+MLNAdditions.mm index aed7a10e2..b3c30ebe0 100644 --- a/platform/ios/platform/macos/src/NSImage+MGLAdditions.mm +++ b/platform/ios/platform/macos/src/NSImage+MLNAdditions.mm @@ -1,15 +1,15 @@ -#import "NSImage+MGLAdditions.h" +#import "NSImage+MLNAdditions.h" -#include +#include -BOOL MGLEdgeInsetsIsZero(NSEdgeInsets edgeInsets) { +BOOL MLNEdgeInsetsIsZero(NSEdgeInsets edgeInsets) { return edgeInsets.left == 0 && edgeInsets.top == 0 && edgeInsets.right == 0 && edgeInsets.bottom == 0; } -@implementation NSImage (MGLAdditions) +@implementation NSImage (MLNAdditions) -- (nullable instancetype)initWithMGLPremultipliedImage:(mbgl::PremultipliedImage&&)src { - CGImageRef image = CGImageCreateWithMGLPremultipliedImage(std::move(src)); +- (nullable instancetype)initWithMLNPremultipliedImage:(mbgl::PremultipliedImage&&)src { + CGImageRef image = CGImageCreateWithMLNPremultipliedImage(std::move(src)); if (!image) { return nil; } @@ -19,8 +19,8 @@ BOOL MGLEdgeInsetsIsZero(NSEdgeInsets edgeInsets) { return self; } -- (nullable instancetype)initWithMGLStyleImage:(const mbgl::style::Image &)styleImage { - CGImageRef image = CGImageCreateWithMGLPremultipliedImage(styleImage.getImage().clone()); +- (nullable instancetype)initWithMLNStyleImage:(const mbgl::style::Image &)styleImage { + CGImageRef image = CGImageCreateWithMLNPremultipliedImage(styleImage.getImage().clone()); if (!image) { return nil; } @@ -64,7 +64,7 @@ BOOL MGLEdgeInsetsIsZero(NSEdgeInsets edgeInsets) { } std::optional imageContent; - if (!MGLEdgeInsetsIsZero(self.capInsets)) { + if (!MLNEdgeInsetsIsZero(self.capInsets)) { imageContent = (mbgl::style::ImageContent){ .left = static_cast(self.capInsets.left * scale), .top = static_cast(self.capInsets.top * scale), @@ -83,7 +83,7 @@ BOOL MGLEdgeInsetsIsZero(NSEdgeInsets edgeInsets) { - (mbgl::PremultipliedImage)mgl_premultipliedImage { CGImageRef ref = [self CGImageForProposedRect:nullptr context:nullptr hints:nullptr]; - return MGLPremultipliedImageFromCGImage(ref); + return MLNPremultipliedImageFromCGImage(ref); } @end diff --git a/platform/ios/platform/macos/src/NSProcessInfo+MGLAdditions.h b/platform/ios/platform/macos/src/NSProcessInfo+MLNAdditions.h similarity index 83% rename from platform/ios/platform/macos/src/NSProcessInfo+MGLAdditions.h rename to platform/ios/platform/macos/src/NSProcessInfo+MLNAdditions.h index 1dc1439d5..6dc24d482 100644 --- a/platform/ios/platform/macos/src/NSProcessInfo+MGLAdditions.h +++ b/platform/ios/platform/macos/src/NSProcessInfo+MLNAdditions.h @@ -1,6 +1,6 @@ #import -@interface NSProcessInfo (MGLAdditions) +@interface NSProcessInfo (MLNAdditions) /** Returns YES if the current process is Interface Builder’s helper process for diff --git a/platform/ios/platform/macos/src/NSProcessInfo+MGLAdditions.m b/platform/ios/platform/macos/src/NSProcessInfo+MLNAdditions.m similarity index 70% rename from platform/ios/platform/macos/src/NSProcessInfo+MGLAdditions.m rename to platform/ios/platform/macos/src/NSProcessInfo+MLNAdditions.m index 0c287c030..ebc514072 100644 --- a/platform/ios/platform/macos/src/NSProcessInfo+MGLAdditions.m +++ b/platform/ios/platform/macos/src/NSProcessInfo+MLNAdditions.m @@ -1,6 +1,6 @@ -#import "NSProcessInfo+MGLAdditions.h" +#import "NSProcessInfo+MLNAdditions.h" -@implementation NSProcessInfo (MGLAdditions) +@implementation NSProcessInfo (MLNAdditions) - (BOOL)mgl_isInterfaceBuilderDesignablesAgent { NSString *processName = self.processName; diff --git a/platform/ios/platform/macos/test/CI.xctestplan b/platform/ios/platform/macos/test/CI.xctestplan index a521a21d2..f3b18bec2 100644 --- a/platform/ios/platform/macos/test/CI.xctestplan +++ b/platform/ios/platform/macos/test/CI.xctestplan @@ -21,8 +21,8 @@ "testTargets" : [ { "skippedTests" : [ - "MGLMapSnapshotterTests\/testLocalGlyphRendering", - "MGLOfflineStorageTests" + "MLNMapSnapshotterTests\/testLocalGlyphRendering", + "MLNOfflineStorageTests" ], "target" : { "containerPath" : "container:macos.xcodeproj", diff --git a/platform/ios/platform/macos/test/MGLMapViewDelegateIntegrationTests.swift b/platform/ios/platform/macos/test/MGLMapViewDelegateIntegrationTests.swift deleted file mode 100644 index 90a777e37..000000000 --- a/platform/ios/platform/macos/test/MGLMapViewDelegateIntegrationTests.swift +++ /dev/null @@ -1,63 +0,0 @@ -import XCTest -import Mapbox - -class MGLMapViewDelegateIntegrationTests: XCTestCase { - - func testCoverage() { - MGLSDKTestHelpers.checkTestsContainAllMethods(testClass: MGLMapViewDelegateIntegrationTests.self, in: MGLMapViewDelegate.self) - } - -} - -extension MGLMapViewDelegateIntegrationTests: MGLMapViewDelegate { - - func mapView(_ mapView: MGLMapView, shouldChangeFrom oldCamera: MGLMapCamera, to newCamera: MGLMapCamera) -> Bool { return false } - - func mapView(_ mapView: MGLMapView, lineWidthForPolylineAnnotation annotation: MGLPolyline) -> CGFloat { return 0 } - - func mapView(_ mapView: MGLMapView, annotationCanShowCallout annotation: MGLAnnotation) -> Bool { return false } - - func mapView(_ mapView: MGLMapView, imageFor annotation: MGLAnnotation) -> MGLAnnotationImage? { return nil } - - func mapView(_ mapView: MGLMapView, alphaForShapeAnnotation annotation: MGLShape) -> CGFloat { return 0 } - - func mapViewDidFinishRenderingFrame(_ mapView: MGLMapView, fullyRendered: Bool) {} - - func mapViewDidFinishRenderingMap(_ mapView: MGLMapView, fullyRendered: Bool) {} - - func mapViewDidBecomeIdle(_ mapView: MGLMapView) {} - - func mapViewDidFailLoadingMap(_ mapView: MGLMapView, withError error: Error) {} - - func mapView(_ mapView: MGLMapView, didFailToLoadImage imageName: String) -> NSImage? { return nil } - - func mapView(_ mapView: MGLMapView, shapeAnnotationIsEnabled annotation: MGLShape) -> Bool { return false } - - func mapView(_ mapView: MGLMapView, didDeselect annotation: MGLAnnotation) {} - - func mapView(_ mapView: MGLMapView, didSelect annotation: MGLAnnotation) {} - - func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) {} - - func mapViewWillStartRenderingFrame(_ mapView: MGLMapView) {} - - func mapViewWillStartRenderingMap(_ mapView: MGLMapView) {} - - func mapViewWillStartLoadingMap(_ mapView: MGLMapView) {} - - func mapViewDidFinishLoadingMap(_ mapView: MGLMapView) {} - - func mapViewCameraIsChanging(_ mapView: MGLMapView) {} - - func mapView(_ mapView: MGLMapView, cameraDidChangeAnimated animated: Bool) {} - - func mapView(_ mapView: MGLMapView, cameraWillChangeAnimated animated: Bool) {} - - func mapView(_ mapView: MGLMapView, strokeColorForShapeAnnotation annotation: MGLShape) -> NSColor { return .black } - - func mapView(_ mapView: MGLMapView, fillColorForPolygonAnnotation annotation: MGLPolygon) -> NSColor { return .black } - - func mapView(_ mapView: MGLMapView, calloutViewControllerFor annotation: MGLAnnotation) -> NSViewController? { return nil } - - func mapView(_ mapView: MGLMapView, shouldRemoveStyleImage imageName: String) -> Bool { return false } -} diff --git a/platform/ios/platform/macos/test/MGLAnnotationTests.m b/platform/ios/platform/macos/test/MLNAnnotationTests.m similarity index 80% rename from platform/ios/platform/macos/test/MGLAnnotationTests.m rename to platform/ios/platform/macos/test/MLNAnnotationTests.m index 9657ae0a4..676e75c15 100644 --- a/platform/ios/platform/macos/test/MGLAnnotationTests.m +++ b/platform/ios/platform/macos/test/MLNAnnotationTests.m @@ -1,17 +1,17 @@ #import #import -@interface MGLAnnotationTests : XCTestCase -@property (nonatomic) MGLMapView *mapView; +@interface MLNAnnotationTests : XCTestCase +@property (nonatomic) MLNMapView *mapView; @property (nonatomic) BOOL centerCoordinateDidChange; @end -@implementation MGLAnnotationTests +@implementation MLNAnnotationTests - (void)setUp { [super setUp]; - _mapView = [[MGLMapView alloc] initWithFrame:CGRectMake(0, 0, 256, 256)]; + _mapView = [[MLNMapView alloc] initWithFrame:CGRectMake(0, 0, 256, 256)]; _mapView.delegate = self; } @@ -26,12 +26,12 @@ self.mapView.contentInsets = NSEdgeInsetsMake(10.0, 10.0, 10.0, 10.0); // Create annotation - MGLPointFeature *point = [[MGLPointFeature alloc] init]; + MLNPointFeature *point = [[MLNPointFeature alloc] init]; point.title = NSStringFromSelector(_cmd); point.coordinate = CLLocationCoordinate2DMake(0.0, 0.0); - MGLCoordinateBounds coordinateBounds = [self.mapView convertRect:self.mapView.bounds toCoordinateBoundsFromView:self.mapView]; - XCTAssert(MGLCoordinateInCoordinateBounds(point.coordinate, coordinateBounds), @"The test point should be within the visible map view"); + MLNCoordinateBounds coordinateBounds = [self.mapView convertRect:self.mapView.bounds toCoordinateBoundsFromView:self.mapView]; + XCTAssert(MLNCoordinateInCoordinateBounds(point.coordinate, coordinateBounds), @"The test point should be within the visible map view"); [self.mapView addObserver:self forKeyPath:@"centerCoordinate" options:NSKeyValueObservingOptionNew context:_cmd]; XCTAssertFalse(self.centerCoordinateDidChange, @"Center coordinate should not have changed at this point"); diff --git a/platform/ios/platform/macos/test/MGLAttributionButtonTests.m b/platform/ios/platform/macos/test/MLNAttributionButtonTests.m similarity index 75% rename from platform/ios/platform/macos/test/MGLAttributionButtonTests.m rename to platform/ios/platform/macos/test/MLNAttributionButtonTests.m index b41de9531..3c743e1df 100644 --- a/platform/ios/platform/macos/test/MGLAttributionButtonTests.m +++ b/platform/ios/platform/macos/test/MLNAttributionButtonTests.m @@ -1,21 +1,21 @@ #import #import -#import "MGLAttributionButton.h" -#import "MGLAttributionInfo.h" +#import "MLNAttributionButton.h" +#import "MLNAttributionInfo.h" -@interface MGLAttributionButtonTests : XCTestCase +@interface MLNAttributionButtonTests : XCTestCase @end -@implementation MGLAttributionButtonTests +@implementation MLNAttributionButtonTests - (void)testPlainSymbol { NSAttributedString *title = [[NSAttributedString alloc] initWithString:@"® & ™ Mapbox" attributes:@{ NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle), }]; - MGLAttributionInfo *info = [[MGLAttributionInfo alloc] initWithTitle:title URL:nil]; - MGLAttributionButton *button = [[MGLAttributionButton alloc] initWithAttributionInfo:info]; + MLNAttributionInfo *info = [[MLNAttributionInfo alloc] initWithTitle:title URL:nil]; + MLNAttributionButton *button = [[MLNAttributionButton alloc] initWithAttributionInfo:info]; NSRange symbolUnderlineRange; NSNumber *symbolUnderline = [button.attributedTitle attribute:NSUnderlineStyleAttributeName atIndex:0 effectiveRange:&symbolUnderlineRange]; diff --git a/platform/ios/platform/macos/test/MLNMapViewDelegateIntegrationTests.swift b/platform/ios/platform/macos/test/MLNMapViewDelegateIntegrationTests.swift new file mode 100644 index 000000000..170159d5e --- /dev/null +++ b/platform/ios/platform/macos/test/MLNMapViewDelegateIntegrationTests.swift @@ -0,0 +1,63 @@ +import XCTest +import Mapbox + +class MLNMapViewDelegateIntegrationTests: XCTestCase { + + func testCoverage() { + MLNSDKTestHelpers.checkTestsContainAllMethods(testClass: MLNMapViewDelegateIntegrationTests.self, in: MLNMapViewDelegate.self) + } + +} + +extension MLNMapViewDelegateIntegrationTests: MLNMapViewDelegate { + + func mapView(_ mapView: MLNMapView, shouldChangeFrom oldCamera: MLNMapCamera, to newCamera: MLNMapCamera) -> Bool { return false } + + func mapView(_ mapView: MLNMapView, lineWidthForPolylineAnnotation annotation: MLNPolyline) -> CGFloat { return 0 } + + func mapView(_ mapView: MLNMapView, annotationCanShowCallout annotation: MLNAnnotation) -> Bool { return false } + + func mapView(_ mapView: MLNMapView, imageFor annotation: MLNAnnotation) -> MLNAnnotationImage? { return nil } + + func mapView(_ mapView: MLNMapView, alphaForShapeAnnotation annotation: MLNShape) -> CGFloat { return 0 } + + func mapViewDidFinishRenderingFrame(_ mapView: MLNMapView, fullyRendered: Bool) {} + + func mapViewDidFinishRenderingMap(_ mapView: MLNMapView, fullyRendered: Bool) {} + + func mapViewDidBecomeIdle(_ mapView: MLNMapView) {} + + func mapViewDidFailLoadingMap(_ mapView: MLNMapView, withError error: Error) {} + + func mapView(_ mapView: MLNMapView, didFailToLoadImage imageName: String) -> NSImage? { return nil } + + func mapView(_ mapView: MLNMapView, shapeAnnotationIsEnabled annotation: MLNShape) -> Bool { return false } + + func mapView(_ mapView: MLNMapView, didDeselect annotation: MLNAnnotation) {} + + func mapView(_ mapView: MLNMapView, didSelect annotation: MLNAnnotation) {} + + func mapView(_ mapView: MLNMapView, didFinishLoading style: MLNStyle) {} + + func mapViewWillStartRenderingFrame(_ mapView: MLNMapView) {} + + func mapViewWillStartRenderingMap(_ mapView: MLNMapView) {} + + func mapViewWillStartLoadingMap(_ mapView: MLNMapView) {} + + func mapViewDidFinishLoadingMap(_ mapView: MLNMapView) {} + + func mapViewCameraIsChanging(_ mapView: MLNMapView) {} + + func mapView(_ mapView: MLNMapView, cameraDidChangeAnimated animated: Bool) {} + + func mapView(_ mapView: MLNMapView, cameraWillChangeAnimated animated: Bool) {} + + func mapView(_ mapView: MLNMapView, strokeColorForShapeAnnotation annotation: MLNShape) -> NSColor { return .black } + + func mapView(_ mapView: MLNMapView, fillColorForPolygonAnnotation annotation: MLNPolygon) -> NSColor { return .black } + + func mapView(_ mapView: MLNMapView, calloutViewControllerFor annotation: MLNAnnotation) -> NSViewController? { return nil } + + func mapView(_ mapView: MLNMapView, shouldRemoveStyleImage imageName: String) -> Bool { return false } +} diff --git a/platform/qt/app/mapwindow.cpp b/platform/qt/app/mapwindow.cpp index b1d0ce148..54c457fb5 100644 --- a/platform/qt/app/mapwindow.cpp +++ b/platform/qt/app/mapwindow.cpp @@ -482,7 +482,7 @@ void MapWindow::initializeGL() // Set default location to Helsinki. m_map->setCoordinateZoom(QMapLibreGL::Coordinate(60.170448, 24.942046), 5); - QString styleUrl = qgetenv("MGL_STYLE_URL"); + QString styleUrl = qgetenv("MLN_STYLE_URL"); if (styleUrl.isEmpty()) { changeStyle(); } else { diff --git a/platform/qt/src/settings.cpp b/platform/qt/src/settings.cpp index fecd4797c..91dfb98bf 100644 --- a/platform/qt/src/settings.cpp +++ b/platform/qt/src/settings.cpp @@ -132,7 +132,7 @@ Settings::Settings() , m_cacheMaximumSize(mbgl::util::DEFAULT_MAX_CACHE_SIZE) , m_cacheDatabasePath(":memory:") , m_assetPath(QCoreApplication::applicationDirPath()) - , m_apiKey(qgetenv("MGL_API_KEY")) + , m_apiKey(qgetenv("MLN_API_KEY")) , m_tileServerOptionsInternal(new mbgl::TileServerOptions(mbgl::TileServerOptions::DefaultConfiguration())) { } @@ -289,7 +289,7 @@ void Settings::setAssetPath(const QString &path) /*! Returns the API key. - By default, it is taken from the environment variable \c MGL_API_KEY + By default, it is taken from the environment variable \c MLN_API_KEY or empty if the variable is not set. */ QString Settings::apiKey() const { diff --git a/render-test/manifest_parser.cpp b/render-test/manifest_parser.cpp index b2e53c1d8..27589140f 100644 --- a/render-test/manifest_parser.cpp +++ b/render-test/manifest_parser.cpp @@ -12,7 +12,7 @@ #endif Manifest::Manifest() { - const char* envApiKey = getenv("MGL_API_KEY"); + const char* envApiKey = getenv("MLN_API_KEY"); if (envApiKey != nullptr) { apiKey = envApiKey; }