Skip to content

Commit

Permalink
Cherry-pick commits to 10.11.0-rc.1 release (#1878)
Browse files Browse the repository at this point in the history
* Force previous fastlane version (#1848)

* Fix issue with map spinning when setting destBearing and sourceBearing to 102 (#1793) (#1828)

Co-authored-by: Niwaka <61189782+NiwakaDev@users.noreply.github.com>

* Update submodules SSH key (#1854)

* Enable CircleCI contexts for shared environment variables (#1852)

* Use the latest v4 Slack Orb

* Add 'Slack Orb' context for each job

* MAPSIOS-556: Adopt shared context for CocoaPods trunk token

* MAPSIOS-558: Adopt shared context for Fastlane Match password

* MAPSIOS-557: Adopt shared context for SDK Registry token

* MAPSIOS-555: Adopt shared context for Apple credentials/ASC token

* Remove unused license template (#1857)

* Fix missing contexts, reuse CircleCI token (#1859)

* Enable GoogleCloud shared credentials (#1861)

* Enable 'Retry on Failure' up to 3 times for all tests (#1860)

* Add missing public mapbox token (#1863)

* Run IntegrationTests even when unit tests failing (#1864)

* Add Mapbox public token to unit tests (#1865)

* Move mapbox token to build unit tests (#1866)

* Add public Mapbox token to build unit test jobs

* Revert "Add Mapbox public token to unit tests (#1865)"

This reverts commit efba681.

* Improve stability of attribution parsing (#1849)

* Mapsios 567 mark no op and deprecate v10.11.0 properties (#1867)

* Extract integration tests to the separate CircleCI job (#1870)

* Rename job to build host tests

* Rename job to build tests

* Rename job to build firebase tests

* Rename Build tests job

* Run integration tests

* Code coverage command

* Enable codecoverage by default

* Run integration tests on nightly bases

* Utilize default values for run-integration-tests job

* Remove unused arg

* Enable Expression to be created without an operator (#1855)

* Change clusterProperties to accept array

* Break up expression and reassemble for clusterProperties

* Adjust example so app can run

* Introduce operatorless expression

* Add additional tests, update comments

* Enable operatorless encoding, add tests

* Add property back, update filtering

* Remove generated update

* Fix argument and operator access

* Update Sources/MapboxMaps/Style/Types/Expression.swift

Co-authored-by: Mai Mai <mai.mai@mapbox.com>

* Add changelog, update expression operator to simplify

Co-authored-by: Mai Mai <mai.mai@mapbox.com>

* Bump activesupport from 6.1.5 to 6.1.7.2 in /scripts/doc-generation (#1874)

Bumps [activesupport](https://github.com/rails/rails) from 6.1.5 to 6.1.7.2.
- [Release notes](https://github.com/rails/rails/releases)
- [Changelog](https://github.com/rails/rails/blob/v7.0.4.2/activesupport/CHANGELOG.md)
- [Commits](rails/rails@v6.1.5...v6.1.7.2)

---
updated-dependencies:
- dependency-name: activesupport
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update Maps versions (#1875)

* Update CoreMaps and Common

* Update license

* Update changelog

* Generate development DocC on PR merges (#1873)

* Generate DocC

* Upload DocC to the 'latest'

* Fix test results collection

* Debug

* Extra push to force CI trigger

* Last fixes

* Code review fixes

* Add 10.11.0-rc.1 changelog entry (#1876)

* Update SDK version (#1877)

* Add missing changelog for #1828 (#1880)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Patrick Leonard <pjleonard37@users.noreply.github.com>
Co-authored-by: Niwaka <61189782+NiwakaDev@users.noreply.github.com>
Co-authored-by: Roman Laitarenko <roman.laitarenko@mapbox.com>
Co-authored-by: Mai Mai <mai.mai@mapbox.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
6 people committed Jan 26, 2023
1 parent 7833ea7 commit 26038a0
Show file tree
Hide file tree
Showing 50 changed files with 1,141 additions and 457 deletions.
532 changes: 409 additions & 123 deletions .circleci/config.yml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ENV["SPACESHIP_SKIP_2FA_UPGRADE"] = "1"
platform :ios do

lane :build_examples_tests do
app_store_connect_api_key
setup_circle_ci
sync_code_signing
update_code_signing_settings(
Expand Down
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 @@ -15,17 +15,17 @@
"repositoryURL": "https://github.com/mapbox/mapbox-common-ios.git",
"state": {
"branch": null,
"revision": "d6e7b7d8df0ec523eb63412daf2f2fa4f58e0a55",
"version": "23.3.0-beta.1"
"revision": "775d6d749821f41ab25798eeaad1089ae250fd4c",
"version": "23.3.0-rc.1"
}
},
{
"package": "MapboxCoreMaps",
"repositoryURL": "https://github.com/mapbox/mapbox-core-maps-ios.git",
"state": {
"branch": null,
"revision": "439dc92d71ee10f7fb6c3ca89468586c65bb5108",
"version": "10.11.0-beta.1"
"revision": "d16dc2b0a053611b81b3b2ce4052a8662f849d72",
"version": "10.11.0-rc.1"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,30 @@ class PointAnnotationClusteringExample: UIViewController, ExampleProtocol {
UIColor.lightPink
}

// Create a cluster property to add to each cluster feature
// This will be added to the cluster textField below
let clusterProperty: [String: Expression] = ["pointString": Exp(.string) { "Count:\n" }]
// Create expression to get the total count of hydrants in a cluster
let sumExpression = Exp {
Exp(.sum) {
Exp(.accumulated)
Exp(.get) { "sum" }
}
1
}

// Create a cluster property to add to each cluster
let clusterProperties: [String: Expression] = [
"sum": sumExpression
]

// Select the options for clustering and pass them to the PointAnnotationManager to display
let clusterOptions = ClusterOptions(circleRadius: .expression(circleRadiusExpression),
circleColor: .expression(circleColorExpression),
textColor: .constant(StyleColor(.black)),
textField: .expression(Exp(.concat) {
Exp(.get) {"pointString"}
Exp(.get) {"point_count"}
Exp(.string) { "Count:\n" }
Exp(.get) {"sum"} // alternatively, you can use the built-in "point_count" property: Exp(.get) {"point_count"}
}),
clusterRadius: 75,
clusterProperties: clusterProperty)
clusterProperties: clusterProperties)
let pointAnnotationManager = mapView.annotations.makePointAnnotationManager(id: clusterLayerID, clusterOptions: clusterOptions)
pointAnnotationManager.annotations = annotations
pointAnnotationManager.delegate = self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,38 @@ class SymbolClusteringExample: UIViewController, ExampleProtocol {
// Enable clustering for this source.
source.cluster = true
source.clusterRadius = 75

// Create expression to identify the max flow rate of one hydrant in the cluster
// ["max", ["get", "FLOW"]]
let maxExpression = Exp(.max) {Exp(.get) { "FLOW" }}

// Create expression to determine if a hydrant with EngineID E-9 is in the cluster
// ["any", ["==", ["get", "ENGINEID"], "E-9"]]
let ine9Expression = Exp(.any) {
Exp(.eq) {
Exp(.get) { "ENGINEID" }
"E-9"
}
}

// Create expression to get the sum of all of the flow rates in the cluster
// [["+", ["accumulated"], ["get", "sum"]], ["get", "FLOW"]]
let sumExpression = Exp {
Exp(.sum) {
Exp(.accumulated)
Exp(.get) { "sum" }
}
Exp(.get) { "FLOW" }
}

// Add the expressions to the cluster as ClusterProperties so they can be accessed below
let clusterProperties: [String: Expression] = [
"max": maxExpression,
"in_e9": ine9Expression,
"sum": sumExpression
]
source.clusterProperties = clusterProperties

let sourceID = "fire-hydrant-source"

var clusteredLayer = createClusteredLayer()
Expand Down Expand Up @@ -153,10 +185,14 @@ class SymbolClusteringExample: UIViewController, ExampleProtocol {
// If the feature is a cluster, it will have `point_count` and `cluster_id` properties. These are assigned
// when the cluster is created.
} else if let selectedFeatureProperties = queriedFeatures.first?.feature.properties,
case let .number(pointCount) = selectedFeatureProperties["point_count"],
case let .number(clusterId) = selectedFeatureProperties["cluster_id"] {
// If the tap landed on a cluster, pass the cluster ID and point count to the alert.
self?.showAlert(withTitle: "Cluster ID \(Int(clusterId))", and: "There are \(Int(pointCount)) points in this cluster")
case let .number(pointCount) = selectedFeatureProperties["point_count"],
case let .number(clusterId) = selectedFeatureProperties["cluster_id"],
case let .number(maxFlow) = selectedFeatureProperties["max"],
case let .number(sum) = selectedFeatureProperties["sum"],
case let .boolean(in_e9) = selectedFeatureProperties["in_e9"] {
// If the tap landed on a cluster, pass the cluster ID and point count to the alert.
let inEngineNine = in_e9 ? "Some hydrants belong to Engine 9." : "No hydrants belong to Engine 9."
self?.showAlert(withTitle: "Cluster ID \(Int(clusterId))", and: "There are \(Int(pointCount)) hydrants in this cluster. The highest water flow is \(Int(maxFlow)) and the collective flow is \(Int(sum)). \(inEngineNine)")
}
case .failure(let error):
self?.showAlert(withTitle: "An error occurred: \(error.localizedDescription)", and: "Please try another hydrant")
Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

Mapbox welcomes participation and contributions from everyone.

## main

## 10.11.0-rc.1 - January 26, 2023

* Improve stability of attribution parsing. ([#1849](https://github.com/mapbox/mapbox-maps-ios/pull/1849))
* Enable `Expression` to be created without an operator so `clusterProperties` can support advanced use cases. ([#1855](https://github.com/mapbox/mapbox-maps-ios/pull/1855))
* Update CoreMaps `10.11.0-rc.1` and CommonSDK `23.3.0-rc.1`. ([#1856](https://github.com/mapbox/mapbox-maps-ios/pull/1875))
* Angle normalization function was improved to prevent map spinning on close angles. ([#1828](https://github.com/mapbox/mapbox-maps-ios/pull/1828))

## 10.11.0-beta.1 - January 12, 2023

* Reduce CPU usage/energy consumption whem map idling while showing user location. ([#1789](https://github.com/mapbox/mapbox-maps-ios/pull/1789))
Expand All @@ -17,7 +26,7 @@ Mapbox welcomes participation and contributions from everyone.

## 10.10.1 - December 20, 2022

* [CarPlay] Fix map view permanently pausing when moving to window on foreground ([#1808])(https://github.com/mapbox/mapbox-maps-ios/pull/1808)
* [CarPlay] Fix map view permanently pausing when moving to window on foreground ([#1808](https://github.com/mapbox/mapbox-maps-ios/pull/1808))

## 10.10.0 - December 8, 2022

Expand Down
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
source "https://rubygems.org"

gem "fastlane"
# Downgrade fastlane to 2.210.1 to fix the issue with the latest version
# https://github.com/fastlane/fastlane/issues/20960#issuecomment-1378738366
gem "fastlane", "~> 2.210.0"

plugins_path = File.join(File.dirname(__FILE__), '.fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
31 changes: 16 additions & 15 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ GEM
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.663.0)
aws-sdk-core (3.168.0)
aws-partitions (1.692.0)
aws-sdk-core (3.168.4)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.59.0)
aws-sdk-kms (1.61.0)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.117.1)
aws-sdk-s3 (1.117.2)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
Expand All @@ -49,7 +49,7 @@ GEM
unf (>= 0.0.5, < 1.0.0)
dotenv (2.8.1)
emoji_regex (3.2.3)
excon (0.94.0)
excon (0.97.1)
faraday (1.10.2)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
Expand Down Expand Up @@ -79,7 +79,7 @@ GEM
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.2.6)
fastlane (2.211.0)
fastlane (2.210.1)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand Down Expand Up @@ -119,9 +119,9 @@ GEM
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.31.0)
google-apis-androidpublisher_v3 (0.32.0)
google-apis-core (>= 0.9.1, < 2.a)
google-apis-core (0.9.1)
google-apis-core (0.9.5)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
Expand Down Expand Up @@ -161,11 +161,11 @@ GEM
http-cookie (1.0.5)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.6.1)
json (2.6.2)
jwt (2.5.0)
jmespath (1.6.2)
json (2.6.3)
jwt (2.6.0)
memoist (0.16.2)
mini_magick (4.11.0)
mini_magick (4.12.0)
mini_mime (1.1.2)
multi_json (1.15.0)
multipart-post (2.0.0)
Expand All @@ -174,7 +174,7 @@ GEM
optparse (0.1.1)
os (1.1.4)
plist (3.6.0)
public_suffix (5.0.0)
public_suffix (5.0.1)
rake (13.0.6)
representable (3.2.0)
declarative (< 0.1.0)
Expand Down Expand Up @@ -223,10 +223,11 @@ GEM

PLATFORMS
arm64-darwin-21
arm64-darwin-22

DEPENDENCIES
fastlane
fastlane (~> 2.210.0)
fastlane-plugin-firebase_test_lab!

BUNDLED WITH
2.3.21
2.4.3
3 changes: 1 addition & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The software and files in this repository (collectively, “Software”) are lic
## Acknowledgements

This application makes use of the following third party libraries:
### MapboxCoreMaps,10.11.0-beta.1,Mapbox ToS,Mapbox,https://www.mapbox.com/
### MapboxCoreMaps,10.11.0-rc.1,Mapbox ToS,Mapbox,https://www.mapbox.com/

```
Mapbox Core Maps version 10.0
Expand Down Expand Up @@ -1424,4 +1424,3 @@ All other rights reserved.
```

---

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 = '10.11.0-beta.1'
maps_version = '10.11.0-rc.1'

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

m.dependency 'MapboxCoreMaps', '10.11.0-beta.1'
m.dependency 'MapboxCoreMaps', '10.11.0-rc.1'
m.dependency 'MapboxMobileEvents', '1.0.10'
m.dependency 'MapboxCommon', '23.3.0-beta.1'
m.dependency 'MapboxCommon', '23.3.0-rc.1'
m.dependency 'Turf', '~> 2.0'

end
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
"repositoryURL": "https://github.com/mapbox/mapbox-common-ios.git",
"state": {
"branch": null,
"revision": "d6e7b7d8df0ec523eb63412daf2f2fa4f58e0a55",
"version": "23.3.0-beta.1"
"revision": "775d6d749821f41ab25798eeaad1089ae250fd4c",
"version": "23.3.0-rc.1"
}
},
{
"package": "MapboxCoreMaps",
"repositoryURL": "https://github.com/mapbox/mapbox-core-maps-ios.git",
"state": {
"branch": null,
"revision": "439dc92d71ee10f7fb6c3ca89468586c65bb5108",
"version": "10.11.0-beta.1"
"revision": "d16dc2b0a053611b81b3b2ce4052a8662f849d72",
"version": "10.11.0-rc.1"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ let package = Package(
targets: ["MapboxMaps"]),
],
dependencies: [
.package(name: "MapboxCoreMaps", url: "https://github.com/mapbox/mapbox-core-maps-ios.git", .exact("10.11.0-beta.1")),
.package(name: "MapboxCoreMaps", url: "https://github.com/mapbox/mapbox-core-maps-ios.git", .exact("10.11.0-rc.1")),
// We keep MME dependency for compatibility reasons
.package(name: "MapboxMobileEvents", url: "https://github.com/mapbox/mapbox-events-ios.git", .exact("1.0.10")),
.package(name: "MapboxCommon", url: "https://github.com/mapbox/mapbox-common-ios.git", .exact("23.3.0-beta.1")),
.package(name: "MapboxCommon", url: "https://github.com/mapbox/mapbox-common-ios.git", .exact("23.3.0-rc.1")),
.package(name: "Turf", url: "https://github.com/mapbox/turf-swift.git", from: "2.0.0"),
.package(name: "CocoaImageHashing", url: "https://github.com/ameingast/cocoaimagehashing", .exact("1.9.0"))
],
Expand Down
30 changes: 26 additions & 4 deletions Sources/MapboxMaps/Annotations/ClusterOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,34 @@ public struct ClusterOptions: Equatable {
/// clustered points. Has the form `{"property_name": [operator, map_expression]}`.
/// `operator` is any expression function that accepts at
/// least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the
/// cluster contains; `map_expression` produces the value of a single point.
/// cluster contains; `map_expression` produces the value of a single point. Example:
///
/// Example: `{"sum": ["+", ["get", "scalerank"]]}`.
/// ``Expression`` syntax:
/// ```
/// let expression = Exp(.sum) {
/// Exp(.get) { "scalerank" }
/// }
/// clusterProperties: ["sum": expression]
/// ```
///
/// For more advanced use cases, in place of `operator`, you can use a custom reduce expression
/// that references a special `["accumulated"]` value, e.g.:
/// JSON syntax:
/// `{"sum": ["+", ["get", "scalerank"]]}`
///
/// For more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value. Example:
///
/// ``Expression`` syntax:
/// ```
/// let expression = Exp {
/// Exp(.sum) {
/// Exp(.accumulated)
/// Exp(.get) { "sum" }
/// }
/// Exp(.get) { "scalerank" }
/// }
/// clusterProperties: ["sum": expression]
/// ```
///
/// JSON syntax:
/// `{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`
var clusterProperties: [String: Expression]?

Expand Down
5 changes: 2 additions & 3 deletions Sources/MapboxMaps/Foundation/MapboxMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1044,9 +1044,8 @@ extension MapboxMap {
// MARK: - Attribution

extension MapboxMap: AttributionDataSource {
internal func attributions() -> [Attribution] {
let attributions = Attribution.parse(style.sourceAttributions())
return attributions
internal func loadAttributions(completion: @escaping ([Attribution]) -> Void) {
Attribution.parse(style.sourceAttributions(), completion: completion)
}
}

Expand Down
4 changes: 1 addition & 3 deletions Sources/MapboxMaps/Foundation/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ internal struct Utils {

if fabs(angle - (Double.pi * 2) - anchorAngle) < diff {
angle -= (Double.pi * 2)
}

if fabs(angle + (Double.pi * 2) - anchorAngle) < diff {
} else if fabs(angle + (Double.pi * 2) - anchorAngle) < diff {
angle += (Double.pi * 2)
}

Expand Down
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>10.11.0</string>
<key>CFBundleVersion</key>
<string>61</string>
<string>62</string>
</dict>
</plist>
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" : "10.11.0-beta.1"
"version" : "10.11.0-rc.1"
}
Loading

0 comments on commit 26038a0

Please sign in to comment.