From 8a58e117b0adf7a7503e743b8841a558d0a559ea Mon Sep 17 00:00:00 2001 From: Roman Laitarenko Date: Fri, 31 Jan 2025 12:13:47 +0200 Subject: [PATCH] Release `11.10.0-rc.1` cherry-picks (#2439) Co-authored-by: Patrick Leonard Co-authored-by: Ivan Persidsky Co-authored-by: Roman Gardukevich Co-authored-by: Aleksei Sapitskii <45671572+aleksproger@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- CHANGELOG.md | 19 ++++ Examples.xcodeproj/project.pbxproj | 30 ++++- .../xcshareddata/swiftpm/Package.resolved | 8 +- LICENSE.md | 4 +- MapboxMaps.podspec | 6 +- Package.resolved | 8 +- Package.swift | 4 +- .../DynamicViewAnnotationExample.swift | 2 + .../Lab/ColorThemeMapExample.swift | 8 +- .../CustomGeometrySourceExample.swift | 106 ++++++++++++++++++ .../GeofencingPlayground.swift | 2 + .../SwiftUI Examples/SwiftUIRoot.swift | 1 + .../Annotations/ViewAnnotationManager.swift | 9 ++ Sources/MapboxMaps/Foundation/MapboxMap.swift | 6 + Sources/MapboxMaps/Info.plist | 2 +- Sources/MapboxMaps/MapboxMaps.json | 2 +- .../CustomSources/CustomGeometrySource.swift | 10 +- .../CustomSources/CustomRasterSource.swift | 23 +++- .../Expressions/AllExpressions.swift | 8 +- .../Style/Generated/Layers/ClipLayer.swift | 14 +-- .../Generated/Light/DirectionalLight.swift | 25 +---- .../Generated/Properties/Properties.swift | 6 - Sources/MapboxMaps/Style/Generated/Rain.swift | 52 ++++----- Sources/MapboxMaps/Style/Generated/Snow.swift | 36 +++--- Sources/MapboxMaps/Style/StyleManager.swift | 2 +- .../ViewAnnotationManagerTests.swift | 9 +- .../Foundation/MapboxMapTests.swift | 9 ++ .../Foundation/Mocks/MockMapboxMap.swift | 1 + .../Style/CustomSourcesIntegrationTests.swift | 22 +++- .../Layers/ClipLayerIntegrationTests.swift | 2 +- .../Light/DirectionalLightTests.swift | 6 +- .../Style/StyleIntegrationTests.swift | 15 +-- .../breakage_allowlist.txt | 10 +- scripts/release/packager/versions.json | 4 +- xcodegen/Examples.yml | 2 + 36 files changed, 337 insertions(+), 138 deletions(-) create mode 100644 Sources/Examples/SwiftUI Examples/CustomGeometrySourceExample.swift diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4d5499f3774d..f57a80ea340e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: rev: v3.2.0 hooks: - id: trailing-whitespace - exclude: LICENSE.md + exclude: ^(LICENSE.md|.*\.swiftinterface)$ - id: end-of-file-fixer exclude: ".*.list" - id: check-yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index e06014f92fb0..c4d1e7847fb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,27 @@ Mapbox welcomes participation and contributions from everyone. +## 11.10.0-rc.1 - 31 January, 2025 + +* Expose experimental ColorTheme API to set style wide color theme. A color theme modifies the global colors of a style using a LUT (lookup table) for color grading. +Pass the image either as a base64-encoded string or as UIImage: +```swift +let mapView = MapView() +mapView.mapboxMap.setMapStyleContent { + ColorTheme(base64: "base64EncodedImage") // or use an uiimage shortcut ColorTheme(uiimage: lutImage) +} +``` +Note: Each style can have only one `ColorTheme`. Setting a new theme overwrites the previous one. Further details can be fouund in documentation for `ColorTheme` +* Promote `ClipLayer.clipLayerTypes` and `ClipLayer.clipLayerScope` to stable. +* Remove experimental `DirectionalLight.shadowQuality`. +* Add experimental `ViewAnnotationManager.viewAnnotationAvoidLayers` for specifying layers that view annotations should avoid. The API currently only supports line layers. +* Add support for the `maxOverscaleFactorForParentTiles` property in `CustomRasterSource` and `CustomGeometrySource`, allowing greater control over tile overscaling behavior when rendering custom raster tiles. +* Add support for experimental *-use-theme propert that allow to override the color theme set on the Map. This is experimental and have several limitations - currently expressions are not supported. Color properties in Lights, Rain, Snow are not supported. *-use-theme for layer applied only after zoom level change. +* Update CoreMaps to 11.10.0-rc.1 and Common to 24.10.0-rc.1. + ## main +* Added support for the `maxOverscaleFactorForParentTiles` property in `CustomRasterSource`, allowing greater control over tile overscaling behavior when rendering custom raster tiles. * Add support for the `maxOverscaleFactorForParentTiles` property in `CustomRasterSource` and `CustomGeometrySource`, allowing greater control over tile overscaling behavior when rendering custom raster tiles. * Add support for experimental *-use-theme propert that allow to override the color theme set on the Map. This is experimental and have several limitations - currently expressions are not supported. Color properties in Lights, Rain, Snow are not supported. *-use-theme for layer applied only after zoom level change. diff --git a/Examples.xcodeproj/project.pbxproj b/Examples.xcodeproj/project.pbxproj index 4d85e974dd51..7ed272f1f588 100644 --- a/Examples.xcodeproj/project.pbxproj +++ b/Examples.xcodeproj/project.pbxproj @@ -34,7 +34,7 @@ 2C03342240D5487880316518 /* AddOneMarkerSymbolExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DCBE814694CF08A9C2E4A42 /* AddOneMarkerSymbolExample.swift */; platformFilters = (ios, ); }; 30589E5AB307FC934E466332 /* radar2.gif in Resources */ = {isa = PBXBuildFile; fileRef = D8730F8FB259A4F889609108 /* radar2.gif */; }; 312CE7CED726F0A572301622 /* PinView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DC3D7884D057238010CB6E4 /* PinView.swift */; }; - 32FA2A4133B0464494212B34 /* Array+Split.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BB15B17EDE597D37CFF3FCA /* Array+Split.swift */; platformFilters = (ios, ); }; + 32FA2A4133B0464494212B34 /* Array+Split.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BB15B17EDE597D37CFF3FCA /* Array+Split.swift */; }; 33B816803AF5330796686AA1 /* CameraForExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF35650C6319088CAAF95F84 /* CameraForExample.swift */; platformFilters = (ios, ); }; 373BD1EE35B76E43534E23F6 /* Fingertips in Frameworks */ = {isa = PBXBuildFile; platformFilters = (ios, ); productRef = FD9311FF1C736B80A26F4258 /* Fingertips */; }; 38AD95B6DD9BE858F4E59C31 /* WeatherAnnotationExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91D21963A6FF5DA26A210DA5 /* WeatherAnnotationExample.swift */; }; @@ -51,6 +51,7 @@ 48040990713D3220E7055434 /* LiveDataExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4DA62349C7E9846A885BCD3 /* LiveDataExample.swift */; platformFilters = (ios, ); }; 49F6209402BF34C06C90107A /* HeatmapLayerGlobeExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70922E748D003176C4A3C60A /* HeatmapLayerGlobeExample.swift */; platformFilters = (ios, ); }; 4ACB99FAFBF38A425EBD0285 /* ModelLayerExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2D98F58F756D035C98B1F39 /* ModelLayerExample.swift */; platformFilters = (ios, ); }; + 4E64A70408A69F2BC9F70610 /* CustomGeometrySourceExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DED80ACD1618F8EE8F95A4A /* CustomGeometrySourceExample.swift */; }; 4EF3E4C342C3F8ED5BF6C332 /* ViewAnnotationMarkerExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1317C28ACDAC187017096A99 /* ViewAnnotationMarkerExample.swift */; platformFilters = (ios, ); }; 50641F1F3A58B85873E2E5B8 /* AttributionDialogueExamples.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A77AEDBF679F223D4412FEE /* AttributionDialogueExamples.swift */; }; 556C8423BA408C7FF54BB5DA /* AnimateLayerExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61A7965C46F2F371AA940A99 /* AnimateLayerExample.swift */; platformFilters = (ios, ); }; @@ -68,7 +69,25 @@ 60A1572CCF5763FA3C946B89 /* Custom2DPuckExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 262AD875661BAB5564084A9E /* Custom2DPuckExample.swift */; platformFilters = (ios, ); }; 61B79A9069DCE6865E43E261 /* radar4.gif in Resources */ = {isa = PBXBuildFile; fileRef = 876CE24F4E565ED342DDDCD6 /* radar4.gif */; }; 634BA74F4E553C53EE906F5A /* OfflineManagerExample.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 000D0E4CEFB6D5AF02518807 /* OfflineManagerExample.storyboard */; platformFilters = (ios, ); }; - 64F4FA139388DB34564AD42D /* CLLocationCoordinate2D+Random.swift in Sources */ = {isa = PBXBuildFile; fileRef = 455C0B9F01316D0FF38ED62B /* CLLocationCoordinate2D+Random.swift */; platformFilters = (ios, ); }; + 64F4FA139388DB34564AD42D /* CLLocationCoordinate2D+Random.swift in Sources */ = {isa = PBXBuildFile; fileRef = 455C0B9F01316D0FF38ED62B /* CLLocationCoordinate2D+Random.swift */; }; + 655105BD0FAFF4C4BA65DC32 /* ExamplesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EE19F00E87B31FDE5481D56 /* ExamplesTests.swift */; platformFilters = (ios, ); }; + 65E9F2B993AEB394FC2D0080 /* ColorThemeMapExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50F519EC4AF0B4BEE0FDCABC /* ColorThemeMapExample.swift */; platformFilters = (ios, ); }; + 6661DB69D4980E24BCA18AB2 /* PolygonAnnotationExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DCBE4524A8793B4DE950533 /* PolygonAnnotationExample.swift */; platformFilters = (ios, ); }; + 68FD9E1F4606B2729BA1E6DC /* SnapshotterExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 588FD640D91E9DD366703F7B /* SnapshotterExample.swift */; platformFilters = (ios, ); }; + 6B040F65241ABF600D70D14D /* Custom3DPuckExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C957F9CA07061B793C2DD4A /* Custom3DPuckExample.swift */; platformFilters = (ios, ); }; + 7036A19FCD2CCE85BDDF4E00 /* TrackingModeExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F5E598A16FA446F583344CB /* TrackingModeExample.swift */; platformFilters = (ios, ); }; + 7365170E39A459EB4DFA198B /* ExamplesUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE18E37A8652B4807D2459F1 /* ExamplesUITests.swift */; platformFilters = (ios, ); }; + 634BA74F4E553C53EE906F5A /* OfflineManagerExample.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 000D0E4CEFB6D5AF02518807 /* OfflineManagerExample.storyboard */; platformFilter = ios; }; + 64F4FA139388DB34564AD42D /* CLLocationCoordinate2D+Random.swift in Sources */ = {isa = PBXBuildFile; fileRef = 455C0B9F01316D0FF38ED62B /* CLLocationCoordinate2D+Random.swift */; platformFilter = ios; }; + 655105BD0FAFF4C4BA65DC32 /* ExamplesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EE19F00E87B31FDE5481D56 /* ExamplesTests.swift */; platformFilter = ios; }; + 6661DB69D4980E24BCA18AB2 /* PolygonAnnotationExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DCBE4524A8793B4DE950533 /* PolygonAnnotationExample.swift */; platformFilter = ios; }; + 68FD9E1F4606B2729BA1E6DC /* SnapshotterExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 588FD640D91E9DD366703F7B /* SnapshotterExample.swift */; platformFilter = ios; }; + 6B040F65241ABF600D70D14D /* Custom3DPuckExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C957F9CA07061B793C2DD4A /* Custom3DPuckExample.swift */; platformFilter = ios; }; + 7036A19FCD2CCE85BDDF4E00 /* TrackingModeExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F5E598A16FA446F583344CB /* TrackingModeExample.swift */; platformFilter = ios; }; + 7365170E39A459EB4DFA198B /* ExamplesUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE18E37A8652B4807D2459F1 /* ExamplesUITests.swift */; platformFilter = ios; }; + 74C73DEE2D428C7B00DDA274 /* CustomGeometrySourceExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C73DED2D428C7B00DDA274 /* CustomGeometrySourceExample.swift */; }; + 634BA74F4E553C53EE906F5A /* OfflineManagerExample.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 000D0E4CEFB6D5AF02518807 /* OfflineManagerExample.storyboard */; platformFilters = (ios, ); }; + 64F4FA139388DB34564AD42D /* CLLocationCoordinate2D+Random.swift in Sources */ = {isa = PBXBuildFile; fileRef = 455C0B9F01316D0FF38ED62B /* CLLocationCoordinate2D+Random.swift */; }; 655105BD0FAFF4C4BA65DC32 /* ExamplesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EE19F00E87B31FDE5481D56 /* ExamplesTests.swift */; platformFilters = (ios, ); }; 65E9F2B993AEB394FC2D0080 /* ColorThemeMapExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50F519EC4AF0B4BEE0FDCABC /* ColorThemeMapExample.swift */; platformFilters = (ios, ); }; 6661DB69D4980E24BCA18AB2 /* PolygonAnnotationExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DCBE4524A8793B4DE950533 /* PolygonAnnotationExample.swift */; platformFilters = (ios, ); }; @@ -102,7 +121,7 @@ 9DFE9DDE63B78393031C843E /* Examples.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B30F4697545D9F02DD4425D /* Examples.swift */; platformFilters = (ios, ); }; A3D7C0836BFE6FEB40C3C15A /* BasicLocationPulsingExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC98E9169E8E7DFE8DC1CB27 /* BasicLocationPulsingExample.swift */; platformFilters = (ios, ); }; A6389C28B8AAC39878591AD0 /* PitchAndDistanceExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A5C0A3C44715B96D646ACB7 /* PitchAndDistanceExample.swift */; platformFilters = (ios, ); }; - A6A68B4ED674A924ACBD8FA2 /* UIColor+Random.swift in Sources */ = {isa = PBXBuildFile; fileRef = F000C4D3B6FC70FA9607E3A3 /* UIColor+Random.swift */; platformFilters = (ios, ); }; + A6A68B4ED674A924ACBD8FA2 /* UIColor+Random.swift in Sources */ = {isa = PBXBuildFile; fileRef = F000C4D3B6FC70FA9607E3A3 /* UIColor+Random.swift */; }; A972D3306BC53DEC9798C60D /* ExternalVectorSourceExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 133E4EABC7540ED460F08B8F /* ExternalVectorSourceExample.swift */; platformFilters = (ios, ); }; AD0922FA7F69AEE4C23F2351 /* InteractionsPlayground.swift in Sources */ = {isa = PBXBuildFile; fileRef = 388932B3A65BB7E9B59FDBE0 /* InteractionsPlayground.swift */; }; AE51E276DCD8CF89AB339224 /* LongTapAnimationExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DB76F486D80FED88678B04D /* LongTapAnimationExample.swift */; platformFilters = (ios, ); }; @@ -129,7 +148,7 @@ D62F69A9BD802A1926B92968 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BB52F9D3A810B1A9CEC832C /* Example.swift */; platformFilters = (ios, ); }; D63431CA78A557A0FB92177A /* FeatureStateExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3FA795972BB141B9C582ED0 /* FeatureStateExample.swift */; platformFilters = (ios, ); }; D77EEB488CFD90F602077E8F /* CustomPointAnnotationExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D5DB9BD5E97D3C0080EC5D3 /* CustomPointAnnotationExample.swift */; platformFilters = (ios, ); }; - D9297596469F9B31C2350B43 /* UIViewController+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A615EFC3D6CF2A25C9864086 /* UIViewController+Extensions.swift */; platformFilters = (ios, ); }; + D9297596469F9B31C2350B43 /* UIViewController+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A615EFC3D6CF2A25C9864086 /* UIViewController+Extensions.swift */; }; D94672F30272E31087AB5DDD /* NavigationSimulator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FC5980DD30479F30127BA71 /* NavigationSimulator.swift */; platformFilters = (ios, ); }; D98624793DA36578289F02FF /* MapScrollExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65535FB9F190778001AB847A /* MapScrollExample.swift */; }; DA109856E64BBD8071DF0619 /* ColorThemeExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29DD4C2F0049E575A6B5BF66 /* ColorThemeExample.swift */; }; @@ -257,6 +276,7 @@ 7A77AEDBF679F223D4412FEE /* AttributionDialogueExamples.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AttributionDialogueExamples.swift; sourceTree = ""; }; 7DB76F486D80FED88678B04D /* LongTapAnimationExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LongTapAnimationExample.swift; sourceTree = ""; }; 7DCBE4524A8793B4DE950533 /* PolygonAnnotationExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PolygonAnnotationExample.swift; sourceTree = ""; }; + 7DED80ACD1618F8EE8F95A4A /* CustomGeometrySourceExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomGeometrySourceExample.swift; sourceTree = ""; }; 7F5E598A16FA446F583344CB /* TrackingModeExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackingModeExample.swift; sourceTree = ""; }; 83E9078B1B13E54C2FFC5FFC /* View+OnShake.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+OnShake.swift"; sourceTree = ""; }; 858990E6795D3162A941E82C /* ButtonStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonStyle.swift; sourceTree = ""; }; @@ -407,6 +427,7 @@ 63A3027A7DA59E090DAD25F1 /* ClipLayerExample.swift */, 46CE3D9C2873C0767DD76D85 /* ClusteringExample.swift */, 29DD4C2F0049E575A6B5BF66 /* ColorThemeExample.swift */, + 7DED80ACD1618F8EE8F95A4A /* CustomGeometrySourceExample.swift */, C61CC711054A032EE0446036 /* DynamicStylingExample.swift */, A6B06A1D70F479D8DC5C375A /* FeaturesQueryExample.swift */, 7613C4E19DCD679A2620223C /* GeofencingPlayground.swift */, @@ -868,6 +889,7 @@ 3E515D1DD1D9CA02F3E95AA2 /* Constants.swift in Sources */, 60A1572CCF5763FA3C946B89 /* Custom2DPuckExample.swift in Sources */, 6B040F65241ABF600D70D14D /* Custom3DPuckExample.swift in Sources */, + 4E64A70408A69F2BC9F70610 /* CustomGeometrySourceExample.swift in Sources */, EE4064D753E360A6A6AC5BAC /* CustomLayerExample.swift in Sources */, 08DD7D352E50C412B667D6F6 /* CustomLayerExampleShaders.metal in Sources */, D77EEB488CFD90F602077E8F /* CustomPointAnnotationExample.swift in Sources */, diff --git a/Examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 23e69d7ad365..629806d1b51e 100644 --- a/Examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/mapbox/mapbox-common-ios.git", "state" : { - "revision" : "94a111e4e8b0f7f8d5f79cc84c832757fadd280d", - "version" : "24.10.0-beta.2" + "revision" : "eea3a287b1f6212a624b05286799cd22c554849f", + "version" : "24.10.0-rc.1" } }, { @@ -23,8 +23,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/mapbox/mapbox-core-maps-ios.git", "state" : { - "revision" : "2324ba61b603fd73f9b4b913437c910bb33bc405", - "version" : "11.10.0-beta.2" + "revision" : "1938905a7bc2721069df573d5010d8461fbe5ec7", + "version" : "11.10.0-rc.1" } }, { diff --git a/LICENSE.md b/LICENSE.md index 4435817ebeec..338fb11e0619 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ ## License -Mapbox Maps for iOS version 11.10.0-beta.1 +Mapbox Maps for iOS version 11.10.0-rc.1 Mapbox Maps iOS SDK Copyright © 2021 - 2025 Mapbox, Inc. All rights reserved. @@ -31,7 +31,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --- -### MapboxCoreMaps,11.10.0-beta.2,Mapbox ToS,Mapbox,https://www.mapbox.com/ +### MapboxCoreMaps,11.10.0-rc.1,Mapbox ToS,Mapbox,https://www.mapbox.com/ ``` Mapbox Core Maps version 11.0 diff --git a/MapboxMaps.podspec b/MapboxMaps.podspec index 215aabbdfe76..8185424daa04 100644 --- a/MapboxMaps.podspec +++ b/MapboxMaps.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - maps_version = '11.10.0-beta.1' + maps_version = '11.10.0-rc.1' m.name = 'MapboxMaps' m.version = maps_version @@ -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.10.0-beta.2' - m.dependency 'MapboxCommon', '24.10.0-beta.2' + m.dependency 'MapboxCoreMaps', '11.10.0-rc.1' + m.dependency 'MapboxCommon', '24.10.0-rc.1' m.dependency 'Turf', '4.0.0' end diff --git a/Package.resolved b/Package.resolved index 6dc138cd3dd4..f370fd850220 100644 --- a/Package.resolved +++ b/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/mapbox/mapbox-common-ios.git", "state" : { - "revision" : "94a111e4e8b0f7f8d5f79cc84c832757fadd280d", - "version" : "24.10.0-beta.2" + "revision" : "eea3a287b1f6212a624b05286799cd22c554849f", + "version" : "24.10.0-rc.1" } }, { @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/mapbox/mapbox-core-maps-ios.git", "state" : { - "revision" : "2324ba61b603fd73f9b4b913437c910bb33bc405", - "version" : "11.10.0-beta.2" + "revision" : "1938905a7bc2721069df573d5010d8461fbe5ec7", + "version" : "11.10.0-rc.1" } }, { diff --git a/Package.swift b/Package.swift index b08968503d4c..366769b860f7 100644 --- a/Package.swift +++ b/Package.swift @@ -4,9 +4,9 @@ import PackageDescription import Foundation -let coreMaps = MapsDependency.coreMaps(version: "11.10.0-beta.2") +let coreMaps = MapsDependency.coreMaps(version: "11.10.0-rc.1") -let common = MapsDependency.common(version: "24.10.0-beta.2") +let common = MapsDependency.common(version: "24.10.0-rc.1") let mapboxMapsPath: String? = nil diff --git a/Sources/Examples/All Examples/Annotations/DynamicViewAnnotationExample.swift b/Sources/Examples/All Examples/Annotations/DynamicViewAnnotationExample.swift index 8ee617f5fe4f..56783897d39d 100644 --- a/Sources/Examples/All Examples/Annotations/DynamicViewAnnotationExample.swift +++ b/Sources/Examples/All Examples/Annotations/DynamicViewAnnotationExample.swift @@ -12,6 +12,8 @@ final class DynamicViewAnnotationExample: UIViewController, ExampleProtocol { private var routes = [Route]() { didSet { oldValue.forEach { $0.remove() } + // prevent eta labels from showing up on overlapped parts of the route + mapView.viewAnnotations.viewAnnotationAvoidLayers = Set(routes.map(\.layerId)) routes.forEach { route in route.mapView = mapView route.display() diff --git a/Sources/Examples/All Examples/Lab/ColorThemeMapExample.swift b/Sources/Examples/All Examples/Lab/ColorThemeMapExample.swift index f9d272aecaff..d39d877f3b92 100644 --- a/Sources/Examples/All Examples/Lab/ColorThemeMapExample.swift +++ b/Sources/Examples/All Examples/Lab/ColorThemeMapExample.swift @@ -26,7 +26,9 @@ final class ColorThemeMapExample: UIViewController, ExampleProtocol { try! mapView.mapboxMap.setColorTheme(ColorTheme(uiimage: UIImage(named: "monochrome_lut")!)) addTestLayer() - mapView.gestures.onMapTap.observe { _ in + mapView.gestures.onMapTap.observe { [weak self] _ in + guard let self else { return } + self.mapUseTheme.toggle() if self.mapUseTheme { try! self.mapView.mapboxMap.setColorTheme(ColorTheme(uiimage: UIImage(named: "monochrome_lut")!)) @@ -36,7 +38,9 @@ final class ColorThemeMapExample: UIViewController, ExampleProtocol { } .store(in: &cancellables) - mapView.gestures.onLayerTap("blue-layer") { _, _ in + mapView.gestures.onLayerTap("blue-layer") { [weak self] _, _ in + guard let self else { return true } + self.circleUseTheme.toggle() self.addTestLayer(useTheme: self.circleUseTheme) return true diff --git a/Sources/Examples/SwiftUI Examples/CustomGeometrySourceExample.swift b/Sources/Examples/SwiftUI Examples/CustomGeometrySourceExample.swift new file mode 100644 index 000000000000..85109850cf30 --- /dev/null +++ b/Sources/Examples/SwiftUI Examples/CustomGeometrySourceExample.swift @@ -0,0 +1,106 @@ +import SwiftUI +import MapboxMaps + +struct CustomGeometrySourceExample: View { + @StateObject private var model = Model() + + var body: some View { + MapReader { proxy in + Map { + if let options = model.options { + CustomGeometrySource(id: .customGeometrySource, options: options) + LineLayer(id: "grid_layer", source: .customGeometrySource) + .lineColor(.red) + } + } + .ignoresSafeArea() + .overlay(alignment: .bottom) { + sliderPanel + } + .onAppear { + model.options = model.makeCustomGeometrySourceOptions(for: proxy.map!) + } + .onChange(of: model.gridSpacing) { _ in + try? proxy.map!.invalidateCustomGeometrySourceRegion(forSourceId: .customGeometrySource, bounds: .world) + } + } + } + + @ViewBuilder + var sliderPanel: some View { + VStack { + Text("Grid Spacing: \(model.gridSpacing, specifier: "%.2f")") + Slider(value: $model.gridSpacing, in: 0.01...10) { + Text("Grid Spacing") + } minimumValueLabel: { + Image(systemName: "grid") + .font(.system(size: 12)) + } maximumValueLabel: { + Image(systemName: "grid") + .font(.system(size: 24)) + } + } + .padding(10) + .floating(RoundedRectangle(cornerRadius: 10)) + .limitPaneWidth() + } +} + +private extension String { + static let customGeometrySource = "custom-raster-source" +} + +private class Model: ObservableObject { + @Published var gridSpacing: Double = 7 + @Published var options: CustomGeometrySourceOptions? + + func makeCustomGeometrySourceOptions(for mapboxMap: MapboxMap) -> CustomGeometrySourceOptions { + return CustomGeometrySourceOptions( + fetchTileFunction: { [weak self] tileId in + guard let self else { return } + + let neighborTile = CanonicalTileID(z: tileId.z, x: tileId.x + 1, y: tileId.y + 1) + let bounds = CoordinateBounds( + southwest: CLLocationCoordinate2D(latitude: neighborTile.latitude, longitude: tileId.longitude), + northeast: CLLocationCoordinate2D(latitude: tileId.latitude, longitude: neighborTile.longitude) + ) + + let latFrom = ceil(bounds.northeast.latitude / gridSpacing) * gridSpacing + let latTo = floor(bounds.southwest.latitude / gridSpacing) * gridSpacing + let latLines = stride(from: latFrom, through: latTo, by: -gridSpacing).map { lat in + LineString([ + CLLocationCoordinate2D(latitude: lat, longitude: bounds.southwest.longitude), + CLLocationCoordinate2D(latitude: lat, longitude: bounds.northeast.longitude) + ]) + } + + let lonFrom = floor(bounds.southwest.longitude / gridSpacing) * gridSpacing + let lonTo = ceil(bounds.northeast.longitude / gridSpacing) * gridSpacing + let lonLines = stride(from: lonFrom, through: lonTo, by: gridSpacing).map { lng in + LineString([ + CLLocationCoordinate2D(latitude: bounds.southwest.latitude, longitude: lng), + CLLocationCoordinate2D(latitude: bounds.northeast.latitude, longitude: lng) + ]) + } + try! mapboxMap.setCustomGeometrySourceTileData( + forSourceId: .customGeometrySource, + tileId: tileId, + features: (latLines + lonLines).map(Feature.init) + ) + }, + cancelTileFunction: { _ in }, + tileOptions: TileOptions() + ) + } +} + +extension CanonicalTileID { + var latitude: CLLocationDegrees { + let n = Double.pi - 2.0 * Double.pi * Double(y) / pow(2.0, Double(z)) + return (180.0 / .pi) * atan(0.5 * (exp(n) - exp(-n))) + } + + var longitude: CLLocationDegrees { + return Double(x) / pow(2.0, Double(z)) * 360.0 - 180.0 + } +} diff --git a/Sources/Examples/SwiftUI Examples/GeofencingPlayground.swift b/Sources/Examples/SwiftUI Examples/GeofencingPlayground.swift index f7996da3bef0..d724994330a2 100644 --- a/Sources/Examples/SwiftUI Examples/GeofencingPlayground.swift +++ b/Sources/Examples/SwiftUI Examples/GeofencingPlayground.swift @@ -265,8 +265,10 @@ private func requestNotificationPermission() { } private func requestLocationAuthorization() { + #if !os(visionOS) CLLocationManager().requestAlwaysAuthorization() print("Location request finished.") + #endif } private extension Turf.Feature { diff --git a/Sources/Examples/SwiftUI Examples/SwiftUIRoot.swift b/Sources/Examples/SwiftUI Examples/SwiftUIRoot.swift index f7c1bf1825c3..a71a3307d29d 100644 --- a/Sources/Examples/SwiftUI Examples/SwiftUIRoot.swift +++ b/Sources/Examples/SwiftUI Examples/SwiftUIRoot.swift @@ -54,6 +54,7 @@ struct SwiftUIRoot: View { } #endif ExampleLink("Precipitation", note: "Show show and rain", destination: PrecipitationExample()) + ExampleLink("Custom geometry", note: "Supply custom geometry to the map", destination: CustomGeometrySourceExample()) } header: { Text("Testing Examples") } } diff --git a/Sources/MapboxMaps/Annotations/ViewAnnotationManager.swift b/Sources/MapboxMaps/Annotations/ViewAnnotationManager.swift index 64fba6f13854..125fae177e96 100644 --- a/Sources/MapboxMaps/Annotations/ViewAnnotationManager.swift +++ b/Sources/MapboxMaps/Annotations/ViewAnnotationManager.swift @@ -82,6 +82,15 @@ public final class ViewAnnotationManager { Array(objectAnnotations.values) } + /// Specify layers that view annotations should avoid. This applies to ALL view annotations associated to any layer. + /// The API currently only supports line layers. + @_spi(Experimental) + @_documentation(visibility: public) + public var viewAnnotationAvoidLayers: Set { + get { mapboxMap.viewAnnotationAvoidLayers } + set { mapboxMap.viewAnnotationAvoidLayers = newValue } + } + /// The complete list of annotations associated with the receiver. @available(*, deprecated, renamed: "allAnnotations", message: "Please use allAnnotations instead, or directly access ViewAnnotation itself") public var annotations: [UIView: ViewAnnotationOptions] { diff --git a/Sources/MapboxMaps/Foundation/MapboxMap.swift b/Sources/MapboxMaps/Foundation/MapboxMap.swift index 4ef88804cb90..6a20b865c248 100644 --- a/Sources/MapboxMaps/Foundation/MapboxMap.swift +++ b/Sources/MapboxMaps/Foundation/MapboxMap.swift @@ -5,6 +5,7 @@ import MapboxCoreMaps import Turf protocol MapboxMapProtocol: AnyObject { + var viewAnnotationAvoidLayers: Set { get set } var cameraBounds: CameraBounds { get } var cameraState: CameraState { get } var size: CGSize { get } @@ -1666,6 +1667,11 @@ extension MapboxMap { // MARK: - View Annotations extension MapboxMap { + var viewAnnotationAvoidLayers: Set { + get { __map.getViewAnnotationAvoidLayers() } + set { __map.setViewAnnotationAvoidLayersForLayerIds(newValue) } + } + func setViewAnnotationPositionsUpdateCallback(_ callback: ViewAnnotationPositionsUpdateCallback?) { __map.setViewAnnotationPositionsUpdateListenerFor(callback.map { ViewAnnotationPositionsUpdateListenerImpl(callback: $0) diff --git a/Sources/MapboxMaps/Info.plist b/Sources/MapboxMaps/Info.plist index 28a74d4ec53d..3bf4c7aef60f 100644 --- a/Sources/MapboxMaps/Info.plist +++ b/Sources/MapboxMaps/Info.plist @@ -17,6 +17,6 @@ CFBundleShortVersionString 11.10.0 CFBundleVersion - 143 + 144 diff --git a/Sources/MapboxMaps/MapboxMaps.json b/Sources/MapboxMaps/MapboxMaps.json index 7aadc2a29483..eb068f767c63 100644 --- a/Sources/MapboxMaps/MapboxMaps.json +++ b/Sources/MapboxMaps/MapboxMaps.json @@ -1,3 +1,3 @@ { - "version" : "11.10.0-beta.1" + "version" : "11.10.0-rc.1" } diff --git a/Sources/MapboxMaps/Style/CustomSources/CustomGeometrySource.swift b/Sources/MapboxMaps/Style/CustomSources/CustomGeometrySource.swift index 73109f402db3..b45e9680f5db 100644 --- a/Sources/MapboxMaps/Style/CustomSources/CustomGeometrySource.swift +++ b/Sources/MapboxMaps/Style/CustomSources/CustomGeometrySource.swift @@ -19,10 +19,15 @@ public struct CustomGeometrySource: Source { /// - Note: Current implementation does not take into account resources allocated by the visible tiles. public var tileCacheBudget: TileCacheBudgetSize? - public init(id: String, options: CustomGeometrySourceOptions) { + /// When a set of tiles for a current zoom level is being rendered and some of the ideal tiles that cover the screen are not yet loaded, parent tiles could be used instead. Note that this might introduce unwanted rendering side-effects, especially for raster tiles that are overscaled multiple times. This property sets the maximum limit for how much a parent tile can be overscaled. + @_documentation(visibility: public) + public var maxOverscaleFactorForParentTiles: UInt8? + + public init(id: String, options: CustomGeometrySourceOptions, maxOverscaleFactorForParentTiles: UInt8? = nil) { self.type = .customGeometry self.id = id self.options = options + self.maxOverscaleFactorForParentTiles = maxOverscaleFactorForParentTiles } } @@ -31,6 +36,7 @@ extension CustomGeometrySource { case id case type case tileCacheBudget = "tile-cache-budget" + case maxOverscaleFactorForParentTiles = "max-overscale-factor-for-parent-tiles" } /// Init from a decoder, note that the CustomGeometrySourceOptions are not decodable and need to be set separately @@ -40,6 +46,7 @@ extension CustomGeometrySource { type = try container.decode(SourceType.self, forKey: .type) tileCacheBudget = try container.decodeIfPresent(TileCacheBudgetSize.self, forKey: .tileCacheBudget) options = nil + maxOverscaleFactorForParentTiles = try container.decodeIfPresent(UInt8.self, forKey: .maxOverscaleFactorForParentTiles) } /// Encode, note that options will not be included @@ -58,6 +65,7 @@ extension CustomGeometrySource { private func encodeVolatile(to encoder: Encoder, into container: inout KeyedEncodingContainer) throws { try container.encodeIfPresent(tileCacheBudget, forKey: .tileCacheBudget) + try container.encodeIfPresent(maxOverscaleFactorForParentTiles, forKey: .maxOverscaleFactorForParentTiles) } private func encodeNonVolatile(to encoder: Encoder, into container: inout KeyedEncodingContainer) throws { diff --git a/Sources/MapboxMaps/Style/CustomSources/CustomRasterSource.swift b/Sources/MapboxMaps/Style/CustomSources/CustomRasterSource.swift index 21180e59e7c1..29e428157fe7 100644 --- a/Sources/MapboxMaps/Style/CustomSources/CustomRasterSource.swift +++ b/Sources/MapboxMaps/Style/CustomSources/CustomRasterSource.swift @@ -19,10 +19,15 @@ public struct CustomRasterSource: Source, Equatable { @_documentation(visibility: public) public let options: CustomRasterSourceOptions? + /// When a set of tiles for a current zoom level is being rendered and some of the ideal tiles that cover the screen are not yet loaded, parent tiles could be used instead. Note that this might introduce unwanted rendering side-effects, especially for raster tiles that are overscaled multiple times. This property sets the maximum limit for how much a parent tile can be overscaled. @_documentation(visibility: public) - public init(id: String, options: CustomRasterSourceOptions) { + public var maxOverscaleFactorForParentTiles: UInt8? + + @_documentation(visibility: public) + public init(id: String, options: CustomRasterSourceOptions, maxOverscaleFactorForParentTiles: UInt8? = nil) { self.id = id self.options = options + self.maxOverscaleFactorForParentTiles = maxOverscaleFactorForParentTiles } } @@ -30,6 +35,7 @@ extension CustomRasterSource { enum CodingKeys: String, CodingKey { case id case type + case maxOverscaleFactorForParentTiles = "max-overscale-factor-for-parent-tiles" } /// Init from a decoder, note that the CustomRasterSourceOptions are not decodable and need to be set separately @@ -37,12 +43,25 @@ extension CustomRasterSource { let container = try decoder.container(keyedBy: CodingKeys.self) id = try container.decode(String.self, forKey: .id) options = nil + maxOverscaleFactorForParentTiles = try container.decodeIfPresent(UInt8.self, forKey: .maxOverscaleFactorForParentTiles) } /// Encode, note that options will not be included public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - try encodeNonVolatile(to: encoder, into: &container) + + if encoder.userInfo[.volatilePropertiesOnly] as? Bool == true { + try encodeVolatile(to: encoder, into: &container) + } else if encoder.userInfo[.nonVolatilePropertiesOnly] as? Bool == true { + try encodeNonVolatile(to: encoder, into: &container) + } else { + try encodeVolatile(to: encoder, into: &container) + try encodeNonVolatile(to: encoder, into: &container) + } + } + + private func encodeVolatile(to encoder: Encoder, into container: inout KeyedEncodingContainer) throws { + try container.encodeIfPresent(maxOverscaleFactorForParentTiles, forKey: .maxOverscaleFactorForParentTiles) } private func encodeNonVolatile(to encoder: Encoder, into container: inout KeyedEncodingContainer) throws { diff --git a/Sources/MapboxMaps/Style/Generated/Expressions/AllExpressions.swift b/Sources/MapboxMaps/Style/Generated/Expressions/AllExpressions.swift index 48a16e9d6f74..369815a5f9aa 100644 --- a/Sources/MapboxMaps/Style/Generated/Expressions/AllExpressions.swift +++ b/Sources/MapboxMaps/Style/Generated/Expressions/AllExpressions.swift @@ -142,7 +142,13 @@ public extension Exp { /// Returns the feature's id, if it has one. public static let id = Operator(rawValue: "id") - /// Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `--pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `'image'` argument. To implement crossfading between two images within a symbol layer using the [`icon-image-cross-fade`](/mapbox-gl-js/style-spec/layers/#paint-symbol-icon-image-cross-fade) attribute, include a second image as the second argument in the `'image'` expression. + /// Returns a [`ResolvedImage`](/style-spec/reference/types/#resolvedimage) for use in [`icon-image`](/style-spec/reference/layers/#layout-symbol-icon-image), `--pattern` entries, and as a section in the [`'format'`](#types-format) expression. + /// + /// A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `'image'` argument. + /// + /// Every image name can be followed by an optional [`ImageOptions`](/style-spec/reference/types/#imageoptions) object, which will be used for vector images only. + /// + /// To implement crossfading between two images within a symbol layer using the [`icon-image-cross-fade`](/style-spec/reference/layers/#paint-symbol-icon-image-cross-fade) attribute, include a second image as the second argument in the `'image'` expression. public static let image = Operator(rawValue: "image") /// Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system). diff --git a/Sources/MapboxMaps/Style/Generated/Layers/ClipLayer.swift b/Sources/MapboxMaps/Style/Generated/Layers/ClipLayer.swift index 346a3db7a9b1..108b105e6e1f 100644 --- a/Sources/MapboxMaps/Style/Generated/Layers/ClipLayer.swift +++ b/Sources/MapboxMaps/Style/Generated/Layers/ClipLayer.swift @@ -41,13 +41,11 @@ public struct ClipLayer: Layer, Equatable { /// Removes content from layers with the specified scope. By default all layers are affected. For example specifying `basemap` will only remove content from the Mapbox Standard style layers which have the same scope /// Default value: []. - @_documentation(visibility: public) - @_spi(Experimental) public var clipLayerScope: Value<[String]>? + public var clipLayerScope: Value<[String]>? /// Layer types that will also be removed if fallen below this clip layer. /// Default value: []. - @_documentation(visibility: public) - @_spi(Experimental) public var clipLayerTypes: Value<[ClipLayerTypes]>? + public var clipLayerTypes: Value<[ClipLayerTypes]>? public init(id: String, source: String) { self.source = source @@ -152,32 +150,24 @@ extension ClipLayer { /// Removes content from layers with the specified scope. By default all layers are affected. For example specifying `basemap` will only remove content from the Mapbox Standard style layers which have the same scope /// Default value: []. - @_documentation(visibility: public) - @_spi(Experimental) public func clipLayerScope(_ constant: [String]) -> Self { with(self, setter(\.clipLayerScope, .constant(constant))) } /// Removes content from layers with the specified scope. By default all layers are affected. For example specifying `basemap` will only remove content from the Mapbox Standard style layers which have the same scope /// Default value: []. - @_documentation(visibility: public) - @_spi(Experimental) public func clipLayerScope(_ expression: Exp) -> Self { with(self, setter(\.clipLayerScope, .expression(expression))) } /// Layer types that will also be removed if fallen below this clip layer. /// Default value: []. - @_documentation(visibility: public) - @_spi(Experimental) public func clipLayerTypes(_ constant: [ClipLayerTypes]) -> Self { with(self, setter(\.clipLayerTypes, .constant(constant))) } /// Layer types that will also be removed if fallen below this clip layer. /// Default value: []. - @_documentation(visibility: public) - @_spi(Experimental) public func clipLayerTypes(_ expression: Exp) -> Self { with(self, setter(\.clipLayerTypes, .expression(expression))) } diff --git a/Sources/MapboxMaps/Style/Generated/Light/DirectionalLight.swift b/Sources/MapboxMaps/Style/Generated/Light/DirectionalLight.swift index 07803e1b69b4..b7d470790f3e 100644 --- a/Sources/MapboxMaps/Style/Generated/Light/DirectionalLight.swift +++ b/Sources/MapboxMaps/Style/Generated/Light/DirectionalLight.swift @@ -44,10 +44,6 @@ public struct DirectionalLight: Codable, StyleEncodable, Equatable { /// Transition property for `shadowIntensity` public var shadowIntensityTransition: StyleTransition? - /// Determines the quality of the shadows on the map. A value of 1 ensures the highest quality and is the default value. - /// Default value: 1. Value range: [0, 1] - @_spi(Experimental) public var shadowQuality: Value? - /// Creates a new Directional light. public init(id: String = UUID().uuidString) { self.id = id @@ -68,7 +64,6 @@ public struct DirectionalLight: Codable, StyleEncodable, Equatable { try propertiesContainer.encodeIfPresent(intensityTransition, forKey: .intensityTransition) try propertiesContainer.encodeIfPresent(shadowIntensity, forKey: .shadowIntensity) try propertiesContainer.encodeIfPresent(shadowIntensityTransition, forKey: .shadowIntensityTransition) - try propertiesContainer.encodeIfPresent(shadowQuality, forKey: .shadowQuality) } public init(from decoder: Decoder) throws { @@ -85,7 +80,6 @@ public struct DirectionalLight: Codable, StyleEncodable, Equatable { self.intensityTransition = try propertiesContainer.decodeIfPresent(StyleTransition.self, forKey: .intensityTransition) self.shadowIntensity = try propertiesContainer.decodeIfPresent(Value.self, forKey: .shadowIntensity) self.shadowIntensityTransition = try propertiesContainer.decodeIfPresent(StyleTransition.self, forKey: .shadowIntensityTransition) - self.shadowQuality = try propertiesContainer.decodeIfPresent(Value.self, forKey: .shadowQuality) } } @@ -105,8 +99,7 @@ public struct DirectionalLight: Codable, StyleEncodable, Equatable { case intensityTransition = "intensity-transition" case shadowIntensity = "shadow-intensity" case shadowIntensityTransition = "shadow-intensity-transition" - case shadowQuality = "shadow-quality" - } + } } extension DirectionalLight { @@ -195,22 +188,6 @@ extension DirectionalLight { public func shadowIntensity(_ expression: Exp) -> Self { with(self, setter(\.shadowIntensity, .expression(expression))) } - - /// Determines the quality of the shadows on the map. A value of 1 ensures the highest quality and is the default value. - /// Default value: 1. Value range: [0, 1] - @_documentation(visibility: public) - @_spi(Experimental) - public func shadowQuality(_ constant: Double) -> Self { - with(self, setter(\.shadowQuality, .constant(constant))) - } - - /// Determines the quality of the shadows on the map. A value of 1 ensures the highest quality and is the default value. - /// Default value: 1. Value range: [0, 1] - @_documentation(visibility: public) - @_spi(Experimental) - public func shadowQuality(_ expression: Exp) -> Self { - with(self, setter(\.shadowQuality, .expression(expression))) - } } extension DirectionalLight: MapStyleContent, PrimitiveMapContent { diff --git a/Sources/MapboxMaps/Style/Generated/Properties/Properties.swift b/Sources/MapboxMaps/Style/Generated/Properties/Properties.swift index 2ea3ac12672d..c7b18e2cb7ce 100644 --- a/Sources/MapboxMaps/Style/Generated/Properties/Properties.swift +++ b/Sources/MapboxMaps/Style/Generated/Properties/Properties.swift @@ -725,22 +725,16 @@ public struct TextWritingMode: RawRepresentable, Codable, Hashable, Sendable { } /// Layer types that will also be removed if fallen below this clip layer. -@_documentation(visibility: public) -@_spi(Experimental) public struct ClipLayerTypes: RawRepresentable, Codable, Hashable, Sendable { - @_documentation(visibility: public) public let rawValue: String - @_documentation(visibility: public) public init(rawValue: String) { self.rawValue = rawValue } /// If present the clip layer would remove all 3d model layers below it. Currently only instanced models (e.g. trees) are removed. - @_documentation(visibility: public) public static let model = ClipLayerTypes(rawValue: "model") /// If present the clip layer would remove all symbol layers below it. - @_documentation(visibility: public) public static let symbol = ClipLayerTypes(rawValue: "symbol") } diff --git a/Sources/MapboxMaps/Style/Generated/Rain.swift b/Sources/MapboxMaps/Style/Generated/Rain.swift index ce203e675f20..d28c1277e1ac 100644 --- a/Sources/MapboxMaps/Style/Generated/Rain.swift +++ b/Sources/MapboxMaps/Style/Generated/Rain.swift @@ -14,7 +14,7 @@ public struct Rain: Codable, Equatable, StyleEncodable { public init() { } /// Thinning factor of rain particles from center. 0 - no thinning. 1 - maximal central area thinning. - /// Default value: 1. Value range: [0, 1] + /// Default value: 0.57. Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public var centerThinning: Value? @@ -29,7 +29,7 @@ public struct Rain: Codable, Equatable, StyleEncodable { public var centerThinningUseTheme: Value? /// Individual rain particle dorplets color. - /// Default value: "#919191". + /// Default value: "["interpolate",["linear"],["measure-light","brightness"],0,"#03113d",0.3,"#a8adbc"]". @_documentation(visibility: public) @_spi(Experimental) public var color: Value? @@ -44,7 +44,7 @@ public struct Rain: Codable, Equatable, StyleEncodable { public var colorUseTheme: Value? /// Rain particles density. Controls the overall screen density of the rain. - /// Default value: 1. Value range: [0, 1] + /// Default value: "["interpolate",["linear"],["zoom"],11,0,13,0.5]". Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public var density: Value? @@ -74,7 +74,7 @@ public struct Rain: Codable, Equatable, StyleEncodable { public var directionUseTheme: Value? /// Rain particles screen-space distortion strength. - /// Default value: 0.5. Value range: [0, 1] + /// Default value: 0.7. Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public var distortionStrength: Value? @@ -89,7 +89,7 @@ public struct Rain: Codable, Equatable, StyleEncodable { public var distortionStrengthUseTheme: Value? /// Rain droplet size. x - normal to direction, y - along direction - /// Default value: [1,10]. Value range: [0, 20] + /// Default value: [2.6,18.2]. Value range: [0, 50] @_documentation(visibility: public) @_spi(Experimental) public var dropletSize: Value<[Double]>? @@ -119,7 +119,7 @@ public struct Rain: Codable, Equatable, StyleEncodable { public var intensityUseTheme: Value? /// Rain particles opacity. - /// Default value: 0.19. Value range: [0, 1] + /// Default value: "["interpolate",["linear"],["measure-light","brightness"],0,0.88,1,0.7]". Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public var opacity: Value? @@ -134,7 +134,7 @@ public struct Rain: Codable, Equatable, StyleEncodable { public var opacityUseTheme: Value? /// Screen-space vignette rain tinting effect intensity. - /// Default value: 0.3. Value range: [0, 1] + /// Default value: "["interpolate",["linear"],["zoom"],11,0,13,1]". Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public var vignette: Value? @@ -149,7 +149,7 @@ public struct Rain: Codable, Equatable, StyleEncodable { public var vignetteUseTheme: Value? /// Rain vignette screen-space corners tint color. - /// Default value: "#ffffff". + /// Default value: "["interpolate",["linear"],["measure-light","brightness"],0,"#001736",0.3,"#464646"]". @_documentation(visibility: public) @_spi(Experimental) public var vignetteColor: Value? @@ -189,7 +189,7 @@ public struct Rain: Codable, Equatable, StyleEncodable { extension Rain { /// Thinning factor of rain particles from center. 0 - no thinning. 1 - maximal central area thinning. - /// Default value: 1. Value range: [0, 1] + /// Default value: 0.57. Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func centerThinning(_ constant: Double) -> Self { @@ -204,7 +204,7 @@ extension Rain { } /// Thinning factor of rain particles from center. 0 - no thinning. 1 - maximal central area thinning. - /// Default value: 1. Value range: [0, 1] + /// Default value: 0.57. Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func centerThinning(_ expression: Exp) -> Self { @@ -212,7 +212,7 @@ extension Rain { } /// Individual rain particle dorplets color. - /// Default value: "#919191". + /// Default value: "["interpolate",["linear"],["measure-light","brightness"],0,"#03113d",0.3,"#a8adbc"]". @_documentation(visibility: public) @_spi(Experimental) public func color(_ constant: StyleColor) -> Self { @@ -220,7 +220,7 @@ extension Rain { } /// Individual rain particle dorplets color. - /// Default value: "#919191". + /// Default value: "["interpolate",["linear"],["measure-light","brightness"],0,"#03113d",0.3,"#a8adbc"]". @_documentation(visibility: public) @_spi(Experimental) public func color(_ color: UIColor) -> Self { @@ -235,7 +235,7 @@ extension Rain { } /// Individual rain particle dorplets color. - /// Default value: "#919191". + /// Default value: "["interpolate",["linear"],["measure-light","brightness"],0,"#03113d",0.3,"#a8adbc"]". @_documentation(visibility: public) @_spi(Experimental) public func color(_ expression: Exp) -> Self { @@ -259,7 +259,7 @@ extension Rain { } /// Rain particles density. Controls the overall screen density of the rain. - /// Default value: 1. Value range: [0, 1] + /// Default value: "["interpolate",["linear"],["zoom"],11,0,13,0.5]". Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func density(_ constant: Double) -> Self { @@ -274,7 +274,7 @@ extension Rain { } /// Rain particles density. Controls the overall screen density of the rain. - /// Default value: 1. Value range: [0, 1] + /// Default value: "["interpolate",["linear"],["zoom"],11,0,13,0.5]". Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func density(_ expression: Exp) -> Self { @@ -305,7 +305,7 @@ extension Rain { } /// Rain particles screen-space distortion strength. - /// Default value: 0.5. Value range: [0, 1] + /// Default value: 0.7. Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func distortionStrength(_ constant: Double) -> Self { @@ -320,7 +320,7 @@ extension Rain { } /// Rain particles screen-space distortion strength. - /// Default value: 0.5. Value range: [0, 1] + /// Default value: 0.7. Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func distortionStrength(_ expression: Exp) -> Self { @@ -328,7 +328,7 @@ extension Rain { } /// Rain droplet size. x - normal to direction, y - along direction - /// Default value: [1,10]. Value range: [0, 20] + /// Default value: [2.6,18.2]. Value range: [0, 50] @_documentation(visibility: public) @_spi(Experimental) public func dropletSize(normalToDirection: Double, alongDirection: Double) -> Self { @@ -343,7 +343,7 @@ extension Rain { } /// Rain droplet size. x - normal to direction, y - along direction - /// Default value: [1,10]. Value range: [0, 20] + /// Default value: [2.6,18.2]. Value range: [0, 50] @_documentation(visibility: public) @_spi(Experimental) public func dropletSize(_ expression: Exp) -> Self { @@ -374,7 +374,7 @@ extension Rain { } /// Rain particles opacity. - /// Default value: 0.19. Value range: [0, 1] + /// Default value: "["interpolate",["linear"],["measure-light","brightness"],0,0.88,1,0.7]". Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func opacity(_ constant: Double) -> Self { @@ -389,7 +389,7 @@ extension Rain { } /// Rain particles opacity. - /// Default value: 0.19. Value range: [0, 1] + /// Default value: "["interpolate",["linear"],["measure-light","brightness"],0,0.88,1,0.7]". Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func opacity(_ expression: Exp) -> Self { @@ -397,7 +397,7 @@ extension Rain { } /// Screen-space vignette rain tinting effect intensity. - /// Default value: 0.3. Value range: [0, 1] + /// Default value: "["interpolate",["linear"],["zoom"],11,0,13,1]". Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func vignette(_ constant: Double) -> Self { @@ -412,7 +412,7 @@ extension Rain { } /// Screen-space vignette rain tinting effect intensity. - /// Default value: 0.3. Value range: [0, 1] + /// Default value: "["interpolate",["linear"],["zoom"],11,0,13,1]". Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func vignette(_ expression: Exp) -> Self { @@ -420,7 +420,7 @@ extension Rain { } /// Rain vignette screen-space corners tint color. - /// Default value: "#ffffff". + /// Default value: "["interpolate",["linear"],["measure-light","brightness"],0,"#001736",0.3,"#464646"]". @_documentation(visibility: public) @_spi(Experimental) public func vignetteColor(_ constant: StyleColor) -> Self { @@ -428,7 +428,7 @@ extension Rain { } /// Rain vignette screen-space corners tint color. - /// Default value: "#ffffff". + /// Default value: "["interpolate",["linear"],["measure-light","brightness"],0,"#001736",0.3,"#464646"]". @_documentation(visibility: public) @_spi(Experimental) public func vignetteColor(_ color: UIColor) -> Self { @@ -443,7 +443,7 @@ extension Rain { } /// Rain vignette screen-space corners tint color. - /// Default value: "#ffffff". + /// Default value: "["interpolate",["linear"],["measure-light","brightness"],0,"#001736",0.3,"#464646"]". @_documentation(visibility: public) @_spi(Experimental) public func vignetteColor(_ expression: Exp) -> Self { diff --git a/Sources/MapboxMaps/Style/Generated/Snow.swift b/Sources/MapboxMaps/Style/Generated/Snow.swift index 80c237a69325..16280941b6af 100644 --- a/Sources/MapboxMaps/Style/Generated/Snow.swift +++ b/Sources/MapboxMaps/Style/Generated/Snow.swift @@ -14,7 +14,7 @@ public struct Snow: Codable, Equatable, StyleEncodable { public init() { } /// Thinning factor of snow particles from center. 0 - no thinning. 1 - maximal central area thinning. - /// Default value: 1. Value range: [0, 1] + /// Default value: 0.4. Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public var centerThinning: Value? @@ -44,7 +44,7 @@ public struct Snow: Codable, Equatable, StyleEncodable { public var colorUseTheme: Value? /// Snow particles density. Controls the overall particles number. - /// Default value: 1. Value range: [0, 1] + /// Default value: "["interpolate",["linear"],["zoom"],11,0,13,0.85]". Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public var density: Value? @@ -59,7 +59,7 @@ public struct Snow: Codable, Equatable, StyleEncodable { public var densityUseTheme: Value? /// Main snow particles direction. Azimuth and polar angles - /// Default value: [0,90]. Value range: [0, 360] + /// Default value: [0,50]. Value range: [0, 360] @_documentation(visibility: public) @_spi(Experimental) public var direction: Value<[Double]>? @@ -74,7 +74,7 @@ public struct Snow: Codable, Equatable, StyleEncodable { public var directionUseTheme: Value? /// Snow flake particle size. Correlates with individual particle screen size - /// Default value: 1. Value range: [0, 5] + /// Default value: 0.71. Value range: [0, 5] @_documentation(visibility: public) @_spi(Experimental) public var flakeSize: Value? @@ -104,7 +104,7 @@ public struct Snow: Codable, Equatable, StyleEncodable { public var intensityUseTheme: Value? /// Snow particles opacity. - /// Default value: 0.9. Value range: [0, 1] + /// Default value: 1. Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public var opacity: Value? @@ -119,7 +119,7 @@ public struct Snow: Codable, Equatable, StyleEncodable { public var opacityUseTheme: Value? /// Snow vignette screen-space effect. Adds snow tint to screen corners - /// Default value: 0.3. Value range: [0, 1] + /// Default value: "["interpolate",["linear"],["zoom"],11,0,13,0.3]". Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public var vignette: Value? @@ -172,7 +172,7 @@ public struct Snow: Codable, Equatable, StyleEncodable { extension Snow { /// Thinning factor of snow particles from center. 0 - no thinning. 1 - maximal central area thinning. - /// Default value: 1. Value range: [0, 1] + /// Default value: 0.4. Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func centerThinning(_ constant: Double) -> Self { @@ -187,7 +187,7 @@ extension Snow { } /// Thinning factor of snow particles from center. 0 - no thinning. 1 - maximal central area thinning. - /// Default value: 1. Value range: [0, 1] + /// Default value: 0.4. Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func centerThinning(_ expression: Exp) -> Self { @@ -242,7 +242,7 @@ extension Snow { } /// Snow particles density. Controls the overall particles number. - /// Default value: 1. Value range: [0, 1] + /// Default value: "["interpolate",["linear"],["zoom"],11,0,13,0.85]". Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func density(_ constant: Double) -> Self { @@ -257,7 +257,7 @@ extension Snow { } /// Snow particles density. Controls the overall particles number. - /// Default value: 1. Value range: [0, 1] + /// Default value: "["interpolate",["linear"],["zoom"],11,0,13,0.85]". Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func density(_ expression: Exp) -> Self { @@ -265,7 +265,7 @@ extension Snow { } /// Main snow particles direction. Azimuth and polar angles - /// Default value: [0,90]. Value range: [0, 360] + /// Default value: [0,50]. Value range: [0, 360] @_documentation(visibility: public) @_spi(Experimental) public func direction(azimuthal: Double, polar: Double) -> Self { @@ -280,7 +280,7 @@ extension Snow { } /// Main snow particles direction. Azimuth and polar angles - /// Default value: [0,90]. Value range: [0, 360] + /// Default value: [0,50]. Value range: [0, 360] @_documentation(visibility: public) @_spi(Experimental) public func direction(_ expression: Exp) -> Self { @@ -288,7 +288,7 @@ extension Snow { } /// Snow flake particle size. Correlates with individual particle screen size - /// Default value: 1. Value range: [0, 5] + /// Default value: 0.71. Value range: [0, 5] @_documentation(visibility: public) @_spi(Experimental) public func flakeSize(_ constant: Double) -> Self { @@ -303,7 +303,7 @@ extension Snow { } /// Snow flake particle size. Correlates with individual particle screen size - /// Default value: 1. Value range: [0, 5] + /// Default value: 0.71. Value range: [0, 5] @_documentation(visibility: public) @_spi(Experimental) public func flakeSize(_ expression: Exp) -> Self { @@ -334,7 +334,7 @@ extension Snow { } /// Snow particles opacity. - /// Default value: 0.9. Value range: [0, 1] + /// Default value: 1. Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func opacity(_ constant: Double) -> Self { @@ -349,7 +349,7 @@ extension Snow { } /// Snow particles opacity. - /// Default value: 0.9. Value range: [0, 1] + /// Default value: 1. Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func opacity(_ expression: Exp) -> Self { @@ -357,7 +357,7 @@ extension Snow { } /// Snow vignette screen-space effect. Adds snow tint to screen corners - /// Default value: 0.3. Value range: [0, 1] + /// Default value: "["interpolate",["linear"],["zoom"],11,0,13,0.3]". Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func vignette(_ constant: Double) -> Self { @@ -372,7 +372,7 @@ extension Snow { } /// Snow vignette screen-space effect. Adds snow tint to screen corners - /// Default value: 0.3. Value range: [0, 1] + /// Default value: "["interpolate",["linear"],["zoom"],11,0,13,0.3]". Value range: [0, 1] @_documentation(visibility: public) @_spi(Experimental) public func vignette(_ expression: Exp) -> Self { diff --git a/Sources/MapboxMaps/Style/StyleManager.swift b/Sources/MapboxMaps/Style/StyleManager.swift index e377bcdc763b..f2969c46362a 100644 --- a/Sources/MapboxMaps/Style/StyleManager.swift +++ b/Sources/MapboxMaps/Style/StyleManager.swift @@ -439,7 +439,7 @@ public class StyleManager { /// } /// ``` /// - /// - Warning: Avoind having strong references to `MapboxMap` or `MapView` in your custom content as it will lead to strong reference cycles. + /// - Warning: Avoid having strong references to `MapboxMap` or `MapView` in your custom content as it will lead to strong reference cycles. /// /// See more information in the . public func setMapStyleContent(@MapStyleContentBuilder content: () -> some MapStyleContent) { diff --git a/Tests/MapboxMapsTests/Annotations/ViewAnnotationManagerTests.swift b/Tests/MapboxMapsTests/Annotations/ViewAnnotationManagerTests.swift index dbc83d6346ce..f28ddebbfc3d 100644 --- a/Tests/MapboxMapsTests/Annotations/ViewAnnotationManagerTests.swift +++ b/Tests/MapboxMapsTests/Annotations/ViewAnnotationManagerTests.swift @@ -1,5 +1,5 @@ import XCTest -@testable import MapboxMaps +@testable @_spi(Experimental) import MapboxMaps final class ViewAnnotationManagerTests: XCTestCase { @@ -437,6 +437,13 @@ final class ViewAnnotationManagerTests: XCTestCase { XCTAssertTrue(bounds.contains(forArea: innerBounds, wrappedCoordinates: true)) } + func testAvoidLayers() throws { + let layers: Set = ["my-symbol-layer", "my-fill-layer"] + manager.viewAnnotationAvoidLayers = layers + + XCTAssertEqual(manager.viewAnnotationAvoidLayers, layers) + } + // MARK: - Helper functions @available(*, deprecated) diff --git a/Tests/MapboxMapsTests/Foundation/MapboxMapTests.swift b/Tests/MapboxMapsTests/Foundation/MapboxMapTests.swift index b9fc62677a9e..3463d8016102 100644 --- a/Tests/MapboxMapsTests/Foundation/MapboxMapTests.swift +++ b/Tests/MapboxMapsTests/Foundation/MapboxMapTests.swift @@ -508,4 +508,13 @@ final class MapboxMapTests: XCTestCase { XCTAssertEqual(CGPoint(x: 102, y: 1).fit(to: size), CGPoint(x: -1, y: -1)) XCTAssertEqual(CGPoint(x: 1, y: 101).fit(to: size), CGPoint(x: -1, y: -1)) } + + func testViewAnnotationAvoidLayers() { + let layers: Set = ["my-symbol-layer", "my-fill-layer"] + + mapboxMap.viewAnnotationAvoidLayers = layers + + XCTAssertEqual(mapboxMap.viewAnnotationAvoidLayers, layers) + XCTAssertEqual(mapboxMap.__testingMap.getViewAnnotationAvoidLayers(), layers) + } } diff --git a/Tests/MapboxMapsTests/Foundation/Mocks/MockMapboxMap.swift b/Tests/MapboxMapsTests/Foundation/Mocks/MockMapboxMap.swift index c54f34ec4e87..25548e77e8ee 100644 --- a/Tests/MapboxMapsTests/Foundation/Mocks/MockMapboxMap.swift +++ b/Tests/MapboxMapsTests/Foundation/Mocks/MockMapboxMap.swift @@ -3,6 +3,7 @@ import CoreLocation import UIKit final class MockMapboxMap: MapboxMapProtocol { + var viewAnnotationAvoidLayers = Set() var options: MapOptions = MapOptions() let events = MapEvents(makeGenericSubject: { _ in diff --git a/Tests/MapboxMapsTests/Style/CustomSourcesIntegrationTests.swift b/Tests/MapboxMapsTests/Style/CustomSourcesIntegrationTests.swift index 30ccba645c85..fdf10ce915de 100644 --- a/Tests/MapboxMapsTests/Style/CustomSourcesIntegrationTests.swift +++ b/Tests/MapboxMapsTests/Style/CustomSourcesIntegrationTests.swift @@ -15,9 +15,14 @@ final class CustomSourcesIntegrationTests: MapViewIntegrationTestCase { let rasterOptions = CustomRasterSourceOptions( clientCallback: CustomRasterSourceClient.fromCustomRasterSourceTileStatusChangedCallback { _, _ in } ) + let maxOverscaleFactorForParentTiles = UInt8(83) didFinishLoadingStyle = { mapView in - let source = CustomRasterSource(id: "test-source", options: rasterOptions) + let source = CustomRasterSource( + id: "test-source", + options: rasterOptions, + maxOverscaleFactorForParentTiles: maxOverscaleFactorForParentTiles + ) // Add source do { @@ -29,8 +34,9 @@ final class CustomSourcesIntegrationTests: MapViewIntegrationTestCase { // Retrieve the source do { - _ = try mapView.mapboxMap.source(withId: "test-source", type: CustomRasterSource.self) + let retrievedSource = try mapView.mapboxMap.source(withId: "test-source", type: CustomRasterSource.self) + XCTAssertEqual(retrievedSource.maxOverscaleFactorForParentTiles, maxOverscaleFactorForParentTiles) successfullyRetrievedSourceExpectation.fulfill() } catch { XCTFail("Failed to retrieve CustomRasterSource because of error: \(error)") @@ -47,9 +53,18 @@ final class CustomSourcesIntegrationTests: MapViewIntegrationTestCase { successfullyRetrievedSourceExpectation.expectedFulfillmentCount = 1 mapView.mapboxMap.styleURI = .standard + let maxOverscaleFactorForParentTiles = UInt8(83) didFinishLoadingStyle = { mapView in - var source = CustomGeometrySource(id: "test-source", options: CustomGeometrySourceOptions(fetchTileFunction: { _ in }, cancelTileFunction: { _ in }, tileOptions: TileOptions())) + var source = CustomGeometrySource( + id: "test-source", + options: CustomGeometrySourceOptions( + fetchTileFunction: { _ in }, + cancelTileFunction: { _ in }, + tileOptions: TileOptions() + ), + maxOverscaleFactorForParentTiles: maxOverscaleFactorForParentTiles + ) source.tileCacheBudget = .testSourceValue(.megabytes(7)) // Add source @@ -64,6 +79,7 @@ final class CustomSourcesIntegrationTests: MapViewIntegrationTestCase { do { let retrievedSource = try mapView.mapboxMap.source(withId: "test-source", type: CustomGeometrySource.self) XCTAssertEqual(retrievedSource.tileCacheBudget, .testSourceValue(.megabytes(7))) + XCTAssertEqual(retrievedSource.maxOverscaleFactorForParentTiles, maxOverscaleFactorForParentTiles) successfullyRetrievedSourceExpectation.fulfill() } catch { diff --git a/Tests/MapboxMapsTests/Style/Generated/IntegrationTests/Layers/ClipLayerIntegrationTests.swift b/Tests/MapboxMapsTests/Style/Generated/IntegrationTests/Layers/ClipLayerIntegrationTests.swift index bbdb38efece6..d49093457ae8 100644 --- a/Tests/MapboxMapsTests/Style/Generated/IntegrationTests/Layers/ClipLayerIntegrationTests.swift +++ b/Tests/MapboxMapsTests/Style/Generated/IntegrationTests/Layers/ClipLayerIntegrationTests.swift @@ -1,6 +1,6 @@ // This file is generated import XCTest -@_spi(Experimental) @testable import MapboxMaps +@testable import MapboxMaps final class ClipLayerIntegrationTests: MapViewIntegrationTestCase { diff --git a/Tests/MapboxMapsTests/Style/Generated/Light/DirectionalLightTests.swift b/Tests/MapboxMapsTests/Style/Generated/Light/DirectionalLightTests.swift index ee2bce9c33af..c01f0123a59d 100644 --- a/Tests/MapboxMapsTests/Style/Generated/Light/DirectionalLightTests.swift +++ b/Tests/MapboxMapsTests/Style/Generated/Light/DirectionalLightTests.swift @@ -1,6 +1,6 @@ // This file is generated import XCTest -@_spi(Experimental) @testable import MapboxMaps +@testable import MapboxMaps final class DirectionalLightTests: XCTestCase { @@ -16,8 +16,7 @@ final class DirectionalLightTests: XCTestCase { light.intensityTransition = StyleTransition(duration: 10.0, delay: 10.0) light.shadowIntensity = Value.testConstantValue() light.shadowIntensityTransition = StyleTransition(duration: 10.0, delay: 10.0) - light.shadowQuality = Value.testConstantValue() - + let data = try JSONEncoder().encode(light) XCTAssertFalse(data.isEmpty) @@ -37,7 +36,6 @@ final class DirectionalLightTests: XCTestCase { XCTAssertEqual(decodedLight.shadowIntensity, Value.testConstantValue()) XCTAssertEqual(decodedLight.shadowIntensityTransition?.duration, 10) XCTAssertEqual(decodedLight.shadowIntensityTransition?.delay, 10) - XCTAssertEqual(decodedLight.shadowQuality, Value.testConstantValue()) } } diff --git a/Tests/MapboxMapsTests/Style/StyleIntegrationTests.swift b/Tests/MapboxMapsTests/Style/StyleIntegrationTests.swift index dfc62a8be8a7..520a3c2a885d 100644 --- a/Tests/MapboxMapsTests/Style/StyleIntegrationTests.swift +++ b/Tests/MapboxMapsTests/Style/StyleIntegrationTests.swift @@ -557,29 +557,22 @@ internal class StyleIntegrationTests: MapViewIntegrationTestCase { XCTAssertTrue(exaggerationTransitionProperty is NSNull) } - func testOnlyAddedDataIdReturned() throws { - throw XCTSkip("Disabled due to behavior change, investigated in https://mapbox.atlassian.net/browse/MAPSIOS-1708") - + func testAddedSourceDataIdReturned() throws { let source = GeoJSONSource(id: "Source") - let source2 = GeoJSONSource(id: "Source2") let geometry = Geometry.point(Point.init(LocationCoordinate2D(latitude: 0, longitude: 0))) let dataId = "TestdataId" let expectation = XCTestExpectation(description: "dataId returned when source updated") expectation.expectedFulfillmentCount = 1 expectation.assertForOverFulfill = true - var returnedSourceDataId: String? - - try! mapView.mapboxMap.addSource(source) - try! mapView.mapboxMap.addSource(source2) - mapView.mapboxMap.onSourceDataLoaded.observe { event in - returnedSourceDataId = event.dataId - XCTAssertEqual(returnedSourceDataId, dataId) + guard event.dataId == dataId else { return } expectation.fulfill() }.store(in: &cancelables) + try! mapView.mapboxMap.addSource(source) + mapView.mapboxMap.updateGeoJSONSource(withId: source.id, geoJSON: .geometry(geometry), dataId: dataId) wait(for: [expectation], timeout: 3.0) diff --git a/scripts/api-compatibility-check/breakage_allowlist.txt b/scripts/api-compatibility-check/breakage_allowlist.txt index f25273f8c284..5a046ae9ad52 100644 --- a/scripts/api-compatibility-check/breakage_allowlist.txt +++ b/scripts/api-compatibility-check/breakage_allowlist.txt @@ -2062,4 +2062,12 @@ Constructor ViewAnnotationOptions.init(annotatedFeature:width:height:allowOverla Func StyleManager.removeRain() is now with @_documentation Func StyleManager.removeSnow() is now with @_documentation Func StyleManager.setRain(_:) is now with @_documentation -Func StyleManager.setSnow(_:) is now with @_documentation \ No newline at end of file +Func StyleManager.setSnow(_:) is now with @_documentation + +# Add maxOverscaleFactorForParentTiles to CustomRasterSource and CustomGeometrySource constructors +Constructor CustomRasterSource.init(id:options:) has been removed +Constructor CustomGeometrySource.init(id:options:) has been removed + +# Remove experimental light property +Func DirectionalLight.shadowQuality(_:) has been removed +Var DirectionalLight.shadowQuality has been removed diff --git a/scripts/release/packager/versions.json b/scripts/release/packager/versions.json index a9588d89c6a8..a2de53f74934 100644 --- a/scripts/release/packager/versions.json +++ b/scripts/release/packager/versions.json @@ -1,5 +1,5 @@ { - "MapboxCoreMaps": "11.10.0-beta.2", - "MapboxCommon": "24.10.0-beta.2", + "MapboxCoreMaps": "11.10.0-rc.1", + "MapboxCommon": "24.10.0-rc.1", "Turf": "4.0.0" } diff --git a/xcodegen/Examples.yml b/xcodegen/Examples.yml index 17a1879e2e75..47085e3dadee 100644 --- a/xcodegen/Examples.yml +++ b/xcodegen/Examples.yml @@ -19,6 +19,7 @@ targets: - path: ../Sources/Examples excludes: - VisionOSMain.swift + - "Extensions/**" - "SwiftUI Examples/**" - "All Examples/Sample Data/**" - "Assets.xcassets/**" @@ -30,6 +31,7 @@ targets: - path: ../Sources/Examples includes: - "SwiftUI Examples/**" + - "Extensions/**" - "All Examples/Sample Data/**" - "Assets.xcassets/**" # destinationFilters: [iOS, visionOS]