@mapsindoors/react-native-maps-indoors-mapbox 2.6.2 → 2.7.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 (34) hide show
  1. package/README.md +10 -1
  2. package/android/build.gradle +17 -70
  3. package/android/src/main/java/com/mapsindoorsrn/MapsIndoorsPackage.java +69 -18
  4. package/android/src/main/java/com/mapsindoorsrn/core/DirectionsRendererModule.java +5 -1
  5. package/android/src/main/java/com/mapsindoorsrn/core/DirectionsServiceModule.java +5 -2
  6. package/android/src/main/java/com/mapsindoorsrn/core/MPDisplayRuleModule.java +5 -1
  7. package/android/src/main/java/com/mapsindoorsrn/core/MapControlModule.java +5 -1
  8. package/android/src/main/java/com/mapsindoorsrn/core/MapsIndoorsModule.java +4 -1
  9. package/android/src/main/java/com/mapsindoorsrn/core/UtilsModule.java +4 -1
  10. package/ios/core/DirectionsRendererBridge.m +5 -0
  11. package/ios/core/DirectionsRendererModule.swift +92 -72
  12. package/ios/core/DirectionsServiceBridge.m +1 -1
  13. package/ios/core/DirectionsServiceModule.swift +44 -51
  14. package/ios/core/IconStopUrl.swift +1 -1
  15. package/ios/core/MPDisplayRuleModule.swift +208 -210
  16. package/ios/core/MapControlModule.swift +284 -216
  17. package/ios/core/MapsIndoorsData.swift +48 -49
  18. package/ios/core/MapsIndoorsModule.swift +46 -52
  19. package/ios/core/RCMapView.swift +1 -1
  20. package/ios/core/ReactPositionProvider.swift +1 -2
  21. package/ios/core/RouteIcon.swift +6 -6
  22. package/ios/core/UtilsModule.swift +37 -42
  23. package/ios/core/helpers.swift +16 -11
  24. package/package.json +10 -1
  25. package/react-native-maps-indoors-mapbox.podspec +3 -3
  26. package/specs/MapsIndoorsViewNativeComponent.ts +10 -0
  27. package/specs/NativeDirectionsRendererModule.ts +23 -0
  28. package/specs/NativeDirectionsServiceModule.ts +22 -0
  29. package/specs/NativeMPDisplayRuleModule.ts +155 -0
  30. package/specs/NativeMapControlModule.ts +62 -0
  31. package/specs/NativeMapsIndoorsModule.ts +43 -0
  32. package/specs/NativeUtilsModule.ts +21 -0
  33. package/src/core/MPDirectionsRenderer.ts +15 -0
  34. package/src/core/MPDirectionsService.ts +1 -1
@@ -128,6 +128,21 @@ export default class MPDirectionsRenderer {
128
128
  await DirectionsRenderer.setAnimatedPolyline(animated, repeating, durationMs);
129
129
  }
130
130
 
131
+ /**
132
+ * Set the colors of the route polyline.
133
+ *
134
+ * Colors are given as hex strings (e.g. "#3071D9").
135
+ *
136
+ * @public
137
+ * @async
138
+ * @param {string} foregroundColor the primary color (animated polyline)
139
+ * @param {string} backgroundColor the secondary color (static polyline)
140
+ * @returns {Promise<void>}
141
+ */
142
+ public async setPolylineColors(foregroundColor: string, backgroundColor: string): Promise<void> {
143
+ await DirectionsRenderer.setPolyLineColors(foregroundColor, backgroundColor);
144
+ }
145
+
131
146
  /**
132
147
  * Enable/Disable the route end/start label buttons from showing on the route. Default is true
133
148
  *
@@ -29,7 +29,7 @@ export default class MPDirectionsService {
29
29
  * @returns {Promise<MPDirectionsService>}
30
30
  */
31
31
  public static async create(): Promise<MPDirectionsService> {
32
- return DirectionsService.create().then((resolve: string) => new MPDirectionsService(resolve));
32
+ return DirectionsService.createService().then((resolve: string) => new MPDirectionsService(resolve));
33
33
  }
34
34
 
35
35
  /**