@maplibre/maplibre-react-native 11.0.0-beta.24 → 11.0.0-beta.26

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 (218) hide show
  1. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapView.kt +10 -8
  2. package/ios/modules/offline/MLRNOfflineModule.h +1 -2
  3. package/ios/modules/offline/MLRNOfflineModule.mm +9 -9
  4. package/lib/commonjs/components/annotations/callout/Callout.js +2 -1
  5. package/lib/commonjs/components/annotations/callout/Callout.js.map +1 -1
  6. package/lib/commonjs/components/annotations/marker/Marker.js +4 -2
  7. package/lib/commonjs/components/annotations/marker/Marker.js.map +1 -1
  8. package/lib/commonjs/components/annotations/view-annotation/ViewAnnotation.js +6 -5
  9. package/lib/commonjs/components/annotations/view-annotation/ViewAnnotation.js.map +1 -1
  10. package/lib/commonjs/components/camera/Camera.js.map +1 -1
  11. package/lib/commonjs/components/images/Images.js +2 -2
  12. package/lib/commonjs/components/layer/Layer.js +0 -1
  13. package/lib/commonjs/components/layer/Layer.js.map +1 -1
  14. package/lib/commonjs/components/map/Map.js.map +1 -1
  15. package/lib/commonjs/components/sources/geojson-source/GeoJSONSource.js +2 -2
  16. package/lib/commonjs/components/sources/geojson-source/GeoJSONSource.js.map +1 -1
  17. package/lib/commonjs/components/sources/image-source/ImageSource.js +3 -2
  18. package/lib/commonjs/components/sources/image-source/ImageSource.js.map +1 -1
  19. package/lib/commonjs/components/sources/raster-source/RasterSource.js +4 -3
  20. package/lib/commonjs/components/sources/raster-source/RasterSource.js.map +1 -1
  21. package/lib/commonjs/components/sources/vector-source/VectorSource.js +4 -2
  22. package/lib/commonjs/components/sources/vector-source/VectorSource.js.map +1 -1
  23. package/lib/commonjs/components/user-location/NativeUserLocation.js.map +1 -1
  24. package/lib/commonjs/components/user-location/UserLocation.js.map +1 -1
  25. package/lib/commonjs/modules/log/LogManager.js +5 -4
  26. package/lib/commonjs/modules/log/LogManager.js.map +1 -1
  27. package/lib/commonjs/modules/network/NetworkManager.js +7 -7
  28. package/lib/commonjs/modules/network/NetworkManager.js.map +1 -1
  29. package/lib/commonjs/modules/offline/OfflineManager.js +63 -47
  30. package/lib/commonjs/modules/offline/OfflineManager.js.map +1 -1
  31. package/lib/commonjs/modules/transform-request/TransformRequestManager.js +50 -45
  32. package/lib/commonjs/modules/transform-request/TransformRequestManager.js.map +1 -1
  33. package/lib/commonjs/plugin/ios.js +9 -8
  34. package/lib/commonjs/plugin/ios.js.map +1 -1
  35. package/lib/commonjs/types/Anchor.js +5 -6
  36. package/lib/commonjs/types/Anchor.js.map +1 -1
  37. package/lib/commonjs/utils/animated/AbstractAnimatedCoordinates.js +2 -2
  38. package/lib/commonjs/utils/animated/AnimatedCoordinatesArray.js +6 -6
  39. package/lib/commonjs/utils/animated/AnimatedGeoJSON.js +2 -1
  40. package/lib/commonjs/utils/animated/AnimatedGeoJSON.js.map +1 -1
  41. package/lib/commonjs/utils/animated/AnimatedRouteCoordinatesArray.js +6 -6
  42. package/lib/commonjs/utils/convertStyleSpec.js +4 -4
  43. package/lib/module/components/annotations/callout/Callout.js +2 -1
  44. package/lib/module/components/annotations/callout/Callout.js.map +1 -1
  45. package/lib/module/components/annotations/marker/Marker.js +4 -2
  46. package/lib/module/components/annotations/marker/Marker.js.map +1 -1
  47. package/lib/module/components/annotations/view-annotation/ViewAnnotation.js +6 -5
  48. package/lib/module/components/annotations/view-annotation/ViewAnnotation.js.map +1 -1
  49. package/lib/module/components/camera/Camera.js.map +1 -1
  50. package/lib/module/components/images/Images.js +2 -2
  51. package/lib/module/components/layer/Layer.js +0 -1
  52. package/lib/module/components/layer/Layer.js.map +1 -1
  53. package/lib/module/components/map/Map.js.map +1 -1
  54. package/lib/module/components/sources/geojson-source/GeoJSONSource.js +2 -2
  55. package/lib/module/components/sources/geojson-source/GeoJSONSource.js.map +1 -1
  56. package/lib/module/components/sources/image-source/ImageSource.js +3 -2
  57. package/lib/module/components/sources/image-source/ImageSource.js.map +1 -1
  58. package/lib/module/components/sources/raster-source/RasterSource.js +4 -3
  59. package/lib/module/components/sources/raster-source/RasterSource.js.map +1 -1
  60. package/lib/module/components/sources/vector-source/VectorSource.js +4 -2
  61. package/lib/module/components/sources/vector-source/VectorSource.js.map +1 -1
  62. package/lib/module/components/user-location/NativeUserLocation.js.map +1 -1
  63. package/lib/module/components/user-location/UserLocation.js.map +1 -1
  64. package/lib/module/modules/log/LogManager.js +5 -4
  65. package/lib/module/modules/log/LogManager.js.map +1 -1
  66. package/lib/module/modules/network/NetworkManager.js +7 -7
  67. package/lib/module/modules/network/NetworkManager.js.map +1 -1
  68. package/lib/module/modules/offline/OfflineManager.js +63 -47
  69. package/lib/module/modules/offline/OfflineManager.js.map +1 -1
  70. package/lib/module/modules/transform-request/TransformRequestManager.js +50 -45
  71. package/lib/module/modules/transform-request/TransformRequestManager.js.map +1 -1
  72. package/lib/module/plugin/ios.js +9 -8
  73. package/lib/module/plugin/ios.js.map +1 -1
  74. package/lib/module/types/Anchor.js +5 -6
  75. package/lib/module/types/Anchor.js.map +1 -1
  76. package/lib/module/utils/animated/AbstractAnimatedCoordinates.js +2 -2
  77. package/lib/module/utils/animated/AnimatedCoordinatesArray.js +6 -6
  78. package/lib/module/utils/animated/AnimatedGeoJSON.js +2 -1
  79. package/lib/module/utils/animated/AnimatedGeoJSON.js.map +1 -1
  80. package/lib/module/utils/animated/AnimatedRouteCoordinatesArray.js +6 -6
  81. package/lib/module/utils/convertStyleSpec.js +4 -4
  82. package/lib/typescript/commonjs/components/annotations/callout/Callout.d.ts +3 -2
  83. package/lib/typescript/commonjs/components/annotations/callout/Callout.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/components/annotations/marker/Marker.d.ts +15 -14
  85. package/lib/typescript/commonjs/components/annotations/marker/Marker.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/components/annotations/view-annotation/ViewAnnotation.d.ts +26 -24
  87. package/lib/typescript/commonjs/components/annotations/view-annotation/ViewAnnotation.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/components/camera/Camera.d.ts +10 -24
  89. package/lib/typescript/commonjs/components/camera/Camera.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/components/images/Images.d.ts +12 -12
  91. package/lib/typescript/commonjs/components/layer/Layer.d.ts +0 -1
  92. package/lib/typescript/commonjs/components/layer/Layer.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/components/map/Map.d.ts +54 -51
  94. package/lib/typescript/commonjs/components/map/Map.d.ts.map +1 -1
  95. package/lib/typescript/commonjs/components/sources/geojson-source/GeoJSONSource.d.ts +40 -41
  96. package/lib/typescript/commonjs/components/sources/geojson-source/GeoJSONSource.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/components/sources/image-source/ImageSource.d.ts +5 -3
  98. package/lib/typescript/commonjs/components/sources/image-source/ImageSource.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/components/sources/raster-source/RasterSource.d.ts +20 -15
  100. package/lib/typescript/commonjs/components/sources/raster-source/RasterSource.d.ts.map +1 -1
  101. package/lib/typescript/commonjs/components/sources/vector-source/VectorSource.d.ts +23 -20
  102. package/lib/typescript/commonjs/components/sources/vector-source/VectorSource.d.ts.map +1 -1
  103. package/lib/typescript/commonjs/components/user-location/NativeUserLocation.d.ts +9 -6
  104. package/lib/typescript/commonjs/components/user-location/NativeUserLocation.d.ts.map +1 -1
  105. package/lib/typescript/commonjs/components/user-location/UserLocation.d.ts +4 -2
  106. package/lib/typescript/commonjs/components/user-location/UserLocation.d.ts.map +1 -1
  107. package/lib/typescript/commonjs/hooks/useCurrentPosition.d.ts +2 -2
  108. package/lib/typescript/commonjs/modules/log/LogManager.d.ts +5 -4
  109. package/lib/typescript/commonjs/modules/log/LogManager.d.ts.map +1 -1
  110. package/lib/typescript/commonjs/modules/network/NetworkManager.d.ts +7 -7
  111. package/lib/typescript/commonjs/modules/network/NetworkManager.d.ts.map +1 -1
  112. package/lib/typescript/commonjs/modules/offline/OfflineManager.d.ts +63 -47
  113. package/lib/typescript/commonjs/modules/offline/OfflineManager.d.ts.map +1 -1
  114. package/lib/typescript/commonjs/modules/static-map/StaticMapManager.d.ts +2 -2
  115. package/lib/typescript/commonjs/modules/transform-request/TransformRequestManager.d.ts +56 -49
  116. package/lib/typescript/commonjs/modules/transform-request/TransformRequestManager.d.ts.map +1 -1
  117. package/lib/typescript/commonjs/plugin/MapLibrePluginProps.d.ts +10 -15
  118. package/lib/typescript/commonjs/plugin/MapLibrePluginProps.d.ts.map +1 -1
  119. package/lib/typescript/commonjs/plugin/ios.d.ts +2 -2
  120. package/lib/typescript/commonjs/plugin/ios.d.ts.map +1 -1
  121. package/lib/typescript/commonjs/types/Anchor.d.ts +5 -6
  122. package/lib/typescript/commonjs/types/Anchor.d.ts.map +1 -1
  123. package/lib/typescript/commonjs/types/LngLatBounds.d.ts +2 -1
  124. package/lib/typescript/commonjs/types/LngLatBounds.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/types/MapLibreRNStyles.d.ts +243 -93
  126. package/lib/typescript/commonjs/types/MapLibreRNStyles.d.ts.map +1 -1
  127. package/lib/typescript/commonjs/types/sources/PressableSourceProps.d.ts +1 -2
  128. package/lib/typescript/commonjs/types/sources/PressableSourceProps.d.ts.map +1 -1
  129. package/lib/typescript/commonjs/utils/animated/AbstractAnimatedCoordinates.d.ts +2 -2
  130. package/lib/typescript/commonjs/utils/animated/AnimatedCoordinatesArray.d.ts +6 -6
  131. package/lib/typescript/commonjs/utils/animated/AnimatedGeoJSON.d.ts +2 -1
  132. package/lib/typescript/commonjs/utils/animated/AnimatedGeoJSON.d.ts.map +1 -1
  133. package/lib/typescript/commonjs/utils/animated/AnimatedRouteCoordinatesArray.d.ts +6 -6
  134. package/lib/typescript/commonjs/utils/convertStyleSpec.d.ts +4 -4
  135. package/lib/typescript/module/components/annotations/callout/Callout.d.ts +3 -2
  136. package/lib/typescript/module/components/annotations/callout/Callout.d.ts.map +1 -1
  137. package/lib/typescript/module/components/annotations/marker/Marker.d.ts +15 -14
  138. package/lib/typescript/module/components/annotations/marker/Marker.d.ts.map +1 -1
  139. package/lib/typescript/module/components/annotations/view-annotation/ViewAnnotation.d.ts +26 -24
  140. package/lib/typescript/module/components/annotations/view-annotation/ViewAnnotation.d.ts.map +1 -1
  141. package/lib/typescript/module/components/camera/Camera.d.ts +10 -24
  142. package/lib/typescript/module/components/camera/Camera.d.ts.map +1 -1
  143. package/lib/typescript/module/components/images/Images.d.ts +12 -12
  144. package/lib/typescript/module/components/layer/Layer.d.ts +0 -1
  145. package/lib/typescript/module/components/layer/Layer.d.ts.map +1 -1
  146. package/lib/typescript/module/components/map/Map.d.ts +54 -51
  147. package/lib/typescript/module/components/map/Map.d.ts.map +1 -1
  148. package/lib/typescript/module/components/sources/geojson-source/GeoJSONSource.d.ts +40 -41
  149. package/lib/typescript/module/components/sources/geojson-source/GeoJSONSource.d.ts.map +1 -1
  150. package/lib/typescript/module/components/sources/image-source/ImageSource.d.ts +5 -3
  151. package/lib/typescript/module/components/sources/image-source/ImageSource.d.ts.map +1 -1
  152. package/lib/typescript/module/components/sources/raster-source/RasterSource.d.ts +20 -15
  153. package/lib/typescript/module/components/sources/raster-source/RasterSource.d.ts.map +1 -1
  154. package/lib/typescript/module/components/sources/vector-source/VectorSource.d.ts +23 -20
  155. package/lib/typescript/module/components/sources/vector-source/VectorSource.d.ts.map +1 -1
  156. package/lib/typescript/module/components/user-location/NativeUserLocation.d.ts +9 -6
  157. package/lib/typescript/module/components/user-location/NativeUserLocation.d.ts.map +1 -1
  158. package/lib/typescript/module/components/user-location/UserLocation.d.ts +4 -2
  159. package/lib/typescript/module/components/user-location/UserLocation.d.ts.map +1 -1
  160. package/lib/typescript/module/hooks/useCurrentPosition.d.ts +2 -2
  161. package/lib/typescript/module/modules/log/LogManager.d.ts +5 -4
  162. package/lib/typescript/module/modules/log/LogManager.d.ts.map +1 -1
  163. package/lib/typescript/module/modules/network/NetworkManager.d.ts +7 -7
  164. package/lib/typescript/module/modules/network/NetworkManager.d.ts.map +1 -1
  165. package/lib/typescript/module/modules/offline/OfflineManager.d.ts +63 -47
  166. package/lib/typescript/module/modules/offline/OfflineManager.d.ts.map +1 -1
  167. package/lib/typescript/module/modules/static-map/StaticMapManager.d.ts +2 -2
  168. package/lib/typescript/module/modules/transform-request/TransformRequestManager.d.ts +56 -49
  169. package/lib/typescript/module/modules/transform-request/TransformRequestManager.d.ts.map +1 -1
  170. package/lib/typescript/module/plugin/MapLibrePluginProps.d.ts +10 -15
  171. package/lib/typescript/module/plugin/MapLibrePluginProps.d.ts.map +1 -1
  172. package/lib/typescript/module/plugin/ios.d.ts +2 -2
  173. package/lib/typescript/module/plugin/ios.d.ts.map +1 -1
  174. package/lib/typescript/module/types/Anchor.d.ts +5 -6
  175. package/lib/typescript/module/types/Anchor.d.ts.map +1 -1
  176. package/lib/typescript/module/types/LngLatBounds.d.ts +2 -1
  177. package/lib/typescript/module/types/LngLatBounds.d.ts.map +1 -1
  178. package/lib/typescript/module/types/MapLibreRNStyles.d.ts +243 -93
  179. package/lib/typescript/module/types/MapLibreRNStyles.d.ts.map +1 -1
  180. package/lib/typescript/module/types/sources/PressableSourceProps.d.ts +1 -2
  181. package/lib/typescript/module/types/sources/PressableSourceProps.d.ts.map +1 -1
  182. package/lib/typescript/module/utils/animated/AbstractAnimatedCoordinates.d.ts +2 -2
  183. package/lib/typescript/module/utils/animated/AnimatedCoordinatesArray.d.ts +6 -6
  184. package/lib/typescript/module/utils/animated/AnimatedGeoJSON.d.ts +2 -1
  185. package/lib/typescript/module/utils/animated/AnimatedGeoJSON.d.ts.map +1 -1
  186. package/lib/typescript/module/utils/animated/AnimatedRouteCoordinatesArray.d.ts +6 -6
  187. package/lib/typescript/module/utils/convertStyleSpec.d.ts +4 -4
  188. package/package.json +1 -2
  189. package/src/components/annotations/callout/Callout.tsx +3 -2
  190. package/src/components/annotations/marker/Marker.tsx +15 -14
  191. package/src/components/annotations/view-annotation/ViewAnnotation.tsx +26 -24
  192. package/src/components/camera/Camera.tsx +10 -24
  193. package/src/components/images/Images.tsx +12 -12
  194. package/src/components/layer/Layer.tsx +0 -1
  195. package/src/components/map/Map.tsx +54 -51
  196. package/src/components/sources/geojson-source/GeoJSONSource.tsx +40 -41
  197. package/src/components/sources/image-source/ImageSource.tsx +5 -3
  198. package/src/components/sources/raster-source/RasterSource.tsx +20 -15
  199. package/src/components/sources/vector-source/VectorSource.tsx +23 -20
  200. package/src/components/user-location/NativeUserLocation.tsx +9 -6
  201. package/src/components/user-location/UserLocation.tsx +4 -2
  202. package/src/hooks/useCurrentPosition.ts +2 -2
  203. package/src/modules/log/LogManager.ts +5 -4
  204. package/src/modules/network/NetworkManager.ts +7 -7
  205. package/src/modules/offline/OfflineManager.ts +63 -47
  206. package/src/modules/static-map/StaticMapManager.ts +2 -2
  207. package/src/modules/transform-request/TransformRequestManager.ts +56 -49
  208. package/src/plugin/MapLibrePluginProps.ts +10 -15
  209. package/src/plugin/ios.ts +9 -8
  210. package/src/types/Anchor.ts +5 -6
  211. package/src/types/LngLatBounds.ts +2 -1
  212. package/src/types/MapLibreRNStyles.ts +243 -93
  213. package/src/types/sources/PressableSourceProps.ts +1 -2
  214. package/src/utils/animated/AbstractAnimatedCoordinates.ts +2 -2
  215. package/src/utils/animated/AnimatedCoordinatesArray.ts +6 -6
  216. package/src/utils/animated/AnimatedGeoJSON.ts +2 -1
  217. package/src/utils/animated/AnimatedRouteCoordinatesArray.ts +6 -6
  218. package/src/utils/convertStyleSpec.ts +4 -4
@@ -79,88 +79,90 @@ export interface MapRef {
79
79
  /**
80
80
  * Returns the current center coordinates of the map
81
81
  *
82
+ * @returns Current center coordinates of the map
83
+ *
82
84
  * @example
83
85
  * await mapRef.current?.getCenter();
84
- *
85
- * @return Current center coordinates of the map
86
86
  */
87
87
  getCenter(): Promise<LngLat>;
88
88
 
89
89
  /**
90
90
  * Returns the current zoom level of the map
91
91
  *
92
+ * @returns Current zoom level of the map
93
+ *
92
94
  * @example
93
95
  * await mapRef.current?.getZoom();
94
- *
95
- * @return Current zoom level of the map
96
96
  */
97
97
  getZoom(): Promise<number>;
98
98
 
99
99
  /**
100
100
  * Returns the current bearing of the map
101
101
  *
102
+ * @returns Current bearing of the map
103
+ *
102
104
  * @example
103
105
  * await mapRef.current?.getBearing();
104
- *
105
- * @return Current bearing of the map
106
106
  */
107
107
  getBearing(): Promise<number>;
108
108
 
109
109
  /**
110
110
  * Returns the current pitch of the map
111
111
  *
112
+ * @returns Current pitch of the map
113
+ *
112
114
  * @example
113
115
  * await mapRef.current?.getPitch();
114
- *
115
- * @return Current pitch of the map
116
116
  */
117
117
  getPitch(): Promise<number>;
118
118
 
119
119
  /**
120
120
  * Returns the current bounds of the map
121
121
  *
122
+ * @returns Current bounds of the map
123
+ *
122
124
  * @example
123
125
  * await mapRef.current?.getBounds();
124
- *
125
- * @return Current bounds of the map
126
126
  */
127
127
  getBounds(): Promise<LngLatBounds>;
128
128
 
129
129
  /**
130
130
  * Returns the current view state of the map
131
131
  *
132
+ * @returns Current view state of the map
133
+ *
132
134
  * @example
133
135
  * await mapRef.current?.getViewState();
134
- *
135
- * @return Current view state of the map
136
136
  */
137
137
  getViewState(): Promise<ViewState>;
138
138
 
139
139
  /**
140
140
  * Converts geographic coordinates to pixel point of the view
141
141
  *
142
+ * @param lngLat - Geographic coordinate
143
+ * @returns Pixel point
144
+ *
142
145
  * @example
143
146
  * await mapRef.current?.project([13.04214014753952, 47.80554907882145]);
144
- *
145
- * @param lngLat Geographic coordinate
146
- * @return Pixel point
147
147
  */
148
148
  project(lngLat: LngLat): Promise<PixelPoint>;
149
149
 
150
150
  /**
151
151
  * Converts a pixel point of the view to geographic coordinates.
152
152
  *
153
+ * @param point - Pixel point
154
+ * @returns Geographic coordinate
155
+ *
153
156
  * @example
154
157
  * await mapRef.current?.unproject([280, 640]);
155
- *
156
- * @param point Pixel point
157
- * @return Geographic coordinate
158
158
  */
159
159
  unproject(point: PixelPoint): Promise<LngLat>;
160
160
 
161
161
  /**
162
162
  * Query rendered features at a point
163
163
  *
164
+ * @returns Queried features
165
+ *
164
166
  * @example
165
167
  * await mapRef.current?.queryRenderedFeatures(
166
168
  * [240, 640],
@@ -169,8 +171,6 @@ export interface MapRef {
169
171
  * layers: ["restaurants", "shops"],
170
172
  * },
171
173
  * );
172
- *
173
- * @return Queried features
174
174
  */
175
175
  queryRenderedFeatures(
176
176
  pixelPoint: PixelPoint,
@@ -180,6 +180,8 @@ export interface MapRef {
180
180
  /**
181
181
  * Query rendered features within pixel bounds
182
182
  *
183
+ * @returns Queried features
184
+ *
183
185
  * @example
184
186
  * await mapRef.current?.queryRenderedFeatures(
185
187
  * [100, 100, 400, 400],
@@ -188,8 +190,6 @@ export interface MapRef {
188
190
  * layers: ["restaurants", "shops"],
189
191
  * },
190
192
  * );
191
- *
192
- * @return Queried features
193
193
  */
194
194
  queryRenderedFeatures(
195
195
  pixelPointBounds: PixelPointBounds,
@@ -199,6 +199,8 @@ export interface MapRef {
199
199
  /**
200
200
  * Query rendered features within the current viewport
201
201
  *
202
+ * @returns Queried features
203
+ *
202
204
  * @example
203
205
  * await mapRef.current?.queryRenderedFeatures(
204
206
  * {
@@ -206,8 +208,6 @@ export interface MapRef {
206
208
  * layers: ["restaurants", "shops"],
207
209
  * },
208
210
  * );
209
- *
210
- * @return Queried features
211
211
  */
212
212
  queryRenderedFeatures(
213
213
  options?: QueryRenderedFeaturesOptions,
@@ -216,21 +216,20 @@ export interface MapRef {
216
216
  /**
217
217
  * Takes static-map image of the currently displayed map
218
218
  *
219
- * @param options.output Use "base64" to get a Base64 encoded string, or "file" to get a URI to an image file saved on disk
220
- *
221
- * @return Base64 encoded image or URI of image file
219
+ * @returns Base64 encoded image or URI of image file
222
220
  */
223
221
  createStaticMapImage(options: { output: "base64" | "file" }): Promise<string>;
224
222
 
225
223
  /**
226
- * Sets the visibility of all the layers referencing the specified `source` and optionally `sourceLayer`
227
- *
228
- * @example
229
- * await mapRef.current?.setSourceVisibility(false, 'composite', 'building')
224
+ * Sets the visibility of all the layers referencing the specified `source` and
225
+ * optionally `sourceLayer`
230
226
  *
231
227
  * @param visible - Visibility of the layers
232
228
  * @param source - Identifier of the target source (e.g. 'composite')
233
229
  * @param sourceLayer - Identifier of the target source-layer (e.g. 'building')
230
+ *
231
+ * @example
232
+ * await mapRef.current?.setSourceVisibility(false, 'composite', 'building')
234
233
  */
235
234
  setSourceVisibility(
236
235
  visible: boolean,
@@ -250,14 +249,14 @@ export interface MapProps extends ViewProps {
250
249
  /**
251
250
  * Style for wrapping React Native View
252
251
  *
253
- * @default { flex: 1 }
252
+ * @defaultValue { flex: 1 }
254
253
  */
255
254
  style?: ViewProps["style"];
256
255
 
257
256
  /**
258
257
  * Maplibre style - either a URL or a Style JSON.
259
258
  *
260
- * @see https://maplibre.org/maplibre-style-spec/
259
+ * @see {@link https://maplibre.org/maplibre-style-spec/}
261
260
  */
262
261
  mapStyle: string | StyleSpecification;
263
262
 
@@ -271,25 +270,28 @@ export interface MapProps extends ViewProps {
271
270
  light?: LightSpecification;
272
271
 
273
272
  /**
274
- * The distance from the edges of the map view's frame to the edges of the map view's logical viewport.
273
+ * The distance from the edges of the map view's frame to the edges of the map
274
+ * view's logical viewport.
275
275
  */
276
276
  contentInset?: ViewPadding;
277
277
 
278
278
  /**
279
- * iOS: The preferred frame rate at which the map view is rendered.
280
- * The default value for this property is MLNMapViewPreferredFramesPerSecondDefault,
281
- * which will adaptively set the preferred frame rate based on the capability of
282
- * the user’s device to maintain a smooth experience. This property can be set to arbitrary integer values.
279
+ * iOS: The preferred frame rate at which the map view is rendered. The default
280
+ * value for this property is MLNMapViewPreferredFramesPerSecondDefault, which
281
+ * will adaptively set the preferred frame rate based on the capability of the
282
+ * user’s device to maintain a smooth experience. This property can be set to
283
+ * arbitrary integer values.
283
284
  *
284
- * Android: The maximum frame rate at which the map view is rendered, but it can't excess the ability of device hardware.
285
- * This property can be set to arbitrary integer values.
285
+ * Android: The maximum frame rate at which the map view is rendered, but it
286
+ * can't excess the ability of device hardware. This property can be set to
287
+ * arbitrary integer values.
286
288
  */
287
289
  preferredFramesPerSecond?: number;
288
290
 
289
291
  /**
290
292
  * Toggle pan interaction of the map
291
293
  *
292
- * @default true
294
+ * @defaultValue true
293
295
  */
294
296
  dragPan?: boolean;
295
297
 
@@ -298,35 +300,36 @@ export interface MapProps extends ViewProps {
298
300
  *
299
301
  * On Android this also disables {@link doubleTapZoom} and {@link doubleTapHoldZoom}.
300
302
  *
301
- * @default true
303
+ * @defaultValue true
302
304
  */
303
305
  touchZoom?: boolean;
304
306
 
305
307
  /**
306
308
  * Toggle double-tap zoom interaction of the map.
307
309
  *
308
- * @default true
310
+ * @defaultValue true
309
311
  */
310
312
  doubleTapZoom?: boolean;
311
313
 
312
314
  /**
313
- * Toggle double-tap-and-hold zoom interaction of the map (also known as quick zoom and one finger zoom).
315
+ * Toggle double-tap-and-hold zoom interaction of the map (also known as quick
316
+ * zoom and one finger zoom).
314
317
  *
315
- * @default true
318
+ * @defaultValue true
316
319
  */
317
320
  doubleTapHoldZoom?: boolean;
318
321
 
319
322
  /**
320
323
  * Toggle rotate interaction of the map
321
324
  *
322
- * @default true
325
+ * @defaultValue true
323
326
  */
324
327
  touchRotate?: boolean;
325
328
 
326
329
  /**
327
330
  * Toggle pitch interaction of the map
328
331
  *
329
- * @default true
332
+ * @defaultValue true
330
333
  */
331
334
  touchPitch?: boolean;
332
335
 
@@ -377,7 +380,7 @@ export interface MapProps extends ViewProps {
377
380
  /**
378
381
  * Toggle the compass from hiding when facing north
379
382
  *
380
- * @default true
383
+ * @defaultValue true
381
384
  */
382
385
  compassHiddenFacingNorth?: boolean;
383
386
 
@@ -398,7 +401,7 @@ export interface MapProps extends ViewProps {
398
401
  * Android only: Switch between TextureView (default) and GLSurfaceView for
399
402
  * rendering the map
400
403
  *
401
- * @default "surface"
404
+ * @defaultValue "surface"
402
405
  */
403
406
  androidView?: "surface" | "texture";
404
407
 
@@ -406,8 +409,8 @@ export interface MapProps extends ViewProps {
406
409
  * Called when a user presses the map
407
410
  *
408
411
  * If the event bubbles up from a child `Source` with an `onPress` handler the
409
- * `features` will be included. The event will emit on `Map` and `Source`.
410
- * To prevent this use `event.stopPropagation()` in the `Source` handler.
412
+ * `features` will be included. The event will emit on `Map` and `Source` . To
413
+ * prevent this use `event.stopPropagation()` in the `Source` handler.
411
414
  */
412
415
  onPress?: (
413
416
  event:
@@ -24,35 +24,36 @@ import { getNativeFilter } from "../../../utils/getNativeFilter";
24
24
 
25
25
  export interface GeoJSONSourceRef {
26
26
  /**
27
- * Get all features from the source that match the filter, regardless of visibility
27
+ * Get all features from the source that match the filter, regardless of
28
+ * visibility
29
+ *
30
+ * @param filter - Optional filter statement to filter the returned features
28
31
  *
29
32
  * @example
30
33
  * const data = await geoJSONSourceRef.current?.getData(clusterId);
31
- *
32
- * @param filter Optional filter statement to filter the returned features
33
34
  */
34
35
  getData(filter?: FilterSpecification): Promise<GeoJSON.FeatureCollection>;
35
36
 
36
37
  /**
37
38
  * Returns the zoom needed to expand the cluster.
38
39
  *
40
+ * @param clusterId - The feature cluster to expand.
41
+ * @returns Zoom level at which the cluster expands
42
+ *
39
43
  * @example
40
44
  * const zoom = await geoJSONSourceRef.current?.getClusterExpansionZoom(clusterId);
41
- *
42
- * @param clusterId The feature cluster to expand.
43
- * @return Zoom level at which the cluster expands
44
45
  */
45
46
  getClusterExpansionZoom(clusterId: number): Promise<number>;
46
47
 
47
48
  /**
48
49
  * Returns the FeatureCollection from the cluster.
49
50
  *
50
- * @example
51
- * const collection = await geoJSONSourceRef.current?.getClusterLeaves(clusterId, limit, offset);
52
- *
53
- * @param clusterId The feature cluster to expand.
51
+ * @param clusterId - The feature cluster to expand.
54
52
  * @param limit - The number of points to return.
55
53
  * @param offset - The amount of points to skip (for pagination).
54
+ *
55
+ * @example
56
+ * const collection = await geoJSONSourceRef.current?.getClusterLeaves(clusterId, limit, offset);
56
57
  */
57
58
  getClusterLeaves(
58
59
  clusterId: number,
@@ -63,10 +64,10 @@ export interface GeoJSONSourceRef {
63
64
  /**
64
65
  * Returns the FeatureCollection from the cluster (on the next zoom level).
65
66
  *
67
+ * @param clusterId - The feature cluster to expand.
68
+ *
66
69
  * @example
67
70
  * const collection = await geoJSONSourceRef.current?.getClusterChildren(clusterId);
68
- *
69
- * @param clusterId - The feature cluster to expand.
70
71
  */
71
72
  getClusterChildren(clusterId: number): Promise<GeoJSON.Feature[]>;
72
73
  }
@@ -79,7 +80,8 @@ export interface GeoJSONSourceProps extends BaseProps, PressableSourceProps {
79
80
 
80
81
  /**
81
82
  * Can be provided as one of:
82
- * - An HTTP(S) URL, absolute file URL, or local file URL relative to the current application’s resource bundle
83
+ * - An HTTP(S) URL, absolute file URL, or local file URL relative to the current
84
+ * application’s resource bundle
83
85
  * - Any valid GeoJSON object
84
86
  */
85
87
  data: string | GeoJSON.GeoJSON;
@@ -90,51 +92,49 @@ export interface GeoJSONSourceProps extends BaseProps, PressableSourceProps {
90
92
  cluster?: boolean;
91
93
 
92
94
  /**
93
- * Specifies the radius of each cluster if clustering is enabled.
94
- * A value of 512 produces a radius equal to the width of a tile.
95
- * The default value is 50.
95
+ * Specifies the radius of each cluster if clustering is enabled. A value of 512
96
+ * produces a radius equal to the width of a tile. The default value is 50.
96
97
  */
97
98
  clusterRadius?: number;
98
99
 
99
100
  /**
100
- * Specifies minimum number of points to form a cluster if clustering is enabled.
101
- * The default value is 2.
101
+ * Specifies minimum number of points to form a cluster if clustering is
102
+ * enabled. The default value is 2.
102
103
  */
103
104
  clusterMinPoints?: number;
104
105
 
105
106
  /**
106
- * Specifies the maximum zoom level at which to cluster points if clustering is enabled.
107
- * Defaults to one zoom level less than the value of maxzoom so that, at the maximum zoom,
108
- * the data is not clustered.
107
+ * Specifies the maximum zoom level at which to cluster points if clustering is
108
+ * enabled. Defaults to one zoom level less than the value of maxzoom so that,
109
+ * at the maximum zoom, the data is not clustered.
109
110
  */
110
111
  clusterMaxZoom?: number;
111
112
 
112
113
  /**
113
- * Specifies custom properties on the generated clusters if clustering
114
- * is enabled, aggregating values from clustered points.
114
+ * Specifies custom properties on the generated clusters if clustering is
115
+ * enabled, aggregating values from clustered points.
115
116
  *
116
- * Has the form `{ "property_name": [operator, map_expression]}`, where
117
- * `operator` is a custom reduce expression that references a special `["accumulated"]` value -
118
- * it accumulates the property value from clusters/points the cluster contains
119
- * `map_expression` produces the value of a single point
117
+ * Has the form `{ "property_name": [operator, map_expression]}` , where
118
+ * `operator` is a custom reduce expression that references a special
119
+ * `["accumulated"]` value - it accumulates the property value from
120
+ * clusters/points the cluster contains `map_expression` produces the value of a
121
+ * single point
120
122
  *
121
123
  * @example `{ "resultingSum": [["+", ["accumulated"], ["get", "resultingSum"]], ["get", "scalerank"]] }`
122
- *
123
124
  */
124
125
  clusterProperties?: GeoJSONSourceSpecification["clusterProperties"];
125
126
 
126
127
  /**
127
- * Specifies the maximum zoom level at which to create vector tiles.
128
- * A greater value produces greater detail at high zoom levels.
129
- * The default value is 18.
128
+ * Specifies the maximum zoom level at which to create vector tiles. A greater
129
+ * value produces greater detail at high zoom levels. The default value is 18.
130
130
  */
131
131
  maxzoom?: number;
132
132
 
133
133
  /**
134
- * Specifies the size of the tile buffer on each side.
135
- * A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself.
136
- * Larger values produce fewer rendering artifacts near tile edges and slower performance.
137
- * The default value is 128.
134
+ * Specifies the size of the tile buffer on each side. A value of 0 produces no
135
+ * buffer. A value of 512 produces a buffer as wide as the tile itself. Larger
136
+ * values produce fewer rendering artifacts near tile edges and slower
137
+ * performance. The default value is 128.
138
138
  */
139
139
  buffer?: number;
140
140
 
@@ -143,14 +143,13 @@ export interface GeoJSONSourceProps extends BaseProps, PressableSourceProps {
143
143
  *
144
144
  * Higher means simpler geometries and faster performance.
145
145
  *
146
- * @default 0.375
146
+ * @defaultValue 0.375
147
147
  */
148
148
  tolerance?: number;
149
149
 
150
150
  /**
151
- * Whether to calculate line distance metrics.
152
- * This is required for line layers that specify lineGradient values.
153
- * The default value is false.
151
+ * Whether to calculate line distance metrics. This is required for line layers
152
+ * that specify lineGradient values. The default value is false.
154
153
  */
155
154
  lineMetrics?: boolean;
156
155
 
@@ -163,8 +162,8 @@ export interface GeoJSONSourceProps extends BaseProps, PressableSourceProps {
163
162
  }
164
163
 
165
164
  /**
166
- * GeoJSONSource is a map content source that supplies GeoJSON to be shown on the map.
167
- * The data may be provided as an url or a GeoJSON object.
165
+ * GeoJSONSource is a map content source that supplies GeoJSON to be shown on
166
+ * the map. The data may be provided as an url or a GeoJSON object.
168
167
  */
169
168
  export const GeoJSONSource = memo(
170
169
  ({ id, data, ref, ...props }: GeoJSONSourceProps) => {
@@ -23,7 +23,8 @@ export interface ImageSourceProps extends BaseProps {
23
23
  url: string | number;
24
24
 
25
25
  /**
26
- * The top left, top right, bottom right, and bottom left coordinates for the image.
26
+ * The top left, top right, bottom right, and bottom left coordinates for the
27
+ * image.
27
28
  */
28
29
  coordinates: [
29
30
  topLeft: LngLat,
@@ -36,8 +37,9 @@ export interface ImageSourceProps extends BaseProps {
36
37
  }
37
38
 
38
39
  /**
39
- * ImageSource is a content source that is used for a georeferenced raster image to be shown on the map.
40
- * The georeferenced image scales and rotates as the user zooms and rotates the map
40
+ * ImageSource is a content source that is used for a georeferenced raster image
41
+ * to be shown on the map. The georeferenced image scales and rotates as the
42
+ * user zooms and rotates the map
41
43
  */
42
44
  export const ImageSource = memo(({ id, url, ...props }: ImageSourceProps) => {
43
45
  const frozenId = useFrozenId(id);
@@ -12,47 +12,51 @@ export interface RasterSourceProps extends BaseProps {
12
12
  id?: string;
13
13
 
14
14
  /**
15
- * A URL to a TileJSON configuration file describing the source's contents and other metadata.
15
+ * A URL to a TileJSON configuration file describing the source's contents and
16
+ * other metadata.
16
17
  */
17
18
  url?: string;
18
19
 
19
20
  /**
20
- * An array of tile URL templates. If multiple endpoints are specified, clients may use any combination of endpoints.
21
+ * An array of tile URL templates. If multiple endpoints are specified, clients
22
+ * may use any combination of endpoints.
23
+ *
21
24
  * @example "https://example.com/raster-tiles/{z}/{x}/{y}.png"
22
25
  */
23
26
  tiles?: string[];
24
27
 
25
28
  /**
26
- * An unsigned integer that specifies the minimum zoom level at which to display tiles from the source.
27
- * The value should be between 0 and 22, inclusive, and less than
28
- * maxzoom, if specified. The default value for this option is 0.
29
+ * An unsigned integer that specifies the minimum zoom level at which to display
30
+ * tiles from the source. The value should be between 0 and 22, inclusive, and
31
+ * less than maxzoom, if specified. The default value for this option is 0.
29
32
  */
30
33
  minzoom?: number;
31
34
 
32
35
  /**
33
- * An unsigned integer that specifies the maximum zoom level at which to display tiles from the source.
34
- * The value should be between 0 and 22, inclusive, and less than
35
- * minzoom, if specified. The default value for this option is 22.
36
+ * An unsigned integer that specifies the maximum zoom level at which to display
37
+ * tiles from the source. The value should be between 0 and 22, inclusive, and
38
+ * less than minzoom, if specified. The default value for this option is 22.
36
39
  */
37
40
  maxzoom?: number;
38
41
 
39
42
  /**
40
43
  * Size of the map tiles.
41
44
  *
42
- * @default 512
45
+ * @defaultValue 512
43
46
  */
44
47
  tileSize?: number;
45
48
 
46
49
  /**
47
50
  * Influences the y direction of the tile coordinates. (tms inverts y-axis)
48
51
  *
49
- * @default "xyz"
52
+ * @defaultValue "xyz"
50
53
  */
51
54
  scheme?: "xyz" | "tms";
52
55
 
53
56
  /**
54
- * An HTML or literal text string defining the buttons to be displayed in an action sheet when the
55
- * source is part of a map view's style and the map view's attribution button is pressed.
57
+ * An HTML or literal text string defining the buttons to be displayed in an
58
+ * action sheet when the source is part of a map view's style and the map view's
59
+ * attribution button is pressed.
56
60
  */
57
61
  attribution?: string;
58
62
 
@@ -60,9 +64,10 @@ export interface RasterSourceProps extends BaseProps {
60
64
  }
61
65
 
62
66
  /**
63
- * RasterSource is a map content source that supplies raster image tiles to be shown on the map.
64
- * The location of and metadata about the tiles are defined either by an option dictionary
65
- * or by an external file that conforms to the TileJSON specification.
67
+ * RasterSource is a map content source that supplies raster image tiles to be
68
+ * shown on the map. The location of and metadata about the tiles are defined
69
+ * either by an option dictionary or by an external file that conforms to the
70
+ * TileJSON specification.
66
71
  */
67
72
  export const RasterSource = memo(({ id, ...props }: RasterSourceProps) => {
68
73
  const frozenId = useFrozenId(id);
@@ -21,15 +21,13 @@ import { getNativeFilter } from "../../../utils/getNativeFilter";
21
21
 
22
22
  export interface VectorSourceRef {
23
23
  /**
24
- * Returns all features that match the query parameters regardless of whether or not the feature is
25
- * currently rendered on the map. The domain of the query includes all currently-loaded vector tiles
26
- * and GeoJSON source tiles. This function does not check tiles outside of the visible viewport.
24
+ * Returns all features that match the query parameters regardless of whether or
25
+ * not the feature is currently rendered on the map. The domain of the query
26
+ * includes all currently-loaded vector tiles and GeoJSON source tiles. This
27
+ * function does not check tiles outside of the visible viewport.
27
28
  *
28
29
  * @example
29
30
  * vectorSource.features(['id1', 'id2'])
30
- *
31
- * @param options.sourceLayer - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.
32
- * @param options.filter - an optional filter statement to filter the returned Features.
33
31
  */
34
32
  querySourceFeatures(options: {
35
33
  sourceLayer: string;
@@ -44,40 +42,43 @@ export interface VectorSourceProps extends BaseProps, PressableSourceProps {
44
42
  id?: string;
45
43
 
46
44
  /**
47
- * A URL to a TileJSON configuration file describing the source’s contents and other metadata.
45
+ * A URL to a TileJSON configuration file describing the source’s contents and
46
+ * other metadata.
48
47
  */
49
48
  url?: string;
50
49
 
51
50
  /**
52
- * An array of tile URL templates. If multiple endpoints are specified, clients may use any combination of endpoints.
53
- * Example: https://example.com/vector-tiles/{z}/{x}/{y}.pbf
51
+ * An array of tile URL templates. If multiple endpoints are specified, clients
52
+ * may use any combination of endpoints. Example:
53
+ * https://example.com/vector-tiles/{z}/{x}/{y}.pbf
54
54
  */
55
55
  tiles?: string[];
56
56
 
57
57
  /**
58
- * An unsigned integer that specifies the minimum zoom level at which to display tiles from the source.
59
- * The value should be between 0 and 22, inclusive, and less than
60
- * maxzoom, if specified. The default value for this option is 0.
58
+ * An unsigned integer that specifies the minimum zoom level at which to display
59
+ * tiles from the source. The value should be between 0 and 22, inclusive, and
60
+ * less than maxzoom, if specified. The default value for this option is 0.
61
61
  */
62
62
  minzoom?: number;
63
63
 
64
64
  /**
65
- * An unsigned integer that specifies the maximum zoom level at which to display tiles from the source.
66
- * The value should be between 0 and 22, inclusive, and less than
67
- * minzoom, if specified. The default value for this option is 22.
65
+ * An unsigned integer that specifies the maximum zoom level at which to display
66
+ * tiles from the source. The value should be between 0 and 22, inclusive, and
67
+ * less than minzoom, if specified. The default value for this option is 22.
68
68
  */
69
69
  maxzoom?: number;
70
70
 
71
71
  /**
72
72
  * Influences the y direction of the tile coordinates. (tms inverts y-axis)
73
73
  *
74
- * @default "xyz"
74
+ * @defaultValue "xyz"
75
75
  */
76
76
  scheme?: "xyz" | "tms";
77
77
 
78
78
  /**
79
- * An HTML or literal text string defining the buttons to be displayed in an action sheet when the
80
- * source is part of a map view’s style and the map view’s attribution button is pressed.
79
+ * An HTML or literal text string defining the buttons to be displayed in an
80
+ * action sheet when the source is part of a map view’s style and the map view’s
81
+ * attribution button is pressed.
81
82
  */
82
83
  attribution?: string;
83
84
 
@@ -90,8 +91,10 @@ export interface VectorSourceProps extends BaseProps, PressableSourceProps {
90
91
  }
91
92
 
92
93
  /**
93
- * VectorSource is a map content source that supplies tiled vector data in Mapbox Vector Tile format to be shown on the map.
94
- * The location of and metadata about the tiles are defined either by an option dictionary or by an external file that conforms to the TileJSON specification.
94
+ * VectorSource is a map content source that supplies tiled vector data in
95
+ * Mapbox Vector Tile format to be shown on the map. The location of and
96
+ * metadata about the tiles are defined either by an option dictionary or by an
97
+ * external file that conforms to the TileJSON specification.
95
98
  */
96
99
  export const VectorSource = memo(({ id, ref, ...props }: VectorSourceProps) => {
97
100
  const nativeRef = useRef<