@rnmapbox/maps 10.3.2-rc.1 → 10.3.2

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 (35) hide show
  1. package/android/src/main/java/com/rnmapbox/rnmbx/RNMBXPackage.kt +2 -0
  2. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXMarkerView.kt +0 -2
  3. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotation.kt +6 -2
  4. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotationCoordinator.kt +10 -2
  5. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotationManagerView.kt +143 -0
  6. package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXPointAnnotationManagerViewManager.kt +105 -0
  7. package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt +33 -7
  8. package/ios/RNMBX/RNMBXMapView.swift +69 -7
  9. package/ios/RNMBX/RNMBXPointAnnotation.swift +11 -5
  10. package/ios/RNMBX/RNMBXPointAnnotationManagerComponentView.h +15 -0
  11. package/ios/RNMBX/RNMBXPointAnnotationManagerComponentView.mm +98 -0
  12. package/ios/RNMBX/RNMBXPointAnnotationManagerComponentView.swift +130 -0
  13. package/ios/RNMBX/rnmapbox_maps-Swift.pre.h +1 -1
  14. package/lib/module/Mapbox.native.js +1 -0
  15. package/lib/module/Mapbox.native.js.map +1 -1
  16. package/lib/module/components/PointAnnotationManager.js +37 -0
  17. package/lib/module/components/PointAnnotationManager.js.map +1 -0
  18. package/lib/module/components/StyleImport.js +9 -1
  19. package/lib/module/components/StyleImport.js.map +1 -1
  20. package/lib/module/specs/RNMBXPointAnnotationManagerNativeComponent.ts +28 -0
  21. package/lib/typescript/scripts/autogenHelpers/DocJSONBuilder.d.mts.map +1 -1
  22. package/lib/typescript/src/Mapbox.native.d.ts +2 -0
  23. package/lib/typescript/src/Mapbox.native.d.ts.map +1 -1
  24. package/lib/typescript/src/components/PointAnnotationManager.d.ts +59 -0
  25. package/lib/typescript/src/components/PointAnnotationManager.d.ts.map +1 -0
  26. package/lib/typescript/src/components/StyleImport.d.ts +63 -3
  27. package/lib/typescript/src/components/StyleImport.d.ts.map +1 -1
  28. package/lib/typescript/src/specs/RNMBXPointAnnotationManagerNativeComponent.d.ts +20 -0
  29. package/lib/typescript/src/specs/RNMBXPointAnnotationManagerNativeComponent.d.ts.map +1 -0
  30. package/package.json +6 -2
  31. package/rnmapbox-maps.podspec +12 -3
  32. package/src/Mapbox.native.ts +2 -0
  33. package/src/components/PointAnnotationManager.tsx +97 -0
  34. package/src/components/StyleImport.tsx +71 -4
  35. package/src/specs/RNMBXPointAnnotationManagerNativeComponent.ts +28 -0
@@ -199,7 +199,19 @@ end
199
199
 
200
200
  $rnMapboxMapsTargetsToChangeToDynamic = rnMapboxMapsTargetsToChangeToDynamic
201
201
 
202
+ def $RNMapboxMaps._expo_precompiled_pipeline?
203
+ # Expo SDK 56+ precompiled iOS pipeline (prebuilt React core) downgrades every
204
+ # framework-style pod back to a static library after the podspec is evaluated.
205
+ # Flipping the Mapbox pods to dynamic here fights that and leaves an inconsistent
206
+ # graph (MapboxMaps stays dynamic while its deps get forced static). See #4242.
207
+ ENV['EXPO_USE_PRECOMPILED_MODULES'] == '1'
208
+ end
209
+
202
210
  def $RNMapboxMaps.pre_install(installer)
211
+ if $RNMapboxMaps._expo_precompiled_pipeline?
212
+ Pod::UI.puts "[RNMapbox] Expo precompiled modules pipeline detected (EXPO_USE_PRECOMPILED_MODULES=1) — skipping the Mapbox dynamic-framework flip so all Mapbox pods stay consistently static."
213
+ return
214
+ end
203
215
  installer.aggregate_targets.each do |target|
204
216
  target.pod_targets.select { |p| $rnMapboxMapsTargetsToChangeToDynamic.include?(p.name) }.each do |mobile_events_target|
205
217
  mobile_events_target.instance_variable_set(:@build_type,Pod::BuildType.dynamic_framework)
@@ -286,9 +298,6 @@ Pod::Spec.new do |s|
286
298
  $RNMapboxMaps._add_compiler_flags(sp, "-DRNMBX_RN_72=1")
287
299
  end
288
300
  end
289
- if ENV['USE_FRAMEWORKS'] || $RNMapboxMapsUseFrameworks
290
- $RNMapboxMaps._add_compiler_flags(sp, "-DRNMBX_USE_FRAMEWORKS=1")
291
- end
292
301
  else
293
302
  fail "$RNMapboxMapsImpl should be mapbox but was: $RNMapboxMapsImpl"
294
303
  end
@@ -18,9 +18,11 @@ export {
18
18
  } from './components/MapView';
19
19
  export { default as Light } from './components/Light';
20
20
  export { default as PointAnnotation } from './components/PointAnnotation';
21
+ export { default as PointAnnotationManager } from './components/PointAnnotationManager';
21
22
  export { default as Annotation } from './components/Annotation';
22
23
  export { default as Callout } from './components/Callout';
23
24
  export { default as StyleImport } from './components/StyleImport';
25
+ export type { StandardStyleConfig } from './components/StyleImport';
24
26
  export {
25
27
  default as UserLocation,
26
28
  UserLocationRenderMode,
@@ -0,0 +1,97 @@
1
+ import React, { type ReactNode } from 'react';
2
+
3
+ import NativePointAnnotationManager from '../specs/RNMBXPointAnnotationManagerNativeComponent';
4
+
5
+ import PointAnnotation from './PointAnnotation';
6
+
7
+ type Slot = 'bottom' | 'middle' | 'top';
8
+
9
+ type Props = {
10
+ /**
11
+ * A stable Mapbox layer id for this manager's annotation layer.
12
+ * When omitted, the SDK generates a unique id automatically.
13
+ */
14
+ id?: string;
15
+
16
+ /**
17
+ * Marks this as the default manager. PointAnnotations that are not wrapped in a
18
+ * PointAnnotationManager attach to the default manager, so this lets you configure
19
+ * the slot and properties used by those bare annotations. Only one default manager
20
+ * is allowed per MapView.
21
+ */
22
+ default?: boolean;
23
+
24
+ /**
25
+ * The slot in the style layer stack to position the annotation layer.
26
+ * Use with Mapbox Standard style to control layer ordering.
27
+ */
28
+ slot?: Slot | (string & {});
29
+
30
+ /**
31
+ * If true, the icon will be visible even if it collides with other previously drawn symbols.
32
+ */
33
+ iconAllowOverlap?: boolean;
34
+
35
+ /**
36
+ * If true, other symbols can be visible even if they collide with the icon.
37
+ */
38
+ iconIgnorePlacement?: boolean;
39
+
40
+ /**
41
+ * If true, text will display without their corresponding icons when the icon collides
42
+ * with other symbols and the text does not.
43
+ */
44
+ iconOptional?: boolean;
45
+
46
+ /**
47
+ * If true, the text will be visible even if it collides with other previously drawn symbols.
48
+ */
49
+ textAllowOverlap?: boolean;
50
+
51
+ /**
52
+ * If true, other symbols can be visible even if they collide with the text.
53
+ */
54
+ textIgnorePlacement?: boolean;
55
+
56
+ /**
57
+ * If true, icons will display without their corresponding text when the text collides
58
+ * with other symbols and the icon does not.
59
+ */
60
+ textOptional?: boolean;
61
+
62
+ children?: ReactNode;
63
+ };
64
+
65
+ /**
66
+ * Configures a PointAnnotation manager. Each PointAnnotationManager owns its own
67
+ * annotation layer, so multiple managers can be placed in different `slot`s of the
68
+ * Mapbox Standard style. Wrap PointAnnotation components as children.
69
+ *
70
+ * PointAnnotations that are not wrapped in a PointAnnotationManager attach to a
71
+ * default manager. Use `default` to configure that manager.
72
+ */
73
+ const PointAnnotationManager = (props: Props) => {
74
+ const { children, default: isDefault, slot, ...rest } = props;
75
+
76
+ if (__DEV__) {
77
+ React.Children.forEach(children, (child) => {
78
+ if (React.isValidElement(child) && child.type !== PointAnnotation) {
79
+ console.warn(
80
+ 'PointAnnotationManager: only PointAnnotation components should be direct children.',
81
+ );
82
+ }
83
+ });
84
+ }
85
+
86
+ return (
87
+ <NativePointAnnotationManager
88
+ {...rest}
89
+ isDefault={isDefault}
90
+ slot={slot as Slot | undefined}
91
+ >
92
+ {children}
93
+ </NativePointAnnotationManager>
94
+ );
95
+ };
96
+
97
+ export default PointAnnotationManager;
@@ -2,6 +2,67 @@ import { memo } from 'react';
2
2
 
3
3
  import NativeStyleImport from '../specs/RNMBXStyleImportNativeComponent';
4
4
 
5
+ /**
6
+ * Configuration options for the Mapbox Standard style.
7
+ *
8
+ * These options are available when using `StyleImport` with `id="basemap"` and
9
+ * a Standard style URL (e.g., `mapbox://styles/mapbox/standard`).
10
+ */
11
+ export type StandardStyleConfig = {
12
+ /** Light preset: controls time-of-day lighting */
13
+ lightPreset?: 'dawn' | 'day' | 'dusk' | 'night';
14
+ /** Color theme */
15
+ theme?: 'default' | 'faded' | 'monochrome';
16
+ /** Font family for labels (e.g., 'Montserrat') */
17
+ font?: string;
18
+ /** Show generic 3D objects */
19
+ show3dObjects?: boolean;
20
+ /** Show extruded 3D buildings */
21
+ show3dBuildings?: boolean;
22
+ /** Show 3D building facades (v11.16+) */
23
+ show3dFacades?: boolean;
24
+ /** Show 3D landmarks (v11.16+) */
25
+ show3dLandmarks?: boolean;
26
+ /** Show 3D trees (v11.17+) */
27
+ show3dTrees?: boolean;
28
+ /** Show point of interest labels */
29
+ showPointOfInterestLabels?: boolean;
30
+ /** Show transit labels */
31
+ showTransitLabels?: boolean;
32
+ /** Show place labels */
33
+ showPlaceLabels?: boolean;
34
+ /** Show road labels */
35
+ showRoadLabels?: boolean;
36
+ /** Show pedestrian roads */
37
+ showPedestrianRoads?: boolean;
38
+ /** Color override for buildings (v11.18+) */
39
+ colorBuildings?: string;
40
+ /** Color override for commercial areas (v11.18+) */
41
+ colorCommercial?: string;
42
+ /** Color override for education areas (v11.18+) */
43
+ colorEducation?: string;
44
+ /** Color override for industrial areas (v11.18+) */
45
+ colorIndustrial?: string;
46
+ /** Color override for land (v11.18+) */
47
+ colorLand?: string;
48
+ /** Color override for medical areas (v11.18+) */
49
+ colorMedical?: string;
50
+ /** Color override for roads (v11.18+) */
51
+ colorRoads?: string;
52
+ /** Color override for motorways (v11.18+) */
53
+ colorMotorways?: string;
54
+ /** Color override for water (v11.18+) */
55
+ colorWater?: string;
56
+ /** Color override for greenspaces (v11.18+) */
57
+ colorGreenspaces?: string;
58
+ /** Color override for boundaries (v11.18+) */
59
+ colorBoundaries?: string;
60
+ };
61
+
62
+ type StyleImportConfig = StandardStyleConfig & {
63
+ [key: string]: string | boolean | undefined;
64
+ };
65
+
5
66
  type Props = {
6
67
  /**
7
68
  * id of the style import (eg. basemap)
@@ -16,11 +77,12 @@ type Props = {
16
77
  /**
17
78
  * config is a dictionary of configuration options for the style import.
18
79
  *
80
+ * When using the Mapbox Standard style with `id="basemap"`, use `StandardStyleConfig`
81
+ * keys for autocomplete. Arbitrary keys are also accepted for forward compatibility.
82
+ *
19
83
  * See https://github.com/mapbox/mapbox-maps-ios/blob/main/Sources/MapboxMaps/Documentation.docc/Migrate%20to%20v11.md#21-the-mapbox-standard-style
20
84
  */
21
- config: {
22
- [key: string]: string;
23
- };
85
+ config: StyleImportConfig;
24
86
  };
25
87
 
26
88
  /**
@@ -29,5 +91,10 @@ type Props = {
29
91
  * See https://github.com/mapbox/mapbox-maps-ios/blob/main/Sources/MapboxMaps/Documentation.docc/Migrate%20to%20v11.md#21-the-mapbox-standard-style
30
92
  */
31
93
  export default memo((props: Props) => {
32
- return <NativeStyleImport {...props} />;
94
+ return (
95
+ <NativeStyleImport
96
+ {...props}
97
+ config={props.config as unknown as { [key: string]: string }}
98
+ />
99
+ );
33
100
  });
@@ -0,0 +1,28 @@
1
+ import type { HostComponent, ViewProps } from 'react-native';
2
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
3
+
4
+ import type { UnsafeMixed } from './codegenUtils';
5
+
6
+ // see https://github.com/rnmapbox/maps/wiki/FabricOptionalProp
7
+ type OptionalProp<T> = UnsafeMixed<T>;
8
+
9
+ type Slot = 'bottom' | 'middle' | 'top';
10
+
11
+ export interface NativeProps extends ViewProps {
12
+ /** Stable Mapbox layer id for this manager. When omitted the SDK generates one. */
13
+ id?: OptionalProp<string>;
14
+ /** Marks this as the manager used by PointAnnotations not wrapped in a manager. */
15
+ isDefault?: OptionalProp<boolean>;
16
+ slot?: OptionalProp<Slot>;
17
+ iconAllowOverlap?: OptionalProp<boolean>;
18
+ iconIgnorePlacement?: OptionalProp<boolean>;
19
+ iconOptional?: OptionalProp<boolean>;
20
+ textAllowOverlap?: OptionalProp<boolean>;
21
+ textIgnorePlacement?: OptionalProp<boolean>;
22
+ textOptional?: OptionalProp<boolean>;
23
+ }
24
+
25
+ // @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast
26
+ export default codegenNativeComponent<NativeProps>(
27
+ 'RNMBXPointAnnotationManager',
28
+ ) as HostComponent<NativeProps>;