@maplibre/maplibre-react-native 10.1.4 → 10.1.5

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 (53) hide show
  1. package/lib/commonjs/MapLibreRN.js.map +1 -1
  2. package/lib/commonjs/components/MapView.js.map +1 -1
  3. package/lib/commonjs/index.js +1 -2
  4. package/lib/commonjs/index.js.map +1 -1
  5. package/lib/commonjs/plugin/ios.js +1 -29
  6. package/lib/commonjs/plugin/ios.js.map +1 -1
  7. package/lib/commonjs/plugin/withMapLibre.js +0 -1
  8. package/lib/commonjs/plugin/withMapLibre.js.map +1 -1
  9. package/lib/module/MapLibreRN.js.map +1 -1
  10. package/lib/module/components/MapView.js.map +1 -1
  11. package/lib/module/plugin/ios.js +1 -29
  12. package/lib/module/plugin/ios.js.map +1 -1
  13. package/lib/module/plugin/withMapLibre.js +0 -1
  14. package/lib/module/plugin/withMapLibre.js.map +1 -1
  15. package/lib/typescript/commonjs/src/MapLibreRN.d.ts +2 -1
  16. package/lib/typescript/commonjs/src/MapLibreRN.d.ts.map +1 -1
  17. package/lib/typescript/commonjs/src/components/Annotation.d.ts +2 -2
  18. package/lib/typescript/commonjs/src/components/Annotation.d.ts.map +1 -1
  19. package/lib/typescript/commonjs/src/components/Images.d.ts +1 -1
  20. package/lib/typescript/commonjs/src/components/Images.d.ts.map +1 -1
  21. package/lib/typescript/commonjs/src/components/MapView.d.ts +34 -42
  22. package/lib/typescript/commonjs/src/components/MapView.d.ts.map +1 -1
  23. package/lib/typescript/commonjs/src/components/PointAnnotation.d.ts +5 -5
  24. package/lib/typescript/commonjs/src/components/PointAnnotation.d.ts.map +1 -1
  25. package/lib/typescript/commonjs/src/components/UserLocation.d.ts +2 -2
  26. package/lib/typescript/commonjs/src/components/UserLocation.d.ts.map +1 -1
  27. package/lib/typescript/commonjs/src/plugin/ios.d.ts +0 -1
  28. package/lib/typescript/commonjs/src/plugin/ios.d.ts.map +1 -1
  29. package/lib/typescript/commonjs/src/plugin/withMapLibre.d.ts.map +1 -1
  30. package/lib/typescript/module/src/MapLibreRN.d.ts +2 -1
  31. package/lib/typescript/module/src/MapLibreRN.d.ts.map +1 -1
  32. package/lib/typescript/module/src/components/Annotation.d.ts +2 -2
  33. package/lib/typescript/module/src/components/Annotation.d.ts.map +1 -1
  34. package/lib/typescript/module/src/components/Images.d.ts +1 -1
  35. package/lib/typescript/module/src/components/Images.d.ts.map +1 -1
  36. package/lib/typescript/module/src/components/MapView.d.ts +34 -42
  37. package/lib/typescript/module/src/components/MapView.d.ts.map +1 -1
  38. package/lib/typescript/module/src/components/PointAnnotation.d.ts +5 -5
  39. package/lib/typescript/module/src/components/PointAnnotation.d.ts.map +1 -1
  40. package/lib/typescript/module/src/components/UserLocation.d.ts +2 -2
  41. package/lib/typescript/module/src/components/UserLocation.d.ts.map +1 -1
  42. package/lib/typescript/module/src/plugin/ios.d.ts +0 -1
  43. package/lib/typescript/module/src/plugin/ios.d.ts.map +1 -1
  44. package/lib/typescript/module/src/plugin/withMapLibre.d.ts.map +1 -1
  45. package/package.json +5 -5
  46. package/src/MapLibreRN.ts +7 -4
  47. package/src/components/Annotation.tsx +2 -2
  48. package/src/components/Images.tsx +1 -1
  49. package/src/components/MapView.tsx +39 -60
  50. package/src/components/PointAnnotation.tsx +5 -5
  51. package/src/components/UserLocation.tsx +2 -2
  52. package/src/plugin/ios.ts +0 -32
  53. package/src/plugin/withMapLibre.ts +0 -1
@@ -55,6 +55,8 @@ export interface RegionPayload {
55
55
  pitch: number;
56
56
  }
57
57
 
58
+ type RegionPayloadFeature = GeoJSON.Feature<GeoJSON.Point, RegionPayload>;
59
+
58
60
  type VisibleBounds = [northEast: GeoJSON.Position, southWest: GeoJSON.Position];
59
61
 
60
62
  interface MapViewProps extends BaseProps {
@@ -102,10 +104,7 @@ interface MapViewProps extends BaseProps {
102
104
  */
103
105
  rotateEnabled?: boolean;
104
106
  /**
105
- * Enable/Disable attribution on map.
106
- *
107
- * This must be enabled for Mapbox-hosted tiles and styles. Please refer to the Mapbox Terms of Service.
108
- * Other providers do not require this.
107
+ * Enable/Disable attribution on map
109
108
  */
110
109
  attributionEnabled?: boolean;
111
110
  /**
@@ -145,91 +144,79 @@ interface MapViewProps extends BaseProps {
145
144
  */
146
145
  compassViewMargins?: object;
147
146
  /**
148
- * [Android only] Enable/Disable use of GLSurfaceView insted of TextureView.
147
+ * [Android only] Enable/Disable use of GLSurfaceView instead of TextureView
149
148
  */
150
149
  surfaceView?: boolean;
151
150
  /**
152
151
  * Map press listener, gets called when a user presses the map
153
152
  */
154
- onPress?(feature: GeoJSON.Feature): void;
153
+ onPress?: (feature: GeoJSON.Feature) => void;
155
154
  /**
156
155
  * Map long press listener, gets called when a user long presses the map
157
156
  */
158
- onLongPress?(feature: GeoJSON.Feature): void;
157
+ onLongPress?: (feature: GeoJSON.Feature) => void;
159
158
  /**
160
- * This event is triggered whenever the currently displayed map region is about to change.
161
- *
162
- * @param {GeoJSON.Feature<GeoJSON.Point, RegionPayload>} feature - The geojson point feature at the camera center, properties contains zoomLevel, visibleBounds
159
+ * Triggered when the currently displayed map region is about to change
163
160
  */
164
- onRegionWillChange?(
165
- feature: GeoJSON.Feature<GeoJSON.Point, RegionPayload>,
166
- ): void;
161
+ onRegionWillChange?: (feature: RegionPayloadFeature) => void;
167
162
  /**
168
- * This event is triggered whenever the currently displayed map region is changing.
169
- *
170
- * @param {GeoJSON.Feature<GeoJSON.Point, RegionPayload>} feature - The geojson point feature at the camera center, properties contains zoomLevel, visibleBounds
163
+ * Triggered when the currently displayed map region is changing
171
164
  */
172
- onRegionIsChanging?(
173
- feature: GeoJSON.Feature<GeoJSON.Point, RegionPayload>,
174
- ): void;
165
+ onRegionIsChanging?: (feature: RegionPayloadFeature) => void;
175
166
  /**
176
- * This event is triggered whenever the currently displayed map region finished changing
177
- *
178
- * @param {GeoJSON.Feature<GeoJSON.Point, RegionPayload>} feature - The geojson point feature at the camera center, properties contains zoomLevel, visibleBounds
167
+ * Triggered when the currently displayed map region finished changing
179
168
  */
180
- onRegionDidChange?(
181
- feature: GeoJSON.Feature<GeoJSON.Point, RegionPayload>,
182
- ): void;
169
+ onRegionDidChange?: (feature: RegionPayloadFeature) => void;
183
170
  /**
184
- * This event is triggered when the map is about to start loading a new map style.
171
+ * Triggered when the map is about to start loading a new map style
185
172
  */
186
- onWillStartLoadingMap?(): void;
173
+ onWillStartLoadingMap?: () => void;
187
174
  /**
188
- * This is triggered when the map has successfully loaded a new map style.
175
+ * This is triggered when the map has successfully loaded a new map style
189
176
  */
190
- onDidFinishLoadingMap?(): void;
177
+ onDidFinishLoadingMap?: () => void;
191
178
  /**
192
- * This event is triggered when the map has failed to load a new map style.
179
+ * Triggered when the map has failed to load a new map style
193
180
  */
194
- onDidFailLoadingMap?(): void;
181
+ onDidFailLoadingMap?: () => void;
195
182
  /**
196
- * This event is triggered when the map will start rendering a frame.
183
+ * Triggered when the map will start rendering a frame
197
184
  */
198
- onWillStartRenderingFrame?(): void;
185
+ onWillStartRenderingFrame?: () => void;
199
186
  /**
200
- * This event is triggered when the map finished rendering a frame.
187
+ * Triggered when the map finished rendering a frame
201
188
  */
202
- onDidFinishRenderingFrame?(): void;
189
+ onDidFinishRenderingFrame?: () => void;
203
190
  /**
204
- * This event is triggered when the map fully finished rendering a frame.
191
+ * Triggered when the map fully finished rendering a frame
205
192
  */
206
- onDidFinishRenderingFrameFully?(): void;
193
+ onDidFinishRenderingFrameFully?: () => void;
207
194
  /**
208
- * This event is triggered when the map will start rendering the map.
195
+ * Triggered when the map will start rendering the map
209
196
  */
210
- onWillStartRenderingMap?(): void;
197
+ onWillStartRenderingMap?: () => void;
211
198
  /**
212
- * This event is triggered when the map finished rendering the map.
199
+ * Triggered when the map finished rendering the map
213
200
  */
214
- onDidFinishRenderingMap?(): void;
201
+ onDidFinishRenderingMap?: () => void;
215
202
  /**
216
- * This event is triggered when the map fully finished rendering the map.
203
+ * Triggered when the map fully finished rendering the map
217
204
  */
218
- onDidFinishRenderingMapFully?(): void;
205
+ onDidFinishRenderingMapFully?: () => void;
219
206
  /**
220
- * This event is triggered when the user location is updated.
207
+ * Triggered when the user location is updated
221
208
  */
222
209
  onUserLocationUpdate?: (location: Location) => void;
223
210
  /**
224
- * This event is triggered when a style has finished loading.
211
+ * Triggered when a style has finished loading
225
212
  */
226
- onDidFinishLoadingStyle?(): void;
213
+ onDidFinishLoadingStyle?: () => void;
227
214
  /**
228
- * The emitted frequency of regionwillchange events
215
+ * Emitted frequency of regionWillChange events
229
216
  */
230
217
  regionWillChangeDebounceTime?: number;
231
218
  /**
232
- * The emitted frequency of regiondidchange events
219
+ * Emitted frequency of regionDidChange events
233
220
  */
234
221
  regionDidChangeDebounceTime?: number;
235
222
 
@@ -623,17 +610,13 @@ export const MapView = memo(
623
610
  }
624
611
  };
625
612
 
626
- const _onRegionWillChange = (
627
- payload: GeoJSON.Feature<GeoJSON.Point, RegionPayload>,
628
- ): void => {
613
+ const _onRegionWillChange = (payload: RegionPayloadFeature): void => {
629
614
  if (isFunction(props.onRegionWillChange)) {
630
615
  props.onRegionWillChange(payload);
631
616
  }
632
617
  };
633
618
 
634
- const _onRegionDidChange = (
635
- payload: GeoJSON.Feature<GeoJSON.Point, RegionPayload>,
636
- ): void => {
619
+ const _onRegionDidChange = (payload: RegionPayloadFeature): void => {
637
620
  if (isFunction(props.onRegionDidChange)) {
638
621
  props.onRegionDidChange(payload);
639
622
  }
@@ -667,9 +650,7 @@ export const MapView = memo(
667
650
  regionWillChangeDebounceTime > 0
668
651
  ) {
669
652
  if (payload) {
670
- _onDebouncedRegionWillChange(
671
- payload as GeoJSON.Feature<GeoJSON.Point, RegionPayload>,
672
- );
653
+ _onDebouncedRegionWillChange(payload as RegionPayloadFeature);
673
654
  }
674
655
  } else {
675
656
  propName = "onRegionWillChange";
@@ -684,9 +665,7 @@ export const MapView = memo(
684
665
  regionDidChangeDebounceTime > 0
685
666
  ) {
686
667
  if (payload) {
687
- _onDebouncedRegionDidChange(
688
- payload as GeoJSON.Feature<GeoJSON.Point, RegionPayload>,
689
- );
668
+ _onDebouncedRegionDidChange(payload as RegionPayloadFeature);
690
669
  }
691
670
  } else {
692
671
  propName = "onRegionDidChange";
@@ -80,23 +80,23 @@ export interface PointAnnotationProps {
80
80
  /**
81
81
  * This callback is fired once this annotation is selected. Returns a Feature as the first param.
82
82
  */
83
- onSelected?(payload: FeaturePayload): void;
83
+ onSelected?: (payload: FeaturePayload) => void;
84
84
  /**
85
85
  * This callback is fired once this annotation is deselected.
86
86
  */
87
- onDeselected?(payload: FeaturePayload): void;
87
+ onDeselected?: (payload: FeaturePayload) => void;
88
88
  /**
89
89
  * This callback is fired once this annotation has started being dragged.
90
90
  */
91
- onDragStart?(payload: FeaturePayload): void;
91
+ onDragStart?: (payload: FeaturePayload) => void;
92
92
  /**
93
93
  * This callback is fired once this annotation has stopped being dragged.
94
94
  */
95
- onDragEnd?(payload: FeaturePayload): void;
95
+ onDragEnd?: (payload: FeaturePayload) => void;
96
96
  /**
97
97
  * This callback is fired while this annotation is being dragged.
98
98
  */
99
- onDrag?(payload: FeaturePayload): void;
99
+ onDrag?: (payload: FeaturePayload) => void;
100
100
 
101
101
  /**
102
102
  * Expects one child, and an optional callout can be added as well
@@ -45,11 +45,11 @@ interface UserLocationProps {
45
45
  /**
46
46
  * Callback that is triggered on location icon press
47
47
  */
48
- onPress?(): void;
48
+ onPress?: () => void;
49
49
  /**
50
50
  * Callback that is triggered on location update
51
51
  */
52
- onUpdate?(location: Location): void;
52
+ onUpdate?: (location: Location) => void;
53
53
  /**
54
54
  * Show or hide small arrow which indicates direction the device is pointing relative to north.
55
55
  */
package/src/plugin/ios.ts CHANGED
@@ -2,7 +2,6 @@ import {
2
2
  type ConfigPlugin,
3
3
  withPodfile,
4
4
  withXcodeProject,
5
- type XcodeProject,
6
5
  } from "@expo/config-plugins";
7
6
  import {
8
7
  mergeContents,
@@ -88,28 +87,6 @@ export const withPodfileGlobalVariables: ConfigPlugin<MapLibrePluginProps> = (
88
87
  });
89
88
  };
90
89
 
91
- /**
92
- * Exclude building for arm64 on simulator devices in the pbxproj project.
93
- * Without this, production builds targeting simulators will fail.
94
- */
95
- function setExcludedArchitectures(project: XcodeProject): XcodeProject {
96
- const configurations = project.pbxXCBuildConfigurationSection();
97
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
98
- // @ts-ignore
99
- for (const { name, buildSettings } of Object.values(configurations || {})) {
100
- // Guessing that this is the best way to emulate Xcode.
101
- // Using `project.addToBuildSettings` modifies too many targets.
102
- if (
103
- name === "Release" &&
104
- typeof buildSettings?.PRODUCT_NAME !== "undefined"
105
- ) {
106
- buildSettings['"EXCLUDED_ARCHS[sdk=iphonesimulator*]"'] = '"arm64"';
107
- }
108
- }
109
-
110
- return project;
111
- }
112
-
113
90
  const withoutSignatures: ConfigPlugin = (config) => {
114
91
  return withXcodeProject(config, async (c) => {
115
92
  c.modResults.addBuildPhase(
@@ -149,18 +126,9 @@ const withDwarfDsym: ConfigPlugin = (config) => {
149
126
  });
150
127
  };
151
128
 
152
- const withExcludedSimulatorArchitectures: ConfigPlugin = (config) => {
153
- return withXcodeProject(config, (c) => {
154
- c.modResults = setExcludedArchitectures(c.modResults);
155
-
156
- return c;
157
- });
158
- };
159
-
160
129
  export const ios = {
161
130
  withPodfilePostInstall,
162
131
  withPodfileGlobalVariables,
163
132
  withoutSignatures,
164
133
  withDwarfDsym,
165
- withExcludedSimulatorArchitectures,
166
134
  };
@@ -18,7 +18,6 @@ const withMapLibre: ConfigPlugin<MapLibrePluginProps> = (config, props) => {
18
18
  config = android.withGradleProperties(config, props);
19
19
 
20
20
  // iOS
21
- config = ios.withExcludedSimulatorArchitectures(config);
22
21
  config = ios.withDwarfDsym(config);
23
22
  config = ios.withoutSignatures(config);
24
23
  config = ios.withPodfileGlobalVariables(config, props);