Skip to content

Commit

Permalink
Prepare v11.8 release (#2352)
Browse files Browse the repository at this point in the history
Co-authored-by: Ivan Persidsky <[email protected]>
Co-authored-by: Patrick Leonard <[email protected]>
Co-authored-by: Release SDK bot for Maps SDK team <[email protected]>
Co-authored-by: Roman Gardukevich <[email protected]>
Co-authored-by: Aleksei Sapitskii <[email protected]>
  • Loading branch information
6 people authored Nov 11, 2024
1 parent 99791fb commit 77446b5
Show file tree
Hide file tree
Showing 20 changed files with 97 additions and 182 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" : "c9bdf65d6b69256b577ffe0e8274b1e0f5c93346",
"version" : "24.8.0-rc.1"
"revision" : "2b9ec86affbf41f0e800f0c1c96be31c02e6854f",
"version" : "24.8.0"
}
},
{
"identity" : "mapbox-core-maps-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mapbox/mapbox-core-maps-ios.git",
"state" : {
"revision" : "3aa9409d77f5929c3d0b70810d0c3b2ddd1d5d8a",
"version" : "11.8.0-rc.1"
"revision" : "c8d61110fb8b9f6452060a1df65dfc494d30afb2",
"version" : "11.8.0"
}
},
{
Expand Down
38 changes: 35 additions & 3 deletions Apps/Examples/Examples/SwiftUI Examples/SnapshotMapExample.swift
Original file line number Diff line number Diff line change
@@ -1,28 +1,60 @@
import SwiftUI
import MapboxMaps

@available(iOS 13.0, *)
@available(iOS 14.0, *)
struct SnapshotMapExample: View {
@State var image: UIImage?

struct SnapshotterImage: Identifiable {
var id: ObjectIdentifier { ObjectIdentifier(image) }
let image: UIImage
}
@State var snapshotterImage: SnapshotterImage?
@State var snapshotter = Snapshotter(options: MapSnapshotOptions(size: CGSize(width: 512, height: 512), pixelRatio: 2.0))

var body: some View {
GeometryReader { geometry in
VStack(spacing: 10) {
MapReader { proxy in
Map(initialViewport: .helsinkiOverview)
.mapStyle(.outdoors)
.onMapIdle { _ in image = proxy.captureSnapshot() }
.onCameraChanged { event in
snapshotter.setCamera(to: CameraOptions(cameraState: event.cameraState))
}
.frame(height: geometry.size.height / 2)
}

SnapshotView(snapshot: image)
.frame(height: geometry.size.height / 2)
}
}
.ignoresSafeArea()
.safeOverlay(alignment: .bottom) {
Button("Make snapshot via Snapshotter") {
snapshotter.start(overlayHandler: nil) { result in
switch result {
case .success(let image):
self.snapshotterImage = SnapshotterImage(image: image)
case .failure(let error):
print("Failure: \(error)")
}
}
}
.floating()
}
.onAppear {
snapshotter.mapStyle = .standardSatellite
}
.sheet(item: $snapshotterImage) {
Image(uiImage: $0.image)
.resizable()
.scaledToFit()
}
}
}

@available(iOS 13.0, *)
@available(iOS 14.0, *)
struct SnapshotView: View {
var snapshot: UIImage?

Expand All @@ -40,7 +72,7 @@ private extension Viewport {
static let helsinkiOverview = Self.overview(geometry: Polygon(center: .helsinki, radius: 10000, vertices: 30))
}

@available(iOS 13.0, *)
@available(iOS 14.0, *)
struct SnapshotMapExample_Preview: PreviewProvider {
static var previews: some View {
SnapshotMapExample()
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Mapbox welcomes participation and contributions from everyone.

## main

## 11.8.0 - 11 November, 2024

* Add two separete Geofence examples in SwiftUI - `GeofencingPlayground` and `GeofencingUserLocation`

## 11.8.0-rc.1 - 23 October, 2024
Expand Down
4 changes: 2 additions & 2 deletions LICENSE.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions MapboxMaps.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |m|

maps_version = '11.8.0-rc.1'
maps_version = '11.8.0'

m.name = 'MapboxMaps'
m.version = maps_version
Expand All @@ -21,8 +21,8 @@ Pod::Spec.new do |m|
m.source_files = 'Sources/MapboxMaps/**/*.{swift,h}'
m.resource_bundles = { 'MapboxMapsResources' => ['Sources/**/*.{xcassets,strings}', 'Sources/MapboxMaps/MapboxMaps.json', 'Sources/MapboxMaps/PrivacyInfo.xcprivacy'] }

m.dependency 'MapboxCoreMaps', '11.8.0-rc.1'
m.dependency 'MapboxCommon', '24.8.0-rc.1'
m.dependency 'MapboxCoreMaps', '11.8.0'
m.dependency 'MapboxCommon', '24.8.0'
m.dependency 'Turf', '3.0.0'

end
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/mapbox/mapbox-common-ios.git",
"state" : {
"revision" : "c9bdf65d6b69256b577ffe0e8274b1e0f5c93346",
"version" : "24.8.0-rc.1"
"revision" : "2b9ec86affbf41f0e800f0c1c96be31c02e6854f",
"version" : "24.8.0"
}
},
{
"identity" : "mapbox-core-maps-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mapbox/mapbox-core-maps-ios.git",
"state" : {
"revision" : "3aa9409d77f5929c3d0b70810d0c3b2ddd1d5d8a",
"version" : "11.8.0-rc.1"
"revision" : "c8d61110fb8b9f6452060a1df65dfc494d30afb2",
"version" : "11.8.0"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import PackageDescription
import Foundation

let coreMaps = MapsDependency.coreMaps(version: "11.8.0-rc.1")
let common = MapsDependency.common(version: "24.8.0-rc.1")
let coreMaps = MapsDependency.coreMaps(version: "11.8.0")
let common = MapsDependency.common(version: "24.8.0")

let mapboxMapsPath: String? = nil

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,10 @@
- ``MapboxMap/beginGesture()``
- ``MapboxMap/endGesture()``

### Quering map features
### Querying map features

- ``MapboxMap/queryRenderedFeatures(with:options:completion:)``
- ``MapboxMap/queryRenderedFeatures(with:targets:completion:)``
- ``MapboxMap/querySourceFeatures(for:options:completion:)``
- ``MapboxMap/querySourceFeatures(for:completion:)``
- ``MapboxMap/getGeoJsonClusterLeaves(forSourceId:feature:limit:offset:completion:)``
- ``MapboxMap/getGeoJsonClusterChildren(forSourceId:feature:completion:)``
- ``MapboxMap/getGeoJsonClusterExpansionZoom(forSourceId:feature:completion:)``
Expand Down
2 changes: 1 addition & 1 deletion Sources/MapboxMaps/Foundation/CoreAliases.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ typealias CoreInteractionHandler = MapboxCoreMaps_Private.InteractionHandler
typealias CoreRenderedQueryGeometry = MapboxCoreMaps_Private.RenderedQueryGeometry
typealias CoreFeaturesetFeatureId = MapboxCoreMaps_Private.FeaturesetFeatureId
typealias CoreFeaturesetQueryTarget = MapboxCoreMaps_Private.FeaturesetQueryTarget
typealias CoreFeaturesetDescriptor = MapboxCoreMaps.FeaturesetDescriptor // TODO: This will be moved to _Private in Core
typealias CoreFeaturesetDescriptor = MapboxCoreMaps_Private.FeaturesetDescriptor
57 changes: 5 additions & 52 deletions Sources/MapboxMaps/Foundation/MapboxMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1061,42 +1061,11 @@ extension MapboxMap: MapFeatureQueryable {
concreteErrorType: MapError.self))
}

/// Queries the map for rendered features using featureset descriptors.
///
/// This method allows to query both featureset from imported styles and user layers in the root style.
/// The results can be additionally filtered per-featureset.
///
/// ```swift
/// let targets = [
/// FeaturesetQueryTarget(
/// featureset: .layer("my-layer"),
/// filter: Exp(.eq) {
/// Exp(.get) { "type" }
/// "hotel"
/// }
/// ),
/// FeaturesetQueryTarget(featureset: .featureset("poi", importId: "basemap"))
/// ]
/// mapView.mapboxMap.queryRenderedFeatures(with: CGPoint(x: 0, y: 0),
/// targets: targets) { result in
/// // handle features in result
/// }
/// ```
///
/// - Important: This is a low-level method. If you need to handle basic gestures on map content, please prefer to use Interactions API (see ``MapboxMap/addInteraction(_:)``) or ``MapboxMap/queryRenderedFeatures(with:featureset:filter:completion:)``.
///
/// - Parameters:
/// - geometry: A screen geometry to query. Can be a `CGPoint`, `CGRect`, or an array of `CGPoint`.
/// - targets: An array of targets to query with.
/// - completion: Callback called when the query completes.
@_spi(Experimental)
@_documentation(visibility: public)
@discardableResult
public func queryRenderedFeatures(with geometry: some RenderedQueryGeometryConvertible,
targets: [FeaturesetQueryTarget],
completion: @escaping (Result<[QueriedRenderedFeature], Error>) -> Void) -> Cancelable {
private func queryRenderedFeatures(with geometry: some RenderedQueryGeometryConvertible,
targets: [CoreFeaturesetQueryTarget],
completion: @escaping (Result<[QueriedRenderedFeature], Error>) -> Void) -> Cancelable {
return __map.__queryRenderedFeatures(for: geometry.geometry.core,
targets: targets.map(\.core),
targets: targets,
callback: coreAPIClosureAdapter(for: completion,
type: NSArray.self,
concreteErrorType: MapError.self))
Expand Down Expand Up @@ -1133,7 +1102,7 @@ extension MapboxMap: MapFeatureQueryable {
queryRenderedFeatures(
with: geometry,
targets: [
FeaturesetQueryTarget(featureset: featureset, filter: filter)
CoreFeaturesetQueryTarget(featureset: featureset.core, filter: filter?.asCore, id: nil)
]) { result in
completion(result.map({ features in
features.compactMap {
Expand Down Expand Up @@ -1187,22 +1156,6 @@ extension MapboxMap: MapFeatureQueryable {
concreteErrorType: MapError.self))
}

/// Queries the source features for a given featureset.
///
/// - Parameters:
/// - target: A featureset query target.
/// - completion: Callback called when the query completes.
@_spi(Experimental)
@_documentation(visibility: public)
@discardableResult
public func querySourceFeatures(for target: FeaturesetQueryTarget,
completion: @escaping (Result<[QueriedSourceFeature], Error>) -> Void) -> Cancelable {
return __map.__querySourceFeatures(for: target.core,
callback: coreAPIClosureAdapter(for: completion,
type: NSArray.self,
concreteErrorType: MapError.self))
}

/// Returns all the leaves (original points) of a cluster (given its cluster_id) from a GeoJSON source, with pagination support: limit is the number of leaves
/// to return (set to Infinity for all points), and offset is the amount of points to skip (for pagination).
///
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion Sources/MapboxMaps/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
<key>CFBundleShortVersionString</key>
<string>11.8.0</string>
<key>CFBundleVersion</key>
<string>137</string>
<string>138</string>
</dict>
</plist>
27 changes: 23 additions & 4 deletions Sources/MapboxMaps/Interactions/FeaturesetDescriptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,28 @@
@_spi(Experimental)
@_documentation(visibility: public)
public struct FeaturesetDescriptor<FeatureType: FeaturesetFeatureType>: Equatable {
private let featuresetId: String?
private let importId: String?
private let layerId: String?
/// An optional unique identifier for the featureset within the style.
/// This id is used to reference a specific featureset.
///
/// * Note: If `featuresetId` is provided and valid, it takes precedence over `layerId`,
/// meaning `layerId` will not be considered even if it has a valid value.
@_documentation(visibility: public)
public let featuresetId: String?

/// An optional import id that is required if the featureset is defined within an imported style.
/// If the featureset belongs to the current style, this field should be set to a null string.
///
/// * Note: `importId` is only applicable when used in conjunction with `featuresetId`
/// and has no effect when used with `layerId`.
@_documentation(visibility: public)
public let importId: String?

/// An optional unique identifier for the layer within the current style.
///
/// * Note: If `featuresetId` is valid, `layerId` will be ignored even if it has a valid value.
/// Additionally, `importId` does not apply when using `layerId`.
@_documentation(visibility: public)
public let layerId: String?

private init(featuresetId: String? = nil, importId: String? = nil, layerId: String? = nil) {
self.featuresetId = featuresetId
Expand Down Expand Up @@ -72,7 +91,7 @@ extension FeaturesetDescriptor {

var core: CoreFeaturesetDescriptor {
CoreFeaturesetDescriptor(
__featuresetId: featuresetId,
featuresetId: featuresetId,
importId: importId,
layerId: layerId
)
Expand Down
37 changes: 0 additions & 37 deletions Sources/MapboxMaps/Interactions/FeaturesetQueryTarget.swift

This file was deleted.

2 changes: 1 addition & 1 deletion Sources/MapboxMaps/MapboxMaps.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version" : "11.8.0-rc.1"
"version" : "11.8.0"
}
Loading

0 comments on commit 77446b5

Please sign in to comment.