react-bkoi-gl 1.0.7 → 2.0.1

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 (142) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +172 -18
  3. package/dist/index.cjs +671 -736
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +370 -0
  6. package/dist/index.d.ts +370 -2
  7. package/dist/index.js +1434 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/styles/index.d.ts +4 -0
  10. package/dist/styles/react-bkoi-gl.css +1 -1
  11. package/package.json +84 -36
  12. package/bkoi-gl/package.json +0 -6
  13. package/dist/components/attribution-control.d.ts +0 -11
  14. package/dist/components/attribution-control.js +0 -19
  15. package/dist/components/attribution-control.js.map +0 -1
  16. package/dist/components/fullscreen-control.d.ts +0 -14
  17. package/dist/components/fullscreen-control.js +0 -21
  18. package/dist/components/fullscreen-control.js.map +0 -1
  19. package/dist/components/geolocate-control.d.ts +0 -37
  20. package/dist/components/geolocate-control.js +0 -46
  21. package/dist/components/geolocate-control.js.map +0 -1
  22. package/dist/components/layer.d.ts +0 -17
  23. package/dist/components/layer.js +0 -99
  24. package/dist/components/layer.js.map +0 -1
  25. package/dist/components/map.d.ts +0 -23
  26. package/dist/components/map.js +0 -102
  27. package/dist/components/map.js.map +0 -1
  28. package/dist/components/marker.d.ts +0 -41
  29. package/dist/components/marker.js +0 -98
  30. package/dist/components/marker.js.map +0 -1
  31. package/dist/components/navigation-control.d.ts +0 -11
  32. package/dist/components/navigation-control.js +0 -19
  33. package/dist/components/navigation-control.js.map +0 -1
  34. package/dist/components/popup.d.ts +0 -33
  35. package/dist/components/popup.js +0 -79
  36. package/dist/components/popup.js.map +0 -1
  37. package/dist/components/scale-control.d.ts +0 -13
  38. package/dist/components/scale-control.js +0 -31
  39. package/dist/components/scale-control.js.map +0 -1
  40. package/dist/components/source.d.ts +0 -7
  41. package/dist/components/source.js +0 -97
  42. package/dist/components/source.js.map +0 -1
  43. package/dist/components/use-control.d.ts +0 -9
  44. package/dist/components/use-control.js +0 -31
  45. package/dist/components/use-control.js.map +0 -1
  46. package/dist/components/use-map.d.ts +0 -20
  47. package/dist/components/use-map.js +0 -54
  48. package/dist/components/use-map.js.map +0 -1
  49. package/dist/exports-bkoi-gl.cjs +0 -1512
  50. package/dist/exports-bkoi-gl.d.ts +0 -89
  51. package/dist/exports-bkoi-gl.js +0 -36
  52. package/dist/exports-bkoi-gl.js.map +0 -1
  53. package/dist/exports-mapbox.d.ts +0 -139
  54. package/dist/exports-mapbox.js +0 -36
  55. package/dist/exports-mapbox.js.map +0 -1
  56. package/dist/mapbox/create-ref.d.ts +0 -9
  57. package/dist/mapbox/create-ref.js +0 -64
  58. package/dist/mapbox/create-ref.js.map +0 -1
  59. package/dist/mapbox/mapbox.d.ts +0 -81
  60. package/dist/mapbox/mapbox.js +0 -476
  61. package/dist/mapbox/mapbox.js.map +0 -1
  62. package/dist/types/common.d.ts +0 -78
  63. package/dist/types/common.js +0 -2
  64. package/dist/types/common.js.map +0 -1
  65. package/dist/types/events-bkoi-gl.d.ts +0 -49
  66. package/dist/types/events-bkoi-gl.js +0 -2
  67. package/dist/types/events-bkoi-gl.js.map +0 -1
  68. package/dist/types/events-mapbox.d.ts +0 -49
  69. package/dist/types/events-mapbox.js +0 -2
  70. package/dist/types/events-mapbox.js.map +0 -1
  71. package/dist/types/events.d.ts +0 -39
  72. package/dist/types/events.js +0 -2
  73. package/dist/types/events.js.map +0 -1
  74. package/dist/types/index.d.ts +0 -70
  75. package/dist/types/index.js +0 -5
  76. package/dist/types/index.js.map +0 -1
  77. package/dist/types/lib.d.ts +0 -224
  78. package/dist/types/lib.js +0 -2
  79. package/dist/types/lib.js.map +0 -1
  80. package/dist/types/public.d.ts +0 -2
  81. package/dist/types/public.js +0 -2
  82. package/dist/types/public.js.map +0 -1
  83. package/dist/types/style-spec-bkoi-gl.d.ts +0 -9
  84. package/dist/types/style-spec-bkoi-gl.js +0 -2
  85. package/dist/types/style-spec-bkoi-gl.js.map +0 -1
  86. package/dist/types/style-spec-mapbox.d.ts +0 -7
  87. package/dist/types/style-spec-mapbox.js +0 -2
  88. package/dist/types/style-spec-mapbox.js.map +0 -1
  89. package/dist/utils/apply-react-style.d.ts +0 -2
  90. package/dist/utils/apply-react-style.js +0 -16
  91. package/dist/utils/apply-react-style.js.map +0 -1
  92. package/dist/utils/assert.d.ts +0 -1
  93. package/dist/utils/assert.js +0 -6
  94. package/dist/utils/assert.js.map +0 -1
  95. package/dist/utils/deep-equal.d.ts +0 -15
  96. package/dist/utils/deep-equal.js +0 -46
  97. package/dist/utils/deep-equal.js.map +0 -1
  98. package/dist/utils/set-globals.d.ts +0 -22
  99. package/dist/utils/set-globals.js +0 -19
  100. package/dist/utils/set-globals.js.map +0 -1
  101. package/dist/utils/style-utils.d.ts +0 -2
  102. package/dist/utils/style-utils.js +0 -42
  103. package/dist/utils/style-utils.js.map +0 -1
  104. package/dist/utils/transform.d.ts +0 -26
  105. package/dist/utils/transform.js +0 -56
  106. package/dist/utils/transform.js.map +0 -1
  107. package/dist/utils/use-isomorphic-layout-effect.d.ts +0 -3
  108. package/dist/utils/use-isomorphic-layout-effect.js +0 -4
  109. package/dist/utils/use-isomorphic-layout-effect.js.map +0 -1
  110. package/src/components/attribution-control.ts +0 -32
  111. package/src/components/fullscreen-control.tsx +0 -37
  112. package/src/components/geolocate-control.ts +0 -90
  113. package/src/components/layer.ts +0 -133
  114. package/src/components/map.tsx +0 -155
  115. package/src/components/marker.ts +0 -137
  116. package/src/components/navigation-control.ts +0 -29
  117. package/src/components/popup.ts +0 -116
  118. package/src/components/scale-control.ts +0 -46
  119. package/src/components/source.ts +0 -158
  120. package/src/components/use-control.ts +0 -64
  121. package/src/components/use-map.tsx +0 -69
  122. package/src/exports-bkoi-gl.ts +0 -156
  123. package/src/exports-mapbox.ts +0 -159
  124. package/src/index.ts +0 -2
  125. package/src/mapbox/create-ref.ts +0 -118
  126. package/src/mapbox/mapbox.ts +0 -742
  127. package/src/types/common.ts +0 -94
  128. package/src/types/events-bkoi-gl.ts +0 -78
  129. package/src/types/events-mapbox.ts +0 -76
  130. package/src/types/events.ts +0 -73
  131. package/src/types/index.ts +0 -93
  132. package/src/types/lib.ts +0 -279
  133. package/src/types/public.ts +0 -9
  134. package/src/types/style-spec-bkoi-gl.ts +0 -81
  135. package/src/types/style-spec-mapbox.ts +0 -80
  136. package/src/utils/apply-react-style.ts +0 -20
  137. package/src/utils/assert.ts +0 -5
  138. package/src/utils/deep-equal.ts +0 -61
  139. package/src/utils/set-globals.ts +0 -57
  140. package/src/utils/style-utils.ts +0 -59
  141. package/src/utils/transform.ts +0 -86
  142. package/src/utils/use-isomorphic-layout-effect.ts +0 -7
package/dist/index.d.ts CHANGED
@@ -1,2 +1,370 @@
1
- export * from './exports-mapbox';
2
- export { default as default } from './exports-mapbox';
1
+ import * as React from 'react';
2
+ import { CSSProperties } from 'react';
3
+ import { PaddingOptions, MapOptions, Map as Map$1, MarkerOptions, Marker as Marker$1, PopupOptions, Popup as Popup$1, AttributionControlOptions, AttributionControl as AttributionControl$1, FullscreenControlOptions, FullscreenControl as FullscreenControl$1, GeolocateControlOptions, GeolocateControl as GeolocateControl$1, NavigationControlOptions, NavigationControl as NavigationControl$1, ScaleControlOptions, ScaleControl as ScaleControl$1, TerrainSpecification, TerrainControl as TerrainControl$1, LogoControlOptions, LogoControl as LogoControl$1, MapLayerMouseEvent, MapLayerTouchEvent, MapWheelEvent, MapLibreZoomEvent, MapLibreEvent, MapStyleDataEvent, MapSourceDataEvent, LngLat, MapMouseEvent as MapMouseEvent$1, Point, MapGeoJSONFeature, LngLatBoundsLike, PointLike, StyleSpecification, ProjectionSpecification, LightSpecification, SkySpecification, ControlPosition, SourceSpecification, LayerSpecification, CustomLayerInterface, IControl } from 'maplibre-gl';
4
+ export { AttributionControlOptions, BackgroundLayerSpecification, CanvasSourceSpecification, CircleLayerSpecification, ControlPosition, CustomLayerInterface, FillExtrusionLayerSpecification, FillLayerSpecification, FullscreenControlOptions, GeoJSONSourceSpecification, GeolocateControlOptions, HeatmapLayerSpecification, HillshadeLayerSpecification, IControl, ImageSourceSpecification, LayerSpecification, LightSpecification, LineLayerSpecification, LngLat, LngLatBounds, LngLatBoundsLike, LngLatLike, LogoControlOptions, MapLibreZoomEvent as MapBoxZoomEvent, MapLibreEvent as MapEvent, MapGeoJSONFeature, MapLayerMouseEvent, MapLayerTouchEvent, MapOptions, MapSourceDataEvent, MapStyleDataEvent, MapTouchEvent, MapWheelEvent, MarkerOptions, NavigationControlOptions, PaddingOptions, Point, PointLike, PopupOptions, ProjectionSpecification, RasterDEMSourceSpecification, RasterLayerSpecification, RasterSourceSpecification, ScaleControlOptions, SkySpecification, SourceSpecification, StyleSpecification, SymbolLayerSpecification, TerrainSpecification, VectorSourceSpecification, VideoSourceSpecification } from 'maplibre-gl';
5
+
6
+ /** Describes the camera's state */
7
+ type ViewState = {
8
+ /** Longitude at map center */
9
+ longitude: number;
10
+ /** Latitude at map center */
11
+ latitude: number;
12
+ /** Map zoom level */
13
+ zoom: number;
14
+ /** Map rotation bearing in degrees counter-clockwise from north */
15
+ bearing: number;
16
+ /** Map angle in degrees at which the camera is looking at the ground */
17
+ pitch: number;
18
+ /** Dimensions in pixels applied on each side of the viewport for shifting the vanishing point. */
19
+ padding: PaddingOptions;
20
+ };
21
+ interface ImmutableLike<T> {
22
+ toJS: () => T;
23
+ }
24
+
25
+ /**
26
+ * A user-facing type that represents the minimal intersection between Mapbox and Maplibre
27
+ * User provided `mapLib` is supposed to implement this interface
28
+ * Only losely typed for compatibility
29
+ */
30
+ interface MapLib {
31
+ supported?: (options: unknown) => boolean;
32
+ Map: {
33
+ new (options: MapOptions): Map$1;
34
+ };
35
+ Marker: {
36
+ new (options: MarkerOptions): Marker$1;
37
+ };
38
+ Popup: {
39
+ new (options: PopupOptions): Popup$1;
40
+ };
41
+ AttributionControl: {
42
+ new (options: AttributionControlOptions): AttributionControl$1;
43
+ };
44
+ FullscreenControl: {
45
+ new (options: FullscreenControlOptions): FullscreenControl$1;
46
+ };
47
+ GeolocateControl: {
48
+ new (options: GeolocateControlOptions): GeolocateControl$1;
49
+ };
50
+ NavigationControl: {
51
+ new (options: NavigationControlOptions): NavigationControl$1;
52
+ };
53
+ ScaleControl: {
54
+ new (options: ScaleControlOptions): ScaleControl$1;
55
+ };
56
+ TerrainControl: {
57
+ new (options: TerrainSpecification): TerrainControl$1;
58
+ };
59
+ LogoControl: {
60
+ new (options: LogoControlOptions): LogoControl$1;
61
+ };
62
+ }
63
+
64
+ interface MapEvent<SourceT, OriginalEventT = undefined> {
65
+ type: string;
66
+ target: SourceT;
67
+ originalEvent: OriginalEventT;
68
+ }
69
+ type ErrorEvent = MapEvent<Map$1> & {
70
+ type: "error";
71
+ error: Error;
72
+ };
73
+ type MapMouseEvent = MapMouseEvent$1 & {
74
+ point: Point;
75
+ lngLat: LngLat;
76
+ features?: MapGeoJSONFeature[];
77
+ };
78
+ type ViewStateChangeEvent = (MapEvent<Map$1, MouseEvent | TouchEvent | WheelEvent | undefined> & {
79
+ type: "movestart" | "move" | "moveend" | "zoomstart" | "zoom" | "zoomend";
80
+ viewState: ViewState;
81
+ }) | (MapEvent<Map$1, MouseEvent | TouchEvent | undefined> & {
82
+ type: "rotatestart" | "rotate" | "rotateend" | "dragstart" | "drag" | "dragend" | "pitchstart" | "pitch" | "pitchend";
83
+ viewState: ViewState;
84
+ });
85
+ type MapCallbacks = {
86
+ onMouseDown?: (e: MapLayerMouseEvent) => void;
87
+ onMouseUp?: (e: MapLayerMouseEvent) => void;
88
+ onMouseOver?: (e: MapLayerMouseEvent) => void;
89
+ onMouseMove?: (e: MapLayerMouseEvent) => void;
90
+ onClick?: (e: MapLayerMouseEvent) => void;
91
+ onDblClick?: (e: MapLayerMouseEvent) => void;
92
+ onMouseEnter?: (e: MapLayerMouseEvent) => void;
93
+ onMouseLeave?: (e: MapLayerMouseEvent) => void;
94
+ onMouseOut?: (e: MapLayerMouseEvent) => void;
95
+ onContextMenu?: (e: MapLayerMouseEvent) => void;
96
+ onTouchStart?: (e: MapLayerTouchEvent) => void;
97
+ onTouchEnd?: (e: MapLayerTouchEvent) => void;
98
+ onTouchMove?: (e: MapLayerTouchEvent) => void;
99
+ onTouchCancel?: (e: MapLayerTouchEvent) => void;
100
+ onMoveStart?: (e: ViewStateChangeEvent) => void;
101
+ onMove?: (e: ViewStateChangeEvent) => void;
102
+ onMoveEnd?: (e: ViewStateChangeEvent) => void;
103
+ onDragStart?: (e: ViewStateChangeEvent) => void;
104
+ onDrag?: (e: ViewStateChangeEvent) => void;
105
+ onDragEnd?: (e: ViewStateChangeEvent) => void;
106
+ onZoomStart?: (e: ViewStateChangeEvent) => void;
107
+ onZoom?: (e: ViewStateChangeEvent) => void;
108
+ onZoomEnd?: (e: ViewStateChangeEvent) => void;
109
+ onRotateStart?: (e: ViewStateChangeEvent) => void;
110
+ onRotate?: (e: ViewStateChangeEvent) => void;
111
+ onRotateEnd?: (e: ViewStateChangeEvent) => void;
112
+ onPitchStart?: (e: ViewStateChangeEvent) => void;
113
+ onPitch?: (e: ViewStateChangeEvent) => void;
114
+ onPitchEnd?: (e: ViewStateChangeEvent) => void;
115
+ onWheel?: (e: MapWheelEvent) => void;
116
+ onBoxZoomStart?: (e: MapLibreZoomEvent) => void;
117
+ onBoxZoomEnd?: (e: MapLibreZoomEvent) => void;
118
+ onBoxZoomCancel?: (e: MapLibreZoomEvent) => void;
119
+ onResize?: (e: MapLibreEvent) => void;
120
+ onLoad?: (e: MapLibreEvent) => void;
121
+ onRender?: (e: MapLibreEvent) => void;
122
+ onIdle?: (e: MapLibreEvent) => void;
123
+ onError?: (e: ErrorEvent) => void;
124
+ onRemove?: (e: MapLibreEvent) => void;
125
+ onData?: (e: MapStyleDataEvent | MapSourceDataEvent) => void;
126
+ onStyleData?: (e: MapStyleDataEvent) => void;
127
+ onSourceData?: (e: MapSourceDataEvent) => void;
128
+ };
129
+ type PopupEvent = {
130
+ type: "open" | "close";
131
+ target: Popup$1;
132
+ };
133
+ type MarkerEvent<OriginalEventT = undefined> = MapEvent<Marker$1, OriginalEventT>;
134
+ type MarkerDragEvent = MarkerEvent & {
135
+ type: "dragstart" | "drag" | "dragend";
136
+ lngLat: LngLat;
137
+ };
138
+ type GeolocateEvent = MapEvent<GeolocateControl$1>;
139
+ type GeolocateResultEvent = GeolocateEvent & GeolocationPosition;
140
+ type GeolocateErrorEvent = GeolocateEvent & GeolocationPositionError;
141
+
142
+ type MaplibreProps = Partial<ViewState> & MapCallbacks & {
143
+ /** Camera options used when constructing the Map instance */
144
+ initialViewState?: Partial<ViewState> & {
145
+ /** The initial bounds of the map. If bounds is specified, it overrides longitude, latitude and zoom options. */
146
+ bounds?: LngLatBoundsLike;
147
+ /** A fitBounds options object to use only when setting the bounds option. */
148
+ fitBoundsOptions?: {
149
+ offset?: PointLike;
150
+ minZoom?: number;
151
+ maxZoom?: number;
152
+ padding?: number | PaddingOptions;
153
+ };
154
+ };
155
+ /** If provided, render into an external WebGL context */
156
+ gl?: WebGLRenderingContext;
157
+ /** For external controller to override the camera state */
158
+ viewState?: ViewState & {
159
+ width: number;
160
+ height: number;
161
+ };
162
+ /** Mapbox style */
163
+ mapStyle?: string | StyleSpecification | ImmutableLike<StyleSpecification>;
164
+ /** Enable diffing when the map style changes
165
+ * @default true
166
+ */
167
+ styleDiffing?: boolean;
168
+ /** The projection property of the style. Must conform to the Projection Style Specification.
169
+ * @default 'mercator'
170
+ */
171
+ projection?: ProjectionSpecification | "mercator" | "globe";
172
+ /** Light properties of the map. */
173
+ light?: LightSpecification;
174
+ /** Terrain property of the style. Must conform to the Terrain Style Specification.
175
+ * If `undefined` is provided, removes terrain from the map. */
176
+ terrain?: TerrainSpecification;
177
+ /** Sky properties of the map. Must conform to the Sky Style Specification. */
178
+ sky?: SkySpecification;
179
+ /** Default layers to query on pointer events */
180
+ interactiveLayerIds?: string[];
181
+ /** CSS cursor */
182
+ cursor?: string;
183
+ };
184
+
185
+ /** These methods may break the react binding if called directly */
186
+ declare const skipMethods: readonly ["setMaxBounds", "setMinZoom", "setMaxZoom", "setMinPitch", "setMaxPitch", "setRenderWorldCopies", "setProjection", "setStyle", "addSource", "removeSource", "addLayer", "removeLayer", "setLayerZoomRange", "setFilter", "setPaintProperty", "setLayoutProperty", "setLight", "setTerrain", "setFog", "remove"];
187
+ type MapRef = {
188
+ getMap(): Map$1;
189
+ } & Omit<Map$1, (typeof skipMethods)[number]>;
190
+
191
+ type GlobalSettings = {
192
+ /** The maximum number of images (raster tiles, sprites, icons) to load in parallel.
193
+ * @default 16
194
+ */
195
+ maxParallelImageRequests?: number;
196
+ /** The map's RTL text plugin. Necessary for supporting the Arabic and Hebrew languages, which are written right-to-left. */
197
+ RTLTextPlugin?: string | {
198
+ pluginUrl: string;
199
+ lazy?: boolean;
200
+ };
201
+ /** The number of web workers instantiated on a page with maplibre-gl maps.
202
+ * @default 2
203
+ */
204
+ workerCount?: number;
205
+ /** Provides an interface for loading maplibre-gl's WebWorker bundle from a self-hosted URL.
206
+ * This is useful if your site needs to operate in a strict CSP (Content Security Policy) environment
207
+ * wherein you are not allowed to load JavaScript code from a Blob URL, which is default behavior. */
208
+ workerUrl?: string;
209
+ };
210
+
211
+ type MapContextValue = {
212
+ mapLib: MapLib;
213
+ map: MapRef;
214
+ };
215
+ type MapInitOptions = Omit<MapOptions, "style" | "container" | "bounds" | "fitBoundsOptions" | "center">;
216
+ type MapProps = MapInitOptions & MaplibreProps & GlobalSettings & {
217
+ mapLib?: MapLib | Promise<MapLib>;
218
+ reuseMaps?: boolean;
219
+ /** Map container id */
220
+ id?: string;
221
+ /** Map container CSS style */
222
+ style?: CSSProperties;
223
+ children?: React.ReactNode;
224
+ /** Show Barikoi logo (default: true) */
225
+ showBarikoiLogo?: boolean;
226
+ /** Show Attribution (default: true) */
227
+ showAttribution?: boolean;
228
+ } & React.RefAttributes<MapRef>;
229
+ declare const Map: React.FC<MapProps>;
230
+
231
+ type MarkerProps = MarkerOptions & {
232
+ /** Longitude of the anchor location */
233
+ longitude: number;
234
+ /** Latitude of the anchor location */
235
+ latitude: number;
236
+ popup?: Popup$1;
237
+ /** CSS style override, applied to the control's container */
238
+ style?: React.CSSProperties;
239
+ onClick?: (e: MarkerEvent<MouseEvent>) => void;
240
+ onDragStart?: (e: MarkerDragEvent) => void;
241
+ onDrag?: (e: MarkerDragEvent) => void;
242
+ onDragEnd?: (e: MarkerDragEvent) => void;
243
+ children?: React.ReactNode;
244
+ };
245
+ declare const Marker: React.FC<MarkerProps>;
246
+
247
+ type PopupProps = PopupOptions & {
248
+ /** Longitude of the anchor location */
249
+ longitude: number;
250
+ /** Latitude of the anchor location */
251
+ latitude: number;
252
+ /** CSS style override, applied to the control's container */
253
+ style?: React.CSSProperties;
254
+ onOpen?: (e: PopupEvent) => void;
255
+ onClose?: (e: PopupEvent) => void;
256
+ children?: React.ReactNode;
257
+ };
258
+ declare const Popup: React.FC<PopupProps>;
259
+
260
+ type AttributionControlProps = AttributionControlOptions & {
261
+ /** Placement of the control relative to the map. */
262
+ position?: ControlPosition;
263
+ /** CSS style override, applied to the control's container */
264
+ style?: React.CSSProperties;
265
+ };
266
+ declare const AttributionControl: React.FC<AttributionControlProps>;
267
+
268
+ type FullscreenControlProps = Omit<FullscreenControlOptions, "container"> & {
269
+ /** Id of the DOM element which should be made full screen. By default, the map container
270
+ * element will be made full screen. */
271
+ containerId?: string;
272
+ /** Placement of the control relative to the map. */
273
+ position?: ControlPosition;
274
+ /** CSS style override, applied to the control's container */
275
+ style?: React.CSSProperties;
276
+ };
277
+ declare const FullscreenControl: React.FC<FullscreenControlProps>;
278
+
279
+ type GeolocateControlProps = GeolocateControlOptions & {
280
+ /** Placement of the control relative to the map. */
281
+ position?: ControlPosition;
282
+ /** CSS style override, applied to the control's container */
283
+ style?: React.CSSProperties;
284
+ /** Called on each Geolocation API position update that returned as success. */
285
+ onGeolocate?: (e: GeolocateResultEvent) => void;
286
+ /** Called on each Geolocation API position update that returned as an error. */
287
+ onError?: (e: GeolocateErrorEvent) => void;
288
+ /** Called on each Geolocation API position update that returned as success but user position
289
+ * is out of map `maxBounds`. */
290
+ onOutOfMaxBounds?: (e: GeolocateResultEvent) => void;
291
+ /** Called when the GeolocateControl changes to the active lock state. */
292
+ onTrackUserLocationStart?: (e: GeolocateEvent) => void;
293
+ /** Called when the GeolocateControl changes to the background state. */
294
+ onTrackUserLocationEnd?: (e: GeolocateEvent) => void;
295
+ };
296
+ declare const GeolocateControl: React.FC<GeolocateControlProps>;
297
+
298
+ type NavigationControlProps = NavigationControlOptions & {
299
+ /** Placement of the control relative to the map. */
300
+ position?: ControlPosition;
301
+ /** CSS style override, applied to the control's container */
302
+ style?: React.CSSProperties;
303
+ };
304
+ declare const NavigationControl: React.FC<NavigationControlProps>;
305
+
306
+ type ScaleControlProps = ScaleControlOptions & {
307
+ unit?: string;
308
+ maxWidth?: number;
309
+ /** Placement of the control relative to the map. */
310
+ position?: ControlPosition;
311
+ /** CSS style override, applied to the control's container */
312
+ style?: React.CSSProperties;
313
+ };
314
+ declare const ScaleControl: React.FC<ScaleControlProps>;
315
+
316
+ type TerrainControlProps = TerrainSpecification & {
317
+ /** Placement of the control relative to the map. */
318
+ position?: ControlPosition;
319
+ /** CSS style override, applied to the control's container */
320
+ style?: React.CSSProperties;
321
+ };
322
+ declare const TerrainControl: React.FC<TerrainControlProps>;
323
+
324
+ type LogoControlProps = LogoControlOptions & {
325
+ /** Placement of the control relative to the map. */
326
+ position?: ControlPosition;
327
+ /** CSS style override, applied to the control's container */
328
+ style?: React.CSSProperties;
329
+ };
330
+ declare const LogoControl: React.FC<LogoControlProps>;
331
+
332
+ type SourceProps = SourceSpecification & {
333
+ id?: string;
334
+ children?: any;
335
+ };
336
+ declare function Source(props: SourceProps): any;
337
+
338
+ type OptionalId<T> = T extends {
339
+ id: string;
340
+ } ? Omit<T, "id"> & {
341
+ id?: string;
342
+ } : T;
343
+ type OptionalSource<T> = T extends {
344
+ source: string;
345
+ } ? Omit<T, "source"> & {
346
+ source?: string;
347
+ } : T;
348
+ type LayerProps = (OptionalSource<OptionalId<LayerSpecification>> | CustomLayerInterface) & {
349
+ /** If set, the layer will be inserted before the specified layer */
350
+ beforeId?: string;
351
+ };
352
+ declare function Layer(props: LayerProps): any;
353
+
354
+ type ControlOptions = {
355
+ position?: ControlPosition;
356
+ };
357
+ declare function useControl<T extends IControl>(onCreate: (context: MapContextValue) => T, opts?: ControlOptions): T;
358
+ declare function useControl<T extends IControl>(onCreate: (context: MapContextValue) => T, onRemove: (context: MapContextValue) => void, opts?: ControlOptions): T;
359
+ declare function useControl<T extends IControl>(onCreate: (context: MapContextValue) => T, onAdd: (context: MapContextValue) => void, onRemove: (context: MapContextValue) => void, opts?: ControlOptions): T;
360
+
361
+ declare const MapProvider: React.FC<{
362
+ children?: React.ReactNode;
363
+ }>;
364
+ type MapCollection = {
365
+ [id: string]: MapRef | undefined;
366
+ current?: MapRef;
367
+ };
368
+ declare function useMap(): MapCollection;
369
+
370
+ export { AttributionControl, type AttributionControlProps, type ErrorEvent, FullscreenControl, type FullscreenControlProps, GeolocateControl, type GeolocateControlProps, type GeolocateErrorEvent, type GeolocateEvent, type GeolocateResultEvent, type ImmutableLike, Layer, type LayerProps, LogoControl, type LogoControlProps, Map, type MapCallbacks, type MapLib, type MapMouseEvent, type MapProps, MapProvider, type MapRef, Marker, type MarkerDragEvent, type MarkerEvent, type MarkerProps, NavigationControl, type NavigationControlProps, Popup, type PopupEvent, type PopupProps, ScaleControl, type ScaleControlProps, Source, type SourceProps, TerrainControl, type TerrainControlProps, type ViewState, type ViewStateChangeEvent, Map as default, useControl, useMap };