Skip to content

Commit

Permalink
Prepare for v11.0.0 release (#1933)
Browse files Browse the repository at this point in the history
* Update examples, align formatting (#1927)

* Bump version to v11.0.0 (#1932)
- Bump MapboxCoreMaps to v11.0.0 and MapboxCommon to v24.0.0

* Fix failing test case where assigned 'slot' is an empty string (#1934)

---------

Co-authored-by: Patrick Leonard <[email protected]>
  • Loading branch information
maios and pjleonard37 authored Nov 29, 2023
1 parent dcaec9b commit b28c633
Show file tree
Hide file tree
Showing 23 changed files with 93 additions and 91 deletions.
8 changes: 4 additions & 4 deletions Apps/Apps.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/mapbox/mapbox-common-ios.git",
"state" : {
"revision" : "47aacdb31c250fe033243f9aadf00513242dad13",
"version" : "24.0.0-rc.3"
"revision" : "66c604ce480a5d2e98dbe017b49886652d4d89a2",
"version" : "24.0.0"
}
},
{
"identity" : "mapbox-core-maps-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mapbox/mapbox-core-maps-ios.git",
"state" : {
"revision" : "52bb5c64c584638863801894e6231ead6417fbab",
"version" : "11.0.0-rc.2"
"revision" : "5c19a597907deb167eed89d737de878db9088f52",
"version" : "11.0.0"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class AnimateImageLayerExample: UIViewController, ExampleProtocol {
]

// Get the file path for the first radar image, then set the `url` for the `ImageSource` to that path.
let path = Bundle.main.path(forResource: "radar0", ofType: "gif")!
imageSource.url = path
let path = Bundle.main.url(forResource: "radar0", withExtension: "gif")
imageSource.url = path?.absoluteString

// Create a `RasterLayer` that will display the images from the `ImageSource`
var imageLayer = RasterLayer(id: "radar-layer", source: sourceId)
Expand Down Expand Up @@ -88,8 +88,8 @@ class AnimateImageLayerExample: UIViewController, ExampleProtocol {
self.imageNumber = 0
}
// Create a `UIImage` from the file at the specified path.
let path = Bundle.main.path(forResource: "radar\(self.imageNumber)", ofType: "gif")
let image = UIImage(contentsOfFile: path!)
let path = Bundle.main.url(forResource: "radar\(self.imageNumber)", withExtension: "gif")
let image = UIImage(contentsOfFile: path!.relativePath)

do {
// Update the image used by the `ImageSource`.
Expand Down
3 changes: 2 additions & 1 deletion Apps/Examples/Examples/All Examples/DebugMapExample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ final class DebugMapExample: UIViewController, ExampleProtocol, DebugOptionSetti
])

let debugOptionsBarItem = UIBarButtonItem(
barButtonSystemItem: .edit,
title: "Debug",
style: .plain,
target: self,
action: #selector(openDebugOptionsMenu(_:)))
let tileCover = UIBarButtonItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ public class FitCameraToGeometryExample: UIViewController, ExampleProtocol {
override public func viewDidLoad() {
super.viewDidLoad()

mapView = MapView(frame: view.bounds)
let cameraOptions = CameraOptions(center: CLLocationCoordinate2D(latitude: 43.2630, longitude: -2.99350), zoom: 11)
let mapInitOptions = MapInitOptions(cameraOptions: cameraOptions)
mapView = MapView(frame: view.bounds, mapInitOptions: mapInitOptions)
mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
view.addSubview(mapView)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class RasterTileSourceExample: UIViewController, ExampleProtocol {
// Initialize a `MapView` that is centered over the southeastern United States.
let centerCoordinate = CLLocationCoordinate2D(latitude: 40, longitude: -74.5)
let cameraOptions = CameraOptions(center: centerCoordinate, zoom: 2)
let mapInitOptions = MapInitOptions(cameraOptions: cameraOptions)
let mapInitOptions = MapInitOptions(cameraOptions: cameraOptions, styleURI: .satellite)

mapView = MapView(frame: view.bounds, mapInitOptions: mapInitOptions)
mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
Expand Down Expand Up @@ -46,8 +46,8 @@ class RasterTileSourceExample: UIViewController, ExampleProtocol {

func addRasterSource() {

// This URL points to raster tiles designed by Stamen Design.
let sourceUrl = "https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg"
// This URL points to raster tiles from OpenStreetMap
let sourceUrl = "https://tile.openstreetmap.org/{z}/{x}/{y}.png"

// Create a `RasterSource` and set the source's `tiles` to the Stamen watercolor raster tiles.
var rasterSource = RasterSource(id: sourceId)
Expand Down
88 changes: 45 additions & 43 deletions Apps/Examples/Examples/Models/Examples.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ struct Examples {
// Examples that show how to get started with Mapbox, such as creating a basic map view or setting a style once.
static let gettingStartedExamples = [
Example(title: "Display a map view",
description: """
Create and display a map that uses the default Mapbox streets style. This example also shows how to update the starting camera for a map.
""",
description: "Create and display a map that uses the default Mapbox Standard style.",
type: BasicMapExample.self),
Example(title: "Use a custom map style",
description: "Set and use a custom map style URL.",
Expand All @@ -75,7 +73,7 @@ struct Examples {
description: "Create and display a map using a storyboard.",
type: StoryboardMapViewExample.self),
Example(title: "Debug Map",
description: "This example shows how the map looks with different debug options",
description: "This example shows how the map looks with different debug options.",
type: DebugMapExample.self),
]

Expand All @@ -85,7 +83,7 @@ struct Examples {
description: "Show realistic elevation by enabling terrain.",
type: TerrainExample.self),
Example(title: "SceneKit rendering on map",
description: "Use custom layer to render SceneKit model over terrain.",
description: "Use a custom layer to render a SceneKit model over terrain.",
type: SceneKitExample.self),
Example(title: "Display 3D buildings",
description: "Extrude the building layer in the Mapbox Light style using FillExtrusionLayer and set up the light position.",
Expand All @@ -96,8 +94,8 @@ struct Examples {
Example(title: "Display a 3D model in a model layer",
description: "Showcase the usage of a 3D model layer.",
type: ModelLayerExample.self),
Example(title: "Lights 3D",
description: "Configure lights in 3D environment",
Example(title: "3D Lights",
description: "Configure lights in 3D environment.",
type: Lights3DExample.self)
]

Expand All @@ -107,10 +105,10 @@ struct Examples {
description: "Add a polygon annotation to the map.",
type: PolygonAnnotationExample.self),
Example(title: "Add a marker symbol",
description: "Add a blue teardrop-shaped marker image to a style and display it on the map using a SymbolLayer.",
description: "Add a red teardrop-shaped marker image to a style and display it on the map using a SymbolLayer.",
type: AddOneMarkerSymbolExample.self),
Example(title: "Add Circle Annotations",
description: "Show circle annotations on a map",
description: "Show circle annotations on a map.",
type: CircleAnnotationExample.self),
Example(title: "Add Cluster Symbol Annotations",
description: "Show fire hydrants in Washington DC area in a cluster using a symbol layer.",
Expand All @@ -121,10 +119,10 @@ struct Examples {
Example(title: "Add markers to a map",
description: "Add markers that use different icons.",
type: AddMarkersSymbolExample.self),
Example(title: "Add Point Annotations",
description: "Show point annotations on a map",
Example(title: "Add Point Annotation",
description: "Show custom point annotation on a map.",
type: CustomPointAnnotationExample.self),
Example(title: "Add Polylines Annotations",
Example(title: "Add Polyline annotations",
description: "Show polyline annotations on a map.",
type: LineAnnotationExample.self),
Example(title: "Animate Marker Position",
Expand All @@ -137,7 +135,7 @@ struct Examples {
description: "Draw multiple shapes on a map.",
type: MultipleGeometriesExample.self),
Example(title: "View annotation with point annotation",
description: "Add view annotation to a point annotation",
description: "Add view annotation to a point annotation.",
type: ViewAnnotationWithPointAnnotationExample.self),
Example(title: "View annotations: basic example",
description: "Add view annotation on a map with a click.",
Expand All @@ -149,11 +147,11 @@ struct Examples {
description: "Animates to camera framing the list of selected view annotations.",
type: FrameViewAnnotationsExample.self),
Example(title: "View annotations: animation",
description: "Animate a view annotation along a route",
description: "Animate a view annotation along a route.",
testTimeout: 60,
type: ViewAnnotationAnimationExample.self),
Example(title: "Dynamic View annotations",
description: "Use Dynamic View Annotations, Style, and Viewport API to create navigation experience",
Example(title: "Dynamic view annotations",
description: "Use Dynamic view annotations, Style, and the Viewport API to create a navigation experience.",
type: DynamicViewAnnotationExample.self)
]

Expand All @@ -168,41 +166,44 @@ struct Examples {
description: "Use ease(to:) to animate updates to the camera's position.",
type: CameraAnimationExample.self),
Example(title: "Viewport",
description: "Viewport camera showcase",
description: "Viewport camera showcase.",
type: ViewportExample.self),
Example(title: "Advanced Viewport Gestures",
description: "Viewport configured to allow gestures",
Example(title: "Advanced viewport gestures",
description: "Viewport configured to allow gestures.",
type: AdvancedViewportGesturesExample.self),
Example(title: "Filter symbols based on pitch and distance",
description: "Use pitch and distance-from-center expressions in the filter field of a symbol layer to remove large size POI labels in the far distance at high pitch",
description: "Use pitch and distance-from-center expressions in the filter field of a symbol layer to remove large size POI labels in the far distance at high pitch.",
type: PitchAndDistanceExample.self),
Example(title: "Add an Inset Map",
description: "Add a smaller inset map that visualizes the viewport of the main map",
Example(title: "Add an inset map",
description: "Add a smaller inset map that visualizes the viewport of the main map.",
type: InsetMapExample.self),
Example(title: "Fit camera to geometry",
description: "Fits the camera to a provided geometry.",
type: FitCameraToGeometryExample.self),
]

// Miscellaneous examples
public static let labExamples = [
Example(title: "Resizable image",
description: "Add a resizable image with cap insets to a style.",
type: ResizableImageExample.self),
Example(title: "Geojson performance",
description: "Display long route as large geojson",
Example(title: "GeoJSON performance",
description: "Display a long route from a large geojson.",
type: LargeGeoJSONPerformanceExample.self),
Example(title: "Map Events",
description: "Print out map events and data",
Example(title: "Map events",
description: "Print out map events and data.",
type: MapEventsExample.self),
Example(title: "Map Recorder",
description: "Record and replay map animations and actions",
Example(title: "Map recorder",
description: "Record and replay map animations and actions.",
type: MapRecorderExample.self)
] + {
if #available(iOS 13.0, *) {
return [
Example(title: "Combine",
description: "Shows how to use map events with Combine framework",
description: "Shows how to use map events with Combine framework.",
type: CombineExample.self),
Example(title: "Combine Location",
description: "Shows how to use Combine framework to drive the location puck",
Example(title: "Combine location",
description: "Shows how to use Combine framework to drive the location puck.",
type: CombineLocationExample.self)
]
} else {
Expand All @@ -215,11 +216,11 @@ struct Examples {
Example(title: "Display the user's location",
description: "Display the user's location on a map with the default user location puck.",
type: TrackingModeExample.self),
Example(title: "Basic pulsing circle",
Example(title: "Basic pulsing puck",
description: "Display sonar-like animation radiating from the location puck.",
type: BasicLocationPulsingExample.self),
Example(title: "Customize the location puck",
description: "Customized the location puck on the map",
description: "Customized the location puck on the map.",
type: Custom2DPuckExample.self),
Example(title: "Use a 3D model to show the user's location",
description: "A 3D model is used to represent the user's location.",
Expand All @@ -228,12 +229,11 @@ struct Examples {
description: "Display the location puck at a custom location.",
type: CustomLocationProviderExample.self),
Example(title: "Simulate navigation",
description: "Simulate a driving trip from LA to San Francisco along a pre-defined route",
description: "Simulate a driving trip from LA to San Francisco along a pre-defined route.",
type: NavigationSimulatorExample.self),
]

// Examples that highlight using the Offline APIs.

static let offlineExamples = [
Example(title: "Use OfflineManager and TileStore to download a region",
description: """
Expand Down Expand Up @@ -303,7 +303,7 @@ struct Examples {
Example(title: "Add external vector tiles",
description: "Add vector map tiles from an external source, using the {z}/{x}/{y} URL scheme.",
type: ExternalVectorSourceExample.self),
Example(title: "Use interpolate colors between zoom level",
Example(title: "Interpolate colors between zoom level",
description: """
Use an interpolate expression to style the background layer color depending on zoom level.
""",
Expand All @@ -318,7 +318,7 @@ struct Examples {
description: "Switch between local and default Mapbox styles for the same map view.",
type: SwitchStylesExample.self),
Example(title: "Change the map's language",
description: "Switch between supported languages for Symbol Layers",
description: "Switch between supported languages for Symbol layers.",
type: LocalizationExample.self),
Example(title: "Add animated weather data",
description: "Load a raster image to a style using ImageSource and display it on a map as animated weather data using RasterLayer.",
Expand All @@ -327,7 +327,7 @@ struct Examples {
description: "Add third-party raster tiles to a map.",
type: RasterTileSourceExample.self),
Example(title: "Raster colorization",
description: "Display weatcher user raster-color.",
description: "Display weather using raster-color.",
type: RasterColorExample.self),
Example(title: "Show and hide layers",
description: "Allow the user to toggle the visibility of a CircleLayer and LineLayer on a map.",
Expand All @@ -338,10 +338,12 @@ struct Examples {
Example(title: "Join data to vector geometry",
description: "Join local JSON data with vector tile geometries.",
type: DataJoinExample.self),
Example(title: "Use a distance expression", description: "Use a distance style expression to show features within a specific radius.", type: DistanceExpressionExample.self),
Example(title: "Use a distance expression",
description: "Use a distance style expression to show features within a specific radius.",
type: DistanceExpressionExample.self),
Example(
title: "Add custom raster source",
description: "Load a custom raster source to Style and display it on a map as animated weather data using RasterLayer",
description: "Load a custom raster source to Style and display it on a map as animated weather data using RasterLayer.",
type: CustomRasterSourceExample.self),
]

Expand All @@ -350,17 +352,17 @@ struct Examples {
Example(title: "Find features at a point",
description: "Query the map for rendered features belonging to a specific layer.",
type: FeaturesAtPointExample.self),
Example(title: "Use Feature State",
Example(title: "Use feature state",
description: "Manipulate map styling with feature states and expressions.",
type: FeatureStateExample.self),
Example(title: "Restrict the map's coordinate bounds",
description: "Prevent the map from panning outside the specified coordinate bounds.",
type: RestrictCoordinateBoundsExample.self),
Example(title: "Add an interactive clustered layer",
description: "Display an alert controller after selecting a feature.",
description: "Display an alert controller after selecting a feature in a clustered layer.",
type: SymbolClusteringExample.self),
Example(title: "Long tap animation",
description: "Animate camera upon a long tap",
description: "Animate camera upon a long tap.",
type: LongTapAnimationExample.self)
]

Expand Down
Loading

0 comments on commit b28c633

Please sign in to comment.