Skip to content

Commit

Permalink
Bump version 11.7.0 rc.1 and cherry-pick in release (#2299)
Browse files Browse the repository at this point in the history
Co-authored-by: Roman Laitarenko <[email protected]>
  • Loading branch information
aleksproger and evil159 authored Sep 16, 2024
1 parent c4e3962 commit acffd86
Show file tree
Hide file tree
Showing 23 changed files with 118 additions and 88 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" : "b4197f12f928066645e08b70c12ce1e22e50e2c3",
"version" : "24.6.0"
"revision" : "2be45bb1954b1c7039afdec0a49b760ae69e05f4",
"version" : "24.7.0-rc.2"
}
},
{
"identity" : "mapbox-core-maps-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mapbox/mapbox-core-maps-ios.git",
"state" : {
"revision" : "455ad90488ab033a50ab4b7283fa78184309eef3",
"version" : "11.6.0"
"revision" : "73e462a63c62c0f1b8b266e0ce632a4c6db154de",
"version" : "11.7.0-rc.2"
}
},
{
Expand Down
14 changes: 0 additions & 14 deletions Apps/Examples/Examples/All Examples/BasicMapExample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@ final class BasicMapExample: UIViewController, ExampleProtocol {

view.addSubview(mapView)

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) { _ in
// handle features in result
}
}

override func viewDidAppear(_ animated: Bool) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,24 @@ final class BuildingExtrusionsExample: UIViewController, ExampleProtocol {

// See https://docs.mapbox.com/mapbox-gl-js/example/3d-buildings/ for equivalent gl-js example
internal func addBuildingExtrusions() {
let wallOnlyThreshold = 20
let extrudeFilter = Exp(.eq) {
Exp(.get) { "extrude" }
"true"
}
var layer = FillExtrusionLayer(id: "3d-buildings", source: "composite")

layer.minZoom = 15
layer.sourceLayer = "building"
layer.fillExtrusionColor = .constant(StyleColor(.lightGray))
layer.fillExtrusionOpacity = .constant(0.6)

layer.filter = Exp(.eq) {
Exp(.get) {
"extrude"
layer.filter = Exp(.all) {
extrudeFilter
Exp(.gt) {
Exp(.get) { "height" }
wallOnlyThreshold
}
"true"
}

layer.fillExtrusionHeight = .expression(
Expand Down Expand Up @@ -140,6 +146,20 @@ final class BuildingExtrusionsExample: UIViewController, ExampleProtocol {
layer.fillExtrusionAmbientOcclusionRadius = .constant(3.0)

try! mapView.mapboxMap.addLayer(layer)

var wallsOnlyExtrusionLayer = layer
wallsOnlyExtrusionLayer.id = "3d-buildings-wall"
wallsOnlyExtrusionLayer.filter = Exp(.all) {
extrudeFilter
Exp(.lte) {
Exp(.get) { "height" }
wallOnlyThreshold
}
}

wallsOnlyExtrusionLayer.fillExtrusionLineWidth = .constant(2)

try! mapView.mapboxMap.addLayer(wallsOnlyExtrusionLayer)
}

// MARK: - Actions
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Mapbox welcomes participation and contributions from everyone.

## main

* Add experimental `FillExtrusionLayer.fillExtrusionLineWidth` that can switches fill extrusion rendering into wall rendering mode. Use this property to render the feature with the given width over the outlines of the geometry.

## 11.7.0-beta.1 - 30 August, 2024

* Expose data-driven properties on annotation managers. Now it's possible to set data-driven properties globally on annotation manager and specify per-annotation overrides.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md

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

4 changes: 2 additions & 2 deletions MapboxMaps.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.7.0-beta.2'
m.dependency 'MapboxCommon', '24.7.0-beta.2'
m.dependency 'MapboxCoreMaps', '11.7.0-rc.2'
m.dependency 'MapboxCommon', '24.7.0-rc.2'
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" : "b4197f12f928066645e08b70c12ce1e22e50e2c3",
"version" : "24.6.0"
"revision" : "2be45bb1954b1c7039afdec0a49b760ae69e05f4",
"version" : "24.7.0-rc.2"
}
},
{
"identity" : "mapbox-core-maps-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mapbox/mapbox-core-maps-ios.git",
"state" : {
"revision" : "455ad90488ab033a50ab4b7283fa78184309eef3",
"version" : "11.6.0"
"revision" : "73e462a63c62c0f1b8b266e0ce632a4c6db154de",
"version" : "11.7.0-rc.2"
}
},
{
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.7.0-beta.2")
let common = MapsDependency.common(version: "24.7.0-beta.2")
let coreMaps = MapsDependency.coreMaps(version: "11.7.0-rc.2")
let common = MapsDependency.common(version: "24.7.0-rc.2")

let mapboxMapsPath: String? = nil

Expand Down
1 change: 0 additions & 1 deletion Sources/MapboxMaps/Foundation/CoreAliases.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ typealias CoreInteraction = MapboxCoreMaps_Private.Interaction
typealias CoreInteractionHandler = MapboxCoreMaps_Private.InteractionHandler
typealias CoreRenderedQueryGeometry = MapboxCoreMaps_Private.RenderedQueryGeometry
typealias CoreFeaturesetFeatureId = MapboxCoreMaps_Private.FeaturesetFeatureId
typealias CoreFeatureIdentifier = MapboxCoreMaps_Private.FeatureIdentifier
typealias CoreFeaturesetQueryTarget = MapboxCoreMaps_Private.FeaturesetQueryTarget

This file was deleted.

27 changes: 2 additions & 25 deletions Sources/MapboxMaps/Interactions/FeaturesetFeatureId.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,10 @@ public struct FeaturesetFeatureId: Hashable {
}

var core: CoreFeaturesetFeatureId {
CoreFeaturesetFeatureId(featureId: .fromNSString(id), featureNamespace: namespace)
CoreFeaturesetFeatureId(featureId: id, featureNamespace: namespace)
}

init(core: CoreFeaturesetFeatureId) {
self.init(id: core.featureId.string, namespace: core.featureNamespace)
}
}

// TODO: remove when core migrates to string id
extension CoreFeatureIdentifier {
var string: String {
if isDouble() {
return String(getDouble())
}
if isLongLong() {
return String(getLongLong())
}

if isUnsignedLongLong() {
return String(getUnsignedLongLong())
}

if isNSString() {
return getNSString()
}

assertionFailure("Invalid id")
return ""
self.init(id: core.featureId, namespace: core.featureNamespace)
}
}
9 changes: 7 additions & 2 deletions Sources/MapboxMaps/Interactions/InteractiveFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ public class InteractiveFeature {
let state = (queriedFeature.state as? JSONObject.TurfRawValue).flatMap {
JSONObject(turfRawValue: $0)
}
self.init(id: queriedFeature.featuresetFeatureId.map(FeaturesetFeatureId.init(core:)),
featureset: featureset, feature: queriedFeature.feature, state: state)

self.init(
id: queriedFeature.featuresetFeatureId.map(FeaturesetFeatureId.init(core:)),
featureset: featureset,
feature: queriedFeature.feature,
state: state
)
}

/// Creates a feature.
Expand Down
38 changes: 38 additions & 0 deletions Sources/MapboxMaps/Style/Generated/Layers/FillExtrusionLayer.swift

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

2 changes: 1 addition & 1 deletion Sources/MapboxMaps/Style/Style+Localization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ extension StyleManager {
options: .caseInsensitive)

if case .expression(let textField) = symbolLayer.textField {
var stringExpression = String(decoding: try JSONEncoder().encode(textField), as: UTF8.self)
var stringExpression = String(data: try JSONEncoder().encode(textField), encoding: .utf8)!
stringExpression.updateOnceExpression(replacement: replacement, regex: expressionCoalesce)
stringExpression.updateExpression(replacement: replacement, regex: expressionAbbr)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ final class AnnotationManagerImplTests: XCTestCase {
func checkExpression(key: String, props: [String: Any]) throws {
let value = try XCTUnwrap(props[key] as? [Any])
let valueData = try XCTUnwrap(JSONSerialization.data(withJSONObject: value))
let valueString = try XCTUnwrap(String(decoding: valueData, as: UTF8.self))
let valueString = try XCTUnwrap(String(data: valueData, encoding: .utf8))

let fallbackValue = me.layerProperties[key] ?? StyleManager.layerPropertyDefaultValue(for: .symbol, property: key).value
let fallbackValueData = JSONSerialization.isValidJSONObject(fallbackValue)
? try XCTUnwrap(JSONSerialization.data(withJSONObject: fallbackValue))
: Data(String(describing: fallbackValue).utf8)
let fallbackValueString = try XCTUnwrap(String(decoding: fallbackValueData, as: UTF8.self))
let fallbackValueString = try XCTUnwrap(String(data: fallbackValueData, encoding: .utf8))

let expectedString = "[\"coalesce\",[\"get\",\"\(key)\",[\"get\",\"layerProperties\"]],\(fallbackValueString)]"
XCTAssertEqual(valueString, expectedString)
Expand Down
2 changes: 1 addition & 1 deletion Tests/MapboxMapsTests/Helpers/Encodable+JsonString.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import Foundation

extension Encodable {
func jsonString() throws -> String {
try String(decoding: JSONEncoder().encode(self), as: UTF8.self)
String(data: try JSONEncoder().encode(self), encoding: .utf8)!
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ final class OfflineManagerIntegrationTestCase: IntegrationTestCase {
let loadTileRegionCompletionBlockInvoked = expectation(description: "loadTileRegion completion block invoked")

/// Perform the download
tileStore.loadTileRegion(
let tileRegionCancelable = tileStore.loadTileRegion(
forId: tileRegionId,
loadOptions: tileRegionLoadOptions!,
progress: { _ in },
Expand Down Expand Up @@ -218,7 +218,7 @@ final class OfflineManagerIntegrationTestCase: IntegrationTestCase {
glyphsRasterizationMode: .ideographsRasterizedLocally,
metadata: ["tag": "my-outdoors-style-pack"])!

offlineManager.loadStylePack(
let stylePackCancelable = offlineManager.loadStylePack(
for: .outdoors,
loadOptions: stylePackOptions,
completion: { result in
Expand All @@ -234,15 +234,19 @@ final class OfflineManagerIntegrationTestCase: IntegrationTestCase {
}
})

let result = XCTWaiter().wait(
for: [loadStylePackCompletionBlockInvoked,
loadTileRegionCompletionBlockInvoked],
timeout: 120)
let waiter = XCTWaiter()
let expectations: Set<XCTestExpectation> = [loadStylePackCompletionBlockInvoked,
loadTileRegionCompletionBlockInvoked]
let result = waiter.wait(for: Array(expectations), timeout: 120)
switch result {
case .completed:
break
default:
XCTFail("Expectation failed with \(result). Aborting test.")
tileRegionCancelable.cancel()
stylePackCancelable.cancel()

let unfullfilledExpectations = expectations.subtracting(Set(waiter.fulfilledExpectations))
XCTFail("Expectation failed with \(result), unfullfilled expectations: \(unfullfilledExpectations). Aborting test.")
abortTest = true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ final class FormatOptionsTests: XCTestCase {

let encoded = try DictionaryEncoder().encode(formatOptions)
XCTAssertEqual(
String(decoding: try JSONSerialization.data(withJSONObject: encoded["font-scale"] as Any), as: UTF8.self),
String(data: try JSONSerialization.data(withJSONObject: encoded["font-scale"] as Any), encoding: .utf8),
#"["case",[">=",["to-number",["get","point_count"]],4],1,2]"#
)
XCTAssertEqual(
String(decoding: try JSONSerialization.data(withJSONObject: encoded["text-font"] as Any), as: UTF8.self),
String(data: try JSONSerialization.data(withJSONObject: encoded["text-font"] as Any), encoding: .utf8),
#"["case",[">=",["to-number",["get","point_count"]],4],["Open Sans Semibold"],["Arial Unicode MS Bold"]]"#
)
XCTAssertEqual(
String(decoding: try JSONSerialization.data(withJSONObject: encoded["text-color"] as Any), as: UTF8.self),
String(data: try JSONSerialization.data(withJSONObject: encoded["text-color"] as Any), encoding: .utf8),
##"["case",[">=",["to-number",["get","point_count"]],4],"#ffffff","#000000"]"##
)
}
Expand Down
Loading

0 comments on commit acffd86

Please sign in to comment.