├── .depsvalidator.yml
├── .fastlane
├── Appfile
├── Fastfile
├── Matchfile
└── Pluginfile
├── .gitattributes
├── .github
├── CODEOWNERS
├── ISSUE_TEMPLATE
│ ├── bug.md
│ └── feature.md
├── PULL_REQUEST_TEMPLATE.md
├── dependabot.yml
├── stale.yml
└── workflows
│ ├── analyze.yml
│ └── codeql.yml
├── .gitignore
├── .gitmodules
├── .pre-commit-config.yaml
├── .swiftlint.yml
├── .swiftpm
└── xcode
│ ├── package.xcworkspace
│ └── contents.xcworkspacedata
│ └── xcshareddata
│ └── xcschemes
│ └── MapboxMaps.xcscheme
├── .yamllint
├── CHANGELOG.md
├── CODE-OF-CONDUCT.md
├── CONTRIBUTING.md
├── DEVELOPING.md
├── Examples.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
└── xcshareddata
│ └── xcschemes
│ └── Examples.xcscheme
├── Examples.yml
├── Gemfile
├── Gemfile.lock
├── LICENSE.md
├── MapboxMaps.podspec
├── Package.swift
├── README.md
├── STYLE_README.md
├── Sources
├── .swiftlint.yml
├── Examples
│ ├── .swiftlint.yml
│ ├── All Examples
│ │ ├── AdvancedViewportGesturesExample.swift
│ │ ├── AnimateGeoJSONLineExample.swift
│ │ ├── AnimateImageLayerExample.swift
│ │ ├── AnimateLayerExample.swift
│ │ ├── Annotations
│ │ │ ├── AddMarkersSymbolExample.swift
│ │ │ ├── AddOneMarkerSymbolExample.swift
│ │ │ ├── AnimatedMarkerExample.swift
│ │ │ ├── AnnotationView.swift
│ │ │ ├── CircleAnnotationExample.swift
│ │ │ ├── CustomPointAnnotationExample.swift
│ │ │ ├── DynamicViewAnnotationExample.swift
│ │ │ ├── FrameViewAnnotationsExample.swift
│ │ │ ├── IconSizeChangeExample.swift
│ │ │ ├── LineAnnotationExample.swift
│ │ │ ├── MultipleGeometriesExample.swift
│ │ │ ├── PointAnnotationClusteringExample.swift
│ │ │ ├── PolygonAnnotationExample.swift
│ │ │ ├── SymbolClusteringExample.swift
│ │ │ ├── ViewAnnotationAnimationExample.swift
│ │ │ ├── ViewAnnotationBasicExample.swift
│ │ │ ├── ViewAnnotationMarkerExample.swift
│ │ │ └── ViewAnnotationWithPointAnnotationExample.swift
│ │ ├── BasicLocationPulsingExample.swift
│ │ ├── BasicMapExample.swift
│ │ ├── BuildingExtrusionsExample.swift
│ │ ├── CameraAnimationExample.swift
│ │ ├── CameraAnimatorsExample.swift
│ │ ├── CameraForExample.swift
│ │ ├── CarPlay
│ │ │ ├── ApplicationCarPlaySceneDelegage.swift
│ │ │ ├── CarPlayMapViewController.swift
│ │ │ ├── DashboardCarPlaySceneDelegate.swift
│ │ │ └── InstrumentClusterCarPlaySceneDelegate.swift
│ │ ├── ColorExpressionExample.swift
│ │ ├── Custom2DPuckExample.swift
│ │ ├── Custom3DPuckExample.swift
│ │ ├── CustomLayerExample.swift
│ │ ├── CustomRasterSourceExample.swift
│ │ ├── DataDrivenSymbolsExample.swift
│ │ ├── DataJoinExample.swift
│ │ ├── DebugMapExample.swift
│ │ ├── DistanceExpressionExample.swift
│ │ ├── EditPolygonExample.swift
│ │ ├── ExternalVectorSourceExample.swift
│ │ ├── FeatureStateExample.swift
│ │ ├── FeaturesAtPointExample.swift
│ │ ├── GlobeFlyToExample.swift
│ │ ├── HeatmapLayerGlobeExample.swift
│ │ ├── InsetMapExample.swift
│ │ ├── Lab
│ │ │ ├── ColorThemeMapExample.swift
│ │ │ ├── CombineExample.swift
│ │ │ ├── CombineLocationExample.swift
│ │ │ ├── Lights3DExample.swift
│ │ │ ├── MapEventsExample.swift
│ │ │ ├── MapRecorderExample.swift
│ │ │ ├── ResizableImageExample.swift
│ │ │ └── ResizeMapViewExample.swift
│ │ ├── LayerPositionExample.swift
│ │ ├── LayerSlotExample.swift
│ │ ├── LiveDataExample.swift
│ │ ├── LongTapAnimationExample.swift
│ │ ├── ModelLayerExample.swift
│ │ ├── NavigationSimulator.swift
│ │ ├── NavigationSimulatorExample.swift
│ │ ├── OfflineManagerExample.storyboard
│ │ ├── OfflineManagerExample.swift
│ │ ├── OfflineRegionManagerExample.swift
│ │ ├── PitchAndDistanceExample.swift
│ │ ├── PointClusteringExample.swift
│ │ ├── RasterColorExample.swift
│ │ ├── RasterTileSourceExample.swift
│ │ ├── RuntimeSlotsExample.swift
│ │ ├── Sample Data
│ │ │ ├── 34M_17.dae
│ │ │ ├── CustomLayerExampleShaders.metal
│ │ │ ├── CustomLayerShaderTypes.h
│ │ │ ├── Fire_Hydrants.geojson
│ │ │ ├── GeoJSONSourceExample.geojson
│ │ │ ├── GradientLine.geojson
│ │ │ ├── Radar
│ │ │ │ ├── radar0.gif
│ │ │ │ ├── radar1.gif
│ │ │ │ ├── radar2.gif
│ │ │ │ ├── radar3.gif
│ │ │ │ └── radar4.gif
│ │ │ ├── annotations.json
│ │ │ ├── blueprint_style.json
│ │ │ ├── fragment-realestate-NY.json
│ │ │ ├── route.geojson
│ │ │ ├── sf_airport_route.geojson
│ │ │ └── sportcar.glb
│ │ ├── SceneKitExample.swift
│ │ ├── SkyLayerExample.swift
│ │ ├── SnapshotterCoreGraphicsExample.swift
│ │ ├── SnapshotterExample.swift
│ │ ├── SpinningGlobeExample.swift
│ │ ├── StandardStyleExample.swift
│ │ ├── StandardStyleInteractionsExample.swift
│ │ ├── TrackingModeExample.swift
│ │ ├── ViewportExample.swift
│ │ └── VoiceOverAccessibilityExample.swift
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ ├── AccentColor.colorset
│ │ │ └── Contents.json
│ │ ├── AppIcon.appiconset
│ │ │ ├── 1024x1024@1x.png
│ │ │ ├── 20x20@1x.png
│ │ │ ├── 20x20@2x-1.png
│ │ │ ├── 20x20@2x.png
│ │ │ ├── 20x20@3x.png
│ │ │ ├── 29x29@1x.png
│ │ │ ├── 29x29@2x-1.png
│ │ │ ├── 29x29@2x.png
│ │ │ ├── 29x29@3x.png
│ │ │ ├── 40x40@1x.png
│ │ │ ├── 40x40@2x-1.png
│ │ │ ├── 40x40@2x.png
│ │ │ ├── 40x40@3x.png
│ │ │ ├── 60x60@2x.png
│ │ │ ├── 60x60@3x.png
│ │ │ ├── 76x76@1x.png
│ │ │ ├── 76x76@2x.png
│ │ │ ├── 83.5x83.5@2x.png
│ │ │ └── Contents.json
│ │ ├── AppIcon.solidimagestack
│ │ │ ├── Back.solidimagestacklayer
│ │ │ │ ├── Content.imageset
│ │ │ │ │ ├── Contents.json
│ │ │ │ │ └── back.png
│ │ │ │ └── Contents.json
│ │ │ ├── Contents.json
│ │ │ ├── Front.solidimagestacklayer
│ │ │ │ ├── Content.imageset
│ │ │ │ │ ├── Contents.json
│ │ │ │ │ └── star.png
│ │ │ │ └── Contents.json
│ │ │ └── Middle.solidimagestacklayer
│ │ │ │ ├── Content.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ └── middle.png
│ │ │ │ └── Contents.json
│ │ ├── Contents.json
│ │ ├── RasterSource
│ │ │ ├── Contents.json
│ │ │ ├── wind_0.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ └── wind_0.png
│ │ │ ├── wind_1.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ └── wind_1.png
│ │ │ ├── wind_2.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ └── wind_2.png
│ │ │ └── wind_3.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ └── wind_3.png
│ │ ├── circle.imageset
│ │ │ ├── Contents.json
│ │ │ └── circle.png
│ │ ├── dash-puck.imageset
│ │ │ ├── Contents.json
│ │ │ └── dash-puck.pdf
│ │ ├── dataDrivenSymbolsExample
│ │ │ ├── Contents.json
│ │ │ ├── nps-picnic-area.imageset
│ │ │ │ ├── 16px-nps-picnic_area.png
│ │ │ │ ├── 48px-nps-picnic_area.png
│ │ │ │ ├── Contents.json
│ │ │ │ └── nps-picnic_area.png
│ │ │ ├── nps-restrooms.imageset
│ │ │ │ ├── 16px-nps-restrooms.png
│ │ │ │ ├── 48px-nps-restrooms .png
│ │ │ │ ├── Contents.json
│ │ │ │ └── nps-restrooms.png
│ │ │ └── nps-trailhead.imageset
│ │ │ │ ├── 16px-nps-trailhead.png
│ │ │ │ ├── 48x-nps-trailhead.png
│ │ │ │ ├── Contents.json
│ │ │ │ └── nps-trailhead.png
│ │ ├── dest-pin.imageset
│ │ │ ├── Contents.json
│ │ │ └── dest-pin.pdf
│ │ ├── fire-station-11.imageset
│ │ │ ├── Contents.json
│ │ │ └── fire-station-11.svg
│ │ ├── intermediate-pin.imageset
│ │ │ ├── Contents.json
│ │ │ └── intermediate-pin.pdf
│ │ ├── jpeg-image.imageset
│ │ │ ├── Contents.json
│ │ │ └── jpeg-image.jpg
│ │ ├── long_route.dataset
│ │ │ ├── Contents.json
│ │ │ └── long_route.json
│ │ ├── maneuver-straight.imageset
│ │ │ ├── Contents.json
│ │ │ └── maneuver-straight.svg
│ │ ├── maneuver-turn-right.imageset
│ │ │ ├── Contents.json
│ │ │ └── maneuver-turn-right.pdf
│ │ ├── mapbox-logo.imageset
│ │ │ ├── Contents.json
│ │ │ ├── mapbox-logo-white.pdf
│ │ │ └── mapbox-logo.pdf
│ │ ├── monochrome_lut.imageset
│ │ │ ├── Contents.json
│ │ │ └── monochrome_lut.png
│ │ ├── parking-icon.imageset
│ │ │ ├── Contents.json
│ │ │ └── parking-icon.svg
│ │ ├── route-sf-1.dataset
│ │ │ ├── Contents.json
│ │ │ └── route-sf-1.geojson
│ │ └── route-sf-2.dataset
│ │ │ ├── Contents.json
│ │ │ └── route-sf-2.geojson
│ ├── Controllers
│ │ └── ExampleTableViewController.swift
│ ├── Examples-Bridging-Header.h
│ ├── Examples_CarPlay.entitlements
│ ├── Extensions
│ │ ├── Array+Split.swift
│ │ ├── CLLocationCoordinate2D+Random.swift
│ │ ├── UIColor+Random.swift
│ │ └── UIViewController+Extensions.swift
│ ├── Info.plist
│ ├── Models
│ │ ├── Example.swift
│ │ ├── ExampleProtocol.swift
│ │ └── Examples.swift
│ ├── SwiftUI Examples
│ │ ├── AnnotationsExample.swift
│ │ ├── ClipLayerExample.swift
│ │ ├── ClusteringExample.swift
│ │ ├── ColorThemeExample.swift
│ │ ├── CustomGeometrySourceExample.swift
│ │ ├── DynamicStylingExample.swift
│ │ ├── ElevatedLineMapView.swift
│ │ ├── FeaturesQueryExample.swift
│ │ ├── GeofencingPlayground.swift
│ │ ├── GeofencingUserLocation.swift
│ │ ├── LocateMeExample.swift
│ │ ├── LocationOverrideExample.swift
│ │ ├── PrecipitationsExample.swift
│ │ ├── RasterParticleExample.swift
│ │ ├── SnapshotMapExample.swift
│ │ ├── StandardInteractiveBuildingsExample.swift
│ │ ├── StandardInteractiveFeaturesExample.swift
│ │ ├── StandardStyleImportExample.swift
│ │ ├── StandardStyleLocationsExample.swift
│ │ ├── SwiftUIRoot.swift
│ │ ├── Testing Examples
│ │ │ ├── AnnotationsOrderTestExample.swift
│ │ │ ├── AttributionDialogueExamples.swift
│ │ │ ├── InteractionsPlayground.swift
│ │ │ ├── MapScrollExample.swift
│ │ │ ├── MapSettingsExample.swift
│ │ │ ├── PuckPlayground.swift
│ │ │ ├── SimpleMapExample.swift
│ │ │ ├── StudioStyleExample.swift
│ │ │ └── ViewportPlayground.swift
│ │ ├── Util
│ │ │ ├── ButtonStyle.swift
│ │ │ ├── CalloutView.swift
│ │ │ ├── Constants.swift
│ │ │ ├── PinView.swift
│ │ │ ├── SwiftExtensions.swift
│ │ │ ├── View+OnShake.swift
│ │ │ └── ViewExtensions.swift
│ │ ├── ViewAnnotationsExample.swift
│ │ └── WeatherAnnotationExample.swift
│ ├── VisionOSMain.swift
│ └── en.lproj
│ │ └── LaunchScreen.storyboard
├── MapboxMaps
│ ├── Annotations
│ │ ├── AnnotatedFeature.swift
│ │ ├── Annotation.swift
│ │ ├── AnnotationImagesManager.swift
│ │ ├── AnnotationManagerImpl.swift
│ │ ├── AnnotationOrchestrator.swift
│ │ ├── ClusterOptions.swift
│ │ ├── Generated
│ │ │ ├── .swiftlint.yml
│ │ │ ├── CircleAnnotation.swift
│ │ │ ├── CircleAnnotationManager.swift
│ │ │ ├── PointAnnotation.swift
│ │ │ ├── PointAnnotationManager.swift
│ │ │ ├── PolygonAnnotation.swift
│ │ │ ├── PolygonAnnotationManager.swift
│ │ │ ├── PolylineAnnotation.swift
│ │ │ └── PolylineAnnotationManager.swift
│ │ ├── OffsetGeometryCalculator.swift
│ │ ├── ViewAnnotation.swift
│ │ ├── ViewAnnotationAnchorConfig.swift
│ │ ├── ViewAnnotationManager.swift
│ │ ├── ViewAnnotationOptions.swift
│ │ └── ViewAnnotationPositionsUpdateListenerImpl.swift
│ ├── Attribution
│ │ ├── AttributionMenu.swift
│ │ ├── AttributionMenuItem.swift
│ │ └── AttributionMenuSection.swift
│ ├── Camera
│ │ ├── AnimationCompletion.swift
│ │ ├── AnimationOwner.swift
│ │ ├── AnimationType.swift
│ │ ├── BasicCameraAnimator.swift
│ │ ├── BasicCameraAnimatorImpl.swift
│ │ ├── CameraAnimationsManager.swift
│ │ ├── CameraAnimationsManagerImpl.swift
│ │ ├── CameraAnimator.swift
│ │ ├── CameraAnimatorStatusObservable.swift
│ │ ├── CameraAnimatorsFactory.swift
│ │ ├── CameraAnimatorsRunner.swift
│ │ ├── CameraOptionsInterpolator.swift
│ │ ├── CameraTransition.swift
│ │ ├── CameraView.swift
│ │ ├── FlyToCameraAnimator.swift
│ │ ├── FlyToInterpolator.swift
│ │ ├── GestureDecelerationCameraAnimator.swift
│ │ └── SimpleCameraAnimator.swift
│ ├── ContentBuilders
│ │ ├── MapContent
│ │ │ ├── ForEvery.swift
│ │ │ ├── MapContent.swift
│ │ │ ├── MapContentBuilder.swift
│ │ │ ├── MapContentUniqueProperties.swift
│ │ │ ├── MapStyleReconciler.swift
│ │ │ ├── MountedAnnotationGroup.swift
│ │ │ ├── MountedFeatureState.swift
│ │ │ ├── MountedInteraction.swift
│ │ │ ├── MountedPuck.swift
│ │ │ ├── MountedViewAnnotation.swift
│ │ │ ├── PrimitiveMapContent.swift
│ │ │ ├── Puck2D.swift
│ │ │ └── Puck3D.swift
│ │ ├── MapStyleContent
│ │ │ ├── MapStyleContent.swift
│ │ │ ├── MapStyleContentAdapter.swift
│ │ │ ├── MapStyleContentBuilder.swift
│ │ │ ├── MapStyleMountedComponents.swift
│ │ │ └── MountedStyleImport.swift
│ │ └── Tree
│ │ │ ├── MapContentMountedComponent.swift
│ │ │ ├── MapContentNode.swift
│ │ │ ├── MapContentNodeContext.swift
│ │ │ └── MapContentReconciler.swift
│ ├── Documentation.docc
│ │ ├── API Catalogs
│ │ │ ├── Camera and coordinates.md
│ │ │ ├── CoreMaps.md
│ │ │ ├── CoreMapsInternal.md
│ │ │ ├── Events.md
│ │ │ ├── Expressions.md
│ │ │ ├── Featuresets and Interactions.md
│ │ │ ├── Free Camera.md
│ │ │ ├── Gestures.md
│ │ │ ├── Layer Annotations.md
│ │ │ ├── Layer Property Values.md
│ │ │ ├── Layers.md
│ │ │ ├── Location APIs.md
│ │ │ ├── Map View.md
│ │ │ ├── MapboxMap APIs.md
│ │ │ ├── Network.md
│ │ │ ├── Offline.md
│ │ │ ├── Ornaments.md
│ │ │ ├── Performance.md
│ │ │ ├── Settings and Constants.md
│ │ │ ├── Snapshotter APIs.md
│ │ │ ├── Sources.md
│ │ │ ├── Style.md
│ │ │ ├── SwiftUI.md
│ │ │ ├── TileStore APIs.md
│ │ │ ├── TurfAPI.md
│ │ │ └── View Annotations.md
│ │ ├── Articles
│ │ │ ├── Declarative Map Styling.md
│ │ │ ├── Map Content Gestures User Guide.md
│ │ │ ├── Migrate to v11.md
│ │ │ ├── SwiftUI User Guide.md
│ │ │ └── Work with visionOS.md
│ │ ├── Documentation.md
│ │ ├── Extensions
│ │ │ └── MapboxMap.md
│ │ └── Overview.md
│ ├── Foundation
│ │ ├── AlwayEqual.swift
│ │ ├── AnyCancelable+Combine.swift
│ │ ├── AnyCancelable.swift
│ │ ├── ArrayBuilder.swift
│ │ ├── AttributionURLOpener.swift
│ │ ├── CameraBounds.swift
│ │ ├── CameraBoundsOptions.swift
│ │ ├── CameraOptions.swift
│ │ ├── CameraState.swift
│ │ ├── Cancelable.swift
│ │ ├── CollectionDiff.swift
│ │ ├── CoreAliases.swift
│ │ ├── CurrentValueSignalProxy.swift
│ │ ├── CurrentValueSignalSubject.swift
│ │ ├── DateProvider.swift
│ │ ├── DelegatingMapClient.swift
│ │ ├── DictionaryCoding
│ │ │ ├── Array+CodingKey.swift
│ │ │ └── DictionaryEncoder.swift
│ │ ├── Events
│ │ │ └── EventsManager.swift
│ │ ├── Extensions
│ │ │ ├── Array+Extensions.swift
│ │ │ ├── Bool.swift
│ │ │ ├── Bundle+MapboxMaps.swift
│ │ │ ├── CodingUserInfoKey+Custom.swift
│ │ │ ├── Comparable+Clamped.swift
│ │ │ ├── Core
│ │ │ │ ├── CoordinateBounds.swift
│ │ │ │ ├── EdgeInsets.swift
│ │ │ │ ├── FeatureExtensionValue.swift
│ │ │ │ ├── FreeCameraOptions.swift
│ │ │ │ ├── GlyphsRasterizationOptions.swift
│ │ │ │ ├── ImportPosition.swift
│ │ │ │ ├── MapOptions.swift
│ │ │ │ ├── MapSnapshotOptions.swift
│ │ │ │ ├── OfflineRegion.swift
│ │ │ │ ├── OfflineRegionGeometryDefinition.swift
│ │ │ │ ├── OfflineRegionManager.swift
│ │ │ │ ├── OfflineSwitch.swift
│ │ │ │ ├── QueriedFeature.swift
│ │ │ │ ├── RenderedQueryOptions.swift
│ │ │ │ ├── ScreenBox.swift
│ │ │ │ ├── ScreenCoordinate.swift
│ │ │ │ ├── Size.swift
│ │ │ │ ├── Slot.swift
│ │ │ │ ├── TransitionOptions.swift
│ │ │ │ └── Vec2.swift
│ │ │ ├── CoreGraphics.swift
│ │ │ ├── CoreLocation.swift
│ │ │ ├── DateFormatter.swift
│ │ │ ├── Dictionary+MapKeys.swift
│ │ │ ├── Encodable+ToJSON.swift
│ │ │ ├── FloatingPoint.swift
│ │ │ ├── Image.swift
│ │ │ ├── Int.swift
│ │ │ ├── JSONObject+Extensions.swift
│ │ │ ├── KebabCaseKeyDecodingStrategy.swift
│ │ │ ├── NSNumber.swift
│ │ │ ├── NSValue.swift
│ │ │ ├── RawRepresentable.swift
│ │ │ ├── Turf
│ │ │ │ ├── Feature.swift
│ │ │ │ ├── Geometry.swift
│ │ │ │ └── Polygon.swift
│ │ │ ├── UIEdgeInsets.swift
│ │ │ ├── UIImage.swift
│ │ │ ├── UIView.swift
│ │ │ ├── UIViewController+Extensions.swift
│ │ │ └── UIWindow+ParentScene.swift
│ │ ├── ForwardingDispalyLinkTarget.swift
│ │ ├── Helpers
│ │ │ ├── CGPointCodable.swift
│ │ │ ├── CLLocationCoordinate2DCodable.swift
│ │ │ ├── MainQueueWrapper.swift
│ │ │ └── UIEdgeInsetsCodable.swift
│ │ ├── InterfaceOrientationProvider.swift
│ │ ├── Interpolators
│ │ │ ├── CoordinateInterpolator.swift
│ │ │ ├── DirectionInterpolator.swift
│ │ │ ├── DoubleInterpolator.swift
│ │ │ ├── LongitudeInterpolator.swift
│ │ │ ├── OptionalInterpolator.swift
│ │ │ ├── TimingCurve.swift
│ │ │ ├── UIEdgeInsetsInterpolator.swift
│ │ │ ├── UnitBezier.swift
│ │ │ └── WrappingInterpolator.swift
│ │ ├── Logger.swift
│ │ ├── MapFeatureQueryable.swift
│ │ ├── MapInitOptions.swift
│ │ ├── MapPlayerOptions.swift
│ │ ├── MapRecorder.swift
│ │ ├── MapRecorderOptions.swift
│ │ ├── MapView+Attribution.swift
│ │ ├── MapView+Snapshot.swift
│ │ ├── MapView.swift
│ │ ├── MapViewDependencyProvider.swift
│ │ ├── MapViewMetricsReporter.swift
│ │ ├── MapboxMap.swift
│ │ ├── MapboxMapsOptions.swift
│ │ ├── MetalView.swift
│ │ ├── ObjectWrapper.swift
│ │ ├── Optional+Extensions.swift
│ │ ├── PerformanceStatisticsOptions.swift
│ │ ├── PresentationTransactionMode.swift
│ │ ├── Projection.swift
│ │ ├── PropertiesEquality.swift
│ │ ├── Reexports.swift
│ │ ├── Ref.swift
│ │ ├── RenderedQueryGeometry.swift
│ │ ├── RetroactiveConformances
│ │ │ ├── BundleProtocol.swift
│ │ │ ├── DispatchQueueProtocol.swift
│ │ │ ├── DisplayLinkProtocol.swift
│ │ │ ├── NotificationCenterProtocol.swift
│ │ │ ├── TimerProtocol.swift
│ │ │ ├── UIApplicationProtocol.swift
│ │ │ └── UIDeviceProtocol.swift
│ │ ├── ScreenShim.swift
│ │ ├── Signal
│ │ │ ├── ClosureHandlersStore.swift
│ │ │ ├── Signal+Combine.swift
│ │ │ ├── Signal+Tracing.swift
│ │ │ ├── Signal.swift
│ │ │ ├── SignalObservingAdapter.swift
│ │ │ └── SignalSubject.swift
│ │ ├── SizeTrackingLayer.swift
│ │ ├── TelemetryCounter.swift
│ │ ├── TileCoverOptions.swift
│ │ ├── Tracing.swift
│ │ ├── Utils.swift
│ │ ├── Utils
│ │ │ ├── BidirectionalMap.swift
│ │ │ ├── CameraDebugView.swift
│ │ │ ├── MapViewDebugOptions.swift
│ │ │ └── Once.swift
│ │ ├── ValueAnimator.swift
│ │ ├── ViewAnnotationsContainer.swift
│ │ └── WeakSet.swift
│ ├── Gestures
│ │ ├── GestureHandlers
│ │ │ ├── AnyTouchGestureHandler.swift
│ │ │ ├── DoubleTapToZoomInGestureHandler.swift
│ │ │ ├── DoubleTouchToZoomOutGestureHandler.swift
│ │ │ ├── FocusableGestureHandlerProtocol.swift
│ │ │ ├── GestureHandler.swift
│ │ │ ├── InterruptDecelerationGestureHandler.swift
│ │ │ ├── LongPressGestureHandler.swift
│ │ │ ├── PanGestureHandler.swift
│ │ │ ├── PinchGestureHandler.swift
│ │ │ ├── PitchGestureHandler.swift
│ │ │ ├── QuickZoomGestureHandler.swift
│ │ │ ├── RotateGestureHandler.swift
│ │ │ ├── SingleTapGestureHandler.swift
│ │ │ └── UIGestureRecognizer+Extensions.swift
│ │ ├── GestureManager.swift
│ │ ├── GestureOptions.swift
│ │ ├── GestureRecognizers
│ │ │ └── TouchBeganGestureRecognizer.swift
│ │ ├── GestureType.swift
│ │ └── MapContentGestureContext.swift
│ ├── Info.plist
│ ├── Interactions
│ │ ├── CoreInteraction.swift
│ │ ├── FeatureState.swift
│ │ ├── FeaturesetDescriptor.swift
│ │ ├── FeaturesetFeature.swift
│ │ ├── FeaturesetFeatureId.swift
│ │ └── Interactions.swift
│ ├── Location
│ │ ├── AppleLocationProvider.swift
│ │ ├── CLLocationManagerDelegateProxy.swift
│ │ ├── CLLocationManagerProtocol.swift
│ │ ├── Heading.swift
│ │ ├── HeadingInterpolator.swift
│ │ ├── HeadingProvider.swift
│ │ ├── Location.swift
│ │ ├── LocationInterpolator.swift
│ │ ├── LocationManager.swift
│ │ ├── LocationOptions.swift
│ │ ├── LocationPermissionsDelegate.swift
│ │ ├── ModelAdapters.swift
│ │ └── Puck
│ │ │ ├── IndicatorAssets.xcassets
│ │ │ ├── Contents.json
│ │ │ ├── location-dot-inner.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ └── location-dot-inner.pdf
│ │ │ └── location-dot-outer.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ └── location-dot-outer.pdf
│ │ │ ├── Puck2DRenderer.swift
│ │ │ ├── Puck3DRenderer.swift
│ │ │ ├── PuckManager.swift
│ │ │ ├── PuckRenderer.swift
│ │ │ ├── PuckRendererState.swift
│ │ │ ├── PuckRenderingData.swift
│ │ │ └── PuckType.swift
│ ├── MapEvents
│ │ ├── CoreEventsExtensions.swift
│ │ ├── MapEvents+Deprecated.swift
│ │ └── MapEvents.swift
│ ├── MapboxMaps.h
│ ├── MapboxMaps.json
│ ├── Offline
│ │ ├── ClearCacheError.swift
│ │ ├── OfflineCallbacks.swift
│ │ ├── OfflineErrors.swift
│ │ ├── OfflineManager+MapboxMaps.swift
│ │ ├── StylePackLoadOptions+MapboxMaps.swift
│ │ ├── TileRegionLoadOptions+MapboxMaps.swift
│ │ ├── TileStore+MapboxMaps.swift
│ │ ├── TileStoreObserver.swift
│ │ ├── TileStoreObserverCancelable.swift
│ │ ├── TileStoreObserverWrapper.swift
│ │ └── TilesetDescriptorOptions+MapboxMaps.swift
│ ├── Ornaments
│ │ ├── Compass
│ │ │ ├── CompassDirectionFormatter.swift
│ │ │ ├── MapboxCompassOrnamentView.swift
│ │ │ ├── ar.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── bg.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── ca.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── cs.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── da.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── de.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── en.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── es.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── fr.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── gl.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── he.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── it.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── ja.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── ko.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── lt.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── nb.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── nl.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── pl.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── pt-BR.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── ru.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── sv.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── uk.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── vi.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ ├── zh-Hans.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ │ └── zh-Hant.lproj
│ │ │ │ ├── CompassDirectionLong.strings
│ │ │ │ └── CompassDirectionShort.strings
│ │ ├── DistanceFormatter.swift
│ │ ├── InfoButtonOrnament.swift
│ │ ├── LogoView.swift
│ │ ├── OrnamentOptions.swift
│ │ ├── OrnamentsManager.swift
│ │ ├── PaddingDebugView.swift
│ │ ├── ScaleBar
│ │ │ ├── MapboxScaleBarConstants.swift
│ │ │ ├── MapboxScaleBarLabel.swift
│ │ │ └── MapboxScaleBarOrnamentView.swift
│ │ ├── ar.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── be.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── bg.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── ca.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── cs.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── da.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── de.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── en.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── es.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── fr.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── gl.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── he.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── it.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── ja.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── ko.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── lt.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── nb.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── nl.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── pl.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── pt-BR.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── ru.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── sv.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── uk.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── vi.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ ├── zh-Hans.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ │ └── zh-Hant.lproj
│ │ │ └── OrnamentsLocalizable.strings
│ ├── PrivacyInfo.xcprivacy
│ ├── Snapshot
│ │ ├── AttributionMeasure.swift
│ │ ├── AttributionView.swift
│ │ ├── SnapshotOverlay.swift
│ │ └── Snapshotter.swift
│ ├── Style
│ │ ├── Attribution.swift
│ │ ├── AttributionDialogManager.swift
│ │ ├── ColorTheme.swift
│ │ ├── CustomLayer.swift
│ │ ├── CustomSources
│ │ │ ├── CustomGeometrySource.swift
│ │ │ ├── CustomRasterSource.swift
│ │ │ └── CustomRasterSourceTileData+Extensions.swift
│ │ ├── EmptyCustomRenderer.swift
│ │ ├── Generated
│ │ │ ├── Atmosphere.swift
│ │ │ ├── Expressions
│ │ │ │ └── AllExpressions.swift
│ │ │ ├── Layers
│ │ │ │ ├── BackgroundLayer.swift
│ │ │ │ ├── CircleLayer.swift
│ │ │ │ ├── ClipLayer.swift
│ │ │ │ ├── FillExtrusionLayer.swift
│ │ │ │ ├── FillLayer.swift
│ │ │ │ ├── HeatmapLayer.swift
│ │ │ │ ├── HillshadeLayer.swift
│ │ │ │ ├── LineLayer.swift
│ │ │ │ ├── LocationIndicatorLayer.swift
│ │ │ │ ├── ModelLayer.swift
│ │ │ │ ├── RasterLayer.swift
│ │ │ │ ├── RasterParticleLayer.swift
│ │ │ │ ├── SkyLayer.swift
│ │ │ │ ├── SlotLayer.swift
│ │ │ │ └── SymbolLayer.swift
│ │ │ ├── Light
│ │ │ │ ├── AmbientLight.swift
│ │ │ │ ├── DirectionalLight.swift
│ │ │ │ └── FlatLight.swift
│ │ │ ├── MapStyle+Standard.swift
│ │ │ ├── MapStyle+StandardSatellite.swift
│ │ │ ├── Properties
│ │ │ │ └── Properties.swift
│ │ │ ├── Rain.swift
│ │ │ ├── Snow.swift
│ │ │ ├── SourceWrapper.swift
│ │ │ ├── Sources
│ │ │ │ ├── GeoJSONSource.swift
│ │ │ │ ├── ImageSource.swift
│ │ │ │ ├── RasterArraySource.swift
│ │ │ │ ├── RasterDemSource.swift
│ │ │ │ ├── RasterSource.swift
│ │ │ │ ├── SourceProperties.swift
│ │ │ │ └── VectorSource.swift
│ │ │ ├── StandardBuildingsFeature.swift
│ │ │ ├── StandardPlaceLabelsFeature.swift
│ │ │ ├── StandardPoiFeature.swift
│ │ │ └── Terrain.swift
│ │ ├── Layer.swift
│ │ ├── LayerAtPosition.swift
│ │ ├── LayerInfo.swift
│ │ ├── LayerType.swift
│ │ ├── LightInfo.swift
│ │ ├── LightType.swift
│ │ ├── MapStyle.swift
│ │ ├── ModelSource.swift
│ │ ├── RasterArraySource+DataLayer.swift
│ │ ├── Source.swift
│ │ ├── SourceInfo.swift
│ │ ├── SourceType.swift
│ │ ├── Style+Deprecation.swift
│ │ ├── Style+Localization.swift
│ │ ├── StyleEncodable.swift
│ │ ├── StyleErrors.swift
│ │ ├── StyleImport.swift
│ │ ├── StyleManager.swift
│ │ ├── StyleManagerProtocol.swift
│ │ ├── StyleProjection.swift
│ │ ├── StyleSourceManager.swift
│ │ ├── StyleURI.swift
│ │ └── Types
│ │ │ ├── Expression.swift
│ │ │ ├── ExpressionArgumentBuilder.swift
│ │ │ ├── ExpressionOptions.swift
│ │ │ ├── GeoJSONSourceData.swift
│ │ │ ├── PromoteId.swift
│ │ │ ├── ResolvedImage.swift
│ │ │ ├── StyleColor.swift
│ │ │ ├── StyleImage.swift
│ │ │ ├── TileCacheBudgetSize.swift
│ │ │ └── Value.swift
│ ├── SwiftUI
│ │ ├── Annotations
│ │ │ ├── AnnotationClusterGestureContext.swift
│ │ │ ├── AnnotationGroup+Deprecated.swift
│ │ │ ├── Generated
│ │ │ │ ├── CircleAnnotationGroup.swift
│ │ │ │ ├── PointAnnotationGroup.swift
│ │ │ │ ├── PolygonAnnotationGroup.swift
│ │ │ │ └── PolylineAnnotationGroup.swift
│ │ │ └── MapViewAnnotation.swift
│ │ ├── Deps.swift
│ │ ├── Map+Events.swift
│ │ ├── Map+Gestures.swift
│ │ ├── Map+URLOpener.swift
│ │ ├── Map.swift
│ │ ├── MapBasicCoordinator.swift
│ │ ├── MapOrnaments.swift
│ │ ├── MapProxy.swift
│ │ ├── MapReader.swift
│ │ ├── MapViewFacade.swift
│ │ ├── README.md
│ │ ├── Util
│ │ │ ├── Signal+Extensions.swift
│ │ │ ├── SwiftUIEdgeInsets.swift
│ │ │ ├── Util.swift
│ │ │ └── View+OnSizeChange.swift
│ │ └── Viewport
│ │ │ ├── Viewport.swift
│ │ │ └── ViewportAnimation.swift
│ └── Viewport
│ │ ├── States
│ │ ├── CameraViewportState.swift
│ │ ├── FollowPuck
│ │ │ ├── FollowPuckViewportState.swift
│ │ │ ├── FollowPuckViewportStateBearing.swift
│ │ │ └── FollowPuckViewportStateOptions.swift
│ │ └── Overview
│ │ │ ├── OverviewViewportState.swift
│ │ │ └── OverviewViewportStateOptions.swift
│ │ ├── Transitions
│ │ ├── Default
│ │ │ ├── CameraOptionsComponent.swift
│ │ │ ├── DefaultViewportTransition.swift
│ │ │ ├── DefaultViewportTransitionAnimation.swift
│ │ │ ├── DefaultViewportTransitionAnimationFactory.swift
│ │ │ ├── DefaultViewportTransitionAnimationHelper.swift
│ │ │ ├── DefaultViewportTransitionAnimationSpec.swift
│ │ │ ├── DefaultViewportTransitionAnimationSpecProvider.swift
│ │ │ ├── DefaultViewportTransitionOptions.swift
│ │ │ ├── HighZoomToLowZoomAnimationSpecProvider.swift
│ │ │ └── LowZoomToHighZoomAnimationSpecProvider.swift
│ │ └── Immediate
│ │ │ └── ImmediateViewportTransition.swift
│ │ ├── ViewportManager.swift
│ │ ├── ViewportManagerImpl.swift
│ │ ├── ViewportOptions.swift
│ │ ├── ViewportState.swift
│ │ ├── ViewportStatus.swift
│ │ ├── ViewportStatusObserver.swift
│ │ └── ViewportTransition.swift
└── MapboxTestHost
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AccentColor.colorset
│ │ └── Contents.json
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── icon-40.png
│ │ ├── icon-40@2x.png
│ │ ├── icon-40@3x.png
│ │ ├── icon-60@2x.png
│ │ ├── icon-60@3x.png
│ │ ├── icon-72.png
│ │ ├── icon-72@2x.png
│ │ ├── icon-76.png
│ │ ├── icon-76@2x.png
│ │ ├── icon-83.5@2x.png
│ │ ├── icon-small-50.png
│ │ ├── icon-small-50@2x.png
│ │ ├── icon-small.png
│ │ ├── icon-small@2x.png
│ │ ├── icon-small@3x.png
│ │ ├── icon.png
│ │ ├── icon@2x.png
│ │ ├── ios-marketing.png
│ │ ├── notification-icon@2x.png
│ │ ├── notification-icon@3x.png
│ │ ├── notification-icon~ipad.png
│ │ └── notification-icon~ipad@2x.png
│ └── Contents.json
│ ├── Info.plist
│ └── Main.storyboard
├── Tests
├── .swiftlint.yml
├── ExamplesTests
│ ├── ExamplesTests.swift
│ └── TestableExampleTests.swift
├── ExamplesUITests
│ └── ExamplesUITests.swift
├── GestureTests
│ ├── AsyncHelpers.swift
│ ├── Double Taps and Touch
│ │ ├── DoubleTapGesture.test.swift
│ │ └── DoubleTouchGesture.test.swift
│ ├── GestureTests.test.swift
│ ├── Pinch
│ │ ├── ZoomInPinchGesture.test.swift
│ │ ├── ZoomOutPinchGesture.test.swift
│ │ └── ZoomPinchGesture.test.swift
│ ├── PitchGesture.test.swift
│ ├── RotateGesture.test.swift
│ └── SingleTapGesture.test.swift
├── MapboxMapsTests
│ ├── Annotations
│ │ ├── AnnotationImagesManagerTests.swift
│ │ ├── AnnotationManagerImplTests.swift
│ │ ├── AnnotationManagerTestingHarness.swift
│ │ ├── DelegatingViewAnnotationPositionsUpdateListenerTests.swift
│ │ ├── Generated
│ │ │ ├── .swiftlint.yml
│ │ │ ├── CircleAnnotationIntegrationTests.swift
│ │ │ ├── CircleAnnotationManagerTests.swift
│ │ │ ├── CircleAnnotationTests.swift
│ │ │ ├── PointAnnotationIntegrationTests.swift
│ │ │ ├── PointAnnotationManagerTests.swift
│ │ │ ├── PointAnnotationTests.swift
│ │ │ ├── PolygonAnnotationIntegrationTests.swift
│ │ │ ├── PolygonAnnotationManagerTests.swift
│ │ │ ├── PolygonAnnotationTests.swift
│ │ │ ├── PolylineAnnotationIntegrationTests.swift
│ │ │ ├── PolylineAnnotationManagerTests.swift
│ │ │ └── PolylineAnnotationTests.swift
│ │ ├── Mocks
│ │ │ ├── MockAnnotationManager.swift
│ │ │ └── ViewAnnotationUpdateObserver.swift
│ │ ├── ViewAnnotationManagerTests.swift
│ │ ├── ViewAnnotationOptionsTests.swift
│ │ ├── ViewAnnotationPositionDescriptor.swift
│ │ └── ViewAnntoationTests.swift
│ ├── Camera
│ │ ├── AnimationOwnerTests.swift
│ │ ├── BasicCameraAnimatorImplIntegrationTests.swift
│ │ ├── BasicCameraAnimatorImplTests.swift
│ │ ├── BasicCameraAnimatorTests.swift
│ │ ├── CameraAnimationsManagerImplTests.swift
│ │ ├── CameraAnimationsManagerTests.swift
│ │ ├── CameraAnimatorsRunnerTests.swift
│ │ ├── CameraOptionsInterpolatorTests.swift
│ │ ├── CameraTransitionTests.swift
│ │ ├── CameraViewTests.swift
│ │ ├── FlyToCameraAnimatorTests.swift
│ │ ├── FlyToTests.swift
│ │ ├── GestureDecelerationCameraAnimatorTests.swift
│ │ ├── Mocks
│ │ │ ├── MockBasicCameraAnimator.swift
│ │ │ ├── MockCameraAnimationsManager.swift
│ │ │ ├── MockCameraAnimatorsFactory.swift
│ │ │ ├── MockCameraAnimatorsRunner.swift
│ │ │ ├── MockCameraOptionsInterpolator.swift
│ │ │ ├── MockCameraView.swift
│ │ │ ├── MockLocationChangeHandler.swift
│ │ │ ├── MockPropertyAnimator.swift
│ │ │ ├── MockSimpleCameraAnimator.swift
│ │ │ └── MockTimingCurveProvider.swift
│ │ ├── Random
│ │ │ └── AnimationOwner+Random.swift
│ │ └── SimpleCameraAnimatorTests.swift
│ ├── Foundation
│ │ ├── AnyCancelableTests.swift
│ │ ├── Assets.xcassets
│ │ │ ├── Contents.json
│ │ │ ├── green-star.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ └── green-star.pdf
│ │ │ └── mapbox-icon.imageset
│ │ │ │ ├── 76x76@2x.png
│ │ │ │ └── Contents.json
│ │ ├── AttributionURLOpenerTests.swift
│ │ ├── CameraOptionsTests.swift
│ │ ├── CameraStateTests.swift
│ │ ├── CancelableTests.swift
│ │ ├── CollectionDiffTests.swift
│ │ ├── CurrentValueSignalProxyTests.swift
│ │ ├── CurrentValueSignalSugjectTests.swift
│ │ ├── DelegatingMapClientTests.swift
│ │ ├── DictionaryEncoderTests.swift
│ │ ├── Events
│ │ │ ├── EventsManagerTests.swift
│ │ │ └── Mocks
│ │ │ │ └── EventsManagerMock.swift
│ │ ├── Extensions
│ │ │ ├── Array+ExtensionsTests.swift
│ │ │ ├── Comparable+ClampedTests.swift
│ │ │ ├── Core
│ │ │ │ ├── FeatureExtensionValueTests.swift
│ │ │ │ ├── GlyphsRasterizationOptionsTests.swift
│ │ │ │ ├── LayerPositionTests.swift
│ │ │ │ ├── OfflineRegionGeometryDefinitionTests.swift
│ │ │ │ ├── RenderedQueryOptionsTests.swift
│ │ │ │ ├── ScreenBoxTests.swift
│ │ │ │ ├── SizeTests.swift
│ │ │ │ └── TransitionOptionsTests.swift
│ │ │ ├── CoreGraphicsTests.swift
│ │ │ ├── Encodable+ToJSONTests.swift
│ │ │ ├── FloatingPointTests.swift
│ │ │ ├── KebabCaseKeyDecodingStrategyTests.swift
│ │ │ ├── Turf
│ │ │ │ ├── FeatureTests.swift
│ │ │ │ └── GeometryTests.swift
│ │ │ ├── UIEdgeInsetsTests.swift
│ │ │ ├── UIViewController+ExtensionsTests.swift
│ │ │ └── UIWindow+ParentSceneTests.swift
│ │ ├── FeaturesetsTests.swift
│ │ ├── Fixtures
│ │ │ ├── CameraOptions+Fixtures.swift
│ │ │ └── CameraState+Fixtures.swift
│ │ ├── Helpers
│ │ │ ├── CAAnimationDelegateProxy.swift
│ │ │ ├── CGPointCodable.test.swift
│ │ │ ├── CLLocationCoordinate2DCodable.test.swift
│ │ │ └── UIEdgeInsetsCodable.test.swift
│ │ ├── InteractionsTests.swift
│ │ ├── InterfaceOrientationProviderTests.swift
│ │ ├── Interpolators
│ │ │ ├── AnimationCurveTests.swift
│ │ │ ├── CoordinateInterpolatorTests.swift
│ │ │ ├── DirectionInterpolatorTests.swift
│ │ │ ├── DoubleInterpolatorTests.swift
│ │ │ ├── LongitudeInterpolatorTests.swift
│ │ │ ├── Mocks
│ │ │ │ ├── MockCoordinateInterpolator.swift
│ │ │ │ ├── MockDirectionInterpolator.swift
│ │ │ │ ├── MockDoubleInterpolator.swift
│ │ │ │ ├── MockLongitudeInterpolator.swift
│ │ │ │ └── MockUIEdgeInsetsInterpolator.swift
│ │ │ ├── OptionalInterpolatorTests.swift
│ │ │ ├── Random
│ │ │ │ └── TimingCurve+Fixtures.swift
│ │ │ ├── UIEdgeInsetsInterpolatorTests.swift
│ │ │ ├── UnitBezierTests.swift
│ │ │ └── WrappingInterpolatorTests.swift
│ │ ├── MapInitOptionsTests.swift
│ │ ├── MapPresentationTests.swift
│ │ ├── MapViewSubclassingTests.swift
│ │ ├── MapViewTests.swift
│ │ ├── MapboxMapTests.swift
│ │ ├── MapboxMapsFoundationTests.swift
│ │ ├── Mocks
│ │ │ ├── MockAnnotationImagesManager.swift
│ │ │ ├── MockAttributionURLOpener.swift
│ │ │ ├── MockBundle.swift
│ │ │ ├── MockCameraAnimator.swift
│ │ │ ├── MockCancelable.swift
│ │ │ ├── MockDateProvider.swift
│ │ │ ├── MockDelegatingMapClientDelegate.swift
│ │ │ ├── MockDisplayLink.swift
│ │ │ ├── MockMapClient.swift
│ │ │ ├── MockMapFeatureQueryable.swift
│ │ │ ├── MockMapViewDependencyProvider.swift
│ │ │ ├── MockMapboxMap.swift
│ │ │ ├── MockMetalView.swift
│ │ │ ├── MockNotificationCenter.swift
│ │ │ ├── MockStyleManager.swift
│ │ │ ├── MockStyleSourceManager.swift
│ │ │ ├── MockTimeProvider.swift
│ │ │ ├── MockTimer.swift
│ │ │ ├── MockUIApplication.swift
│ │ │ ├── MockUIDevice.swift
│ │ │ └── MockWrappingInterpolator.swift
│ │ ├── MutableRefTests.swift
│ │ ├── OptionalExtensionsTests.swift
│ │ ├── ProjectionTests.swift
│ │ ├── PropertiesEqualityTests.swift
│ │ ├── RefTests.swift
│ │ ├── SignalSubjectTests.swift
│ │ ├── SignalTests.swift
│ │ ├── SizeTrackingLayerTests.swift
│ │ ├── Style
│ │ │ ├── MapStyleReconcilerTests.swift
│ │ │ ├── StyleSourceManagerTests.swift
│ │ │ └── StyleTests.swift
│ │ ├── Tracing.test.swift
│ │ ├── UtilsTests.swift
│ │ ├── ValueAnimatorTests.swift
│ │ └── ViewAnnotationsContainerTests.swift
│ ├── Gestures
│ │ ├── GestureHandlers
│ │ │ ├── AnyTouchGestureHandlerTests.swift
│ │ │ ├── DoubleTapToZoomInGestureHandlerTests.swift
│ │ │ ├── DoubleTouchToZoomOutGestureHandlerTests.swift
│ │ │ ├── GestureTestsUtils.swift
│ │ │ ├── InterruptDecelerationGestureHandlerTests.swift
│ │ │ ├── Mocks
│ │ │ │ ├── MockFocusableGestureHandler.swift
│ │ │ │ ├── MockGestureHandlerDelegate.swift
│ │ │ │ ├── MockLongPressGestureRecognizer.swift
│ │ │ │ ├── MockPanGestureHandler.swift
│ │ │ │ ├── MockPanGestureRecognizer.swift
│ │ │ │ ├── MockPinchGestureHandler.swift
│ │ │ │ ├── MockPinchGestureRecognizer.swift
│ │ │ │ ├── MockRotateGestureHandler.swift
│ │ │ │ ├── MockRotationGestureRecognizer.swift
│ │ │ │ └── MockTapGestureRecognizer.swift
│ │ │ ├── PanGestureHandlerTests.swift
│ │ │ ├── PinchGestureHandlerTests.swift
│ │ │ ├── PitchGestureHandlerTests.swift
│ │ │ ├── QuickZoomGestureHandlerTests.swift
│ │ │ ├── RotateGestureHandlerTests.swift
│ │ │ └── SingleTapGestureHandlerTests.swift
│ │ ├── GestureManagerTests.swift
│ │ ├── GestureOptionsTests.swift
│ │ ├── GestureRecognizers
│ │ │ └── TouchBeganGestureRecognizerTests.swift
│ │ ├── MapContentGestureContext+Tests.swift
│ │ ├── Mocks
│ │ │ ├── MockGestureManagerDelegate.swift
│ │ │ └── MockGestureRecognizer.swift
│ │ └── UIGestureRecognizerDelegate+Tests.swift
│ ├── Helpers
│ │ ├── Bundle+MapboxMapsTests.swift
│ │ ├── Encodable+JsonString.swift
│ │ ├── MapStyle+Tests.swift
│ │ ├── MockError.swift
│ │ ├── Random
│ │ │ ├── Array+Fixtures.swift
│ │ │ ├── CGPoint+Fixtures.swift
│ │ │ ├── CLLocationCoordinate2D+Fixtures.swift
│ │ │ ├── Character+Fixtures.swift
│ │ │ ├── String+Fixtures.swift
│ │ │ └── UIColor+Fixtures.swift
│ │ ├── String+FileSystemSafe.swift
│ │ ├── Stub.swift
│ │ ├── StubProtocol.swift
│ │ ├── Stubbed.swift
│ │ ├── TestSignal.swift
│ │ ├── UIApplication+Tests.swift
│ │ ├── UIImage+Empty.swift
│ │ ├── UIImage+Init.swift
│ │ ├── XCTestCase+GuardForMetalDevice.swift
│ │ ├── XCTestCase+ImageComparison.swift
│ │ ├── XCTestCase+ResetStubs.swift
│ │ └── XCTestCase+TemporaryCacheDirectory.swift
│ ├── Integration Tests
│ │ ├── ExampleIntegrationTest.swift
│ │ ├── FeatureQueryingTest.swift
│ │ ├── FeatureStateIntegrationTests.swift
│ │ ├── IntegrationTestCase.swift
│ │ ├── MSAAIntegrationTests.swift
│ │ ├── Map
│ │ │ ├── DidIdleFailureIntegrationTest.swift
│ │ │ ├── MapInitOptionsIntegrationTests.swift
│ │ │ ├── MapViewIntegrationTests.swift
│ │ │ ├── MapViewRenderedSnapshotIntegrationTests.swift
│ │ │ ├── MapboxMapIntegrationTests.swift
│ │ │ └── ObservableIntegrationTests.swift
│ │ ├── MapRecorderIntegrationTests.swift
│ │ ├── MapViewIntegrationTestCase.swift
│ │ ├── OfflineManagerIntegrationTests.swift
│ │ ├── Style
│ │ │ ├── GeoJSONUpdateIntegrationTests.swift
│ │ │ ├── RasterArraySourceQueryTests.swift
│ │ │ ├── StyleDSLIntegrationTests.swift
│ │ │ └── StyleLoadIntegrationTests.swift
│ │ ├── StyleImportIntegrationTests.swift
│ │ └── TileCoverIntegrationTests.swift
│ ├── Location
│ │ ├── AppleLocationProviderTests.swift
│ │ ├── Fixtures
│ │ │ └── Location+Fixtures.swift
│ │ ├── LocationInterpolatorTests.swift
│ │ ├── LocationManagerTests.swift
│ │ ├── LocationOptionsTests.swift
│ │ ├── LocationTests.swift
│ │ ├── Mocks
│ │ │ ├── MockCLLocationManager.swift
│ │ │ ├── MockHeading.swift
│ │ │ ├── MockLocationInterpolator.swift
│ │ │ ├── MockLocationManagerDelegate.swift
│ │ │ └── MockLocationProducerDelegate.swift
│ │ └── Puck
│ │ │ ├── Mocks
│ │ │ └── MockPuck.swift
│ │ │ ├── Puck2DRendererTests.swift
│ │ │ ├── Puck3DRendererTests.swift
│ │ │ ├── PuckManagerTests.swift
│ │ │ └── PuckTypeTests.swift
│ ├── MigrationGuide
│ │ ├── Fixtures
│ │ │ └── polygon.geojson
│ │ ├── MigrationGuideIntegrationTests.swift
│ │ └── OfflineGuideIntegrationTests.swift
│ ├── Offline
│ │ ├── Mocks
│ │ │ ├── MockMapboxCommonTileStoreObserver.swift
│ │ │ ├── MockTileStore.swift
│ │ │ └── MockTileStoreObserver.swift
│ │ ├── StylePackLoadOptions_MapboxMapTests.swift
│ │ ├── TileRegionEstimateOptions_MapboxMapTests.swift
│ │ ├── TileRegionLoadOptions+MapboxMapsTests.swift
│ │ ├── TileStoreObserverCancelableTests.swift
│ │ └── TileStoreObserverWrapperTests.swift
│ ├── Ornaments
│ │ ├── CameraDebugViewTests.swift
│ │ ├── Compass
│ │ │ ├── CompassDirectionFormatterTests.swift
│ │ │ └── MapboxCompassOrnamentViewTests.swift
│ │ ├── DistanceFormatterTests.swift
│ │ ├── InfoButton
│ │ │ └── InfoButtonOrnamentTests.swift
│ │ ├── Mocks
│ │ │ └── MockInfoButtonOrnamentDelegate.swift
│ │ ├── OrnamentManagerTests.swift
│ │ └── ScaleBar
│ │ │ └── MapboxScaleBarOrnamentViewTests.swift
│ ├── Resources
│ │ ├── MapInitOptionsTests.xib
│ │ └── empty-style-chicago.json
│ ├── Snapshot
│ │ ├── MapboxMapsSnapshotTests.swift
│ │ ├── Mocks
│ │ │ └── MockMapSnapshotter.swift
│ │ ├── SnapshotterTests.swift
│ │ ├── testDoesNotShowAttribution().png
│ │ ├── testDoesNotShowLogo().png
│ │ ├── testDoesNotShowLogoAndAttribution().png
│ │ ├── testShowsLogoAndAttribution().png
│ │ ├── testSnapshotAttribution-100.png
│ │ ├── testSnapshotAttribution-150.png
│ │ ├── testSnapshotAttribution-200.png
│ │ ├── testSnapshotAttribution-250.png
│ │ ├── testSnapshotAttribution-300.png
│ │ ├── testSnapshotAttribution-50.png
│ │ ├── testSnapshotLogoVisibility.png
│ │ └── testSnapshotOverlay.png
│ ├── Style
│ │ ├── AttributionDialogTests.swift
│ │ ├── AttributionTests.swift
│ │ ├── CustomLayer.test.swift
│ │ ├── CustomSourcesIntegrationTests.swift
│ │ ├── CustomSourcesTests.swift
│ │ ├── DSL
│ │ │ ├── DynamicStylingTests.swift
│ │ │ ├── MapContent+Fixture.swift
│ │ │ ├── MapContentNodeContextTests.swift
│ │ │ └── MapStyleContentReconcilerTests.swift
│ │ ├── ExpressionTests
│ │ │ ├── ExpressionBuilderTests.swift
│ │ │ ├── ExpressionTests.swift
│ │ │ └── FormatOptionsTests.swift
│ │ ├── Fixtures
│ │ │ ├── Fixtures.swift
│ │ │ ├── LayerType+Fixtures.swift
│ │ │ ├── SourceProperties+Fixtures.swift
│ │ │ ├── SourceType+Fixtures.swift
│ │ │ └── Value+Fixtures.swift
│ │ ├── Generated
│ │ │ ├── IntegrationTests
│ │ │ │ ├── Layers
│ │ │ │ │ ├── BackgroundLayerIntegrationTests.swift
│ │ │ │ │ ├── CircleLayerIntegrationTests.swift
│ │ │ │ │ ├── ClipLayerIntegrationTests.swift
│ │ │ │ │ ├── FillExtrusionLayerIntegrationTests.swift
│ │ │ │ │ ├── FillLayerIntegrationTests.swift
│ │ │ │ │ ├── HeatmapLayerIntegrationTests.swift
│ │ │ │ │ ├── HillshadeLayerIntegrationTests.swift
│ │ │ │ │ ├── LineLayerIntegrationTests.swift
│ │ │ │ │ ├── LocationIndicatorLayerIntegrationTests.swift
│ │ │ │ │ ├── ModelLayerIntegrationTests.swift
│ │ │ │ │ ├── RasterLayerIntegrationTests.swift
│ │ │ │ │ ├── RasterParticleLayerIntegrationTests.swift
│ │ │ │ │ ├── SkyLayerIntegrationTests.swift
│ │ │ │ │ ├── SlotLayerIntegrationTests.swift
│ │ │ │ │ └── SymbolLayerIntegrationTests.swift
│ │ │ │ ├── RainIntegrationTests.swift
│ │ │ │ ├── SnowIntegrationTests.swift
│ │ │ │ └── Sources
│ │ │ │ │ ├── GeoJSONSourceIntegrationTests.swift
│ │ │ │ │ ├── ImageSourceIntegrationTests.swift
│ │ │ │ │ ├── RasterArraySourceIntegrationTests.swift
│ │ │ │ │ ├── RasterDemSourceIntegrationTests.swift
│ │ │ │ │ ├── RasterSourceIntegrationTests.swift
│ │ │ │ │ └── VectorSourceIntegrationTests.swift
│ │ │ ├── Layers
│ │ │ │ ├── BackgroundLayerTests.swift
│ │ │ │ ├── CircleLayerTests.swift
│ │ │ │ ├── ClipLayerTests.swift
│ │ │ │ ├── FillExtrusionLayerTests.swift
│ │ │ │ ├── FillLayerTests.swift
│ │ │ │ ├── HeatmapLayerTests.swift
│ │ │ │ ├── HillshadeLayerTests.swift
│ │ │ │ ├── LineLayerTests.swift
│ │ │ │ ├── LocationIndicatorLayerTests.swift
│ │ │ │ ├── ModelLayerTests.swift
│ │ │ │ ├── RasterLayerTests.swift
│ │ │ │ ├── RasterParticleLayerTests.swift
│ │ │ │ ├── SkyLayerTests.swift
│ │ │ │ ├── SlotLayerTests.swift
│ │ │ │ └── SymbolLayerTests.swift
│ │ │ ├── Light
│ │ │ │ ├── AmbientLightTests.swift
│ │ │ │ ├── DirectionalLightTests.swift
│ │ │ │ └── FlatLightTests.swift
│ │ │ ├── Properties
│ │ │ │ └── PropertiesTests.swift
│ │ │ ├── RainTests.swift
│ │ │ ├── SnowTests.swift
│ │ │ └── Sources
│ │ │ │ ├── GeoJSONSourceTests.swift
│ │ │ │ ├── ImageSourceTests.swift
│ │ │ │ ├── RasterArraySourceTests.swift
│ │ │ │ ├── RasterDemSourceTests.swift
│ │ │ │ ├── RasterSourceTests.swift
│ │ │ │ └── VectorSourceTests.swift
│ │ ├── GeoJSONSourceDataTests.swift
│ │ ├── ImageTests.swift
│ │ ├── LayerInfoTests.swift
│ │ ├── MapStyleTests.swift
│ │ ├── Mocks
│ │ │ ├── MockAttributionDataSource.swift
│ │ │ ├── MockAttributionDialogManagerDelegate.swift
│ │ │ ├── MockCustomRenderer.swift
│ │ │ └── MockStyle.swift
│ │ ├── PromoteIdTests.swift
│ │ ├── SouceInfoTests.swift
│ │ ├── Style+LocalizationTests.swift
│ │ ├── StyleColorTests.swift
│ │ ├── StyleEncodableTests.swift
│ │ ├── StyleIntegrationTests.swift
│ │ ├── StyleProjectionTests.swift
│ │ ├── StyleTransitionTests.swift
│ │ ├── StyleURITests.swift
│ │ └── TileCacheBudgetTests.swift
│ ├── SwiftUI
│ │ ├── MapBasicCoordinatorTests.swift
│ │ ├── Mocks
│ │ │ ├── MockGestureManager.swift
│ │ │ ├── MockMapView.swift
│ │ │ ├── MockOrnamentsManager.swift
│ │ │ └── MockViewAnnotationsManager.swift
│ │ ├── OnceTests.swift
│ │ ├── SwiftUIEdgeInsetsTests.swift
│ │ └── ViewportTests.swift
│ └── Viewport
│ │ ├── Fixtures
│ │ ├── ViewportOptions+Fixtures.swift
│ │ └── ViewportStatus+Fixtures.swift
│ │ ├── Helpers
│ │ └── Mocks
│ │ │ └── MockDispatchQueue.swift
│ │ ├── Mocks
│ │ ├── MockViewportImpl.swift
│ │ ├── MockViewportState.swift
│ │ ├── MockViewportStatusObserver.swift
│ │ └── MockViewportTransition.swift
│ │ ├── States
│ │ ├── CameraViewportStateTests.swift
│ │ ├── FollowPuck
│ │ │ ├── Fixtures
│ │ │ │ ├── FollowPuckViewportStateBearing+Fixtures.swift
│ │ │ │ └── FollowPuckViewportStateOptions+Fixtures.swift
│ │ │ ├── FollowPuckViewportStateBearingTests.swift
│ │ │ ├── FollowPuckViewportStateOptionsTests.swift
│ │ │ └── FollowPuckViewportStateTests.swift
│ │ └── Overview
│ │ │ ├── Fixtures
│ │ │ └── OverviewViewportStateOptions+Fixtures.swift
│ │ │ ├── OverviewViewportStateOptionsTests.swift
│ │ │ └── OverviewViewportStateTests.swift
│ │ ├── Transitions
│ │ ├── Default
│ │ │ ├── CameraOptionsComponentTests.swift
│ │ │ ├── DefaultViewportTransitionAnimationHelperTests.swift
│ │ │ ├── DefaultViewportTransitionAnimationSpecProviderTests.swift
│ │ │ ├── DefaultViewportTransitionAnimationSpecTests.swift
│ │ │ ├── DefaultViewportTransitionAnimationTests.swift
│ │ │ ├── DefaultViewportTransitionOptionsTests.swift
│ │ │ ├── DefaultViewportTransitionTests.swift
│ │ │ ├── Fixtures
│ │ │ │ └── DefaultViewportTransitionOptions+Fixtures.swift
│ │ │ ├── HighZoomToLowZoomAnimationSpecProviderTests.swift
│ │ │ ├── LowZoomToHighZoomAnimationSpecProviderTests.swift
│ │ │ └── Mocks
│ │ │ │ ├── MockCameraOptionsComponent.swift
│ │ │ │ ├── MockDefaultViewportTransitionAnimation.swift
│ │ │ │ ├── MockDefaultViewportTransitionAnimationFactory.swift
│ │ │ │ ├── MockDefaultViewportTransitionAnimationHelper.swift
│ │ │ │ └── MockDefaultViewportTransitionAnimationSpecProvider.swift
│ │ └── Immediate
│ │ │ └── ImmediateViewportTransitionTests.swift
│ │ ├── ViewportManagerImplTests.swift
│ │ ├── ViewportManagerTests.swift
│ │ ├── ViewportOptionsTests.swift
│ │ └── ViewportStatusTests.swift
└── TestPlans
│ ├── Examples no unit tests.xctestplan
│ ├── Examples.xctestplan
│ ├── IntegrationTests.xctestplan
│ ├── MapboxMapsAll.xctestplan
│ └── UnitTests.xctestplan
├── codecov.yml
├── project.yml
├── scripts
├── .shellcheckrc
├── api-compatibility-check
│ ├── README.md
│ ├── breakage_allowlist.txt
│ ├── breaking-api-check.py
│ └── dump_api.sh
├── ci-trigger
│ ├── ci-e2e-compatibility-start-pipeline.py
│ └── ci-e2e-job-trigger-checker.sh
├── code-coverage
│ ├── parse-code-coverage.py
│ └── publish_to_aws.sh
├── doc-generation
│ ├── build-docc.sh
│ ├── docc-theme
│ │ ├── assembly.min.css
│ │ ├── docc-inject.css
│ │ ├── favicon.ico
│ │ ├── favicon.svg
│ │ ├── footer.html
│ │ ├── header.html
│ │ └── page-shell-styles.css
│ ├── restrict-top-sections.py
│ └── xcode-rebuild-docc.sh
├── generate_access_token_file.sh
├── insert_access_token.sh
├── prepare_binary_dependencies.sh
├── release
│ ├── README-dynamic.md
│ ├── README-static.md
│ ├── create-api-downloads-pr.sh
│ ├── create-docs-prs.sh
│ ├── create-github-draft-release.sh
│ ├── packager
│ │ ├── .gitignore
│ │ ├── PACKAGE.md
│ │ ├── create-xcframework.sh
│ │ ├── package-mapbox-maps.sh
│ │ ├── project.yml
│ │ └── versions.json
│ ├── sync_deps_versions.sh
│ ├── update-version.sh
│ ├── upload-docs
│ └── upload-to-registry.sh
├── run_swiftlint.sh
├── utilities
│ ├── cocoapods.sh
│ ├── git.sh
│ ├── helpers.sh
│ └── replace-regex-in-file.py
├── utils.sh
└── validate-integrations
│ ├── .gitignore
│ ├── MapLoadingUITest.swift
│ ├── Podfile
│ ├── ViewController.swift
│ ├── project-base.yml
│ ├── project.yml
│ ├── validate-integrations.sh
│ └── validate-min-xcode-binary-integration.sh
└── xcodegen
├── Examples.yml
├── MapboxMaps.yml
├── MapboxMapsTests.yml
└── targets.yml
/.fastlane/Appfile:
--------------------------------------------------------------------------------
1 | app_identifier "com.mapbox.examples" # The bundle identifier of your app
2 | itc_team_name "Mapbox, Inc."
3 |
--------------------------------------------------------------------------------
/.fastlane/Matchfile:
--------------------------------------------------------------------------------
1 | git_url("git@github.com:mapbox/apple-certificates.git")
2 | type("development") # The default type, can be: appstore, adhoc, enterprise or development
3 | app_identifier(["com.mapbox.examples", "mapbox.ExamplesUITests.xctrunner"])
4 | template_name("CarPlay Navigation App (Distribution)")
5 |
--------------------------------------------------------------------------------
/.fastlane/Pluginfile:
--------------------------------------------------------------------------------
1 | # Autogenerated by fastlane
2 | #
3 | # Ensure this file is checked in to source control!
4 |
5 | gem 'fastlane-plugin-firebase_test_lab', github: 'fastlane/fastlane-plugin-firebase_test_lab', ref: 'eee528b'
6 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | #
2 | *.pbxproj merge=union
3 | CHANGELOG.md merge=union
4 |
5 | # Mark files as generated in Github PRs
6 | **/Generated/** linguist-generated=true
7 | LICENSE.md linguist-generated=true
8 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @mapbox/maps-ios
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug
3 | about: This template should be used for reporting bugs and defects.
4 | labels: 'bug :beetle:'
5 | assignees: ''
6 | ---
7 |
8 | ## Environment
9 |
10 | - Xcode version:
11 | - iOS version:
12 | - Devices affected:
13 | - Maps SDK Version:
14 |
15 | ## Observed behavior and steps to reproduce
16 |
17 |
18 |
19 | ## Expected behavior
20 |
21 |
22 |
23 | ## Notes / preliminary analysis
24 |
25 |
26 |
27 | ## Additional links and references
28 |
29 |
30 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature Request
3 | about: To request a new feature, please provide detail on the outcome desired, solutions attempted and any suggested approaches.
4 | title: ''
5 | labels: 'feature :green apple:'
6 | assignees: ''
7 |
8 | ---
9 |
10 | ## New Feature
11 |
12 | <- Description of the feature being requested and any outcomes desired, an example use case, and any suggestions for solution ->
13 |
14 | ## Why
15 | <- 1-2 sentence description of why you're requesting this feature. What problem does it solve? Why is it valuable? ->
16 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: "github-actions" # See documentation for possible values
9 | directory: "/" # Location of package manifests
10 | schedule:
11 | interval: "weekly"
12 |
--------------------------------------------------------------------------------
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | # Configuration for probot-stale - https://github.com/probot/stale
2 | ---
3 | exemptProjects: true
4 | exemptMilestones: true
5 |
6 | staleLabel: archived
7 |
8 | limitPerRun: 1
9 |
10 | # SEMVER-MAJOR - @tobrun
11 | exemptLabels:
12 | - SEMVER-MAJOR
13 |
14 | pulls:
15 | daysUntilStale: 60
16 | daysUntilClose: 7
17 | markComment: false
18 | closeComment: >
19 | This pull request has been automatically detected as stale because it has not had
20 | recent activity and will be archived. Thank you for your contributions.
21 |
22 | issues:
23 | daysUntilStale: 180
24 | daysUntilClose: -1
25 | markComment: false
26 | closeComment: >
27 | This issue has been automatically detected as stale because it has not had
28 | recent activity and will be archived. Thank you for your contributions.
29 |
--------------------------------------------------------------------------------
/.github/workflows/codeql.yml:
--------------------------------------------------------------------------------
1 | name: "CodeQL"
2 |
3 | on:
4 | push:
5 | branches: ['main', 'publisher-production', 'release/*', 'lts/*']
6 | pull_request:
7 | branches: ['main', 'publisher-production', 'release/*', 'lts/*']
8 | schedule:
9 | - cron: "16 20 * * 4"
10 |
11 | jobs:
12 | analyze:
13 | uses: ./.github/workflows/analyze.yml
14 | with:
15 | project-path: Examples.xcodeproj
16 | secrets: inherit
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | /build
3 | .build
4 | /Packages
5 | xcuserdata
6 | node_modules
7 | developer.xcconfig
8 | Carthage
9 | Cartfile*
10 | MapboxAccessToken
11 | scripts/release/packager/artifacts
12 | scripts/release/packager/build
13 | scripts/xcparty/.swiftpm
14 | MapboxMaps.xcodeproj
15 | *.doccarchive*
16 | Sources/MapboxMaps/Documentation.docc/*.html
17 |
18 | .vscode
19 | Package.resolved
20 | Examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
21 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/.gitmodules
--------------------------------------------------------------------------------
/.swiftlint.yml:
--------------------------------------------------------------------------------
1 | ---
2 | allow_zero_lintable_files: true
3 | included:
4 | - Sources
5 | - Tests
6 | excluded:
7 | - "**/Generated"
8 | disabled_rules:
9 | - comment_spacing
10 | - computed_accessors_order
11 | - force_try
12 | - identifier_name
13 | - line_length
14 | - shorthand_operator
15 | - todo
16 | - trailing_comma
17 | - type_name
18 | - type_body_length
19 | custom_rules:
20 | trojan_source:
21 | regex: "[\u202A\u202B\u202D\u202E\u2066\u2067\u2068\u202C\u2069]"
22 | severity: error
23 | message: "Source should not contain characters that may be used in reordering attacks. See https://trojansource.codes/trojan-source.pdf"
24 |
--------------------------------------------------------------------------------
/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.yamllint:
--------------------------------------------------------------------------------
1 | ---
2 | extends: default
3 |
4 | rules:
5 | line-length: disable
6 |
--------------------------------------------------------------------------------
/CODE-OF-CONDUCT.md:
--------------------------------------------------------------------------------
1 | Everyone is invited to participate in this project and public discussions: we want to create a welcoming and friendly environment. Harassment of participants or other unethical and unprofessional behavior will not be tolerated in our spaces.
2 |
3 | The [Contributor Covenant](https://contributor-covenant.org/) applies to [all projects under the Mapbox organization](https://github.com/mapbox) and we ask that you please read [the full text](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
4 |
5 | Please report any instances of behavior violating this code to conduct@mapbox.com. Our team will handle any such report confidentially, promptly review and investigate the situation, and act to [enforce](https://www.contributor-covenant.org/version/2/0/code_of_conduct#enforcement) this code of conduct as needed.
6 |
--------------------------------------------------------------------------------
/Examples.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Examples.yml:
--------------------------------------------------------------------------------
1 | name: Examples
2 | include:
3 | - xcodegen/Examples.yml
4 | packages:
5 | MapboxMaps:
6 | path: .
7 | targets:
8 | Examples:
9 | settings:
10 | base:
11 | MAPBOXMAPS_PATH: ./
12 | scheme:
13 | testPlans:
14 | - path: Tests/TestPlans/Examples.xctestplan
15 | defaultPlan: true
16 | - path: Tests/TestPlans/Examples no unit tests.xctestplan
17 | defaultPlan: true
18 |
19 | targetTemplates:
20 | map-library:REPLACE:
21 | dependencies:
22 | - package: MapboxMaps
23 |
24 | maps-dependencies:
25 | dependencies:
26 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 |
3 | # Fastlane 2.220.0 introduced a new crypto algo for Match, which is not compatible with the pre-existed versions
4 | gem "fastlane", '= 2.219.0'
5 |
6 | plugins_path = File.join(File.dirname(__FILE__), '.fastlane', 'Pluginfile')
7 | eval_gemfile(plugins_path) if File.exist?(plugins_path)
8 |
--------------------------------------------------------------------------------
/Sources/.swiftlint.yml:
--------------------------------------------------------------------------------
1 | ---
2 | opt_in_rules:
3 | - missing_docs
4 | disabled_rules:
5 | - file_length
6 |
--------------------------------------------------------------------------------
/Sources/Examples/.swiftlint.yml:
--------------------------------------------------------------------------------
1 | ---
2 | disabled_rules:
3 | - force_cast
4 | - file_length
5 | - type_body_length
6 | - function_body_length
7 |
--------------------------------------------------------------------------------
/Sources/Examples/All Examples/Sample Data/CustomLayerShaderTypes.h:
--------------------------------------------------------------------------------
1 | #ifndef CustomLayerShaderTypes_h
2 | #define CustomLayerShaderTypes_h
3 |
4 | #include
5 |
6 | // Buffer indexes shared between shader and platform code to ensure Metal shader buffer inputs
7 | // match Metal API buffer set calls.
8 | typedef enum
9 | {
10 | VertexInputIndexVertices = 0,
11 | VertexInputIndexTransformation = 1,
12 | } VertexInputIndex;
13 |
14 | typedef struct
15 | {
16 | simd_float3 position;
17 | simd_float4 color;
18 | } VertexData;
19 |
20 | typedef struct
21 | {
22 | simd_float3 pos_merc;
23 | simd_float3 pos_ecef;
24 | simd_float3 color;
25 | } GlobeVertexData;
26 |
27 | typedef struct
28 | {
29 | simd_float4x4 u_matrix_merc;
30 | simd_float4x4 u_matrix_ecef;
31 | float u_transition;
32 | float u_point_size;
33 | } GlobeUniforms;
34 | #endif /* CustomLayerShaderTypes_h */
35 |
--------------------------------------------------------------------------------
/Sources/Examples/All Examples/Sample Data/Radar/radar0.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/All Examples/Sample Data/Radar/radar0.gif
--------------------------------------------------------------------------------
/Sources/Examples/All Examples/Sample Data/Radar/radar1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/All Examples/Sample Data/Radar/radar1.gif
--------------------------------------------------------------------------------
/Sources/Examples/All Examples/Sample Data/Radar/radar2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/All Examples/Sample Data/Radar/radar2.gif
--------------------------------------------------------------------------------
/Sources/Examples/All Examples/Sample Data/Radar/radar3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/All Examples/Sample Data/Radar/radar3.gif
--------------------------------------------------------------------------------
/Sources/Examples/All Examples/Sample Data/Radar/radar4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/All Examples/Sample Data/Radar/radar4.gif
--------------------------------------------------------------------------------
/Sources/Examples/All Examples/Sample Data/sportcar.glb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/All Examples/Sample Data/sportcar.glb
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AccentColor.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "colors" : [
3 | {
4 | "color" : {
5 | "color-space" : "srgb",
6 | "components" : {
7 | "alpha" : "1.000",
8 | "blue" : "1.000",
9 | "green" : "0.747",
10 | "red" : "0.207"
11 | }
12 | },
13 | "idiom" : "universal"
14 | },
15 | {
16 | "appearances" : [
17 | {
18 | "appearance" : "luminosity",
19 | "value" : "dark"
20 | }
21 | ],
22 | "color" : {
23 | "color-space" : "srgb",
24 | "components" : {
25 | "alpha" : "1.000",
26 | "blue" : "1.000",
27 | "green" : "1.000",
28 | "red" : "1.000"
29 | }
30 | },
31 | "idiom" : "universal"
32 | }
33 | ],
34 | "info" : {
35 | "author" : "xcode",
36 | "version" : 1
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/1024x1024@1x.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/20x20@1x.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/20x20@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/20x20@2x-1.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/20x20@2x.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/20x20@3x.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/29x29@1x.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/29x29@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/29x29@2x-1.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/29x29@2x.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/29x29@3x.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/40x40@1x.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/40x40@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/40x40@2x-1.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/40x40@2x.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/40x40@3x.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/60x60@2x.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/60x60@3x.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/76x76@1x.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/76x76@2x.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.appiconset/83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.appiconset/83.5x83.5@2x.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "back.png",
5 | "idiom" : "vision",
6 | "scale" : "2x"
7 | }
8 | ],
9 | "info" : {
10 | "author" : "xcode",
11 | "version" : 1
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/back.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.solidimagestack/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | },
6 | "layers" : [
7 | {
8 | "filename" : "Front.solidimagestacklayer"
9 | },
10 | {
11 | "filename" : "Middle.solidimagestacklayer"
12 | },
13 | {
14 | "filename" : "Back.solidimagestacklayer"
15 | }
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "star.png",
5 | "idiom" : "vision",
6 | "scale" : "2x"
7 | }
8 | ],
9 | "info" : {
10 | "author" : "xcode",
11 | "version" : 1
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/star.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "middle.png",
5 | "idiom" : "vision",
6 | "scale" : "2x"
7 | }
8 | ],
9 | "info" : {
10 | "author" : "xcode",
11 | "version" : 1
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/middle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/middle.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/RasterSource/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | },
6 | "properties" : {
7 | "provides-namespace" : true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/RasterSource/wind_0.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "wind_0.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/RasterSource/wind_0.imageset/wind_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/RasterSource/wind_0.imageset/wind_0.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/RasterSource/wind_1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "wind_1.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/RasterSource/wind_1.imageset/wind_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/RasterSource/wind_1.imageset/wind_1.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/RasterSource/wind_2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "wind_2.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/RasterSource/wind_2.imageset/wind_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/RasterSource/wind_2.imageset/wind_2.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/RasterSource/wind_3.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "wind_3.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/RasterSource/wind_3.imageset/wind_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/RasterSource/wind_3.imageset/wind_3.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/circle.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "filename" : "circle.png",
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/circle.imageset/circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/circle.imageset/circle.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/dash-puck.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "dash-puck.pdf",
5 | "idiom" : "universal"
6 | }
7 | ],
8 | "info" : {
9 | "author" : "xcode",
10 | "version" : 1
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/dash-puck.imageset/dash-puck.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/dash-puck.imageset/dash-puck.pdf
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-picnic-area.imageset/16px-nps-picnic_area.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-picnic-area.imageset/16px-nps-picnic_area.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-picnic-area.imageset/48px-nps-picnic_area.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-picnic-area.imageset/48px-nps-picnic_area.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-picnic-area.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "16px-nps-picnic_area.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "nps-picnic_area.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "filename" : "48px-nps-picnic_area.png",
15 | "idiom" : "universal",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "author" : "xcode",
21 | "version" : 1
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-picnic-area.imageset/nps-picnic_area.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-picnic-area.imageset/nps-picnic_area.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-restrooms.imageset/16px-nps-restrooms.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-restrooms.imageset/16px-nps-restrooms.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-restrooms.imageset/48px-nps-restrooms .png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-restrooms.imageset/48px-nps-restrooms .png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-restrooms.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "16px-nps-restrooms.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "nps-restrooms.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "filename" : "48px-nps-restrooms .png",
15 | "idiom" : "universal",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "author" : "xcode",
21 | "version" : 1
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-restrooms.imageset/nps-restrooms.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-restrooms.imageset/nps-restrooms.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-trailhead.imageset/16px-nps-trailhead.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-trailhead.imageset/16px-nps-trailhead.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-trailhead.imageset/48x-nps-trailhead.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-trailhead.imageset/48x-nps-trailhead.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-trailhead.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "16px-nps-trailhead.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "nps-trailhead.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "filename" : "48x-nps-trailhead.png",
15 | "idiom" : "universal",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "author" : "xcode",
21 | "version" : 1
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-trailhead.imageset/nps-trailhead.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/dataDrivenSymbolsExample/nps-trailhead.imageset/nps-trailhead.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/dest-pin.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "dest-pin.pdf",
5 | "idiom" : "universal"
6 | }
7 | ],
8 | "info" : {
9 | "author" : "xcode",
10 | "version" : 1
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/dest-pin.imageset/dest-pin.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/dest-pin.imageset/dest-pin.pdf
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/fire-station-11.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "fire-station-11.svg",
5 | "idiom" : "universal"
6 | }
7 | ],
8 | "info" : {
9 | "author" : "xcode",
10 | "version" : 1
11 | },
12 | "properties" : {
13 | "template-rendering-intent" : "template"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/fire-station-11.imageset/fire-station-11.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/intermediate-pin.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "intermediate-pin.pdf",
5 | "idiom" : "universal"
6 | }
7 | ],
8 | "info" : {
9 | "author" : "xcode",
10 | "version" : 1
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/intermediate-pin.imageset/intermediate-pin.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/intermediate-pin.imageset/intermediate-pin.pdf
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/jpeg-image.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "jpeg-image.jpg",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/jpeg-image.imageset/jpeg-image.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/jpeg-image.imageset/jpeg-image.jpg
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/long_route.dataset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "data" : [
3 | {
4 | "filename" : "long_route.json",
5 | "idiom" : "universal"
6 | }
7 | ],
8 | "info" : {
9 | "author" : "xcode",
10 | "version" : 1
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/maneuver-straight.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "maneuver-straight.svg",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/maneuver-straight.imageset/maneuver-straight.svg:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/maneuver-turn-right.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "maneuver-turn-right.pdf",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/mapbox-logo.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "mapbox-logo.pdf"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "mapbox-logo-white.pdf",
10 | "appearances" : [
11 | {
12 | "appearance" : "luminosity",
13 | "value" : "dark"
14 | }
15 | ]
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/mapbox-logo.imageset/mapbox-logo-white.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/mapbox-logo.imageset/mapbox-logo-white.pdf
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/mapbox-logo.imageset/mapbox-logo.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/mapbox-logo.imageset/mapbox-logo.pdf
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/monochrome_lut.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "monochrome_lut.png",
5 | "idiom" : "universal"
6 | }
7 | ],
8 | "info" : {
9 | "author" : "xcode",
10 | "version" : 1
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/monochrome_lut.imageset/monochrome_lut.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/Examples/Assets.xcassets/monochrome_lut.imageset/monochrome_lut.png
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/parking-icon.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "filename" : "parking-icon.svg",
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/parking-icon.imageset/parking-icon.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/route-sf-1.dataset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "data" : [
3 | {
4 | "filename" : "route-sf-1.geojson",
5 | "idiom" : "universal"
6 | }
7 | ],
8 | "info" : {
9 | "author" : "xcode",
10 | "version" : 1
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sources/Examples/Assets.xcassets/route-sf-2.dataset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "data" : [
3 | {
4 | "filename" : "route-sf-2.geojson",
5 | "idiom" : "universal"
6 | }
7 | ],
8 | "info" : {
9 | "author" : "xcode",
10 | "version" : 1
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sources/Examples/Examples-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #ifndef Examples_Bridging_Header_h
2 | #define Examples_Bridging_Header_h
3 |
4 | #import "CustomLayerShaderTypes.h"
5 |
6 | #endif /* Examples_Bridging_Header_h */
7 |
--------------------------------------------------------------------------------
/Sources/Examples/Examples_CarPlay.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.developer.carplay-maps
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Sources/Examples/Extensions/Array+Split.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | extension Array {
4 | func chunked(into size: Int) -> [[Element]] {
5 | return stride(from: 0, to: count, by: size).map {
6 | Array(self[$0.. Void
4 |
5 | internal final class ViewAnnotationPositionsUpdateListenerImpl: CoreViewAnnotationPositionsUpdateListener {
6 | private let callback: ViewAnnotationPositionsUpdateCallback
7 | init(callback: @escaping ViewAnnotationPositionsUpdateCallback) {
8 | self.callback = callback
9 | }
10 |
11 | internal func onViewAnnotationPositionsUpdate(forPositions positions: [ViewAnnotationPositionDescriptor]) {
12 | callback(positions)
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Camera/AnimationCompletion.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | /// A block object to be executed when the animation sequence ends.
4 | public typealias AnimationCompletion = (UIViewAnimatingPosition) -> Void
5 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Camera/AnimationOwner.swift:
--------------------------------------------------------------------------------
1 | public struct AnimationOwner: RawRepresentable, Equatable, Sendable {
2 | public typealias RawValue = String
3 |
4 | public let rawValue: String
5 |
6 | public init(rawValue: String) {
7 | self.rawValue = rawValue
8 | }
9 |
10 | public static let gestures = AnimationOwner(rawValue: "com.mapbox.maps.gestures")
11 |
12 | public static let unspecified = AnimationOwner(rawValue: "com.mapbox.maps.unspecified")
13 |
14 | public static let compass = AnimationOwner(rawValue: "com.mapbox.maps.ornaments.compass")
15 |
16 | internal static let cameraAnimationsManager = AnimationOwner(rawValue: "com.mapbox.maps.cameraAnimationsManager")
17 |
18 | internal static let defaultViewportTransition = AnimationOwner(rawValue: "com.mapbox.maps.viewport.defaultTransition")
19 | }
20 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Camera/AnimationType.swift:
--------------------------------------------------------------------------------
1 | /// Declares type of animations. Can be used to fine-grain cancellation filtering.
2 | internal struct AnimationType: RawRepresentable, Equatable {
3 |
4 | internal let rawValue: String
5 |
6 | internal static let unspecified = AnimationType(rawValue: "com.mapbox.maps.animation.type.unspecified")
7 |
8 | internal static let deceleration = AnimationType(rawValue: "com.mapbox.maps.animation.type.deceleration")
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Camera/CameraAnimatorStatusObservable.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | enum CameraAnimatorStatus: Equatable {
4 | case started
5 | case stopped(reason: StopReason)
6 | case paused
7 |
8 | enum StopReason: Equatable {
9 | case finished, cancelled
10 | }
11 | }
12 |
13 | typealias CameraAnimatorStatusPayload = (CameraAnimator, CameraAnimatorStatus)
14 |
15 | extension Signal where Payload == any CameraAnimator {
16 |
17 | /// Creates new Signal from upstream filtering out ``CameraAnimator`` that is not owned by the given ``AnimationOwner``.
18 | public func owned(by owner: AnimationOwner) -> Self {
19 | filter { $0.owner == owner }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/ContentBuilders/MapContent/PrimitiveMapContent.swift:
--------------------------------------------------------------------------------
1 | protocol PrimitiveMapContent {
2 | func visit(_ node: MapContentNode)
3 | }
4 |
5 | extension PrimitiveMapContent {
6 | /// :nodoc:
7 | public var body: Never { fatalError("shouldn't be called") }
8 | }
9 |
10 | extension Never: MapStyleContent {
11 | public var body: Never { fatalError("shouldn't be called") }
12 | }
13 |
14 | extension Never: MapContent {
15 | public var content: Never { fatalError("shouldn't be called") }
16 | }
17 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/ContentBuilders/MapStyleContent/MapStyleContentAdapter.swift:
--------------------------------------------------------------------------------
1 | ///The adapter allows representing any instance of ``MapStyleContent`` as ``MapContent``.
2 |
3 | protocol AdaptingMapContent: PrimitiveMapContent {}
4 |
5 | struct MapStyleContentAdapter: MapContent, AdaptingMapContent {
6 | private let subject: S
7 |
8 | init(_ subject: S) {
9 | self.subject = subject
10 | }
11 |
12 | func visit(_ node: MapContentNode) {
13 | if let primitive = subject as? PrimitiveMapContent {
14 | node.update(with: primitive)
15 | } else {
16 | node.update(newContent: subject) { nextNode in
17 | MapStyleContentAdapter(subject.body).visit(nextNode)
18 | }
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/ContentBuilders/Tree/MapContentMountedComponent.swift:
--------------------------------------------------------------------------------
1 | import os
2 | @_implementationOnly import MapboxCommon_Private
3 |
4 | protocol MapContentMountedComponent {
5 | func mount(with context: MapContentNodeContext) throws
6 | func unmount(with context: MapContentNodeContext) throws
7 | func tryUpdate(from old: MapContentMountedComponent, with context: MapContentNodeContext) throws -> Bool
8 | func updateMetadata(with: MapContentNodeContext)
9 | }
10 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/API Catalogs/CoreMaps.md:
--------------------------------------------------------------------------------
1 | # Core Maps API
2 |
3 | Maps rendering SDK also known as GL-Native
4 |
5 | ## Topics
6 |
7 | ### Offline
8 | -
9 |
10 | ### Free Camera
11 | -
12 |
13 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/API Catalogs/Expressions.md:
--------------------------------------------------------------------------------
1 | # Expressions
2 |
3 | ## Topics
4 |
5 | ### Expressions
6 |
7 | - ``Exp``
8 | - ``Expression``
9 | - ``FormatOptions``
10 | - ``NumberFormatOptions``
11 | - ``CollatorOptions``
12 | - ``ImageOptions``
13 | - ``ExpressionArgumentConvertible``
14 | - ``ExpressionArgumentBuilder``
15 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/API Catalogs/Free Camera.md:
--------------------------------------------------------------------------------
1 | # Free Camera
2 |
3 | ## Topics
4 |
5 | ### Symbols
6 |
7 | - ``Vec2``
8 | - ``Vec3``
9 | - ``Vec4``
10 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/API Catalogs/Gestures.md:
--------------------------------------------------------------------------------
1 | # Gestures
2 |
3 | ## Topics
4 |
5 | ### Gestures
6 |
7 | - ``GestureManager``
8 | - ``GestureOptions``
9 | - ``PanMode``
10 | - ``GestureManagerDelegate``
11 | - ``GestureType``
12 | - ``MapContentGestureContext``
13 | - ``InteractionContext``
14 | - ``AnnotationClusterGestureContext``
15 | - ``MapLayerGestureHandler``
16 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/API Catalogs/Layer Annotations.md:
--------------------------------------------------------------------------------
1 | # Layer Annotations
2 |
3 | ## Topics
4 |
5 | ### Annotations
6 |
7 | - ``AnnotationOrchestrator``
8 | - ``AnnotationInteractionDelegate``
9 | - ``Annotation``
10 | - ``AnnotationManager``
11 | - ``CircleAnnotation``
12 | - ``CircleAnnotationManager``
13 | - ``PointAnnotation``
14 | - ``PointAnnotationManager``
15 | - ``PolygonAnnotation``
16 | - ``PolygonAnnotationManager``
17 | - ``PolylineAnnotation``
18 | - ``PolylineAnnotationManager``
19 | - ``ClusterOptions``
20 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/API Catalogs/Layers.md:
--------------------------------------------------------------------------------
1 | # Layers
2 |
3 | ## Topics
4 |
5 | ### Layers
6 |
7 | - ``Layer``
8 | - ``LayerType``
9 | - ``LayerInfo``
10 | - ``BackgroundLayer``
11 | - ``CircleLayer``
12 | - ``FillExtrusionLayer``
13 | - ``FillLayer``
14 | - ``HeatmapLayer``
15 | - ``HillshadeLayer``
16 | - ``LineLayer``
17 | - ``LocationIndicatorLayer``
18 | - ``RasterLayer``
19 | - ``RasterParticleLayer``
20 | - ``SkyLayer``
21 | - ``SymbolLayer``
22 | - ``ModelLayer``
23 | - ``CustomLayer``
24 | - ``CustomLayerRenderConfiguration``
25 | - ``CustomLayerRenderParameters``
26 | - ``CustomLayerHost``
27 | - ``CustomLayerMapProjection``
28 | - ``ElevationData``
29 | - ``Slot``
30 | - ``SlotLayer``
31 | - ``LayerAtPosition``
32 | - ``ClipLayer``
33 | - ``ClipLayerTypes``
34 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/API Catalogs/Map View.md:
--------------------------------------------------------------------------------
1 | # MapView
2 |
3 | ## Topics
4 |
5 | ### MapView
6 |
7 | - ``MapView``
8 | - ``MapInitOptions``
9 | - ``MapInitOptionsProvider``
10 | - ``MapOptions``
11 | - ``GlyphsRasterizationOptions``
12 | - ``AttributionURLOpener``
13 | - ``ConstrainMode``
14 | - ``GlyphsRasterizationMode``
15 | - ``NorthOrientation``
16 | - ``ViewportMode``
17 | - ``PresentationTransactionMode``
18 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/API Catalogs/Network.md:
--------------------------------------------------------------------------------
1 | # Network customisations
2 |
3 | ## Topics
4 |
5 |
6 | ### Network
7 |
8 | - ``HttpRequest``
9 | - ``HttpRequestError``
10 | - ``HttpRequestFlags``
11 | - ``HttpRequestOrResponse``
12 | - ``HttpResponse``
13 | - ``HttpResponseData``
14 | - ``HttpServiceFactory``
15 | - ``HttpServiceInterceptorInterface``
16 | - ``HttpServiceInterceptorRequestContinuation``
17 | - ``HttpServiceInterceptorResponseContinuation``
18 | - ``HttpMethod``
19 | - ``RequestErrorType``
20 | - ``NetworkRestriction``
21 |
22 | - ``HttpRequestErrorType``
23 | - ``HttpRequestFlags``
24 | - ``HttpRequestOrResponse``
25 | - ``HttpResponse``
26 | - ``HttpRequestOrResponseType``
27 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/API Catalogs/Offline.md:
--------------------------------------------------------------------------------
1 | # Offline Support
2 |
3 | ## Topics
4 |
5 | ### Offline
6 |
7 | - ``OfflineManager``
8 |
9 |
10 | ### Deprecated
11 |
12 | - ``OfflineRegion``
13 | - ``OfflineRegionError``
14 | - ``OfflineRegionGeometryDefinition``
15 | - ``OfflineRegionManager``
16 | - ``OfflineRegionTilePyramidDefinition``
17 | - ``OfflineRegionStatus``
18 | - ``OfflineRegionObserver``
19 | - ``StylePackLoadProgressCallback``
20 | - ``OfflineRegionDownloadState``
21 | - ``OfflineRegionErrorType``
22 |
23 | ### Control network
24 |
25 | - ``OfflineSwitch-5hi1w``
26 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/API Catalogs/Ornaments.md:
--------------------------------------------------------------------------------
1 | # Ornaments
2 |
3 | ## Topics
4 |
5 | ### Ornaments
6 |
7 | - ``OrnamentsManager``
8 | - ``OrnamentOptions``
9 | - ``OrnamentPosition``
10 | - ``OrnamentVisibility``
11 | - ``AttributionButtonOptions``
12 | - ``CompassViewOptions``
13 | - ``LogoViewOptions``
14 | - ``ScaleBarViewOptions``
15 | - ``CompassDirectionFormatter``
16 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/API Catalogs/Performance.md:
--------------------------------------------------------------------------------
1 | # Performance and investigations
2 |
3 | ## Topics
4 |
5 | ### Signpost
6 |
7 | - ``Tracing``
8 |
9 | ### Map Recording
10 |
11 | - ``MapRecorderOptions-struct``
12 | - ``MapPlayerOptions-struct``
13 |
14 | ### Performance recording
15 |
16 | - ``PerformanceStatistics``
17 | - ``CumulativeRenderingStatistics``
18 | - ``DurationStatistics``
19 | - ``GroupPerformanceStatistics``
20 | - ``PerFrameRenderingStatistics``
21 | - ``PerformanceStatisticsOptions``
22 | - ``PerformanceStatisticsCallback``
23 |
24 | ### Logs
25 |
26 | - ``MapboxCommon/LogConfiguration``
27 | - ``MapboxCommon/LogWriterBackend``
28 | - ``MapboxCommon/LoggingLevel``
29 |
30 | ### Debug
31 |
32 | - ``MapViewDebugOptions``
33 | - ``MapDebugOptions``
34 |
35 | ### Crashes
36 |
37 | - ``MapboxCommon/NSExceptionHandler``
38 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/API Catalogs/Settings and Constants.md:
--------------------------------------------------------------------------------
1 | # Settings and Constants
2 |
3 |
4 | ## Topics
5 |
6 | ### Settings
7 |
8 | - ``MapboxCommon/MapboxCommonSettings``
9 | - ``MapboxCommon/MapboxOptions``
10 | - ``MapboxMapsOptions``
11 |
12 | ### Common Settings
13 |
14 | - ``MapboxCommon/SettingsService``
15 | - ``MapboxCommon/SettingsServiceFactory``
16 | - ``MapboxCommon/SettingsServiceError``
17 | - ``MapboxCommon/SettingsServiceStorageType``
18 | - ``MapboxCommon/SdkInformation``
19 |
20 | ### Constants
21 |
22 | - ``MapConstants``
23 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/API Catalogs/Snapshotter APIs.md:
--------------------------------------------------------------------------------
1 | # Snapshotter
2 |
3 | ## Topics
4 |
5 | ### Snapshotter
6 |
7 | - ``Snapshotter``
8 | - ``MapSnapshotOptions-swift.struct``
9 | - ``SnapshotOverlay``
10 | - ``SnapshotOverlayHandler``
11 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/API Catalogs/Sources.md:
--------------------------------------------------------------------------------
1 | # Sources
2 |
3 | ## Topics
4 |
5 | ### Sources
6 |
7 | - ``Source``
8 | - ``SourceType``
9 | - ``SourceInfo``
10 | - ``GeoJSONSource``
11 | - ``GeoJSONSourceData-swift.enum``
12 | - ``ImageSource``
13 | - ``RasterDemSource``
14 | - ``RasterSource``
15 | - ``RasterArraySource``
16 | - ``VectorSource``
17 | - ``PromoteId``
18 | - ``VectorSourcePromoteId``
19 | - ``Scheme``
20 | - ``Encoding``
21 | - ``CustomGeometrySource``
22 | - ``CustomGeometrySourceOptions``
23 | - ``CustomRasterSource``
24 | - ``CustomRasterSourceOptions``
25 | - ``CustomRasterSourceTileStatusChangedCallback``
26 | - ``CustomRasterSourceTileData``
27 | - ``CustomRasterSourceTileStatus``
28 | - ``CustomRasterSourceClient``
29 | - ``CustomRasterSourceTileRenderer``
30 | - ``CustomRasterSourceClientType``
31 | - ``TileFunctionCallback``
32 | - ``TileCacheBudgetSize``
33 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/API Catalogs/SwiftUI.md:
--------------------------------------------------------------------------------
1 | # SwiftUI
2 |
3 | ## Topics
4 |
5 | ### SwiftUI
6 | - ``Map-swift.struct``
7 | - ``MapContent``
8 | - ``ConditionalMapContent``
9 | - ``EmptyMapContent``
10 | - ``OptionalMapContent``
11 | - ``TupleMapContent``
12 | - ``MapContentBuilder``
13 | - ``MapStyle``
14 | - ``Viewport``
15 | - ``ViewportAnimation``
16 | - ``withViewportAnimation(_:body:completion:)``
17 | - ``MapViewAnnotation``
18 | - ``PointAnnotationGroup``
19 | - ``CircleAnnotationGroup``
20 | - ``PolygonAnnotationGroup``
21 | - ``PolylineAnnotationGroup``
22 | - ``Puck2D``
23 | - ``Puck3D``
24 | - ``MapReader``
25 | - ``MapProxy``
26 | - ``FeatureState``
27 | - ``Viewport/FollowPuckOptions``
28 | - ``Viewport/OverviewOptions``
29 | - ``MapGestureHandlers``
30 | - ``MapURLOpener``
31 | - ``ForEvery``
32 | - ``ArrayBuilder``
33 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/API Catalogs/TurfAPI.md:
--------------------------------------------------------------------------------
1 | # Turf
2 |
3 | Describes `turf-swift` dependency objects
4 |
5 | ## Topics
6 |
7 | ### GeoJSON
8 |
9 | - ``Feature-swift.typealias``
10 | - ``Geometry-swift.typealias``
11 | - ``MapboxCommon/GeometryType``
12 | - ``Turf``
13 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/API Catalogs/View Annotations.md:
--------------------------------------------------------------------------------
1 | # View Annotations
2 |
3 | ## Topics
4 |
5 | ### View Annotations
6 |
7 | - ``ViewAnnotation``
8 | - ``ViewAnnotationManager``
9 | - ``ViewAnnotationOptions-swift.struct``
10 | - ``ViewAnnotationManagerError``
11 | - ``ViewAnnotationAnchorConfig``
12 | - ``ViewAnnotationPositionDescriptor``
13 | - ``ViewAnnotationUpdateObserver``
14 | - ``ViewAnnotationAnchor``
15 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Documentation.docc/Overview.md:
--------------------------------------------------------------------------------
1 | # MapboxMaps Documentation
2 |
3 | @Metadata {
4 | @TechnologyRoot
5 | }
6 |
7 | ## Topics
8 |
9 | - ``/MapboxMaps``
10 | - ``/MapboxCommon``
11 | - ``/Turf``
12 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/AlwayEqual.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | struct AlwaysEqual: Equatable {
4 | var value: Value
5 | static func == (lhs: Self, rhs: Self) -> Bool { true }
6 | }
7 |
8 | extension AlwaysEqual: ExpressibleByNilLiteral where Value: ExpressibleByNilLiteral {
9 | init(nilLiteral: ()) { self.init(value: nil) }
10 | }
11 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/AttributionURLOpener.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import UIKit
3 |
4 | /// A protocol to open attribution URLs.
5 | ///
6 | /// Use this protocol when the map view is used in non-application target(e.g. application extension target).
7 | public protocol AttributionURLOpener {
8 |
9 | /// Asks the opener to open the provided URL.
10 | /// - Parameters:
11 | /// - url: The URL to be opened.
12 | func openAttributionURL(_ url: URL)
13 | }
14 |
15 | @available(iOSApplicationExtension, unavailable)
16 | internal final class DefaultAttributionURLOpener: AttributionURLOpener {
17 | private let application: UIApplicationProtocol
18 |
19 | init(application: UIApplicationProtocol = UIApplication.shared) {
20 | self.application = application
21 | }
22 |
23 | func openAttributionURL(_ url: URL) {
24 | application.open(url)
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/DateProvider.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import QuartzCore
3 |
4 | internal protocol DateProvider {
5 |
6 | // Provides the current date
7 | var now: Date { get }
8 | }
9 |
10 | internal protocol TimeProvider {
11 | // Provides the current time
12 | var current: TimeInterval { get }
13 | }
14 |
15 | internal struct DefaultDateProvider: DateProvider {
16 | var now: Date {
17 | return Date()
18 | }
19 | }
20 |
21 | internal struct DefaultTimeProvider: TimeProvider {
22 | var current: TimeInterval {
23 | return CACurrentMediaTime()
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/DelegatingMapClient.swift:
--------------------------------------------------------------------------------
1 | import MapboxCoreMaps
2 | import MetalKit
3 |
4 | protocol DelegatingMapClientDelegate: AnyObject {
5 | func scheduleRepaint()
6 | func getMetalView(for metalDevice: MTLDevice?) -> MetalView?
7 | }
8 |
9 | final class DelegatingMapClient: CoreMapClient, CoreMetalViewProvider {
10 | weak var delegate: DelegatingMapClientDelegate?
11 |
12 | func scheduleRepaint() {
13 | delegate?.scheduleRepaint()
14 | }
15 |
16 | func getMetalView(for metalDevice: MTLDevice?) -> CoreMetalView? {
17 | delegate?.getMetalView(for: metalDevice)
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/DictionaryCoding/Array+CodingKey.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | internal extension Array where Element == CodingKey {
4 |
5 | func appending(key codingKey: CodingKey) -> [CodingKey] {
6 | self + [codingKey]
7 | }
8 |
9 | func appending(index: Int) -> [CodingKey] {
10 | self + [IndexedKey(intValue: index)]
11 | }
12 |
13 | private struct IndexedKey: CodingKey {
14 | var intValue: Int? { index }
15 | var stringValue: String { "Index \(index)" }
16 |
17 | private let index: Int
18 |
19 | init(intValue index: Int) {
20 | self.index = index
21 | }
22 |
23 | init?(stringValue: String) {
24 | return nil
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/Array+Extensions.swift:
--------------------------------------------------------------------------------
1 | extension Array {
2 | /// Removes elements from `self` whose `key` is duplicated with other elements.
3 | ///
4 | /// - Returns: A list of duplicated keys.
5 | mutating func removeDuplicates(by key: (Element) -> Key) -> [Element] {
6 | var keys = Set()
7 | var duplicates = [Element]()
8 | self.removeAll { el in
9 | let k = key(el)
10 | let isUnique = keys.insert(k).inserted
11 | if !isUnique {
12 | duplicates.append(el)
13 | }
14 | return !isUnique
15 | }
16 | return duplicates
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/Bool.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | extension Bool {
4 | internal var NSNumber: NSNumber {
5 | Foundation.NSNumber(value: self)
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/CodingUserInfoKey+Custom.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | internal extension CodingUserInfoKey {
4 | static var nonVolatilePropertiesOnly: CodingUserInfoKey {
5 | return CodingUserInfoKey(rawValue: "nonVolatilePropertiesOnly")!
6 | }
7 |
8 | static var volatilePropertiesOnly: CodingUserInfoKey {
9 | return CodingUserInfoKey(rawValue: "volatilePropertiesOnly")!
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/Comparable+Clamped.swift:
--------------------------------------------------------------------------------
1 | internal extension Comparable {
2 | /// Returns new value clamped to the specified range.
3 | func clamped(to limits: ClosedRange) -> Self {
4 | var newValue = self
5 | newValue.clamp(to: limits)
6 | return newValue
7 | }
8 |
9 | /// Clamps `self` value to the specified range. Returns true if actual clamping was made.
10 | @discardableResult
11 | mutating func clamp(to limits: ClosedRange) -> Bool {
12 | guard self <= limits.upperBound else {
13 | self = limits.upperBound
14 | return true
15 | }
16 |
17 | guard self >= limits.lowerBound else {
18 | self = limits.lowerBound
19 | return true
20 | }
21 |
22 | return false
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/Core/EdgeInsets.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | internal extension CoreEdgeInsets {
4 | func toUIEdgeInsetsValue() -> UIEdgeInsets {
5 | return UIEdgeInsets(top: CGFloat(self.top),
6 | left: CGFloat(self.left),
7 | bottom: CGFloat(self.bottom),
8 | right: CGFloat(self.right))
9 | }
10 | }
11 |
12 | extension UIEdgeInsets {
13 | func toMBXEdgeInsetsValue() -> CoreEdgeInsets {
14 | return CoreEdgeInsets(top: Double(self.top),
15 | left: Double(self.left),
16 | bottom: Double(self.bottom),
17 | right: Double(self.right))
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/Core/FeatureExtensionValue.swift:
--------------------------------------------------------------------------------
1 | extension FeatureExtensionValue {
2 |
3 | /// Initializes a `FeatureExtensionValue` with the provided `value` and `features`.
4 | /// - Parameters:
5 | /// - value: Value for the feature extension.
6 | /// - features: Features for the feature extension.
7 | public convenience init(value: Any?, features: [Feature]?) {
8 | self.init(
9 | __value: value,
10 | featureCollection: features?.map(MapboxCommon.Feature.init(_:)))
11 | }
12 |
13 | /// An array of features from the feature extension.
14 | public var features: [Feature]? {
15 | return __featureCollection?.compactMap(Feature.init(_:))
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/Core/FreeCameraOptions.swift:
--------------------------------------------------------------------------------
1 | import CoreLocation
2 | import MapboxCoreMaps
3 | import MapboxCommon.MBXCoordinate2D
4 |
5 | extension FreeCameraOptions {
6 |
7 | /// The current mercator location coordinate.
8 | /// - Note: If the location could not be resolved in some case, `kCLLocationCoordinate2DInvalid` will be returned.
9 | public var location: CLLocationCoordinate2D {
10 | get {
11 | __getLocation()?.value ?? kCLLocationCoordinate2DInvalid
12 | }
13 | set {
14 | __setLocationForLocation(newValue)
15 | }
16 | }
17 |
18 | /// The current altitude in meters.
19 | public var altitude: CLLocationDistance {
20 | get {
21 | __getAltitude()?.doubleValue ?? 0
22 | }
23 | set {
24 | __setAltitudeForAltitude(newValue)
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/Core/QueriedFeature.swift:
--------------------------------------------------------------------------------
1 | import MapboxCoreMaps
2 |
3 | extension QueriedFeature {
4 |
5 | /// Feature returned by the query.
6 | public var feature: Feature {
7 | return Feature(__feature)
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/Core/ScreenBox.swift:
--------------------------------------------------------------------------------
1 | import MapboxCoreMaps
2 |
3 | extension CoreScreenBox {
4 | internal convenience init(_ rect: CGRect) {
5 | self.init(
6 | min: CoreScreenCoordinate(x: Double(rect.minX), y: Double(rect.minY)),
7 | max: CoreScreenCoordinate(x: Double(rect.maxX), y: Double(rect.maxY)))
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/Core/ScreenCoordinate.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import CoreLocation
3 | import CoreGraphics
4 |
5 | // MARK: - ScreenCoordinate
6 |
7 | extension CoreScreenCoordinate {
8 |
9 | // swiftlint:disable identifier_name
10 | /// Initializes an internal `ScreenCoordinate` type from two `CGFloat` values.
11 | /// - Parameters:
12 | /// - x: The horizontal point along the screen's coordinate system.
13 | /// - y: The vertical point along the screen's coordinate system.
14 | internal convenience init(x: CGFloat, y: CGFloat) {
15 | self.init(x: Double(x), y: Double(y))
16 | }
17 | // swiftlint:enable identifier_name
18 |
19 | /// Returns a `CGPoint` representation of an internal `ScreenCoordinate` value.
20 | internal var point: CGPoint {
21 | CGPoint(x: x, y: y)
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/Core/Size.swift:
--------------------------------------------------------------------------------
1 | import MapboxCoreMaps
2 |
3 | extension Size {
4 | internal convenience init(_ cgSize: CGSize) {
5 | self.init(width: Float(cgSize.width), height: Float(cgSize.height))
6 | }
7 | }
8 |
9 | extension CGSize {
10 | internal init(_ size: Size) {
11 | self.init(width: CGFloat(size.width), height: CGFloat(size.height))
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/Core/Vec2.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import MapboxCoreMaps
3 |
4 | extension Vec2 {
5 | var point: CGPoint {
6 | CGPoint(x: x, y: y)
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/DateFormatter.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | extension DateFormatter {
4 | internal static let rfc1123: DateFormatter = {
5 | let formatter = DateFormatter()
6 | formatter.locale = Locale(identifier: "en_US_POSIX")
7 | formatter.dateFormat = "EEE, dd MMM yyyy HH:mm:ss z"
8 | return formatter
9 | }()
10 | }
11 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/Dictionary+MapKeys.swift:
--------------------------------------------------------------------------------
1 | internal extension Dictionary {
2 | func mapKeys(_ transform: (Key) -> T) -> [T: Value] {
3 | // swiftlint:disable:next syntactic_sugar
4 | Dictionary(uniqueKeysWithValues: map { (kv) -> (T, Value) in
5 | (transform(kv.key), kv.value)
6 | })
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/FloatingPoint.swift:
--------------------------------------------------------------------------------
1 | extension FloatingPoint {
2 | internal func wrapped(to range: Range) -> Self {
3 | let d = range.upperBound - range.lowerBound
4 | return fmod(fmod(self - range.lowerBound, d) + d, d) + range.lowerBound
5 | }
6 |
7 | internal func toDegrees() -> Self {
8 | return self * 180 / .pi
9 | }
10 |
11 | /// Calculates the rotation between two angles in radians. Result is wrapped to [0, 2pi)
12 | internal func wrappedAngle(to: Self) -> Self {
13 | return (to - self).wrapped(to: 0..<(2 * .pi))
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/Int.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | // MARK: - Int
4 | extension Int {
5 | /// Wraps an `Int` within a `NSNumber` value.
6 | internal var NSNumber: NSNumber {
7 | Foundation.NSNumber(value: Int(self))
8 | }
9 | }
10 |
11 | extension UInt64 {
12 | /// Wraps an `Int` within a `NSNumber` value.
13 | internal var NSNumber: NSNumber {
14 | Foundation.NSNumber(value: UInt64(self))
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/JSONObject+Extensions.swift:
--------------------------------------------------------------------------------
1 | extension JSONObject {
2 | mutating func encode(key: String, value: Bool?) {
3 | if let value {
4 | self[key] = .boolean(value)
5 | }
6 | }
7 |
8 | mutating func encode(key: String, value: String?) {
9 | if let value {
10 | self[key] = .string(value)
11 | }
12 | }
13 |
14 | mutating func encode(key: String, value: T?) where T: RawRepresentable, T.RawValue == String {
15 | encode(key: key, value: value?.rawValue)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/NSNumber.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import CoreGraphics
3 | import CoreLocation
4 |
5 | extension NSNumber {
6 |
7 | /// Converts an `NSNumber` to a `CGFloat` value from its `Double` representation.
8 | internal var CGFloat: CGFloat {
9 | CoreGraphics.CGFloat(doubleValue)
10 | }
11 |
12 | /// Converts the `Float` value of an `NSNumber` to a `CLLocationDirection` representation.
13 | internal var CLLocationDirection: CLLocationDirection {
14 | CoreLocation.CLLocationDirection(doubleValue)
15 | }
16 |
17 | // Useful for converting between NSNumbers and Core enums
18 | internal func intValueAsRawRepresentable() -> T? where
19 | T: RawRepresentable,
20 | T.RawValue == Int {
21 | return T(rawValue: intValue)
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/RawRepresentable.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | extension RawRepresentable where Self.RawValue == Int {
4 | internal var NSNumber: NSNumber {
5 | Foundation.NSNumber(value: rawValue)
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/Turf/Polygon.swift:
--------------------------------------------------------------------------------
1 | @_documentation(visibility: internal)
2 | // swiftlint:disable:next missing_docs
3 | public typealias Polygon = Turf.Polygon
4 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Extensions/UIViewController+Extensions.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | extension UIViewController {
4 | var topmostPresentedViewController: UIViewController {
5 | var result = self
6 | while let presented = result.presentedViewController {
7 | result = presented
8 | }
9 | return result
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/ForwardingDispalyLinkTarget.swift:
--------------------------------------------------------------------------------
1 | import QuartzCore
2 |
3 | internal final class ForwardingDisplayLinkTarget {
4 | private let handler: (CADisplayLink) -> Void
5 |
6 | internal init(handler: @escaping (CADisplayLink) -> Void) {
7 | self.handler = handler
8 | }
9 |
10 | @objc internal func update(with displayLink: CADisplayLink) {
11 | handler(displayLink)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Helpers/CGPointCodable.swift:
--------------------------------------------------------------------------------
1 | import CoreFoundation.CFCGTypes
2 |
3 | /// `CGPoint` with Codable & Hashable support
4 | internal struct CGPointCodable: Codable, Hashable {
5 | var x: CGFloat
6 | var y: CGFloat
7 | }
8 |
9 | extension CGPointCodable {
10 | init(_ point: CGPoint) {
11 | self.x = point.x
12 | self.y = point.y
13 | }
14 |
15 | var point: CGPoint {
16 | get { CGPoint(x: x, y: y) }
17 | set {
18 | x = newValue.x
19 | y = newValue.y
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Helpers/CLLocationCoordinate2DCodable.swift:
--------------------------------------------------------------------------------
1 | import CoreLocation.CLLocation
2 |
3 | /// `CLLocationCoordinate2D` with Codable & Hashable support
4 | internal struct CLLocationCoordinate2DCodable: Codable, Hashable {
5 | var latitude: CLLocationDegrees
6 | var longitude: CLLocationDegrees
7 | }
8 |
9 | extension CLLocationCoordinate2DCodable {
10 | var coordinates: CLLocationCoordinate2D {
11 | get { CLLocationCoordinate2D(latitude: latitude, longitude: longitude) }
12 | set {
13 | latitude = newValue.latitude
14 | longitude = newValue.longitude
15 | }
16 | }
17 |
18 | init(_ coordinate: CLLocationCoordinate2D) {
19 | latitude = coordinate.latitude
20 | longitude = coordinate.longitude
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Helpers/MainQueueWrapper.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import Dispatch
3 |
4 | protocol MainQueueProtocol: DispatchQueueProtocol { }
5 |
6 | final class MainQueueWrapper: MainQueueProtocol {
7 | func async(
8 | group: DispatchGroup?,
9 | qos: DispatchQoS,
10 | flags: DispatchWorkItemFlags,
11 | execute work: @Sendable @escaping @convention(block) () -> Void
12 | ) {
13 | DispatchQueue.main.async(group: group, qos: qos, flags: flags, execute: work)
14 | }
15 |
16 | func async(execute workItem: DispatchWorkItem) {
17 | DispatchQueue.main.async(execute: workItem)
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Helpers/UIEdgeInsetsCodable.swift:
--------------------------------------------------------------------------------
1 | import UIKit.UIGeometry
2 |
3 | /// `UIEdgeInsets` with Codable & Hashable support
4 | internal struct UIEdgeInsetsCodable: Codable, Hashable {
5 | var top: CGFloat
6 | var left: CGFloat
7 | var bottom: CGFloat
8 | var right: CGFloat
9 | }
10 |
11 | extension UIEdgeInsetsCodable {
12 | var edgeInsets: UIEdgeInsets {
13 | get { UIEdgeInsets(top: top, left: left, bottom: bottom, right: right) }
14 | set {
15 | top = newValue.top
16 | left = newValue.left
17 | bottom = newValue.bottom
18 | right = newValue.right
19 | }
20 | }
21 |
22 | init(_ edgeInsets: UIEdgeInsets) {
23 | top = edgeInsets.top
24 | left = edgeInsets.left
25 | bottom = edgeInsets.bottom
26 | right = edgeInsets.right
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Interpolators/DoubleInterpolator.swift:
--------------------------------------------------------------------------------
1 | internal protocol DoubleInterpolatorProtocol {
2 | func interpolate(from: Double, to: Double, fraction: Double) -> Double
3 | }
4 |
5 | internal final class DoubleInterpolator: DoubleInterpolatorProtocol {
6 | internal func interpolate(from: Double,
7 | to: Double,
8 | fraction: Double) -> Double {
9 | return from + (to - from) * fraction
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Interpolators/OptionalInterpolator.swift:
--------------------------------------------------------------------------------
1 | internal struct OptionalInterpolator {
2 | internal func interpolate(from: T?,
3 | to: T?,
4 | fraction: Double,
5 | interpolate: (T, T, Double) -> T) -> T? {
6 | if let from = from, let to = to {
7 | return interpolate(from, to, fraction)
8 | } else {
9 | return nil
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/MapViewMetricsReporter.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import MetalKit
3 |
4 | @_spi(Metrics) public protocol MapViewMetricsReporter: AnyObject {
5 | func beforeDisplayLinkCallback(displayLink: CADisplayLink)
6 | func afterDisplayLinkCallback(displayLink: CADisplayLink)
7 |
8 | func beforeMetalViewDrawCallback()
9 | func afterMetalViewDrawCallback()
10 | }
11 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/ObjectWrapper.swift:
--------------------------------------------------------------------------------
1 | /// Helper class to wrap any subject as a reference type, so it can be compared by identity (`===`).
2 | internal class ObjectWrapper {
3 | var subject: T
4 | init(subject: T) {
5 | self.subject = subject
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Optional+Extensions.swift:
--------------------------------------------------------------------------------
1 | extension Optional {
2 | var asArray: [Wrapped] {
3 | switch self {
4 | case .none: return []
5 | case .some(let wrapped): return [wrapped]
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Reexports.swift:
--------------------------------------------------------------------------------
1 | @_exported import MapboxCoreMaps
2 | @_exported import MapboxCommon
3 | @_exported import Turf
4 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/RetroactiveConformances/BundleProtocol.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | internal protocol BundleProtocol: AnyObject {
4 | var infoDictionary: [String: Any]? { get }
5 | func path(forResource name: String?, ofType ext: String?) -> String?
6 | }
7 |
8 | extension Bundle: BundleProtocol {}
9 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/RetroactiveConformances/DisplayLinkProtocol.swift:
--------------------------------------------------------------------------------
1 | import QuartzCore
2 |
3 | internal protocol DisplayLinkProtocol: AnyObject {
4 | var timestamp: CFTimeInterval { get }
5 | var duration: CFTimeInterval { get }
6 | var preferredFramesPerSecond: Int { get set }
7 | @available(iOS 15.0, *)
8 | var preferredFrameRateRange: CAFrameRateRange { get set }
9 | var isPaused: Bool { get set }
10 | func add(to runloop: RunLoop, forMode mode: RunLoop.Mode)
11 | func invalidate()
12 | }
13 |
14 | extension CADisplayLink: DisplayLinkProtocol {}
15 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/RetroactiveConformances/NotificationCenterProtocol.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | internal protocol NotificationCenterProtocol: AnyObject {
4 | func addObserver(_ observer: Any, selector aSelector: Selector, name aName: NSNotification.Name?, object anObject: Any?)
5 |
6 | func removeObserver(_ observer: Any)
7 | func removeObserver(_ observer: Any, name aName: NSNotification.Name?, object anObject: Any?)
8 | }
9 |
10 | extension NotificationCenter: NotificationCenterProtocol {}
11 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/RetroactiveConformances/TimerProtocol.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | internal protocol TimerProtocol: AnyObject {
4 | func invalidate()
5 | }
6 |
7 | extension Timer: TimerProtocol {}
8 |
9 | internal protocol TimerProviderProtocol {
10 | func makeScheduledTimer(timeInterval: TimeInterval,
11 | repeats: Bool,
12 | block: @escaping (TimerProtocol) -> Void) -> TimerProtocol
13 | }
14 |
15 | internal final class TimerProvider: TimerProviderProtocol {
16 | internal func makeScheduledTimer(timeInterval: TimeInterval, repeats: Bool, block: @escaping (TimerProtocol) -> Void) -> TimerProtocol {
17 | return Timer.scheduledTimer(withTimeInterval: timeInterval, repeats: repeats, block: block)
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/RetroactiveConformances/UIApplicationProtocol.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import UIKit
3 |
4 | internal protocol UIApplicationProtocol: AnyObject {
5 | var applicationState: UIApplication.State { get }
6 |
7 | func open(_ url: URL)
8 | }
9 |
10 | @available(iOSApplicationExtension, unavailable)
11 | extension UIApplication: UIApplicationProtocol {
12 | func open(_ url: URL) {
13 | open(url, options: [:], completionHandler: nil)
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/RetroactiveConformances/UIDeviceProtocol.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import UIKit
3 |
4 | internal protocol UIDeviceProtocol: AnyObject {
5 | var orientation: UIDeviceOrientation { get }
6 |
7 | func beginGeneratingDeviceOrientationNotifications()
8 | func endGeneratingDeviceOrientationNotifications()
9 | }
10 |
11 | #if swift(>=5.9)
12 | @available(visionOS, unavailable)
13 | #endif
14 | extension UIDevice: UIDeviceProtocol { }
15 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/ScreenShim.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | enum ScreenShim {
4 | static var nativeScale: CGFloat {
5 | #if swift(>=5.9) && os(visionOS)
6 | return UITraitCollection.current.displayScale
7 | #else
8 | return UIScreen.main.nativeScale
9 | #endif
10 | }
11 |
12 | static var scale: CGFloat {
13 | #if swift(>=5.9) && os(visionOS)
14 | return UITraitCollection.current.displayScale
15 | #else
16 | return UIScreen.main.scale
17 | #endif
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/Signal/Signal+Tracing.swift:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | extension Signal {
4 | /// Creates a signal that traces time required to handle it's update.
5 | ///
6 | /// Every invocation on every observer will result in trancing interval.
7 | func tracingInterval(_ name: StaticString, _ message: String? = nil, log: OSLog = .platform) -> Signal {
8 | Signal { handler in
9 | self.observe { payload in
10 | log.withIntervalSignpost(name, message) {
11 | handler(payload)
12 | }
13 | }
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Foundation/WeakSet.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | internal class WeakSet {
4 | private let hashTable = NSHashTable.weakObjects()
5 |
6 | internal var count: Int { hashTable.count }
7 | internal var anyObject: T? { hashTable.anyObject as? T }
8 |
9 | internal func add(_ object: T) {
10 | hashTable.add((object as AnyObject))
11 | }
12 |
13 | internal func remove(_ object: T) {
14 | hashTable.remove((object as AnyObject))
15 | }
16 |
17 | internal func removeAll() {
18 | hashTable.removeAllObjects()
19 | }
20 |
21 | internal var allObjects: [T] {
22 | // swiftlint:disable:next force_cast
23 | hashTable.allObjects.map { $0 as! T }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Gestures/GestureHandlers/FocusableGestureHandlerProtocol.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | internal protocol FocusableGestureHandlerProtocol: GestureHandler {
4 | var focalPoint: CGPoint? { get set }
5 | }
6 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Gestures/GestureHandlers/GestureHandler.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | protocol GestureHandlerDelegate: AnyObject {
4 | func gestureBegan(for gestureType: GestureType)
5 |
6 | func gestureEnded(for gestureType: GestureType, willAnimate: Bool)
7 |
8 | func animationEnded(for gestureType: GestureType)
9 | }
10 |
11 | class GestureHandler: NSObject {
12 | let gestureRecognizer: UIGestureRecognizer
13 |
14 | weak var delegate: GestureHandlerDelegate?
15 |
16 | init(gestureRecognizer: UIGestureRecognizer) {
17 | self.gestureRecognizer = gestureRecognizer
18 | }
19 |
20 | deinit {
21 | gestureRecognizer.view?.removeGestureRecognizer(gestureRecognizer)
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Gestures/GestureHandlers/UIGestureRecognizer+Extensions.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | /// Can be used to distinguish between recognizers attached to the SwiftUI hosting view and recognizers added tp underlying UIKit view
4 | /// SwiftUI API's add recognizers to the hosting view
5 | extension UIGestureRecognizer {
6 | func attachedToSameView(as other: UIGestureRecognizer) -> Bool {
7 | view === other.view
8 | }
9 | }
10 |
11 | /// Can be used to decide whether the recognizer should receive the touch.
12 | /// In case where the recognizer is known to be attached to some view we may ignore any touches that is going to be delievered to unrelated view.
13 | extension UIGestureRecognizer {
14 | func attachedToSameView(as touch: UITouch) -> Bool {
15 | view === touch.view
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Gestures/GestureRecognizers/TouchBeganGestureRecognizer.swift:
--------------------------------------------------------------------------------
1 | import UIKit.UIGestureRecognizerSubclass
2 |
3 | internal class TouchBeganGestureRecognizer: UIGestureRecognizer {
4 | override func touchesBegan(_ touches: Set, with event: UIEvent) {
5 | self.state = .recognized
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Location/HeadingInterpolator.swift:
--------------------------------------------------------------------------------
1 | internal func interpolateHeading(from: Heading, to: Heading, fraction: Double) -> Heading {
2 | let direction = directionInterpolator.interpolate(
3 | from: from.direction,
4 | to: to.direction,
5 | fraction: fraction)
6 |
7 | return Heading(
8 | direction: direction,
9 | accuracy: to.accuracy,
10 | timestamp: to.timestamp)
11 | }
12 |
13 | private let directionInterpolator = DirectionInterpolator(wrappingInterpolator: WrappingInterpolator())
14 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Location/HeadingProvider.swift:
--------------------------------------------------------------------------------
1 | /// Listens to ``HeadingProvider``'s updates.
2 | public protocol HeadingObserver: AnyObject {
3 | func onHeadingUpdate(_ heading: Heading)
4 | }
5 |
6 | /// Provides heading data to drive the location puck.
7 | public protocol HeadingProvider {
8 | /// Latest observed heading.
9 | var latestHeading: Heading? { get }
10 |
11 | /// Adds heading observer.
12 | func add(headingObserver: HeadingObserver)
13 |
14 | /// Removes heading observer.
15 | func remove(headingObserver: HeadingObserver)
16 | }
17 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Location/Location.swift:
--------------------------------------------------------------------------------
1 | import CoreLocation
2 |
3 | extension Location {
4 | var accuracyAuthorization: CLAccuracyAuthorization {
5 | let value = getExtra(key: Self.accuracyAuthorizationKey)
6 | let casted = (value as? NSNumber).flatMap { CLAccuracyAuthorization(rawValue: $0.intValue) }
7 | return casted ?? .fullAccuracy
8 | }
9 |
10 | private func getExtra(key: String) -> AnyObject? {
11 | (extra as? [String: AnyObject])?[key]
12 | }
13 |
14 | static func makeExtra(for accuracyAuthorization: CLAccuracyAuthorization) -> [String: AnyObject] {
15 | return [
16 | accuracyAuthorizationKey: NSNumber(value: accuracyAuthorization.rawValue)
17 | ]
18 | }
19 |
20 | private static let accuracyAuthorizationKey = "accuracyAuthorization"
21 | }
22 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Location/LocationPermissionsDelegate.swift:
--------------------------------------------------------------------------------
1 | import CoreLocation
2 |
3 | @available(*, unavailable, renamed: "AppleLocationProviderDelegate")
4 | public protocol LocationPermissionsDelegate: AnyObject { }
5 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Location/Puck/IndicatorAssets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Location/Puck/IndicatorAssets.xcassets/location-dot-inner.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "location-dot-inner.pdf",
5 | "idiom" : "universal"
6 | }
7 | ],
8 | "info" : {
9 | "author" : "xcode",
10 | "version" : 1
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Location/Puck/IndicatorAssets.xcassets/location-dot-outer.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "location-dot-outer.pdf",
5 | "idiom" : "universal"
6 | }
7 | ],
8 | "info" : {
9 | "author" : "xcode",
10 | "version" : 1
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Location/Puck/PuckRenderer.swift:
--------------------------------------------------------------------------------
1 | protocol PuckRenderer: AnyObject {
2 | associatedtype Configuration: Equatable
3 | var state: PuckRendererState? { get set }
4 | }
5 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Location/Puck/PuckRenderingData.swift:
--------------------------------------------------------------------------------
1 | /// Represents the interpolated data ready to render the user location puck.
2 | public struct PuckRenderingData: Equatable {
3 | /// Puck's location.
4 | public var location: Location
5 |
6 | /// Puck's heading.
7 | public var heading: Heading?
8 |
9 | /// Creates a puck rendering data.
10 | public init(
11 | location: Location,
12 | heading: Heading? = nil
13 | ) {
14 | self.location = location
15 | self.heading = heading
16 | }
17 | }
18 |
19 | extension PuckRenderingData {
20 | init?(locations: [Location]? = nil, heading: Heading? = nil) {
21 | guard let location = locations?.last else { return nil }
22 | self.location = location
23 | self.heading = heading
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/MapboxMaps.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | //! Project version number for MapboxMaps.
4 | FOUNDATION_EXPORT double MapboxMapsVersionNumber;
5 |
6 | //! Project version string for MapboxMaps.
7 | FOUNDATION_EXPORT const unsigned char MapboxMapsVersionString[];
8 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/MapboxMaps.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "11.14.0-SNAPSHOT-06-06--04-30.git-ae7b59c"
3 | }
4 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Offline/ClearCacheError.swift:
--------------------------------------------------------------------------------
1 | /// Describes the reason for a cache clearing failure.
2 | public enum ClearCacheError: Error, Equatable, Sendable, CoreErrorRepresentable {
3 |
4 | /// There was an issue accessing the database
5 | case database(String)
6 |
7 | /// There was an uncategorised error, check the associated message
8 | case other(String)
9 |
10 | init(coreError: MapboxCommon.CacheClearingError) {
11 | switch coreError.type {
12 | case .databaseError: self = .database(coreError.message)
13 | case .otherError: fallthrough
14 | @unknown default: self = .other(coreError.message)
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Offline/TileStoreObserver.swift:
--------------------------------------------------------------------------------
1 | public protocol TileStoreObserver: AnyObject {
2 | /// Called whenever the load progress of a `TileRegion` changes.
3 | func onRegionLoadProgress(forId id: String, progress: TileRegionLoadProgress)
4 |
5 | /// Called when a `TileRegion` load finishes.
6 | func onRegionLoadFinished(forId id: String, region: Result)
7 |
8 | /// Called when a `TileRegion` was removed.
9 | func onRegionRemoved(forId id: String)
10 |
11 | /// Called when the geometry of a `TileRegion` was modified.
12 | func onRegionGeometryChanged(forId id: String, geometry: Geometry?)
13 |
14 | /// Called when the user-provided metadata associated with a `TileRegion` was changed.
15 | func onRegionMetadataChanged(forId id: String, value: Any)
16 | }
17 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Offline/TileStoreObserverCancelable.swift:
--------------------------------------------------------------------------------
1 | @_implementationOnly import MapboxCommon_Private
2 |
3 | internal final class TileStoreObserverCancelable: Cancelable {
4 | private weak var observer: MapboxCommon_Private.TileStoreObserver?
5 | private weak var tileStore: TileStoreProtocol?
6 |
7 | internal init(observer: MapboxCommon_Private.TileStoreObserver, tileStore: TileStoreProtocol) {
8 | self.observer = observer
9 | self.tileStore = tileStore
10 | }
11 |
12 | internal func cancel() {
13 | if let observer = observer {
14 | tileStore?.__removeObserver(for: observer)
15 | }
16 | observer = nil
17 | tileStore = nil
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Ornaments/ScaleBar/MapboxScaleBarLabel.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | internal class MapboxScaleBarLabel: UILabel {
4 |
5 | override internal func drawText(in rect: CGRect) {
6 | let originalShadowOffset = shadowOffset
7 | let context = UIGraphicsGetCurrentContext()
8 |
9 | context?.setLineWidth(2)
10 | context?.setLineJoin(.round)
11 |
12 | context?.setTextDrawingMode(.stroke)
13 | textColor = .white
14 | super.drawText(in: rect)
15 |
16 | context?.setTextDrawingMode(.fill)
17 | textColor = .black
18 | shadowOffset = CGSize()
19 | super.drawText(in: rect)
20 |
21 | shadowOffset = originalShadowOffset
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Style/CustomSources/CustomRasterSourceTileData+Extensions.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | extension CustomRasterSourceTileData {
4 | /// Raster content of the tile. If an empty image is provided then the tile gets removed from the map.
5 | public var image: UIImage? { __image.flatMap { UIImage(mbmImage: $0) } }
6 |
7 | /// Creates a raster source tile data.
8 | /// - Parameters:
9 | /// - tileId: Cannonical tile id.
10 | /// - image: Raster content of the tile.
11 | public convenience init(tileId: CanonicalTileID, image: UIImage?) {
12 | self.init(tileId: tileId, image: image.flatMap { CoreMapsImage(uiImage: $0) })
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Style/EmptyCustomRenderer.swift:
--------------------------------------------------------------------------------
1 | import Metal
2 |
3 | class EmptyCustomRenderer: NSObject, CustomLayerHost {
4 | let shouldWarnBeforeUsage: Bool
5 |
6 | init(shouldWarnBeforeUsage: Bool = true) {
7 | self.shouldWarnBeforeUsage = shouldWarnBeforeUsage
8 | }
9 |
10 | func renderingWillStart(_ metalDevice: MTLDevice, colorPixelFormat: UInt, depthStencilPixelFormat: UInt) { }
11 |
12 | func render(_ parameters: CustomLayerRenderParameters, mtlCommandBuffer: MTLCommandBuffer, mtlRenderPassDescriptor: MTLRenderPassDescriptor) {}
13 |
14 | func renderingWillEnd() { }
15 | }
16 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Style/LayerAtPosition.swift:
--------------------------------------------------------------------------------
1 | // Wraps a layer with its ``LayerPosition`` so it can be placed appropriately in the layer stack.
2 | public struct LayerAtPosition: MapStyleContent, PrimitiveMapContent where L: Layer, L: Equatable {
3 | // The layer wrapped in its ``LayerPosition``
4 | var layer: L
5 | var position: LayerPosition
6 |
7 | func visit(_ node: MapContentNode) {
8 | node.mount(MountedLayer(layer: layer, customPosition: position))
9 | }
10 | }
11 |
12 | extension SlotLayer {
13 | /// Positions this layer at a specified position.
14 | ///
15 | /// - Note: This method should be called last in a chain of layer updates.
16 | public func position(_ position: LayerPosition) -> LayerAtPosition {
17 | LayerAtPosition(layer: self, position: position)
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Style/LayerInfo.swift:
--------------------------------------------------------------------------------
1 | /// Information about a layer
2 | public struct LayerInfo: Sendable {
3 | /// The identifier of the layer
4 | public var id: String
5 |
6 | /// The type of the layer
7 | public var type: LayerType
8 |
9 | /// Create a `LayerInfo` value
10 | /// - Parameters:
11 | /// - id: A layer ID
12 | /// - type: A layer type
13 | public init(id: String, type: LayerType) {
14 | self.id = id
15 | self.type = type
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Style/LightInfo.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// Information about a light
4 | public struct LightInfo: Decodable, Sendable {
5 | /// The identifier of the light
6 | public var id: String
7 |
8 | /// The type of the light
9 | public var type: LightType
10 |
11 | /// Create a `LightInfo` value
12 | /// - Parameters:
13 | /// - id: A light ID
14 | /// - type: A light type
15 | public init(id: String, type: LightType) {
16 | self.id = id
17 | self.type = type
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Style/LightType.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | /// Supported light types
4 | public struct LightType: RawRepresentable, Codable, Equatable, Sendable {
5 |
6 | /// A global directional light.
7 | public static let flat = LightType(rawValue: "flat")
8 |
9 | /// An indirect type of light.
10 | public static let ambient = LightType(rawValue: "ambient")
11 |
12 | /// A type of light that has a direction.
13 | public static let directional = LightType(rawValue: "directional")
14 |
15 | public let rawValue: String
16 |
17 | public init(rawValue: String) {
18 | self.rawValue = rawValue
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Style/RasterArraySource+DataLayer.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | extension RasterArraySource {
4 | /// The description of the raster data layers and the bands contained within the tiles.
5 | @_documentation(visibility: public)
6 | @_spi(Experimental) public struct RasterDataLayer: Equatable, Codable, Sendable {
7 | /// Identifier of the data layer fetched from tiles.
8 | @_documentation(visibility: public)
9 | public let layerId: String
10 |
11 | /// An array of bands found in the data layer.
12 | @_documentation(visibility: public)
13 | public let bands: [String]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Style/Source.swift:
--------------------------------------------------------------------------------
1 | public protocol Source: Codable, StyleEncodable, StyleDecodable {
2 | /// Rendering type of this source.
3 | var type: SourceType { get }
4 |
5 | var id: String { get }
6 | }
7 |
8 | public extension Source {
9 | /// Initializes a Source given a JSON dictionary
10 | /// - Throws: Errors occurring during decoding
11 | init(jsonObject: [String: Any]) throws {
12 | let sourceData = try JSONSerialization.data(withJSONObject: jsonObject)
13 | self = try JSONDecoder().decode(Self.self, from: sourceData)
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Style/SourceInfo.swift:
--------------------------------------------------------------------------------
1 | /// Information about a Source
2 | public struct SourceInfo: Sendable {
3 | /// The identifier of the source
4 | public var id: String
5 |
6 | /// The type of the source
7 | public var type: SourceType
8 |
9 | /// Create a `SourceInfo` value
10 | /// - Parameters:
11 | /// - id: A source ID
12 | /// - type: A source type
13 | public init(id: String, type: SourceType) {
14 | self.id = id
15 | self.type = type
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Style/StyleProjection.swift:
--------------------------------------------------------------------------------
1 | /// Describes the projection used to render the map.
2 | public struct StyleProjection: Hashable, Codable, StyleEncodable, Equatable, Sendable {
3 |
4 | /// The name of the projection.
5 | public var name: StyleProjectionName
6 |
7 | /// Initializes a projection
8 | public init(name: StyleProjectionName) {
9 | self.name = name
10 | }
11 |
12 | internal enum CodingKeys: String, CodingKey {
13 | case name
14 | }
15 | }
16 |
17 | @_spi(Experimental)
18 | extension StyleProjection: MapStyleContent, PrimitiveMapContent {
19 | func visit(_ node: MapContentNode) {
20 | node.mount(MountedUniqueProperty(keyPath: \.projection, value: self))
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/SwiftUI/MapOrnaments.swift:
--------------------------------------------------------------------------------
1 | protocol OrnamentsManaging: AnyObject {
2 | var options: OrnamentOptions { get set }
3 | }
4 |
5 | extension OrnamentsManager: OrnamentsManaging {}
6 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/SwiftUI/README.md:
--------------------------------------------------------------------------------
1 | # Mapbox Maps SwiftUI
2 |
3 | ⚠️ Caution: This module is cunrrently in development and its API is not stable yet. We strongly recommend that it not be used in production.
4 |
5 | This module includes a SwiftUI interface for the Mapbox Maps SDK. Its purpose is to offer developers the easiest way to build great apps with Mapbox.
6 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/SwiftUI/Util/View+OnSizeChange.swift:
--------------------------------------------------------------------------------
1 | import CoreGraphics
2 | import SwiftUI
3 |
4 | extension View {
5 |
6 | func onChangeOfSize(perform action: @escaping (CGSize) -> Void) -> some View {
7 | modifier(OnSizeChangeModifier(action: action))
8 | }
9 | }
10 |
11 | private struct OnSizeChangeModifier: ViewModifier {
12 | let action: (CGSize) -> Void
13 |
14 | func body(content: Content) -> some View {
15 | content.background(
16 | GeometryReader { proxy in
17 | Color.clear.preference(key: SizePreferenceKey.self, value: proxy.size)
18 | }
19 | )
20 | .onPreferenceChange(SizePreferenceKey.self, perform: action)
21 | }
22 | }
23 |
24 | private struct SizePreferenceKey: PreferenceKey {
25 | static var defaultValue: CGSize = .zero
26 | static func reduce(value: inout CGSize, nextValue: () -> CGSize) {}
27 | }
28 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Viewport/Transitions/Default/CameraOptionsComponent.swift:
--------------------------------------------------------------------------------
1 | internal protocol CameraOptionsComponentProtocol {
2 | var cameraOptions: CameraOptions { get }
3 | func updated(with cameraOptions: CameraOptions) -> CameraOptionsComponentProtocol?
4 | }
5 |
6 | internal struct CameraOptionsComponent: CameraOptionsComponentProtocol {
7 | internal let keyPath: WritableKeyPath
8 | internal let value: T
9 |
10 | internal var cameraOptions: CameraOptions {
11 | var cameraOptions = CameraOptions()
12 | cameraOptions[keyPath: keyPath] = value
13 | return cameraOptions
14 | }
15 |
16 | internal func updated(with cameraOptions: CameraOptions) -> CameraOptionsComponentProtocol? {
17 | cameraOptions[keyPath: keyPath].map {
18 | CameraOptionsComponent(keyPath: keyPath, value: $0)
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Viewport/Transitions/Default/DefaultViewportTransitionAnimationSpec.swift:
--------------------------------------------------------------------------------
1 | internal struct DefaultViewportTransitionAnimationSpec {
2 | internal var duration: TimeInterval
3 | internal var delay: TimeInterval
4 | internal var cameraOptionsComponent: CameraOptionsComponentProtocol
5 |
6 | internal var total: TimeInterval {
7 | delay + duration
8 | }
9 |
10 | internal func scaled(by factor: Double) -> Self {
11 | var updatedSpec = self
12 | updatedSpec.duration *= factor
13 | updatedSpec.delay *= factor
14 | return updatedSpec
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Sources/MapboxMaps/Viewport/Transitions/Default/DefaultViewportTransitionOptions.swift:
--------------------------------------------------------------------------------
1 | /// Configuration options for ``DefaultViewportTransition``.
2 | public struct DefaultViewportTransitionOptions: Hashable, Sendable {
3 |
4 | /// The maximum duration of the transition.
5 | public var maxDuration: TimeInterval
6 |
7 | /// Memberwise initializer for `DefaultViewportTransitionOptions`.
8 | /// - Parameter maxDuration: Defaults to 3.5.
9 | public init(maxDuration: TimeInterval = 3.5) {
10 | self.maxDuration = maxDuration
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | #if !(swift(>=5.9) && os(visionOS))
3 | import Fingertips
4 | #endif
5 |
6 | @main
7 | public class AppDelegate: UIResponder, UIApplicationDelegate {
8 | #if !(swift(>=5.9) && os(visionOS))
9 | public var window: UIWindow? = {
10 | let window = FingerTipWindow(frame: UIScreen.main.bounds)
11 | window.alwaysShowTouches = true
12 | return window
13 | }()
14 | #endif
15 | }
16 |
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AccentColor.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "colors" : [
3 | {
4 | "color" : {
5 | "color-space" : "srgb",
6 | "components" : {
7 | "alpha" : "1.000",
8 | "blue" : "1.000",
9 | "green" : "0.747",
10 | "red" : "0.207"
11 | }
12 | },
13 | "idiom" : "universal"
14 | },
15 | {
16 | "appearances" : [
17 | {
18 | "appearance" : "luminosity",
19 | "value" : "dark"
20 | }
21 | ],
22 | "color" : {
23 | "color-space" : "srgb",
24 | "components" : {
25 | "alpha" : "1.000",
26 | "blue" : "1.000",
27 | "green" : "1.000",
28 | "red" : "1.000"
29 | }
30 | },
31 | "idiom" : "universal"
32 | }
33 | ],
34 | "info" : {
35 | "author" : "xcode",
36 | "version" : 1
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-40.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-72.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-76.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-small-50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-small-50.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-small-50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-small-50@2x.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-small.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-small@2x.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon-small@3x.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/icon@2x.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/ios-marketing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/ios-marketing.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/notification-icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/notification-icon@2x.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/notification-icon@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/notification-icon@3x.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/notification-icon~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/notification-icon~ipad.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/notification-icon~ipad@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Sources/MapboxTestHost/Assets.xcassets/AppIcon.appiconset/notification-icon~ipad@2x.png
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Sources/MapboxTestHost/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | MBXAccessToken
6 | MAPBOX_ACCESS_TOKEN
7 | UIFileSharingEnabled
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Tests/.swiftlint.yml:
--------------------------------------------------------------------------------
1 | ---
2 | type_name:
3 | allowed_symbols: ['_']
4 | disabled_rules:
5 | - type_body_length
6 | - file_length
7 | - function_body_length
8 |
--------------------------------------------------------------------------------
/Tests/GestureTests/Double Taps and Touch/DoubleTouchGesture.test.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | import MapboxMaps
3 | import Hammer
4 |
5 | final class DoubleTouchGestureTestCase: GestureTestCase {
6 | /// Test that tap with two fingers gestures change zoom level by -1
7 | func testDefaultDoubleTouch() async throws {
8 | try eventGenerator.twoFingerTap()
9 | await mapView.camera.cameraAnimators.waitForAllAnimations()
10 |
11 | XCTAssertEqual(mapView.mapboxMap.cameraState.zoom, 4)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Tests/GestureTests/RotateGesture.test.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | import MapboxMaps
3 | import Hammer
4 |
5 | final class RotateGestureTestCase: GestureTestCase {
6 |
7 | func testDefaultRotateGesture() async throws {
8 | mapView.ornaments.options.compass.visibility = .visible
9 |
10 | try eventGenerator.fingerRotate([.rightThumb, .rightIndex],
11 | angle: -90.0 * .pi / 180.0,
12 | duration: Constants.pinchDuration * 2)
13 |
14 | XCTAssertTrue(mapView.camera.cameraAnimators.isEmpty)
15 | XCTAssertGreaterThanOrEqual(mapView.mapboxMap.cameraState.bearing, 75)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Annotations/DelegatingViewAnnotationPositionsUpdateListenerTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import MapboxMaps
3 |
4 | final class ViewAnnotationPositionsUpdateListenerImplTests: XCTestCase {
5 |
6 | func testOnViewAnnotationPositionsUpdate() {
7 | let stub = Stub<[ViewAnnotationPositionDescriptor], Void>()
8 | let me = ViewAnnotationPositionsUpdateListenerImpl(callback: stub.call(with:))
9 |
10 | let descriptor = ViewAnnotationPositionDescriptor(
11 | identifier: "test",
12 | frame: .init(x: 100, y: 100, width: 100, height: 50)
13 | )
14 |
15 | me.onViewAnnotationPositionsUpdate(forPositions: [descriptor])
16 |
17 | XCTAssertEqual(stub.invocations.last?.parameters, [descriptor])
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Annotations/Generated/.swiftlint.yml:
--------------------------------------------------------------------------------
1 | ---
2 | disabled_rules:
3 | - force_cast
4 | - file_length
5 | - type_body_length
6 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Annotations/Mocks/ViewAnnotationUpdateObserver.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | @testable import MapboxMaps
3 |
4 | final class MockViewAnnotationUpdateObserver: ViewAnnotationUpdateObserver {
5 |
6 | let framesDidChangeStub = Stub<[UIView], Void>()
7 | func framesDidChange(for annotationViews: [UIView]) {
8 | framesDidChangeStub.call(with: annotationViews)
9 | }
10 |
11 | let visibilityDidChangeStub = Stub<[UIView], Void>()
12 | func visibilityDidChange(for annotationViews: [UIView]) {
13 | visibilityDidChangeStub.call(with: annotationViews)
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Annotations/ViewAnnotationPositionDescriptor.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | extension MapboxCoreMaps.ViewAnnotationPositionDescriptor {
4 | convenience init(
5 | identifier: String,
6 | frame: CGRect,
7 | anchorCoordinate: CLLocationCoordinate2D = CLLocationCoordinate2D(latitude: 0, longitude: 0),
8 | anchorConfig: ViewAnnotationAnchorConfig = ViewAnnotationAnchorConfig(anchor: .center)
9 | ) {
10 | self.init(__identifier: identifier,
11 | width: frame.width,
12 | height: frame.height,
13 | leftTopCoordinate: CoreScreenCoordinate(x: frame.minX, y: frame.minY),
14 | anchorCoordinate: anchorCoordinate,
15 | anchorConfig: anchorConfig)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Camera/AnimationOwnerTests.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 | import XCTest
3 |
4 | final class AnimationOwnerTests: XCTestCase {
5 |
6 | func testInitialization() {
7 | let rawValue = UUID().uuidString
8 |
9 | let owner = AnimationOwner(rawValue: rawValue)
10 |
11 | XCTAssertEqual(owner.rawValue, rawValue)
12 | }
13 |
14 | func testStaticValues() {
15 | XCTAssertEqual(AnimationOwner.gestures.rawValue, "com.mapbox.maps.gestures")
16 | XCTAssertEqual(AnimationOwner.unspecified.rawValue, "com.mapbox.maps.unspecified")
17 | XCTAssertEqual(AnimationOwner.cameraAnimationsManager.rawValue, "com.mapbox.maps.cameraAnimationsManager")
18 | XCTAssertEqual(AnimationOwner.defaultViewportTransition.rawValue, "com.mapbox.maps.viewport.defaultTransition")
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Camera/Mocks/MockCameraOptionsInterpolator.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | final class MockCameraOptionsInterpolator: CameraOptionsInterpolatorProtocol {
4 | struct InterpolateParams {
5 | var from: CameraOptions
6 | var to: CameraOptions
7 | var fraction: Double
8 | }
9 | let interpolateStub = Stub(defaultReturnValue: .testConstantValue())
10 | func interpolate(from: CameraOptions, to: CameraOptions, fraction: Double) -> CameraOptions {
11 | interpolateStub.call(with: .init(from: from, to: to, fraction: fraction))
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Camera/Mocks/MockCameraView.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | final class MockCameraView: CameraView {
4 | let syncLayerStub = Stub()
5 | override func syncLayer(to cameraOptions: CameraOptions) {
6 | syncLayerStub.call(with: cameraOptions)
7 | }
8 |
9 | let removeFromSuperviewStub = Stub()
10 | override func removeFromSuperview() {
11 | removeFromSuperviewStub.call()
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Camera/Mocks/MockLocationChangeHandler.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | struct LocationChangeHandlerParams: Equatable {
4 | var fromLocation: CGPoint
5 | var toLocation: CGPoint
6 | }
7 |
8 | typealias MockLocationChangeHandler = Stub
9 |
10 | extension MockLocationChangeHandler {
11 | func call(withFromLocation fromLocation: CGPoint, toLocation: CGPoint) {
12 | call(with: .init(fromLocation: fromLocation, toLocation: toLocation))
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Camera/Mocks/MockTimingCurveProvider.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | final class MockTimingCurveProvider: UITimingCurveProvider {
4 |
5 | var timingCurveType: UITimingCurveType = .cubic
6 |
7 | var cubicTimingParameters: UICubicTimingParameters?
8 |
9 | var springTimingParameters: UISpringTimingParameters?
10 |
11 | init() {
12 | }
13 |
14 | // MARK: - NSCoding
15 |
16 | init?(coder: NSCoder) {
17 | }
18 |
19 | func encode(with coder: NSCoder) {
20 | }
21 |
22 | // MARK: - NSCopying
23 |
24 | func copy(with zone: NSZone? = nil) -> Any {
25 | return self
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Camera/Random/AnimationOwner+Random.swift:
--------------------------------------------------------------------------------
1 | import MapboxMaps
2 |
3 | extension AnimationOwner {
4 | static func testConstantValue() -> Self {
5 | return AnimationOwner(rawValue: .testConstantASCII(withLength: 10))
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Assets.xcassets/green-star.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "green-star.pdf",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Assets.xcassets/green-star.imageset/green-star.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Tests/MapboxMapsTests/Foundation/Assets.xcassets/green-star.imageset/green-star.pdf
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Assets.xcassets/mapbox-icon.imageset/76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Tests/MapboxMapsTests/Foundation/Assets.xcassets/mapbox-icon.imageset/76x76@2x.png
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Assets.xcassets/mapbox-icon.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "filename" : "76x76@2x.png",
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Events/Mocks/EventsManagerMock.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | @testable import MapboxMaps
3 |
4 | class EventsManagerMock: EventsManagerProtocol {
5 |
6 | @Stubbed var accessToken: String
7 |
8 | init(accessToken: String = "tests") {
9 | self.accessToken = accessToken
10 | }
11 |
12 | let sendMapLoadEventStub = Stub()
13 | func sendMapLoadEvent(with tratis: UITraitCollection) {
14 | sendMapLoadEventStub.call(with: tratis)
15 | }
16 |
17 | let sendTurnstileStub = Stub()
18 | func sendTurnstile() {
19 | sendTurnstileStub.call()
20 | }
21 |
22 | let flushStub = Stub()
23 | func flush() {
24 | flushStub.call()
25 | }
26 |
27 | deinit {
28 | flush()
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Extensions/Core/LayerPositionTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import MapboxMaps
3 |
4 | final class LayerPositionTests: XCTestCase {
5 |
6 | func testPositionEnumEquality() {
7 | let a = LayerPosition.default
8 | let b = LayerPosition.default
9 | let c = LayerPosition.above("something")
10 | let d = LayerPosition.above("something-else")
11 | let e = LayerPosition.below("something")
12 | let f = LayerPosition.below("something-else")
13 | let g = LayerPosition.at(3)
14 | let h = LayerPosition.at(4)
15 |
16 | XCTAssertEqual(a, b)
17 | XCTAssertNotEqual(c, d)
18 | XCTAssertNotEqual(c, e)
19 | XCTAssertNotEqual(d, f)
20 | XCTAssertNotEqual(e, f)
21 | XCTAssertNotEqual(g, h)
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Extensions/Core/ScreenBoxTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import MapboxMaps
3 |
4 | final class ScreenBoxTests: XCTestCase {
5 | func testInitWithCGRect() {
6 | let rect = CGRect(
7 | x: 10,
8 | y: 0,
9 | width: 100,
10 | height: 0)
11 |
12 | let screenBox = CoreScreenBox(rect)
13 |
14 | XCTAssertEqual(screenBox.min, CoreScreenCoordinate(x: rect.minX, y: rect.minY))
15 | XCTAssertEqual(screenBox.max, CoreScreenCoordinate(x: rect.maxX, y: rect.maxY))
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Extensions/Core/SizeTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import MapboxMaps
3 |
4 | final class SizeTests: XCTestCase {
5 |
6 | func testInitSizeWithCGSize() {
7 | let cgSize = CGSize(
8 | width: 999,
9 | height: 0)
10 |
11 | let size = Size(cgSize)
12 |
13 | XCTAssertEqual(size.width, Float(cgSize.width))
14 | XCTAssertEqual(size.height, Float(cgSize.height))
15 | }
16 |
17 | func testInitCGSizeWithSize() {
18 | let size = Size(
19 | width: 1000,
20 | height: 1000)
21 |
22 | let cgSize = CGSize(size)
23 |
24 | XCTAssertEqual(cgSize.width, CGFloat(size.width))
25 | XCTAssertEqual(cgSize.height, CGFloat(size.height))
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Extensions/CoreGraphicsTests.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 | import XCTest
3 |
4 | final class CoreGraphicsTests: XCTestCase {
5 | func testPointArithmetic() {
6 | var point = CGPoint(x: 0, y: 0)
7 | point = point + CGPoint(x: 1, y: 2)
8 | point = point - CGPoint(x: -1, y: -2)
9 | XCTAssertEqual(point, CGPoint(x: 2, y: 4))
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Extensions/Encodable+ToJSONTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import MapboxMaps
3 |
4 | final class Encodable_ToJSONTests: XCTestCase {
5 | func testToJSON() {
6 | XCTAssertEqual(try 1.toJSON() as? Int, 1)
7 | XCTAssertEqual(try 1.0.toJSON() as? Double, 1.0)
8 | XCTAssertEqual(try "abc".toJSON() as? String, "abc")
9 | XCTAssertEqual(try true.toJSON() as? Bool, true)
10 | XCTAssertEqual(try false.toJSON() as? Bool, false)
11 | XCTAssertEqual(try String?.none.toJSON() as? NSNull, NSNull())
12 | XCTAssertEqual(try ["abc", "def"].toJSON() as? [String], ["abc", "def"])
13 | XCTAssertEqual(try ["abc": "def"].toJSON() as? [String: String], ["abc": "def"])
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Extensions/UIWindow+ParentSceneTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | #if canImport(CarPlay)
3 | import CarPlay
4 | #endif
5 | @testable import MapboxMaps
6 |
7 | final class UIWindowParentSizeTests: XCTestCase {
8 |
9 | #if canImport(CarPlay)
10 | func testCarPlayWindowReturnsCorrectParentScene() throws {
11 | guard #available(iOS 13.0, *) else {
12 | throw XCTSkip("Test requires iOS 13 or higher.")
13 | }
14 | let window = CPWindow()
15 |
16 | XCTAssertEqual(window.parentScene, window.templateApplicationScene)
17 | }
18 | #endif
19 |
20 | func testUIWindowReturnsCorrectParentScene() throws {
21 | guard #available(iOS 13.0, *) else {
22 | throw XCTSkip("Test requires iOS 13 or higher.")
23 | }
24 | let window = UIWindow()
25 |
26 | XCTAssertEqual(window.parentScene, window.windowScene)
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Fixtures/CameraOptions+Fixtures.swift:
--------------------------------------------------------------------------------
1 | import MapboxMaps
2 |
3 | extension CameraOptions {
4 | static func testConstantValue() -> Self {
5 | return CameraOptions(
6 | center: .init(latitude: 10, longitude: 10),
7 | padding: .init(top: 40, left: 29, bottom: 98, right: 83),
8 | anchor: .init(x: -28, y: -74),
9 | zoom: 71,
10 | bearing: 93,
11 | pitch: 45)
12 |
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Fixtures/CameraState+Fixtures.swift:
--------------------------------------------------------------------------------
1 | import MapboxMaps
2 | import UIKit
3 |
4 | extension CameraState {
5 | static func testConstantValue() -> Self {
6 | return CameraState(
7 | center: .init(latitude: 10, longitude: 10),
8 | padding: .init(top: 40, left: 29, bottom: 98, right: 83),
9 | zoom: 71,
10 | bearing: 93,
11 | pitch: 45)
12 |
13 | }
14 |
15 | static var zero: CameraState {
16 | CameraState(
17 | center: CLLocationCoordinate2D(
18 | latitude: 0,
19 | longitude: 0),
20 | padding: UIEdgeInsets(
21 | top: 0,
22 | left: 0,
23 | bottom: 0,
24 | right: 0),
25 | zoom: 0,
26 | bearing: 0,
27 | pitch: 0)
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Helpers/CAAnimationDelegateProxy.swift:
--------------------------------------------------------------------------------
1 | import QuartzCore
2 | import os
3 |
4 | final class CAAnimationDelegateProxy: NSObject, CAAnimationDelegate {
5 | var animationStart: ((_ animation: CAAnimation) -> Void)?
6 | var animationStop: ((_ animation: CAAnimation, _ finished: Bool) -> Void)?
7 |
8 | init(animationStop: ((_: CAAnimation, _: Bool) -> Void)? = nil) {
9 | self.animationStop = animationStop
10 | }
11 |
12 | func animationDidStart(_ anim: CAAnimation) {
13 | os_log(.info, #function)
14 | animationStart?(anim)
15 | }
16 |
17 | func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
18 | os_log(.info, #function)
19 | animationStop?(anim, flag)
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Interpolators/AnimationCurveTests.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 | import XCTest
3 |
4 | final class AnimationCurveTests: XCTestCase {
5 | func testEaseInOut() {
6 | XCTAssertEqual(TimingCurve.easeInOut.p1, CGPoint(x: 0.42, y: 0))
7 | XCTAssertEqual(TimingCurve.easeInOut.p2, CGPoint(x: 0.58, y: 1))
8 | }
9 |
10 | func testEaseIn() {
11 | XCTAssertEqual(TimingCurve.easeIn.p1, CGPoint(x: 0.58, y: 0))
12 | XCTAssertEqual(TimingCurve.easeIn.p2, CGPoint(x: 1, y: 1))
13 | }
14 |
15 | func testEaseOut() {
16 | XCTAssertEqual(TimingCurve.easeOut.p1, CGPoint(x: 0, y: 0))
17 | XCTAssertEqual(TimingCurve.easeOut.p2, CGPoint(x: 0.42, y: 1))
18 | }
19 |
20 | func testLinear() {
21 | XCTAssertEqual(TimingCurve.linear.p1, CGPoint(x: 0, y: 0))
22 | XCTAssertEqual(TimingCurve.linear.p2, CGPoint(x: 1, y: 1))
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Interpolators/DoubleInterpolatorTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import MapboxMaps
3 |
4 | final class DoubleInterpolatorTests: XCTestCase {
5 | func testInterpolate() {
6 | let interpolator = DoubleInterpolator()
7 |
8 | let fraction = 0.4
9 |
10 | XCTAssertEqual(interpolator.interpolate(from: 0, to: 0, fraction: fraction), 0)
11 | XCTAssertEqual(interpolator.interpolate(from: 0, to: 1, fraction: fraction), fraction)
12 | XCTAssertEqual(interpolator.interpolate(from: 0, to: 10, fraction: fraction), fraction * 10)
13 | XCTAssertEqual(interpolator.interpolate(from: 0, to: -1, fraction: fraction), -fraction)
14 | XCTAssertEqual(interpolator.interpolate(from: -1, to: 1, fraction: fraction), -1 + 2 * fraction)
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Interpolators/Mocks/MockCoordinateInterpolator.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 | import XCTest
3 | import CoreLocation
4 |
5 | final class MockCoordinateInterpolator: CoordinateInterpolatorProtocol {
6 | struct InterpolateParams {
7 | var from: CLLocationCoordinate2D
8 | var to: CLLocationCoordinate2D
9 | var fraction: Double
10 | }
11 | let interpolateStub = Stub(defaultReturnValue: .testConstantValue())
12 | func interpolate(from: CLLocationCoordinate2D, to: CLLocationCoordinate2D, fraction: Double) -> CLLocationCoordinate2D {
13 | interpolateStub.call(with: .init(from: from, to: to, fraction: fraction))
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Interpolators/Mocks/MockDirectionInterpolator.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 | import CoreLocation
3 |
4 | final class MockDirectionInterpolator: DirectionInterpolatorProtocol {
5 |
6 | struct InterpolateParams {
7 | var from: CLLocationDirection
8 | var to: CLLocationDirection
9 | var fraction: Double
10 | }
11 | let interpolateStub = Stub(defaultReturnValue: 340)
12 | func interpolate(from: CLLocationDirection,
13 | to: CLLocationDirection,
14 | fraction: Double) -> CLLocationDirection {
15 | interpolateStub.call(with: .init(
16 | from: from,
17 | to: to,
18 | fraction: fraction))
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Interpolators/Mocks/MockDoubleInterpolator.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | final class MockDoubleInterpolator: DoubleInterpolatorProtocol {
4 | struct InterpolateParams: Equatable {
5 | var from: Double
6 | var to: Double
7 | var fraction: Double
8 | }
9 | let interpolateStub = Stub(defaultReturnValue: 0)
10 | func interpolate(from: Double, to: Double, fraction: Double) -> Double {
11 | interpolateStub.call(with: .init(from: from, to: to, fraction: fraction))
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Interpolators/Mocks/MockLongitudeInterpolator.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 | import CoreLocation
3 |
4 | final class MockLongitudeInterpolator: LongitudeInterpolatorProtocol {
5 | struct InterpolateParams {
6 | var from: CLLocationDegrees
7 | var to: CLLocationDegrees
8 | var fraction: Double
9 | }
10 | let interpolateStub = Stub(defaultReturnValue: -180)
11 | func interpolate(from: CLLocationDegrees,
12 | to: CLLocationDegrees,
13 | fraction: Double) -> CLLocationDegrees {
14 | interpolateStub.call(with: .init(
15 | from: from,
16 | to: to,
17 | fraction: fraction))
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Interpolators/Mocks/MockUIEdgeInsetsInterpolator.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 | import UIKit
3 |
4 | final class MockUIEdgeInsetsInterpolator: UIEdgeInsetsInterpolatorProtocol {
5 | struct InterpolateParams {
6 | var from: UIEdgeInsets
7 | var to: UIEdgeInsets
8 | var fraction: Double
9 | }
10 | let interpolateStub = Stub(defaultReturnValue: .testConstantValue())
11 | func interpolate(from: UIEdgeInsets,
12 | to: UIEdgeInsets,
13 | fraction: Double) -> UIEdgeInsets {
14 | interpolateStub.call(with: .init(
15 | from: from,
16 | to: to,
17 | fraction: fraction))
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Interpolators/Random/TimingCurve+Fixtures.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | extension TimingCurve {
4 | static func testConstantValue() -> Self {
5 | return TimingCurve(p1: .testConstantValue(), p2: .testConstantValue())
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Mocks/MockAnnotationImagesManager.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | @testable import MapboxMaps
3 |
4 | final class MockAnnotationImagesManager: AnnotationImagesManagerProtocol {
5 |
6 | func register(imagesConsumer: AnnotationImagesConsumer) {}
7 | func unregister(imagesConsumer: AnnotationImagesConsumer) {}
8 |
9 | struct AddImageParameters {
10 | let image: UIImage, id: String, sdf: Bool, contentInsets: UIEdgeInsets
11 | }
12 | let addImageStub = Stub()
13 | func addImage(_ image: UIImage, id: String, sdf: Bool, contentInsets: UIEdgeInsets) {
14 | addImageStub.call(with: .init(image: image, id: id, sdf: sdf, contentInsets: contentInsets))
15 | }
16 |
17 | let removeImageStub = Stub()
18 | func removeImage(_ imageName: String) {
19 | removeImageStub.call(with: imageName)
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Mocks/MockAttributionURLOpener.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | @testable import MapboxMaps
3 |
4 | final class MockAttributionURLOpener: AttributionURLOpener {
5 | let openAttributionURLStub = Stub()
6 | func openAttributionURL(_ url: URL) {
7 | openAttributionURLStub.call(with: url)
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Mocks/MockBundle.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | @testable import MapboxMaps
3 |
4 | final class MockBundle: BundleProtocol {
5 | let infoDictionaryStub = Stub(defaultReturnValue: nil)
6 | var infoDictionary: [String: Any]? {
7 | infoDictionaryStub.call()
8 | }
9 |
10 | struct PathForResoucrParameters {
11 | let name, ext: String?
12 | }
13 | let pathForResourceStub = Stub(defaultReturnValue: nil)
14 | func path(forResource name: String?, ofType ext: String?) -> String? {
15 | pathForResourceStub.call(with: PathForResoucrParameters(name: name, ext: ext))
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Mocks/MockCancelable.swift:
--------------------------------------------------------------------------------
1 | import MapboxMaps
2 |
3 | final class MockCancelable: Cancelable {
4 | let cancelStub = Stub()
5 | func cancel() {
6 | cancelStub.call()
7 | }
8 |
9 | let deinitStub = Stub()
10 | deinit {
11 | deinitStub.call()
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Mocks/MockDateProvider.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | final class MockDateProvider: DateProvider {
4 |
5 | let nowStub = Stub(defaultReturnValue: Date(timeIntervalSinceReferenceDate: 0))
6 | var now: Date {
7 | nowStub.call()
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Mocks/MockDelegatingMapClientDelegate.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 | import MetalKit
3 |
4 | final class MockDelegatingMapClientDelegate: DelegatingMapClientDelegate {
5 | let scheduleRepaintStub = Stub()
6 | func scheduleRepaint() {
7 | scheduleRepaintStub.call()
8 | }
9 |
10 | let getMetalViewStub = Stub(defaultReturnValue: nil)
11 | func getMetalView(for metalDevice: MTLDevice?) -> MetalView? {
12 | return getMetalViewStub.call(with: metalDevice)
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Mocks/MockMapClient.swift:
--------------------------------------------------------------------------------
1 | import MapboxCoreMaps
2 | @testable import MapboxMaps
3 | import MetalKit
4 |
5 | final class MockMapClient: CoreMapClient, CoreMetalViewProvider {
6 | func scheduleRepaint() {
7 | }
8 |
9 | let getMetalViewStub = Stub(defaultReturnValue: nil)
10 | func getMetalView(for metalDevice: MTLDevice?) -> CoreMetalView? {
11 | getMetalViewStub.call(with: metalDevice)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Mocks/MockMetalView.swift:
--------------------------------------------------------------------------------
1 | import MetalKit
2 | @testable import MapboxMaps
3 |
4 | final class MockMetalView: MetalView {
5 | let drawStub = Stub()
6 | override func draw() {
7 | super.draw()
8 | drawStub.call()
9 | }
10 |
11 | let releaseDrawablesStub = Stub()
12 | override func releaseDrawables() {
13 | super.releaseDrawables()
14 | releaseDrawablesStub.call()
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Mocks/MockTimeProvider.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | @testable import MapboxMaps
3 |
4 | final class MockTimeProvider: TimeProvider {
5 | let currentStub = Stub(defaultReturnValue: 0)
6 | var current: TimeInterval { currentStub.call() }
7 | }
8 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Mocks/MockUIApplication.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import UIKit
3 | @testable import MapboxMaps
4 |
5 | final class MockUIApplication: UIApplicationProtocol {
6 | var statusBarOrientation: UIInterfaceOrientation = .unknown
7 | private(set) var applicationState: UIApplication.State = .active
8 |
9 | let openURLStub = Stub()
10 | func open(_ url: URL) {
11 | openURLStub.call(with: url)
12 | }
13 |
14 | func updateApplicationState(_ applicationState: UIApplication.State) {
15 | self.applicationState = applicationState
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Mocks/MockUIDevice.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import UIKit
3 | @testable import MapboxMaps
4 |
5 | final class MockUIDevice: UIDeviceProtocol {
6 | @Stubbed var orientation: UIDeviceOrientation = .unknown
7 |
8 | let beginGeneratingDeviceOrientationNotificationsStub = Stub()
9 | func beginGeneratingDeviceOrientationNotifications() {
10 | beginGeneratingDeviceOrientationNotificationsStub.call()
11 | }
12 |
13 | let endGeneratingDeviceOrientationNotificationsStub = Stub()
14 | func endGeneratingDeviceOrientationNotifications() {
15 | endGeneratingDeviceOrientationNotificationsStub.call()
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/Mocks/MockWrappingInterpolator.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | final class MockWrappingInterpolator: WrappingInterpolatorProtocol {
4 | struct InterpolateParams: Equatable {
5 | var from: Double
6 | var to: Double
7 | var fraction: Double
8 | var range: Range
9 | }
10 | let interpolateStub = Stub(defaultReturnValue: 0)
11 | func interpolate(from: Double,
12 | to: Double,
13 | fraction: Double,
14 | range: Range) -> Double {
15 | interpolateStub.call(with: .init(
16 | from: from,
17 | to: to,
18 | fraction: fraction,
19 | range: range))
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Foundation/OptionalExtensionsTests.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 | import XCTest
3 |
4 | final class OptionalExtensionTests: XCTestCase {
5 | func testAsArray() {
6 | var a: Int?
7 |
8 | XCTAssertEqual(a.asArray, [])
9 | a = 5
10 |
11 | XCTAssertEqual(a.asArray, [5])
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Gestures/GestureHandlers/Mocks/MockFocusableGestureHandler.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | final class MockFocusableGestureHandler: GestureHandler, FocusableGestureHandlerProtocol {
4 | var focalPoint: CGPoint?
5 | }
6 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Gestures/GestureHandlers/Mocks/MockPanGestureHandler.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | final class MockPanGestureHandler: GestureHandler, PanGestureHandlerProtocol {
4 | var decelerationFactor: CGFloat = 0.999
5 |
6 | var panMode: PanMode = .horizontalAndVertical
7 | var multiFingerPanEnabled: Bool = true
8 | }
9 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Gestures/GestureHandlers/Mocks/MockPinchGestureHandler.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | final class MockPinchGestureHandler: GestureHandler, PinchGestureHandlerProtocol {
4 | var rotateEnabled: Bool = true
5 |
6 | var zoomEnabled: Bool = true
7 |
8 | var focalPoint: CGPoint?
9 |
10 | var simultaneousRotateAndPinchZoomEnabled: Bool = true
11 | }
12 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Gestures/GestureHandlers/Mocks/MockRotateGestureHandler.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | @testable import MapboxMaps
3 |
4 | final class MockRotateGestureHandler: GestureHandler, RotateGestureHandlerProtocol {
5 | var focalPoint: CGPoint?
6 | var simultaneousRotateAndPinchZoomEnabled: Bool = true
7 |
8 | let scheduleRotationUpdateIfNeededStub = Stub()
9 | func scheduleRotationUpdateIfNeeded() {
10 | scheduleRotationUpdateIfNeededStub.call()
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Gestures/GestureOptionsTests.swift:
--------------------------------------------------------------------------------
1 | import MapboxMaps
2 | import XCTest
3 |
4 | final class GestureOptionsTests: XCTestCase {
5 | func testDefaultValues() {
6 | let options = GestureOptions()
7 |
8 | XCTAssertTrue(options.panEnabled)
9 | XCTAssertTrue(options.pinchEnabled)
10 | XCTAssertTrue(options.rotateEnabled)
11 | XCTAssertTrue(options.pinchZoomEnabled)
12 | XCTAssertTrue(options.pinchPanEnabled)
13 | XCTAssertTrue(options.pitchEnabled)
14 | XCTAssertTrue(options.doubleTapToZoomInEnabled)
15 | XCTAssertTrue(options.doubleTouchToZoomOutEnabled)
16 | XCTAssertTrue(options.quickZoomEnabled)
17 | XCTAssertEqual(options.panMode, .horizontalAndVertical)
18 | XCTAssertEqual(options.panDecelerationFactor, UIScrollView.DecelerationRate.normal.rawValue)
19 | XCTAssertNil(options.focalPoint)
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Gestures/GestureRecognizers/TouchBeganGestureRecognizerTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import MapboxMaps
3 |
4 | final class TouchBeganGestureRecognizerTests: XCTestCase {
5 | func testRecognizedState() {
6 | let recognizer = TouchBeganGestureRecognizer()
7 | XCTAssertNotEqual(recognizer.state, .recognized)
8 |
9 | recognizer.touchesBegan([UITouch()], with: UIEvent())
10 |
11 | XCTAssertEqual(recognizer.state, .recognized)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Gestures/MapContentGestureContext+Tests.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | extension InteractionContext {
4 | static let zero = InteractionContext(point: .init(x: 0, y: 0), coordinate: .init(latitude: 0, longitude: 0))
5 | }
6 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Helpers/Bundle+MapboxMapsTests.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | private class BundleLocator {}
4 |
5 | extension Bundle {
6 | class var mapboxMapsTests: Bundle {
7 | #if SWIFT_PACKAGE
8 | return Bundle.module
9 | #else
10 | return Bundle(for: BundleLocator.self)
11 | #endif
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Helpers/Encodable+JsonString.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | extension Encodable {
4 | func jsonString() throws -> String {
5 | String(data: try JSONEncoder().encode(self), encoding: .utf8)!
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Helpers/MockError.swift:
--------------------------------------------------------------------------------
1 | final class MockError: Error {
2 | }
3 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Helpers/Random/Array+Fixtures.swift:
--------------------------------------------------------------------------------
1 | extension Array {
2 | static func testFixture(withLength length: UInt, generator: () -> Element) -> Self {
3 | return (0.. Element? {
7 | if idx >= startIndex, idx < endIndex {
8 | return self[idx]
9 | }
10 | return nil
11 | }
12 | }
13 |
14 | extension Array where Element == String {
15 | static func testFixture() -> Self {
16 | .testFixture(withLength: 9, generator: { .testConstantASCII(withLength: 16) })
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Helpers/Random/CGPoint+Fixtures.swift:
--------------------------------------------------------------------------------
1 | import CoreGraphics
2 |
3 | extension CGPoint {
4 | static func testConstantValue() -> Self {
5 | return CGPoint(
6 | x: -100,
7 | y: 100)
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Helpers/Random/CLLocationCoordinate2D+Fixtures.swift:
--------------------------------------------------------------------------------
1 | import CoreLocation
2 |
3 | extension CLLocationCoordinate2D {
4 | static func testConstantValue() -> Self {
5 | return CLLocationCoordinate2D(
6 | latitude: .testConstantValue(),
7 | longitude: .testConstantValue())
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Helpers/Random/Character+Fixtures.swift:
--------------------------------------------------------------------------------
1 | extension Character {
2 | static func testConstantASCII(index: Int) -> Self {
3 | let characters = Array(" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~")
4 | return characters[index % characters.count]
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Helpers/Random/String+Fixtures.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | extension String {
3 | static func testConstantAlphanumeric(withLength length: UInt) -> Self {
4 | let letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
5 | return (0.. Self {
9 | return (0.. UIColor {
5 | return UIColor(
6 | red: 0.1,
7 | green: 0.2,
8 | blue: 0,
9 | alpha: 1)
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Helpers/String+FileSystemSafe.swift:
--------------------------------------------------------------------------------
1 | extension String {
2 | /// Creates a new string that is suitable for saving to the file-system
3 | /// - Returns: new string
4 | func fileSystemSafe() -> String {
5 | let invalidFileNameCharactersRegex = "[^a-zA-Z0-9_]+"
6 | let fullRange = startIndex..: StubProtocol {
5 | let getStub: Stub
6 | let setStub = Stub()
7 |
8 | var projectedValue: Stubbed {
9 | return self
10 | }
11 |
12 | let file: String
13 | let line: Int
14 |
15 | init(file: String = #file, line: Int = #line, wrappedValue: T) {
16 | self.file = file
17 | self.line = line
18 | getStub = Stub(defaultReturnValue: wrappedValue)
19 | }
20 |
21 | var wrappedValue: T {
22 | get {
23 | getStub.call()
24 | }
25 | set {
26 | setStub.call(with: newValue)
27 | getStub.defaultReturnValue = newValue
28 | }
29 | }
30 |
31 | func reset() {
32 | getStub.reset()
33 | setStub.reset()
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Helpers/TestSignal.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | @testable import MapboxMaps
3 |
4 | @propertyWrapper
5 | final class TestSignal {
6 | var projectedValue: SignalSubject { subject }
7 |
8 | var wrappedValue: Signal { subject.signal }
9 |
10 | let subject = SignalSubject()
11 | }
12 |
13 | /// Analogous to Published in Combine.
14 | @propertyWrapper
15 | final class TestPublished {
16 | var projectedValue: Signal {
17 | subject.signal
18 | }
19 |
20 | var wrappedValue: T {
21 | set { subject.value = newValue }
22 | get { subject.value }
23 | }
24 | let subject: CurrentValueSignalSubject
25 |
26 | init(wrappedValue: T) {
27 | self.subject = .init(wrappedValue)
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Helpers/UIApplication+Tests.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | extension UIApplication {
4 | var keyWindowForTests: UIWindow? {
5 | #if swift(>=5.9) && os(visionOS)
6 | return connectedScenes
7 | .compactMap({$0 as? UIWindowScene})
8 | .first?.windows
9 | .filter(\.isKeyWindow).first
10 | #else
11 | return keyWindow
12 | #endif
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Helpers/UIImage+Empty.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import UIKit
3 |
4 | extension UIImage {
5 | class var empty: UIImage {
6 | UIGraphicsBeginImageContext(.init(width: 1, height: 1))
7 | let image = UIGraphicsGetImageFromCurrentImageContext()
8 | UIGraphicsEndImageContext()
9 | return image!
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Helpers/UIImage+Init.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | extension UIImage {
4 |
5 | static func emptyImage(with size: CGSize = CGSize(width: 20, height: 20)) -> UIImage? {
6 | UIGraphicsBeginImageContext(size)
7 | let image = UIGraphicsGetImageFromCurrentImageContext()
8 | UIGraphicsEndImageContext()
9 | return image
10 | }
11 |
12 | static func generateSquare(color: UIColor) -> UIImage {
13 | return UIGraphicsImageRenderer(size: CGSize(width: 10, height: 10)).image {
14 | $0.cgContext.setFillColor(color.cgColor)
15 | $0.cgContext.fill([CGRect(x: 0, y: 0, width: 10, height: 10)])
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Helpers/XCTestCase+GuardForMetalDevice.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 |
3 | extension XCTestCase {
4 | func guardForMetalDevice() throws {
5 | guard MTLCreateSystemDefaultDevice() != nil else {
6 | XCTFail("No valid Metal device (OS version or VM?)")
7 | return
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Integration Tests/ExampleIntegrationTest.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | import MapboxMaps
3 | import CoreLocation
4 |
5 | final class ExampleIntegrationTest: MapViewIntegrationTestCase {
6 |
7 | func testWaitForIdle() throws {
8 | let expectation = XCTestExpectation(description: "Wait for map to idle")
9 | expectation.expectedFulfillmentCount = 2
10 |
11 | mapView.mapboxMap.styleJSON = .testStyleJSON()
12 |
13 | didFinishLoadingStyle = { _ in
14 | expectation.fulfill()
15 | }
16 |
17 | didBecomeIdle = { _ in
18 | expectation.fulfill()
19 | }
20 |
21 | wait(for: [expectation], timeout: 5.0)
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Location/LocationOptionsTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | import MapboxMaps
3 |
4 | final class LocationOptionsTests: XCTestCase {
5 | func testLocationOptionsPuckTypeDefault() {
6 | let locationOptions = LocationOptions()
7 | XCTAssertNil(locationOptions.puckType)
8 | }
9 |
10 | func testLocationOptionsPuckBearingDefault() {
11 | let locationOptions = LocationOptions()
12 | XCTAssertEqual(locationOptions.puckBearing, .heading)
13 | }
14 |
15 | func testLocationOptionsPuckBearingEnableDefault() {
16 | let locationOptions = LocationOptions()
17 | XCTAssertEqual(locationOptions.puckBearingEnabled, false)
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Location/LocationTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import MapboxMaps
3 |
4 | final class LocationTests: XCTestCase {
5 | func testAuthorizationAccuracy() {
6 | let coordinate = CLLocationCoordinate2D.testConstantValue()
7 | let date = Date()
8 | let loc1 = Location(coordinate: coordinate, timestamp: date, extra: Location.makeExtra(for: .fullAccuracy))
9 | let loc2 = Location(coordinate: coordinate, timestamp: date, extra: Location.makeExtra(for: .fullAccuracy))
10 |
11 | XCTAssertEqual(loc1.accuracyAuthorization, .fullAccuracy)
12 | XCTAssertEqual(loc1, loc2)
13 |
14 | let loc3 = Location(coordinate: .testConstantValue(), extra: Location.makeExtra(for: .reducedAccuracy))
15 | XCTAssertEqual(loc3.accuracyAuthorization, .reducedAccuracy)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Location/Mocks/MockLocationInterpolator.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | final class MockLocationInterpolator: LocationInterpolatorProtocol {
4 | struct InterpolateParams {
5 | var fromLocation: [Location]
6 | var toLocation: [Location]
7 | var fraction: Double
8 | }
9 | let interpolateStub = Stub(defaultReturnValue: [.testConstantValue()])
10 | func interpolate(from fromLocation: [Location],
11 | to toLocation: [Location],
12 | fraction: Double) -> [Location] {
13 | interpolateStub.call(with: .init(
14 | fromLocation: fromLocation,
15 | toLocation: toLocation,
16 | fraction: fraction))
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Location/Puck/Mocks/MockPuck.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | final class Mock2DPuckRenderer: PuckRenderer {
4 | @Stubbed var state: PuckRendererState?
5 | }
6 |
7 | final class Mock3DPuckRenderer: PuckRenderer {
8 | @Stubbed var state: PuckRendererState?
9 | }
10 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/MigrationGuide/Fixtures/polygon.geojson:
--------------------------------------------------------------------------------
1 | {"type":"Feature", "id": 1.01, "properties":{"null_test": null},"geometry":{"type":"Polygon","coordinates":[[[-109.05029296875,37.00255267215955],[-102.0849609375,37.020098201368114],[-102.041015625,41.0130657870063],[-109.072265625,40.97989806962013],[-109.05029296875,37.00255267215955]],[[-108.56689453125,40.6306300839918],[-108.61083984375,37.43997405227057],[-102.50244140624999,37.405073750176925],[-102.4365234375,40.66397287638688],[-108.56689453125,40.6306300839918]]]}}
2 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Offline/Mocks/MockMapboxCommonTileStoreObserver.swift:
--------------------------------------------------------------------------------
1 | @_implementationOnly import MapboxCommon_Private
2 |
3 | final class MockMapboxCommonTileStoreObserver: MapboxCommon_Private.TileStoreObserver {
4 | func onRegionLoadProgress(forId id: String, progress: TileRegionLoadProgress) {
5 | }
6 |
7 | func onRegionLoadFinished(forId id: String, region: Expected) {
8 | }
9 |
10 | func onRegionRemoved(forId id: String) {
11 | }
12 |
13 | func onRegionGeometryChanged(forId id: String, geometry: MapboxCommon.Geometry) {
14 | }
15 |
16 | func onRegionMetadataChanged(forId id: String, value: Any) {
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Offline/Mocks/MockTileStore.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 | @_implementationOnly import MapboxCommon_Private
3 |
4 | final class MockTileStore: TileStoreProtocol {
5 | let __removeObserverStub = Stub()
6 | func __removeObserver(for observer: MapboxCommon_Private.TileStoreObserver) {
7 | __removeObserverStub.call(with: observer)
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Ornaments/Mocks/MockInfoButtonOrnamentDelegate.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | final class MockInfoButtonOrnamentDelegate: InfoButtonOrnamentDelegate {
4 | func didTap(_ infoButtonOrnament: InfoButtonOrnament) {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Resources/empty-style-chicago.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 8,
3 | "center": [
4 | -87.6298,
5 | 41.8781
6 | ],
7 | "zoom": 12,
8 | "sources": {},
9 | "layers": []
10 | }
11 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Snapshot/testDoesNotShowAttribution().png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Tests/MapboxMapsTests/Snapshot/testDoesNotShowAttribution().png
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Snapshot/testDoesNotShowLogo().png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Tests/MapboxMapsTests/Snapshot/testDoesNotShowLogo().png
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Snapshot/testDoesNotShowLogoAndAttribution().png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Tests/MapboxMapsTests/Snapshot/testDoesNotShowLogoAndAttribution().png
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Snapshot/testShowsLogoAndAttribution().png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Tests/MapboxMapsTests/Snapshot/testShowsLogoAndAttribution().png
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Snapshot/testSnapshotAttribution-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Tests/MapboxMapsTests/Snapshot/testSnapshotAttribution-100.png
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Snapshot/testSnapshotAttribution-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Tests/MapboxMapsTests/Snapshot/testSnapshotAttribution-150.png
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Snapshot/testSnapshotAttribution-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Tests/MapboxMapsTests/Snapshot/testSnapshotAttribution-200.png
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Snapshot/testSnapshotAttribution-250.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Tests/MapboxMapsTests/Snapshot/testSnapshotAttribution-250.png
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Snapshot/testSnapshotAttribution-300.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Tests/MapboxMapsTests/Snapshot/testSnapshotAttribution-300.png
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Snapshot/testSnapshotAttribution-50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Tests/MapboxMapsTests/Snapshot/testSnapshotAttribution-50.png
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Snapshot/testSnapshotLogoVisibility.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Tests/MapboxMapsTests/Snapshot/testSnapshotLogoVisibility.png
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Snapshot/testSnapshotOverlay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/Tests/MapboxMapsTests/Snapshot/testSnapshotOverlay.png
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Style/ExpressionTests/ExpressionBuilderTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import MapboxMaps
3 |
4 | internal class ExpressionBuilderTests: XCTestCase {
5 |
6 | func testStopsDictionariesAreSorted() {
7 | let stopsDictionary: [Double: UIColor] = [
8 | 0.0: .red,
9 | 10.0: .blue,
10 | 7.0: .green]
11 |
12 | let args = stopsDictionary.expressionArguments
13 |
14 | if case Exp.Argument.number(let number1) = args[0],
15 | case Exp.Argument.number(let number2) = args[2],
16 | case Exp.Argument.number(let number3) = args[4] {
17 |
18 | if number1 > number2 || number2 > number3 {
19 | XCTFail("Stops dictionaries should always be sorted in ascending order of keys")
20 | }
21 | } else {
22 | XCTFail("Invalid expression")
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Style/Fixtures/LayerType+Fixtures.swift:
--------------------------------------------------------------------------------
1 | import MapboxMaps
2 |
3 | extension LayerType {
4 | static func testConstantValue() -> Self {
5 | .fillExtrusion
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Style/Fixtures/SourceProperties+Fixtures.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import CoreLocation
3 | @testable import MapboxMaps
4 |
5 | internal extension Scheme {
6 | static func testSourceValue() -> Scheme {
7 | return .tms
8 | }
9 | }
10 |
11 | internal extension Encoding {
12 | static func testSourceValue() -> Encoding {
13 | return .mapbox
14 | }
15 | }
16 |
17 | extension GeoJSONSourceData {
18 | static func testSourceValue() -> GeoJSONSourceData {
19 | let point = Point(CLLocationCoordinate2D(latitude: 0, longitude: 0))
20 | return .feature(.init(geometry: .point(point)))
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Style/Fixtures/SourceType+Fixtures.swift:
--------------------------------------------------------------------------------
1 | import MapboxMaps
2 |
3 | extension SourceType {
4 | static func testConstantValue() -> Self {
5 | .rasterDem
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Style/LayerInfoTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | import MapboxMaps
3 |
4 | final class LayerInfoTests: XCTestCase {
5 | func testMemberwiseInit() {
6 | let id = String.testConstantASCII(withLength: 19)
7 | let type = LayerType.testConstantValue()
8 |
9 | let layerInfo = LayerInfo(id: id, type: type)
10 |
11 | XCTAssertEqual(layerInfo.id, id)
12 | XCTAssertEqual(layerInfo.type, type)
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Style/Mocks/MockAttributionDataSource.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import MapboxMaps
3 | import Foundation
4 |
5 | final class MockAttributionDataSource: AttributionDataSource {
6 | var attributions: [MapboxMaps.Attribution] = []
7 | let loadAttributionsStub = Stub<(([Attribution]) -> Void), Void>()
8 | func loadAttributions(completion: @escaping ([MapboxMaps.Attribution]) -> Void) {
9 | completion(attributions)
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Style/Mocks/MockAttributionDialogManagerDelegate.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import MapboxMaps
3 | import Foundation
4 |
5 | final class MockAttributionDialogManagerDelegate: AttributionDialogManagerDelegate {
6 |
7 | let viewControllerForPresentingStub = Stub(defaultReturnValue: UIViewController())
8 | func viewControllerForPresenting(_ attributionDialogManager: AttributionDialogManager) -> UIViewController? {
9 | viewControllerForPresentingStub.call(with: attributionDialogManager)
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Style/SouceInfoTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | import MapboxMaps
3 |
4 | final class SourceInfoTests: XCTestCase {
5 | func testMemberwiseInit() {
6 | let id = String.testConstantASCII(withLength: 20)
7 | let type = SourceType.testConstantValue()
8 |
9 | let sourceInfo = SourceInfo(id: id, type: type)
10 |
11 | XCTAssertEqual(sourceInfo.id, id)
12 | XCTAssertEqual(sourceInfo.type, type)
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/SwiftUI/Mocks/MockOrnamentsManager.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | @testable import MapboxMaps
3 |
4 | final class MockOrnamentsManager: OrnamentsManaging {
5 | @Stubbed var options = OrnamentOptions()
6 | }
7 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/SwiftUI/Mocks/MockViewAnnotationsManager.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | @testable import MapboxMaps
3 |
4 | final class MockViewAnnotationsManager: ViewAnnotationsManaging {
5 | let mapboxMap = MockMapboxMap()
6 | @TestSignal var displayLink: Signal
7 | var superview = UIView()
8 | var removedAnnotations = [String]()
9 |
10 | let addStub = Stub()
11 | func add(_ annotation: ViewAnnotation) {
12 | addStub.call(with: annotation)
13 | annotation.bind(.init(superview: superview, mapboxMap: mapboxMap, displayLink: displayLink, onRemove: { [weak self, id = annotation.id] in
14 | self?.removedAnnotations.append(id)
15 | }))
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Viewport/Fixtures/ViewportOptions+Fixtures.swift:
--------------------------------------------------------------------------------
1 | import MapboxMaps
2 |
3 | extension ViewportOptions {
4 | static func testConstantValue() -> Self {
5 | return ViewportOptions(
6 | transitionsToIdleUponUserInteraction: .testConstantValue())
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Viewport/Fixtures/ViewportStatus+Fixtures.swift:
--------------------------------------------------------------------------------
1 | import MapboxMaps
2 |
3 | extension ViewportStatus {
4 | static func testConstantValue() -> Self {
5 | .transition(MockViewportTransition(), toState: MockViewportState())
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Viewport/Mocks/MockViewportState.swift:
--------------------------------------------------------------------------------
1 | import MapboxMaps
2 |
3 | final class MockViewportState: ViewportState {
4 |
5 | let observeDataSourceStub = Stub<(CameraOptions) -> Bool, Cancelable>(defaultReturnValue: MockCancelable())
6 | func observeDataSource(with handler: @escaping (CameraOptions) -> Bool) -> Cancelable {
7 | observeDataSourceStub.call(with: handler)
8 | }
9 |
10 | let startUpdatingCameraStub = Stub()
11 | func startUpdatingCamera() {
12 | startUpdatingCameraStub.call()
13 | }
14 |
15 | let stopUpdatingCameraStub = Stub()
16 | func stopUpdatingCamera() {
17 | stopUpdatingCameraStub.call()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Viewport/Mocks/MockViewportStatusObserver.swift:
--------------------------------------------------------------------------------
1 | import MapboxMaps
2 |
3 | final class MockViewportStatusObserver: ViewportStatusObserver {
4 | struct ViewportStatusDidChangeParams: Equatable {
5 | var fromStatus: ViewportStatus
6 | var toStatus: ViewportStatus
7 | var reason: ViewportStatusChangeReason
8 | }
9 | let viewportStatusDidChangeStub = Stub()
10 | func viewportStatusDidChange(from fromStatus: ViewportStatus,
11 | to toStatus: ViewportStatus,
12 | reason: ViewportStatusChangeReason) {
13 | viewportStatusDidChangeStub.call(with: .init(
14 | fromStatus: fromStatus,
15 | toStatus: toStatus,
16 | reason: reason))
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Viewport/Mocks/MockViewportTransition.swift:
--------------------------------------------------------------------------------
1 | import MapboxMaps
2 |
3 | final class MockViewportTransition: ViewportTransition {
4 | struct RunParams {
5 | var toState: ViewportState
6 | var completion: (Bool) -> Void
7 | }
8 | let runStub = Stub(defaultReturnValue: MockCancelable())
9 | func run(to toState: ViewportState,
10 | completion: @escaping (Bool) -> Void) -> Cancelable {
11 | runStub.call(with: .init(
12 | toState: toState,
13 | completion: completion))
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Viewport/States/FollowPuck/Fixtures/FollowPuckViewportStateBearing+Fixtures.swift:
--------------------------------------------------------------------------------
1 | import MapboxMaps
2 |
3 | extension FollowPuckViewportStateBearing {
4 | static func testConstantValue() -> Self {
5 | .heading
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Viewport/States/FollowPuck/Fixtures/FollowPuckViewportStateOptions+Fixtures.swift:
--------------------------------------------------------------------------------
1 | import MapboxMaps
2 |
3 | extension FollowPuckViewportStateOptions {
4 | static func testConstantValue() -> Self {
5 | return FollowPuckViewportStateOptions(
6 | padding: .testConstantValue(),
7 | zoom: 4.7,
8 | bearing: .constant(45),
9 | pitch: 75)
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Viewport/States/Overview/Fixtures/OverviewViewportStateOptions+Fixtures.swift:
--------------------------------------------------------------------------------
1 | import MapboxMaps
2 |
3 | extension OverviewViewportStateOptions {
4 | static func testConstantValue() -> Self {
5 | return OverviewViewportStateOptions(
6 | geometry: Point(.testConstantValue()),
7 | geometryPadding: .testConstantValue(),
8 | bearing: 142,
9 | pitch: 80,
10 | animationDuration: 5)
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Viewport/Transitions/Default/DefaultViewportTransitionOptionsTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | import MapboxMaps
3 |
4 | final class DefaultViewportTransitionOptionsTests: XCTestCase {
5 |
6 | func testInitWithDefaultValues() {
7 | let options = DefaultViewportTransitionOptions()
8 |
9 | XCTAssertEqual(options.maxDuration, 3.5)
10 | }
11 |
12 | func testInitWithNonDefaultValues() {
13 | let maxDuration = TimeInterval.testConstantValue()
14 |
15 | let options = DefaultViewportTransitionOptions(
16 | maxDuration: maxDuration)
17 |
18 | XCTAssertEqual(options.maxDuration, maxDuration)
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Viewport/Transitions/Default/Fixtures/DefaultViewportTransitionOptions+Fixtures.swift:
--------------------------------------------------------------------------------
1 | import MapboxMaps
2 |
3 | extension DefaultViewportTransitionOptions {
4 | static func testConstantValue() -> Self {
5 | return DefaultViewportTransitionOptions(
6 | maxDuration: 13)
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Viewport/Transitions/Default/Mocks/MockCameraOptionsComponent.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | final class MockCameraOptionsComponent: CameraOptionsComponentProtocol {
4 | @Stubbed var cameraOptions: CameraOptions = .testConstantValue()
5 |
6 | let updatedStub = Stub(defaultReturnValue: nil)
7 | func updated(with cameraOptions: CameraOptions) -> CameraOptionsComponentProtocol? {
8 | updatedStub.call(with: cameraOptions)
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Viewport/Transitions/Default/Mocks/MockDefaultViewportTransitionAnimation.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | final class MockDefaultViewportTransitionAnimation: DefaultViewportTransitionAnimationProtocol {
4 |
5 | let startStub = Stub<(Bool) -> Void, Void>()
6 | func start(with completion: @escaping (Bool) -> Void) {
7 | startStub.call(with: completion)
8 | }
9 |
10 | let updateTargetCameraStub = Stub()
11 | func updateTargetCamera(with cameraOptions: CameraOptions) {
12 | updateTargetCameraStub.call(with: cameraOptions)
13 | }
14 |
15 | let cancelStub = Stub()
16 | func cancel() {
17 | cancelStub.call()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Viewport/Transitions/Default/Mocks/MockDefaultViewportTransitionAnimationHelper.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | final class MockDefaultViewportTransitionAnimationHelper: DefaultViewportTransitionAnimationHelperProtocol {
4 |
5 | struct MakeAnimationParams {
6 | var cameraOptions: CameraOptions
7 | var maxDuration: TimeInterval
8 | }
9 | let makeAnimationStub = Stub<
10 | MakeAnimationParams,
11 | DefaultViewportTransitionAnimationProtocol>(
12 | defaultReturnValue: MockDefaultViewportTransitionAnimation())
13 | func makeAnimation(cameraOptions: CameraOptions,
14 | maxDuration: TimeInterval) -> DefaultViewportTransitionAnimationProtocol {
15 | makeAnimationStub.call(with: .init(
16 | cameraOptions: cameraOptions,
17 | maxDuration: maxDuration))
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Viewport/Transitions/Default/Mocks/MockDefaultViewportTransitionAnimationSpecProvider.swift:
--------------------------------------------------------------------------------
1 | @testable import MapboxMaps
2 |
3 | final class MockDefaultViewportTransitionAnimationSpecProvider: DefaultViewportTransitionAnimationSpecProviderProtocol {
4 | let makeAnimationSpecsStub = Stub<
5 | CameraOptions,
6 | [DefaultViewportTransitionAnimationSpec]>(
7 | defaultReturnValue: [])
8 | func makeAnimationSpecs(cameraOptions: CameraOptions) -> [DefaultViewportTransitionAnimationSpec] {
9 | makeAnimationSpecsStub.call(with: cameraOptions)
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Tests/MapboxMapsTests/Viewport/ViewportOptionsTests.swift:
--------------------------------------------------------------------------------
1 | import MapboxMaps
2 | import XCTest
3 |
4 | final class ViewportOptionsTests: XCTestCase {
5 | func testInitWithDefaultValues() {
6 | let options = ViewportOptions()
7 |
8 | XCTAssertTrue(options.transitionsToIdleUponUserInteraction)
9 | }
10 |
11 | func testInitWithNonDefaultValues() {
12 | let transitionsToIdleUponUserInteraction = Bool.testConstantValue()
13 |
14 | let options = ViewportOptions(
15 | transitionsToIdleUponUserInteraction: transitionsToIdleUponUserInteraction)
16 |
17 | XCTAssertEqual(options.transitionsToIdleUponUserInteraction, transitionsToIdleUponUserInteraction)
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Tests/TestPlans/MapboxMapsAll.xctestplan:
--------------------------------------------------------------------------------
1 | {
2 | "configurations" : [
3 | {
4 | "id" : "E3C143EB-7F82-4493-BCCE-19876476264C",
5 | "name" : "Configuration 1",
6 | "options" : {
7 |
8 | }
9 | }
10 | ],
11 | "defaultOptions" : {
12 | "addressSanitizer" : {
13 | "detectStackUseAfterReturn" : true,
14 | "enabled" : true
15 | },
16 | "environmentVariableEntries" : [
17 | {
18 | "key" : "MAPBOX_MAPS_SIGNPOSTS_ENABLED",
19 | "value" : ""
20 | }
21 | ],
22 | "language" : "en",
23 | "testRepetitionMode" : "retryOnFailure"
24 | },
25 | "testTargets" : [
26 | {
27 | "parallelizable" : true,
28 | "target" : {
29 | "containerPath" : "container:",
30 | "identifier" : "MapboxMapsTests",
31 | "name" : "MapboxMapsTests"
32 | }
33 | }
34 | ],
35 | "version" : 1
36 | }
37 |
--------------------------------------------------------------------------------
/codecov.yml:
--------------------------------------------------------------------------------
1 | ---
2 | codecov:
3 | require_ci_to_pass: false
4 | notify:
5 | wait_for_ci: false
6 | ignore:
7 | - "Apps"
8 | - "PCVD"
9 | - "Tests"
10 | coverage:
11 | status:
12 | project:
13 | default:
14 | threshold: 2%
15 | patch:
16 | default:
17 | target: 90%
18 | comment:
19 | require_changes: true
20 | layout: "reach, diff, flags, files"
21 |
--------------------------------------------------------------------------------
/scripts/.shellcheckrc:
--------------------------------------------------------------------------------
1 | # Configuration file for https://github.com/koalaman/shellcheck
2 | source-path=SCRIPTDIR
3 |
4 | external-sources=true
5 |
--------------------------------------------------------------------------------
/scripts/code-coverage/publish_to_aws.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source="$1"
4 | date=`date +%Y-%m-%d`
5 | file_path="$2"
6 | if [ -z "$file_path" ] || [ -z "$source" ]; then
7 | >&2 echo "Usage: publish.sh source date filepath"
8 | >&2 echo ""
9 | >&2 echo "Example: publish.sh mobile_binarysize android-binarysize.json.gz"
10 | exit 1
11 | fi
12 | filename="${file_path##*/}"
13 | s3_destination="s3://mapbox-loading-dock/raw/${source}/${date}/${filename}"
14 |
15 | aws s3 cp "${file_path}" "${s3_destination}"
16 |
--------------------------------------------------------------------------------
/scripts/doc-generation/docc-theme/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/mapbox-maps-ios/de09f0f4bd20db55bf7e87fb7274135371281b6c/scripts/doc-generation/docc-theme/favicon.ico
--------------------------------------------------------------------------------
/scripts/generate_access_token_file.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Usage: Used as a build phase script to inject the Mapbox access to a file in the test bundle.
4 | # Dependencies: MAPBOXMAPS_PATH (relative path to mapbox-maps-ios) build setting must be set in target that use this script, in order to create the MapboxAccessToken file.
5 |
6 | echo "Generating Mapbox Access Token File..."
7 | token_file=~/.mapbox
8 | token_file2=~/mapbox
9 | token="$(cat $token_file 2>/dev/null || cat $token_file2 2>/dev/null)"
10 |
11 | if [ "$token" ]; then
12 | echo "${token}" > "$MAPBOXMAPS_PATH/Tests/MapboxMapsTests/Helpers/MapboxAccessToken"
13 | echo "Generated $INFOPLIST_PREFIX_HEADER"
14 | else
15 | echo \'error: Missing Mapbox access token\'
16 | echo "error: Get an access token from , then create a new file at ~/.mapbox that contains the access token."
17 | exit 1
18 | fi
19 |
--------------------------------------------------------------------------------
/scripts/insert_access_token.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Usage: Used as a build phase script to inject the Mapbox access token into the Info.plist.
4 | # Dependencies: INFOPLIST_PREFIX_HEADER) build setting must be set in target that use this script, in order to locate Info.plis file.
5 |
6 | echo "Inserting Mapbox access token..."
7 | token_file=~/.mapbox
8 | token_file2=~/mapbox
9 | token="$(cat $token_file 2>/dev/null || cat $token_file2 2>/dev/null)"
10 |
11 | if [ "$token" ]; then
12 | echo "#define MAPBOX_ACCESS_TOKEN $token" > "$INFOPLIST_PREFIX_HEADER"
13 | echo "Generated $INFOPLIST_PREFIX_HEADER"
14 | else
15 | echo \'error: Missing Mapbox access token\'
16 | echo "error: Get an access token from , then create a new file at ~/.mapbox that contains the access token."
17 | exit 1
18 | fi
19 |
--------------------------------------------------------------------------------
/scripts/release/README-dynamic.md:
--------------------------------------------------------------------------------
1 | # Mapbox Maps SDK v11 for iOS
2 |
3 | ## Xcode Installation Instructions
4 |
5 | 1. Please drag the following 5 XCFrameworks (included in this archive) to your
6 | Xcode project and add them to your application target.
7 |
8 | - `MapboxCommon.xcframework`
9 | - `MapboxCoreMaps.xcframework`
10 | - `MapboxMaps.xcframework`
11 | - `Turf.xcframework`
12 |
13 | 2. On the General tab for the target, scroll to the section labeled "Frameworks,
14 | Libraries and Embedded Content".
15 |
16 | 3. Ensure `Embed` is set to "Embed & Sign" for all 5 linked XCFrameworks.
17 |
18 | 4. Add `import MapboxMaps` to your Swift source file.
19 |
20 | 5. Please see the [Migration Guide](https://docs.mapbox.com/ios/maps/guides/migrate-to-v11/)
21 | for further guidelines.
22 |
--------------------------------------------------------------------------------
/scripts/release/packager/.gitignore:
--------------------------------------------------------------------------------
1 | /MapboxMaps.zip
2 |
--------------------------------------------------------------------------------
/scripts/release/packager/project.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: MapboxMaps
3 | include:
4 | - mapbox-maps-ios/xcodegen/MapboxMaps.yml
5 | settings:
6 | base:
7 | MAPBOXMAPS_PATH: mapbox-maps-ios
8 | INFOPLIST_FILE: "$(MAPBOXMAPS_PATH)/Sources/MapboxMaps/Info.plist"
9 | targets:
10 | MapboxMaps:
11 | templates:
12 | - MapboxMaps
13 | targetTemplates:
14 | maps-dependencies:
15 | dependencies:REPLACE:
16 | - framework: ../MapboxCoreMaps.xcframework
17 | - framework: ../Turf.xcframework
18 | - framework: ../MapboxCommon.xcframework
19 |
--------------------------------------------------------------------------------
/scripts/release/packager/versions.json:
--------------------------------------------------------------------------------
1 | {
2 | "MapboxCoreMaps": "11.14.0-SNAPSHOT-06-06--04-30.git-ae7b59c",
3 | "MapboxCommon": "24.14.0-SNAPSHOT-06-06--04-30.git-ae7b59c",
4 | "Turf": "4.0.0"
5 | }
6 |
--------------------------------------------------------------------------------
/scripts/run_swiftlint.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Usage: Used as a build phase script in Xcode to run SwiftLint
4 | # Dependencies: MAPBOXMAPS_PATH (relative path to mapbox-maps-ios) build setting must be set in target that use this script, in order to find the .swiftlint.yml file
5 |
6 | # Support Howebrew path on Apple Silicon macOS
7 | export PATH="$PATH:/opt/homebrew/bin"
8 |
9 | echo "MAPBOXMAPS_PATH=$MAPBOXMAPS_PATH"
10 |
11 | pushd "$MAPBOXMAPS_PATH" || exit 1
12 | pwd
13 |
14 | echo "Running SwiftLint in $PWD"
15 |
16 | if which swiftlint > /dev/null; then
17 | swiftlint lint "$@"
18 | else
19 | echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
20 | fi
21 |
--------------------------------------------------------------------------------
/scripts/utilities/cocoapods.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | pod_inject_cdn_version() {
4 | local library_name=$1
5 | local version=$2
6 |
7 | pod repo add-cdn trunk https://cdn.cocoapods.org/
8 | pod search "$library_name" --no-pager > /dev/null
9 | LIBRARY_NAME_HASH=$(md5 -qs "$library_name")
10 | CDN_HASH_PATH="$HOME/.cocoapods/repos/trunk/all_pods_versions_${LIBRARY_NAME_HASH:0:1}_${LIBRARY_NAME_HASH:1:1}_${LIBRARY_NAME_HASH:2:1}.txt"
11 | cat "$CDN_HASH_PATH"
12 | sed -i '' -E "s/($library_name.*)/\1\/${version}/g" "$CDN_HASH_PATH"
13 | cat "$CDN_HASH_PATH"
14 | }
15 |
--------------------------------------------------------------------------------
/scripts/utilities/git.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 |
4 | git_recent_vtag() { git describe --tags --abbrev=0 "$(git_recent_vtag_hash)"; }
5 |
6 | git_recent_vtag_hash() { git rev-list --tags='v*' --max-count=1 ; }
7 |
8 | git_head_hash() { git rev-parse HEAD ; }
9 |
10 | git_configure_release_user() {
11 | git config user.name "Release SDK bot"
12 | git config user.email "release-bot@mapbox.com"
13 | }
14 |
--------------------------------------------------------------------------------
/scripts/utilities/replace-regex-in-file.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | import sys
3 | import argparse
4 | import re
5 |
6 |
7 | def main(argv):
8 | parser = argparse.ArgumentParser(description="Replace string in file.")
9 | parser.add_argument("--old", required=True)
10 | parser.add_argument("--new", required=True)
11 | parser.add_argument("file")
12 |
13 | args = parser.parse_args()
14 |
15 | fin = open(args.file, "rt")
16 | data = fin.read()
17 | pattern = re.compile(args.old)
18 | data = re.sub(pattern, args.new, data)
19 | fin.close()
20 |
21 | fin = open(args.file, "wt")
22 | fin.write(data)
23 | fin.close()
24 |
25 |
26 | if __name__ == "__main__":
27 | main(sys.argv[1:])
28 |
--------------------------------------------------------------------------------
/scripts/utils.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash/env bash
2 |
3 | __UTILS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
4 | source "$__UTILS_SCRIPT_DIR/utilities/helpers.sh"
5 | source "$__UTILS_SCRIPT_DIR/utilities/git.sh"
6 | source "$__UTILS_SCRIPT_DIR/utilities/cocoapods.sh"
7 |
--------------------------------------------------------------------------------
/scripts/validate-integrations/.gitignore:
--------------------------------------------------------------------------------
1 | Info*.plist
2 | artifacts
3 | *.xcodeproj
4 |
--------------------------------------------------------------------------------
/scripts/validate-integrations/MapLoadingUITest.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 |
3 | class MapLoadingUITest: XCTestCase {
4 | func testExample() throws {
5 | let app = XCUIApplication()
6 | app.launch()
7 |
8 | let existancePredicate = NSPredicate(format: "exists == 1")
9 | let query = app.alerts.firstMatch
10 | expectation(for: existancePredicate, evaluatedWith: query, handler: nil)
11 |
12 | waitForExpectations(timeout: 10, handler: nil)
13 |
14 | let loadedPredicate = NSPredicate(format: "label CONTAINS[c] %@", "Loaded")
15 | let loadedAlert = app.alerts.containing(loadedPredicate)
16 |
17 | XCTAssertEqual(loadedAlert.count, 1)
18 |
19 | let failedPredicate = NSPredicate(format: "label CONTAINS[c] %@", "Failed")
20 | let failedAlert = app.alerts.containing(failedPredicate)
21 |
22 | XCTAssertEqual(failedAlert.count, 0)
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/scripts/validate-integrations/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | platform :ios, '14.0'
3 |
4 | target 'CocoaPodsIntegration' do
5 | # Comment the next line if you don't want to use dynamic frameworks
6 | use_frameworks!
7 |
8 | pod 'MapboxMaps', 'VERSION_HERE'
9 |
10 | end
11 |
--------------------------------------------------------------------------------
/scripts/validate-integrations/project.yml:
--------------------------------------------------------------------------------
1 | include:
2 | - project-base.yml
3 | packages:
4 | MapboxMaps:
5 | path: ../..
6 | targets:
7 | SwiftPackageManagerIntegration:
8 | templates:
9 | - Application
10 | dependencies:
11 | - package: MapboxMaps
12 | SwiftPackageManagerIntegrationUITest:
13 | templates:
14 | - UITest
15 | dependencies:
16 | - target: SwiftPackageManagerIntegration
17 | CocoaPodsIntegration:
18 | templates:
19 | - Application
20 | CocoaPodsIntegrationUITest:
21 | templates:
22 | - UITest
23 | dependencies:
24 | - target: CocoaPodsIntegration
25 |
--------------------------------------------------------------------------------