@mapsindoors/react-native-maps-indoors-mapbox 2.10.0 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/Package.swift +87 -0
  2. package/README.md +127 -1
  3. package/android/build.gradle +2 -2
  4. package/android/src/main/java/com/mapsindoorsrn/core/MPDisplayRuleModule.java +24 -0
  5. package/index.ts +4 -233
  6. package/ios/core/MPDisplayRuleBridge.m +9 -0
  7. package/ios/core/MPDisplayRuleModule.swift +18 -0
  8. package/ios/core/MapsIndoorsModule.swift +12 -0
  9. package/ios/spm-bridges/include/MapsIndoorsBridges.h +1 -0
  10. package/package.json +8 -3
  11. package/react-native-maps-indoors-mapbox.podspec +9 -12
  12. package/specs/NativeMPDisplayRuleModule.ts +2 -0
  13. package/src/core/MPBuilding.ts +3 -2
  14. package/src/core/MPCameraEvent.ts +1 -1
  15. package/src/core/MPCameraEventListener.ts +1 -1
  16. package/src/core/MPCategory.ts +1 -1
  17. package/src/core/MPDirectionsRenderer.ts +1 -1
  18. package/src/core/MPDirectionsRendererOptions.ts +1 -1
  19. package/src/core/MPDirectionsService.ts +1 -1
  20. package/src/core/MPDisplayRule.ts +26 -1
  21. package/src/core/MPEntity.ts +1 -1
  22. package/src/core/MPEntityInfo.ts +1 -1
  23. package/src/core/MPFilter.ts +1 -1
  24. package/src/core/MPFilterBehavior.ts +1 -1
  25. package/src/core/MPFloor.ts +26 -1
  26. package/src/core/MPFloorSelectorInterface.ts +1 -1
  27. package/src/core/MPHighlightBehavior.ts +1 -1
  28. package/src/core/MPLocation.ts +1 -1
  29. package/src/core/MPMapConfig.ts +1 -1
  30. package/src/core/MPMultiPolygon.ts +1 -1
  31. package/src/core/MPPolygon.ts +1 -1
  32. package/src/core/MPPositionProviderInterface.ts +1 -1
  33. package/src/core/MPPositionResultInterface.ts +1 -1
  34. package/src/core/MPPropertyData.ts +1 -1
  35. package/src/core/MPQuery.ts +1 -1
  36. package/src/core/MPRoute.ts +1 -1
  37. package/src/core/MPRouteCoordinate.ts +1 -1
  38. package/src/core/MPRouteLeg.ts +1 -1
  39. package/src/core/MPRouteStep.ts +1 -1
  40. package/src/core/MPSelectionBehavior.ts +1 -1
  41. package/src/core/MPSettings3D.ts +1 -1
  42. package/src/core/MPSolution.ts +1 -1
  43. package/src/core/MPSolutionConfig.ts +43 -1
  44. package/src/core/MPSolutionDisplayRule.ts +1 -1
  45. package/src/core/MPUserRoleCollection.ts +1 -1
  46. package/src/core/MPUtils.ts +1 -1
  47. package/src/core/MPVenue.ts +1 -1
  48. package/src/core/MapControl.ts +1 -1
  49. package/src/core/MapsIndoors.ts +13 -15
  50. package/src/core/OnBuildingFoundAtCameraTargetListener.ts +1 -1
  51. package/src/core/OnFloorSelectionChangedListener.ts +1 -1
  52. package/src/core/OnLegSelectedListener.ts +1 -1
  53. package/src/core/OnLocationSelectedListener.ts +1 -1
  54. package/src/core/OnMapClickListener.ts +1 -1
  55. package/src/core/OnMarkerClickListener.ts +1 -1
  56. package/src/core/OnMarkerInfoWindowClickListener.ts +1 -1
  57. package/src/core/OnPositionUpdateListener.ts +1 -1
  58. package/src/core/OnVenueFoundAtCameraTargetListener.ts +1 -1
  59. package/src/core/index.ts +237 -0
  60. package/ios/.swift-format +0 -79
package/Package.swift ADDED
@@ -0,0 +1,87 @@
1
+ // swift-tools-version: 6.0
2
+ import Foundation
3
+ import PackageDescription
4
+
5
+ // Swift Package Manager support for React Native's SwiftPM autolinking (react-native >= 0.88,
6
+ // `npx react-native spm`). CocoaPods apps use the podspec instead; the two ship side by side and
7
+ // must name the same iOS SDK version (checked by __tests__/nativeSdkVersions.test.ts).
8
+ let iosSdkVersion = "4.25.0"
9
+
10
+ let packageDirectory = URL(fileURLWithPath: #filePath).deletingLastPathComponent()
11
+
12
+ // SwiftPM cannot mix Swift and Objective-C in one target, so the RCT_EXTERN_MODULE declaration
13
+ // files (which never import Swift) are a target of their own. They are found by extension, so a new
14
+ // bridge file needs no change here.
15
+ let bridgeFiles: [String] = {
16
+ let ios = packageDirectory.appendingPathComponent("ios").path
17
+ guard let walker = FileManager.default.enumerator(atPath: ios) else { return [] }
18
+ var found: [String] = []
19
+ for case let path as String in walker {
20
+ let name = (path as NSString).lastPathComponent
21
+ if name == ".build" || name == "Tests" { walker.skipDescendants(); continue }
22
+ if name.hasSuffix(".m") { found.append(path) }
23
+ }
24
+ return found.sorted()
25
+ }()
26
+
27
+ // The Swift sources rely on the CocoaPods bridging header for React's Objective-C types
28
+ // (RCTPromiseResolveBlock and friends). unsafeFlags is allowed here because autolinking consumes
29
+ // this package by local path.
30
+ let bridgingHeader = packageDirectory.appendingPathComponent("ios/react-native-maps-indoors-Bridging-Header.h").path
31
+
32
+ // Paths in the repo that are not in the published package (the npm `files` list drops them).
33
+ let swiftExcludes = [
34
+ "react-native-maps-indoors-Bridging-Header.h",
35
+ "MapsIndoors.xcodeproj",
36
+ "MapsIndoors.xcworkspace",
37
+ "spm-bridges",
38
+ "core/Package.swift",
39
+ "core/README.md",
40
+ "core/Tests",
41
+ "core/.build",
42
+ ].filter { FileManager.default.fileExists(atPath: packageDirectory.appendingPathComponent("ios/\($0)").path) }
43
+
44
+ let reactHeaders: [Target.Dependency] = [
45
+ .product(name: "ReactHeaders", package: "ReactNative"),
46
+ .product(name: "ReactNativeHeaders", package: "ReactNative"),
47
+ .product(name: "ReactNativeDependenciesHeaders", package: "ReactNative"),
48
+ ]
49
+
50
+ let package = Package(
51
+ name: "ReactNativeMapsIndoorsMapbox",
52
+ platforms: [.iOS(.v16)],
53
+ products: [
54
+ .library(
55
+ name: "ReactNativeMapsIndoorsMapbox",
56
+ targets: ["ReactNativeMapsIndoorsMapbox", "ReactNativeMapsIndoorsMapboxBridges"]
57
+ ),
58
+ ],
59
+ dependencies: [
60
+ // Resolved by the autolinker relative to build/generated/autolinking/libs/<name> in the app.
61
+ .package(name: "ReactNative", path: "../../../../xcframeworks"),
62
+ .package(url: "https://github.com/MapsPeople/mapsindoors-mapbox-ios.git", exact: Version(stringLiteral: iosSdkVersion)),
63
+ .package(url: "https://github.com/MapsPeople/mapsindoors-codable-ios.git", exact: Version(stringLiteral: iosSdkVersion)),
64
+ ],
65
+ targets: [
66
+ .target(
67
+ name: "ReactNativeMapsIndoorsMapboxBridges",
68
+ dependencies: reactHeaders,
69
+ path: "ios",
70
+ sources: bridgeFiles,
71
+ publicHeadersPath: "spm-bridges/include"
72
+ ),
73
+ .target(
74
+ name: "ReactNativeMapsIndoorsMapbox",
75
+ dependencies: reactHeaders + [
76
+ .product(name: "MapsIndoorsMapbox", package: "mapsindoors-mapbox-ios"),
77
+ .product(name: "MapsIndoorsCodable", package: "mapsindoors-codable-ios"),
78
+ ],
79
+ path: "ios",
80
+ exclude: bridgeFiles + swiftExcludes,
81
+ swiftSettings: [
82
+ .unsafeFlags(["-import-objc-header", bridgingHeader]),
83
+ ]
84
+ ),
85
+ ],
86
+ swiftLanguageModes: [.v5]
87
+ )
package/README.md CHANGED
@@ -2,10 +2,129 @@
2
2
 
3
3
  ## Documentation
4
4
 
5
- Visit [our reference document site](https://app.mapsindoors.com/mapsindoors/reference/react-native/mapbox/2.10.0/index.html) to get an overview of what the MapsIndoors SDK offers.
5
+ Visit [our reference document site](https://app.mapsindoors.com/mapsindoors/reference/react-native/mapbox/2.12.0/index.html) to get an overview of what the MapsIndoors SDK offers.
6
6
 
7
7
  ## Changelog
8
8
 
9
+ ### [2.12.0] - 2026-11-30
10
+
11
+ #### Added
12
+
13
+ - On iOS, the SDK's own text, such as on route markers and in VoiceOver announcements, is available
14
+ in Arabic
15
+
16
+ #### Changed
17
+
18
+ - Updated the MapsIndoors iOS SDK to 4.25.0, with the Mapbox Maps SDK 11.34.1
19
+ - Updated the MapsIndoors Android SDK to 4.25.0, with Mapbox Turf 7.10.1 (from 6.15.0) and the
20
+ Mapbox Maps SDK for Android 11.35.0, which fixes CVE-2026-111497 in the Brotli library that Mapbox
21
+ Common bundles
22
+ - On iOS, Mapbox Standard's 3D landmark models are hidden from the zoom level where base-map
23
+ buildings start to fade, so under a tilted camera they no longer stand in front of a venue's floor
24
+ plan
25
+ - On iOS, when the route network cannot be downloaded and none is cached,
26
+ `MPDirectionsService.getRoute` rejects with the cause, such as no connection or a timeout, instead
27
+ of "Route network not found"
28
+ - On Android, a custom floor selector set with `MapControl.setFloorSelector` should not call its
29
+ `OnFloorSelectionChangedListener` with a floor it receives through `setSelectedFloorByFloorIndex`.
30
+ When a `MapControl` call changes the floor, listeners added with
31
+ `MapControl.addOnFloorUpdateListener` are now called right away, and a second time if the selector
32
+ reports the floor back
33
+
34
+ #### Fixed
35
+
36
+ - On iOS, routes work offline after `MapsIndoors.cacheData`. The solution's route network was not
37
+ cached with the rest of its data, so offline routes failed with "Route network not found"
38
+ - On iOS, routing picks up a route network that changed on the server after the next load,
39
+ synchronization or app launch. When the cached route network had been replaced, every route in the
40
+ venue failed
41
+ - On iOS, offline routes join the route network on the nearest edge on the start's and destination's
42
+ floor, without a detour, an extra step or a wrong first instruction, and a turn across due south
43
+ is no longer reported as straight on
44
+ - On iOS, offline routing avoids the way types added with `MPDirectionsService.addAvoidWayType`, as
45
+ online routing does
46
+ - On iOS, Live Data started with `MapControl.enableLiveData` keeps updating after the connection
47
+ drops and after the app has been in the background for more than a minute, and each live update is
48
+ delivered once
49
+ - On iOS, `MapsIndoors.load`, `synchronizeContent` and `cacheData` no longer hang when a file they
50
+ need is already being downloaded for another call, and reading locations while the SDK reloads or
51
+ updates them no longer crashes the app
52
+ - On iOS, `MapsIndoors.load` called right after the app launches checks the API key. Until the
53
+ network status was known, any key was accepted
54
+ - On iOS, `MPDisplayRule.reset()` on the display rule of a floor, building or venue no longer shows
55
+ it on the map
56
+ - On iOS, when `MapControl.setFilter` is called again before the camera has moved for the previous
57
+ filter, only the latest filter moves the camera
58
+ - On iOS, in a language the SDK has no translation for, its text shows in English instead of
59
+ internal keys, and in right-to-left languages the floor-change arrow on a route points at the
60
+ destination floor
61
+ - On iOS, where point locations overlap, the same one is shown on top on every launch of the app
62
+ - On Android, `MapsIndoors.synchronizeContent` rejects when part of the solution's data fails to
63
+ load. It never settled
64
+ - On Android, `MapsIndoors.load` right after `MapsIndoors.destroy` no longer fails or stalls.
65
+ Calling `MapsIndoors.destroy` again shortly after a reload, or loading a solution with another API
66
+ key while event logging is on, no longer crashes the app
67
+ - On Android, a failed load or synchronization no longer leaves every later request with a
68
+ 100-second timeout
69
+ - On Android, when `MapsIndoors.load` loads another solution while the map stays on screen, and a
70
+ floor is selected before the camera reaches the new venue, the new solution's floor plan is shown.
71
+ Its tiles were missing until the floor changed
72
+ - On Android, listeners added with `MapControl.addOnFloorUpdateListener` are called when a
73
+ `MapControl` call such as `goTo` or `setFilter` changes the floor while the floor selector is
74
+ hidden, while no building is in focus, or with a custom floor selector set with
75
+ `MapControl.setFloorSelector` that does not report the change back
76
+ - On Android, when a display rule's icon is changed and the new icon fails to load, for example
77
+ offline, the map keeps the previous icon instead of showing the location type's icon
78
+ - On iOS, after a floor change, the previous floor's wall shadows no longer stay on the map until
79
+ the camera moves
80
+ - On iOS, a flat label turns with the camera when the map is rotated without zooming
81
+ - On iOS, overlapping rooms of the same size no longer swap which one is drawn on top
82
+ - On iOS, when the camera is fitted to a route or to bounds with uneven padding from
83
+ `MapControl.setMapPadding`, such as a bottom sheet, the route sits in the middle of the space the
84
+ padding leaves
85
+ - On iOS, an open info window moves with its location when the map is rendered again
86
+ - On iOS, the accuracy circle around the user's position is drawn at its display rule's opacity
87
+ - On iOS, the map no longer crashes intermittently when it draws location markers
88
+ - On iOS, a route shown or cleared right after the map is created is applied once the map style has
89
+ loaded. It was dropped
90
+ - On iOS, when zooming back in from the overview, 3D models and floor plans appear as soon as the
91
+ zoom enters their range
92
+ - On iOS, routes that combine indoor and outdoor travel choose a venue's exit and entrance by the
93
+ travel costs from the origin, and no longer fail when one origin and destination pair cannot be
94
+ routed or the query has a departure or arrival time
95
+ - On Android, with clustering on, clusters stay clustered up to the map's maximum zoom, as on Google
96
+ Maps
97
+ - On Android, the map no longer does extra work on the main thread, on every update, for each
98
+ location without a 2D model
99
+
100
+ ### [2.11.0] - 2026-11-10
101
+
102
+ #### Added
103
+
104
+ - `MPDisplayRule.getIconZoomFactor` and `setIconZoomFactor`: how much a location's icon grows across
105
+ the solution's icon zoom range. The factor must be finite and within `0 < factor <= 4`; any other
106
+ value is ignored with a console warning. The default is `1`. Mapbox only: icons do not scale with
107
+ Google Maps
108
+ - `MPSolutionConfig.iconScaleZoomFrom` and `iconScaleZoomTo`: the solution's icon zoom range, as the
109
+ solution stores it, or `undefined` when it is not set
110
+ - Swift Package Manager support for apps built with React Native 0.88's `npx react-native spm`
111
+ (experimental). The package ships a `Package.swift` next to the podspec; CocoaPods stays supported
112
+
113
+ #### Changed
114
+
115
+ - Updated the MapsIndoors iOS SDK to 4.24.1, the release that carries base-map caching before the
116
+ first map
117
+ - Updated the MapsIndoors Android SDK to 4.24.2
118
+
119
+ #### Fixed
120
+
121
+ - On iOS, `MapsIndoors.synchronizeBaseMapTiles` no longer rejects with error 9000 before
122
+ `MapControl.create` has run, so base-map tiles can be cached ahead of the first map, as on
123
+ Android. `MapsIndoors.isBaseMapCachingSupported` and `synchronizeBaseMapTiles` now agree on
124
+ Mapbox. Until `MapControl.create` has run, the MapsIndoors Mapbox style is cached
125
+ - `MapControl.selectBuilding` and `MapControl.goTo` now pass a building's floors to the native SDK,
126
+ which used to receive the building without any
127
+
9
128
  ### [2.10.0] - 2026-11-02
10
129
 
11
130
  #### Added
@@ -218,6 +337,13 @@ end
218
337
  ...
219
338
  ```
220
339
 
340
+ #### Swift Package Manager (experimental)
341
+
342
+ React Native 0.88 can build an iOS app without CocoaPods: run `npx react-native spm` in the app's
343
+ `ios` folder. This package ships a `Package.swift` for that mode; CocoaPods stays supported. It needs
344
+ iOS 16 and no extra setup. Verified on a bare React Native 0.88 app, not on Expo or with
345
+ `app.plugin.js`.
346
+
221
347
  #### Providing API key
222
348
 
223
349
  Navigate to your application settings and add your Mapbox public access token to info with the key `MBXAccessToken`
@@ -93,8 +93,8 @@ dependencies {
93
93
  maven { url 'https://api.mapbox.com/downloads/v2/releases/maven' }
94
94
  }
95
95
 
96
- implementation 'com.mapbox.maps:android-ndk27:11.16.1'
97
- implementation 'com.mapspeople.mapsindoors:mapbox-ndk27:4.23.0'
96
+ implementation 'com.mapbox.maps:android-ndk27:11.35.0'
97
+ implementation 'com.mapspeople.mapsindoors:mapbox-ndk27:4.25.0'
98
98
  implementation 'com.facebook.react:react-native:+' // From node_modules
99
99
  implementation 'androidx.core:core-ktx:1.3.2'
100
100
  implementation 'com.github.bumptech.glide:glide:4.16.0'
@@ -920,6 +920,30 @@ public class MPDisplayRuleModule extends ReactContextBaseJavaModule {
920
920
  }
921
921
  }
922
922
 
923
+ @ReactMethod
924
+ public void getIconZoomFactor(String displayRuleId, final Promise promise) {
925
+ MPDisplayRule displayRule = getRule(displayRuleId);
926
+ if (displayRule != null) {
927
+ // Rules without a parent (highlight, selection) can resolve no factor. The renderer then
928
+ // uses 1.0, which is also what iOS reports.
929
+ Double factor = displayRule.getIconZoomFactor();
930
+ promise.resolve(factor != null ? factor : 1.0);
931
+ } else {
932
+ reject(promise, displayRuleId);
933
+ }
934
+ }
935
+
936
+ @ReactMethod
937
+ public void setIconZoomFactor(String displayRuleId, Double factor, final Promise promise) {
938
+ MPDisplayRule displayRule = getRule(displayRuleId);
939
+ if (displayRule != null) {
940
+ displayRule.setIconZoomFactor(factor);
941
+ promise.resolve(null);
942
+ } else {
943
+ reject(promise, displayRuleId);
944
+ }
945
+ }
946
+
923
947
  @ReactMethod
924
948
  public void getIconPlacement(String displayRuleId, final Promise promise) {
925
949
  MPDisplayRule displayRule = getRule(displayRuleId);
package/index.ts CHANGED
@@ -1,236 +1,7 @@
1
- import MPGeometry from './src/core/MPGeometry';
2
- import MPPoint from './src/core/MPPoint';
3
- import MPEntity from './src/core/MPEntity';
4
- import MPVenue from './src/core/MPVenue';
5
- import MPFloor from './src/core/MPFloor';
6
- import MPQuery from './src/core/MPQuery';
7
- import MPError from './src/core/MPError';
8
- import MPFilter from './src/core/MPFilter';
9
- import MPBounds from './src/core/MPBounds';
10
- import { normalizeLanguageTag, resolveLanguageTag } from './src/core/MPLanguageTag';
11
- import { MPLocationType } from './src/core/MPLocationType';
12
- import { MPLocationPropertyNames } from './src/core/MPLocationPropertyNames';
13
- import { MPLabelType } from './src/core/MPLabelType';
14
- import { MPIconPlacement } from './src/core/MPIconPlacement';
15
- import { MPBadgePosition } from './src/core/MPBadgePosition';
16
- import MPPolygon from './src/core/MPPolygon';
17
- import MPMapStyle from './src/core/MPMapStyle';
18
- import MPBuilding from './src/core/MPBuilding';
19
- import MPLocation from './src/core/MPLocation';
20
- import MPCategory from './src/core/MPCategory';
21
- import MapControl from './src/core/MapControl';
22
- import MPIconSize from './src/core/MPIconSize';
23
- import MPUserRole from './src/core/MPUserRole';
24
- import MPSolution from './src/core/MPSolution';
25
- import MapsIndoors from './src/core/MapsIndoors';
26
- import MPVenueInfo from './src/core/MPVenueInfo';
27
- import MPDataField from './src/core/MPDataField';
28
- import MPMapConfig from './src/core/MPMapConfig';
29
- import MPSettings3D from './src/core/MPSettings3D';
30
- import MPDisplayRule from './src/core/MPDisplayRule';
31
- import MPCameraEvent from './src/core/MPCameraEvent';
32
- import MPCameraUpdate from './src/core/MPCameraUpdate';
33
- import MPMultiPolygon from './src/core/MPMultiPolygon';
34
- import MPRoute from './src/core/MPRoute';
35
- import MPRouteCoordinate from './src/core/MPRouteCoordinate';
36
- import MPRouteLeg from './src/core/MPRouteLeg';
37
- import MPRouteStep from './src/core/MPRouteStep';
38
- import MPRouteProperty from './src/core/MPRouteProperty';
39
- import MPDirectionsRenderer from './src/core/MPDirectionsRenderer';
40
- import MPDirectionsRendererOptions from './src/core/MPDirectionsRendererOptions';
41
- import MPRouteMarkerDisplayRule from './src/core/MPRouteMarkerDisplayRule';
42
- import MPLegBoundaryIcons from './src/core/MPLegBoundaryIcons';
43
- import MPDirectionsService from './src/core/MPDirectionsService';
44
- import { MPCameraViewFitMode } from './src/core/MPCameraViewFitMode';
45
- import { MPStrokeStyle } from './src/core/MPStrokeStyle';
46
- import { MPRouteAnimationType } from './src/core/MPRouteAnimationType';
47
- import { MPRouteStampType } from './src/core/MPRouteStampType';
48
- import { MPRouteArrowStyle } from './src/core/MPRouteArrowStyle';
49
- import MPCameraPosition from './src/core/MPCameraPosition';
50
- import MPFilterBehavior from './src/core/MPFilterBehavior';
51
- import MPHighlightBehavior from './src/core/MPHighlightBehavior';
52
- import MPSolutionConfig from './src/core/MPSolutionConfig';
53
- import { OnMapClickListener } from './src/core/OnMapClickListener';
54
- import MPSelectionBehavior from './src/core/MPSelectionBehavior';
55
- import { MPCollisionHandling } from './src/core/MPCollisionHandling';
56
- import { MPSolutionDisplayRule } from './src/core/MPSolutionDisplayRule';
57
- import MPCameraEventListener from './src/core/MPCameraEventListener';
58
- import { OnFloorUpdateListener } from './src/core/OnFloorUpdateListener';
59
- import { OnMarkerClickListener } from './src/core/OnMarkerClickListener';
60
- import { OnPositionUpdateListener } from './src/core/OnPositionUpdateListener';
61
- import { MPFloorSelectorInterface } from './src/core/MPFloorSelectorInterface';
62
- import { MPPositionResultInterface } from './src/core/MPPositionResultInterface';
63
- import { OnLocationSelectedListener } from './src/core/OnLocationSelectedListener';
64
- import { MPPositionProviderInterface } from './src/core/MPPositionProviderInterface';
65
- import { OnLiveLocationUpdateListener } from './src/core/OnLiveLocationUpdateListener';
66
- import { OnMarkerInfoWindowClickListener } from './src/core/OnMarkerInfoWindowClickListener';
67
- import { OnFloorSelectionChangedListener } from './src/core/OnFloorSelectionChangedListener';
68
- import { OnVenueFoundAtCameraTargetListener } from './src/core/OnVenueFoundAtCameraTargetListener';
69
- import { OnBuildingFoundAtCameraTargetListener } from './src/core/OnBuildingFoundAtCameraTargetListener';
70
- import { OnLegSelectedListener } from './src/core/OnLegSelectedListener';
71
- import { OnBaseMapCacheProgressListener } from './src/core/OnBaseMapCacheProgressListener';
72
- import MPBuildingCollection from './src/core/MPBuildingCollection';
73
- import MPVenueCollection from './src/core/MPVenueCollection';
74
- import MPCategoryCollection from './src/core/MPCategoryCollection';
75
- import MPUserRoleCollection from './src/core/MPUserRoleCollection';
76
- import MPRouteStopIconConfig from './src/core/MPRouteStopIconConfig';
77
- import MPLabelGraphic from './src/core/MPLabelGraphic';
78
- import MPPOIType from './src/core/MPPOIType';
79
- import { MPHighway } from './src/core/MPHighway';
80
- import { MPFloorParams } from './src/core/MPFloor';
81
- import { MPQueryParams } from './src/core/MPQuery';
82
- import { MPRouteParams } from './src/core/MPRoute';
83
- import { MPVenueParams } from './src/core/MPVenue';
84
- import { MPPointParams } from './src/core/MPPoint';
85
- import { MPBoundsParams } from './src/core/MPBounds';
86
- import { MPFilterParams } from './src/core/MPFilter';
87
- import { MPPolygonParams } from './src/core/MPPolygon';
88
- import { MPBuildingParams } from './src/core/MPBuilding';
89
- import { MPCategoryParams } from './src/core/MPCategory';
90
- import { MPMapStyleParams } from './src/core/MPMapStyle';
91
- import { MPRouteLegParams } from './src/core/MPRouteLeg';
92
- import { MPSolutionParams } from './src/core/MPSolution';
93
- import { MPUserRoleParams } from './src/core/MPUserRole';
94
- import { MPDataFieldParams } from './src/core/MPDataField';
95
- import { MPMapConfigParams } from './src/core/MPMapConfig';
96
- import { MPRouteStepParams } from './src/core/MPRouteStep';
97
- import { MPVenueInfoParams } from './src/core/MPVenueInfo';
98
- import { MPMultiPolygonParams } from './src/core/MPMultiPolygon';
99
- import { MPRoutePropertyParams } from './src/core/MPRouteProperty';
100
- import { MPCameraPositionParams } from './src/core/MPCameraPosition';
101
- import { MPFilterBehaviorParams } from './src/core/MPFilterBehavior';
102
- import { MPSolutionConfigParams } from './src/core/MPSolutionConfig';
103
- import { MPRouteCoordinateParams } from './src/core/MPRouteCoordinate';
104
- import { MPHighlightBehaviorParams } from './src/core/MPHighlightBehavior';
105
- import { RouteStopIconConfig } from './src/core/RouteStopIconConfig';
106
- import { MPRouteStopIconConfigParams } from './src/core/MPRouteStopIconConfig';
107
- import { MPDirectionsRendererOptionsParams } from './src/core/MPDirectionsRendererOptions';
108
- import { MPRouteMarkerDisplayRuleParams } from './src/core/MPRouteMarkerDisplayRule';
109
- import { MPLegBoundaryIconsParams } from './src/core/MPLegBoundaryIcons';
110
- import { MPPOITypeParams } from './src/core/MPPOIType';
111
- import { MPSelectionMode } from './src/core/MPSelectionMode';
112
- import { MPFeatureType } from './src/core/MPFeatureTypes';
113
-
114
-
115
- import MapView from './src/core/MapView';
1
+ import MapsIndoors from './src/core/index';
2
+ import { setSdkVersion } from './src/core/MapsIndoors';
116
3
 
4
+ setSdkVersion(require('./package.json').version);
117
5
 
6
+ export * from './src/core/index';
118
7
  export default MapsIndoors;
119
- export {
120
- MapControl,
121
- MPBounds,
122
- MPBuilding,
123
- MPCameraEvent,
124
- MPCameraPosition,
125
- MPCameraUpdate,
126
- MPCategory,
127
- MPCollisionHandling,
128
- MPDataField,
129
- MPDisplayRule,
130
- MPError,
131
- MPFilter,
132
- MPFilterBehavior,
133
- MPHighlightBehavior,
134
- MPSelectionBehavior,
135
- MPFloor,
136
- MPPoint,
137
- MPGeometry,
138
- MPIconSize,
139
- MPLocation,
140
- MPMapConfig,
141
- MPMapStyle,
142
- MPMultiPolygon,
143
- MPPolygon,
144
- MPQuery,
145
- MPSettings3D,
146
- MPSolution,
147
- MPSolutionConfig,
148
- MPSolutionDisplayRule,
149
- MPUserRole,
150
- MPVenue,
151
- MPVenueInfo,
152
- MPLocationType,
153
- normalizeLanguageTag,
154
- resolveLanguageTag,
155
- MPLocationPropertyNames,
156
- MPDirectionsRenderer,
157
- MPDirectionsRendererOptions,
158
- MPRouteMarkerDisplayRule,
159
- MPLegBoundaryIcons,
160
- MPDirectionsService,
161
- MPRoute,
162
- MPRouteCoordinate,
163
- MPRouteLeg,
164
- MPRouteProperty,
165
- MPRouteStep,
166
- MPCameraViewFitMode,
167
- MPStrokeStyle,
168
- MPRouteAnimationType,
169
- MPRouteStampType,
170
- MPRouteArrowStyle,
171
- MPBuildingCollection,
172
- MPVenueCollection,
173
- MPCategoryCollection,
174
- MPUserRoleCollection,
175
- MPHighway,
176
- MPBadgePosition,
177
- MPIconPlacement,
178
- MPLabelType,
179
- MPRouteStopIconConfig,
180
- MPSelectionMode,
181
- MPFeatureType,
182
- MPLabelGraphic,
183
- MPPOIType,
184
- MapView
185
- };
186
-
187
- export type {
188
- MPFloorSelectorInterface,
189
- MPPositionProviderInterface,
190
- MPPositionResultInterface,
191
- MPCameraEventListener,
192
- OnMapClickListener,
193
- OnPositionUpdateListener,
194
- OnFloorUpdateListener,
195
- OnFloorSelectionChangedListener,
196
- OnLocationSelectedListener,
197
- OnVenueFoundAtCameraTargetListener,
198
- OnBuildingFoundAtCameraTargetListener,
199
- OnMarkerClickListener,
200
- OnMarkerInfoWindowClickListener,
201
- OnLiveLocationUpdateListener,
202
- OnLegSelectedListener,
203
- OnBaseMapCacheProgressListener,
204
- MPEntity,
205
- MPFloorParams,
206
- MPQueryParams,
207
- MPRouteParams,
208
- MPVenueParams,
209
- MPPointParams,
210
- MPBoundsParams,
211
- MPFilterParams,
212
- MPPolygonParams,
213
- MPBuildingParams,
214
- MPCategoryParams,
215
- MPMapStyleParams,
216
- MPRouteLegParams,
217
- MPSolutionParams,
218
- MPUserRoleParams,
219
- MPDataFieldParams,
220
- MPMapConfigParams,
221
- MPRouteStepParams,
222
- MPVenueInfoParams,
223
- MPMultiPolygonParams,
224
- MPRoutePropertyParams,
225
- MPCameraPositionParams,
226
- MPFilterBehaviorParams,
227
- MPHighlightBehaviorParams,
228
- MPSolutionConfigParams,
229
- MPRouteCoordinateParams,
230
- MPRouteStopIconConfigParams,
231
- MPDirectionsRendererOptionsParams,
232
- MPRouteMarkerDisplayRuleParams,
233
- MPLegBoundaryIconsParams,
234
- RouteStopIconConfig,
235
- MPPOITypeParams
236
- };
@@ -579,6 +579,15 @@
579
579
  resolver:(RCTPromiseResolveBlock) resolve
580
580
  rejecter:(RCTPromiseRejectBlock) reject)
581
581
 
582
+ RCT_EXTERN_METHOD(getIconZoomFactor: (NSString *) displayRuleId
583
+ resolver:(RCTPromiseResolveBlock) resolve
584
+ rejecter:(RCTPromiseRejectBlock) reject)
585
+
586
+ RCT_EXTERN_METHOD(setIconZoomFactor: (NSString *) displayRuleId
587
+ value:(nonnull NSNumber *) value
588
+ resolver:(RCTPromiseResolveBlock) resolve
589
+ rejecter:(RCTPromiseRejectBlock) reject)
590
+
582
591
  RCT_EXTERN_METHOD(getBadgeScale: (NSString *) displayRuleId
583
592
  resolver:(RCTPromiseResolveBlock) resolve
584
593
  rejecter:(RCTPromiseRejectBlock) reject)
@@ -1454,6 +1454,24 @@ public class MPDisplayRuleModule: NSObject {
1454
1454
  return resolve(nil)
1455
1455
  }
1456
1456
 
1457
+ @objc public func getIconZoomFactor(_ displayRuleId: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
1458
+ guard let displayRule = getRule(name: displayRuleId) else {
1459
+ return doReject(reject, displayRuleId: displayRuleId)
1460
+ }
1461
+
1462
+ return resolve(displayRule.iconZoomFactor)
1463
+ }
1464
+
1465
+ @objc public func setIconZoomFactor(_ displayRuleId: String, value: NSNumber, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
1466
+ guard let displayRule = getRule(name: displayRuleId) else {
1467
+ return doReject(reject, displayRuleId: displayRuleId)
1468
+ }
1469
+
1470
+ displayRule.iconZoomFactor = value.doubleValue
1471
+
1472
+ return resolve(nil)
1473
+ }
1474
+
1457
1475
  @objc public func getBadgeScale(_ displayRuleId: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
1458
1476
  guard let displayRule = getRule(name: displayRuleId) else {
1459
1477
  return doReject(reject, displayRuleId: displayRuleId)
@@ -2,6 +2,9 @@ import Foundation
2
2
  import MapsIndoors
3
3
  import MapsIndoorsCodable
4
4
  import MapsIndoorsCore
5
+ #if canImport(MapsIndoorsMapbox)
6
+ import MapsIndoorsMapbox
7
+ #endif
5
8
  import React
6
9
 
7
10
  @objc(MapsIndoorsModule)
@@ -474,6 +477,15 @@ public class MapsIndoorsModule: RCTEventEmitter {
474
477
  }
475
478
 
476
479
  Task {
480
+ // The SDK otherwise registers its base-map cache only when MapControl.create builds the
481
+ // map provider, so caching before the first map rejected with 9000 (SPEX-2895). A no-op
482
+ // once a map has registered its own. The SDK declares it @MainActor, since the Mapbox
483
+ // objects it creates belong to their creating thread; the await hops there. The token
484
+ // comes from Info.plist's MBXAccessToken, which Mapbox reads by itself.
485
+ #if canImport(MapsIndoorsMapbox)
486
+ await MPMapsIndoors.registerMapboxBaseMapCache()
487
+ #endif
488
+
477
489
  do {
478
490
  if apiKeys == nil {
479
491
  try await datasetCacheManager.synchronizeBaseMapTiles(progress: progress)
@@ -0,0 +1 @@
1
+ // SwiftPM requires a public headers directory; the bridge targets export no headers.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mapsindoors/react-native-maps-indoors-mapbox",
3
3
  "title": "React Native MapsIndoors Mapbox",
4
- "version": "2.10.0",
4
+ "version": "2.12.0",
5
5
  "description": "React Native MapsIndoors component with mapbox",
6
6
  "react-native": "index.ts",
7
7
  "files": [
@@ -17,11 +17,13 @@
17
17
  "!ios/core/Tests",
18
18
  "!ios/core/.build",
19
19
  "!android/build",
20
- "app.plugin.js"
20
+ "app.plugin.js",
21
+ "Package.swift"
21
22
  ],
22
23
  "scripts": {
23
24
  "test": "jest",
24
- "test:watch": "jest --watch"
25
+ "test:watch": "jest --watch",
26
+ "prepack": "if [ -n \"$(find src/core ios/core android/src/main/java/com/mapsindoorsrn/core -type l -print -quit)\" ]; then echo \"The shared cores are symlinks, which npm pack drops. Pack with tools/pack.sh from the repo root.\" >&2; exit 1; fi; for f in src/core/index.ts ios/core/MapsIndoorsModule.swift android/src/main/java/com/mapsindoorsrn/core/MapsIndoorsModule.java; do if [ ! -f $f ]; then echo \"$f is missing: the shared cores are absent or older than this package.\" >&2; exit 1; fi; done"
25
27
  },
26
28
  "repository": {
27
29
  "type": "git",
@@ -62,5 +64,8 @@
62
64
  "android": {
63
65
  "javaPackageName": "com.mapsindoorsrn"
64
66
  }
67
+ },
68
+ "swiftpmConfig": {
69
+ "name": "ReactNativeMapsIndoorsMapbox"
65
70
  }
66
71
  }
@@ -22,21 +22,18 @@ Pod::Spec.new do |s|
22
22
 
23
23
  s.source_files = "ios/**/*.{h,c,cc,cpp,m,mm,swift}"
24
24
  # ios/core carries a SwiftPM manifest and unit tests for its React-free helpers (SPEX-2686). They
25
- # are run with `swift test` in that repository and must not be compiled into the pod, nor must the
25
+ # are run with `swift test` in IosCore/ and must not be compiled into the pod, nor must the
26
26
  # build products `swift test` leaves in .build (they include a generated `@main` test runner).
27
- s.exclude_files = "ios/core/Package.swift", "ios/core/Tests/**/*", "ios/core/.build/**/*"
27
+ s.exclude_files = "ios/core/Package.swift", "ios/core/Tests/**/*", "ios/core/.build/**/*", "ios/spm-bridges/**/*"
28
28
  s.requires_arc = true
29
29
 
30
30
  install_modules_dependencies(s)
31
31
 
32
- # MapsIndoors' iOS SDK is consumed via CocoaPods, which resolves MapsIndoorsCore and MapboxMaps
33
- # 11.x transitively and embeds them into the consuming app.
34
- #
35
- # This deliberately does *not* use the Swift Package Manager integration introduced in SPEX-889:
36
- # `spm_dependency` attaches the packages to the Pods project's own target, and nothing then
37
- # embeds the resulting dynamic frameworks into the app bundle, so the app builds and links but
38
- # dies at launch with `Library not loaded: @rpath/MapsIndoorsCore.framework/MapsIndoorsCore`.
39
- # See SPEX-2429 before reintroducing SPM here.
40
- s.dependency "MapsIndoorsMapbox11", "4.23.0"
41
- s.dependency "MapsIndoorsCodable", "4.23.0"
32
+ # CocoaPods apps get the MapsIndoors SDK as pods, which embed into the app. Do not switch to
33
+ # `spm_dependency`: it attaches the packages to the Pods project's own target, nothing embeds the
34
+ # frameworks, and the app dies at launch with `Library not loaded: @rpath/MapsIndoorsCore...`
35
+ # (SPEX-2429). Apps on React Native's SwiftPM mode (0.88+) use Package.swift instead, which must
36
+ # name the same SDK version.
37
+ s.dependency "MapsIndoorsMapbox11", "4.25.0"
38
+ s.dependency "MapsIndoorsCodable", "4.25.0"
42
39
  end