react-three-map 0.8.2 → 1.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +3 -10
  3. package/dist/cjs/main.js +1261 -42
  4. package/dist/es/main10.mjs +71 -10
  5. package/dist/es/main10.mjs.map +1 -1
  6. package/dist/es/main11.mjs +12 -35
  7. package/dist/es/main11.mjs.map +1 -1
  8. package/dist/es/main12.mjs +12 -13
  9. package/dist/es/main12.mjs.map +1 -1
  10. package/dist/es/main13.mjs +42 -24
  11. package/dist/es/main13.mjs.map +1 -1
  12. package/dist/es/main14.mjs +13 -4
  13. package/dist/es/main14.mjs.map +1 -1
  14. package/dist/es/main15.mjs +22 -31
  15. package/dist/es/main15.mjs.map +1 -1
  16. package/dist/es/main16.mjs +87 -22
  17. package/dist/es/main16.mjs.map +1 -1
  18. package/dist/es/main17.mjs +14 -94
  19. package/dist/es/main17.mjs.map +1 -1
  20. package/dist/es/main18.mjs +22 -62
  21. package/dist/es/main18.mjs.map +1 -1
  22. package/dist/es/main19.mjs +27 -20
  23. package/dist/es/main19.mjs.map +1 -1
  24. package/dist/es/main20.mjs +8 -23
  25. package/dist/es/main20.mjs.map +1 -1
  26. package/dist/es/main21.mjs +34 -16
  27. package/dist/es/main21.mjs.map +1 -1
  28. package/dist/es/main22.mjs +12 -80
  29. package/dist/es/main22.mjs.map +1 -1
  30. package/dist/es/main23.mjs +26 -0
  31. package/dist/es/main23.mjs.map +1 -0
  32. package/dist/es/main24.mjs +5 -0
  33. package/dist/es/main24.mjs.map +1 -0
  34. package/dist/es/main25.mjs +33 -0
  35. package/dist/es/main25.mjs.map +1 -0
  36. package/dist/es/main26.mjs +27 -0
  37. package/dist/es/main26.mjs.map +1 -0
  38. package/dist/es/main27.mjs +98 -0
  39. package/dist/es/main27.mjs.map +1 -0
  40. package/dist/es/main28.mjs +66 -0
  41. package/dist/es/main28.mjs.map +1 -0
  42. package/dist/es/main29.mjs +23 -0
  43. package/dist/es/main29.mjs.map +1 -0
  44. package/dist/es/main3.mjs +13 -4
  45. package/dist/es/main3.mjs.map +1 -1
  46. package/dist/es/main30.mjs +27 -0
  47. package/dist/es/main30.mjs.map +1 -0
  48. package/dist/es/main31.mjs +19 -0
  49. package/dist/es/main31.mjs.map +1 -0
  50. package/dist/es/main32.mjs +83 -0
  51. package/dist/es/main32.mjs.map +1 -0
  52. package/dist/es/main33.mjs +501 -0
  53. package/dist/es/main33.mjs.map +1 -0
  54. package/dist/es/main34.mjs +90 -0
  55. package/dist/es/main34.mjs.map +1 -0
  56. package/dist/es/main35.mjs +6 -0
  57. package/dist/es/main35.mjs.map +1 -0
  58. package/dist/es/main36.mjs +26 -0
  59. package/dist/es/main36.mjs.map +1 -0
  60. package/dist/es/main37.mjs +19 -0
  61. package/dist/es/main37.mjs.map +1 -0
  62. package/dist/es/main38.mjs +50 -0
  63. package/dist/es/main38.mjs.map +1 -0
  64. package/dist/es/main39.mjs +31 -0
  65. package/dist/es/main39.mjs.map +1 -0
  66. package/dist/es/main4.mjs +3 -3
  67. package/dist/es/main40.mjs +9 -0
  68. package/dist/es/main40.mjs.map +1 -0
  69. package/dist/es/main41.mjs +62 -0
  70. package/dist/es/main41.mjs.map +1 -0
  71. package/dist/es/main42.mjs +42 -0
  72. package/dist/es/main42.mjs.map +1 -0
  73. package/dist/es/main5.mjs +1 -1
  74. package/dist/es/main6.mjs +1 -1
  75. package/dist/es/main7.mjs +1 -1
  76. package/dist/es/main8.mjs +87 -20
  77. package/dist/es/main8.mjs.map +1 -1
  78. package/dist/es/main9.mjs +80 -24
  79. package/dist/es/main9.mjs.map +1 -1
  80. package/dist/maplibre/cjs/main.js +8 -7
  81. package/dist/maplibre/es/main.mjs.map +1 -1
  82. package/dist/maplibre/es/main16.mjs +2 -1
  83. package/dist/maplibre/es/main16.mjs.map +1 -1
  84. package/dist/maplibre/es/main3.mjs +2 -2
  85. package/dist/maplibre/es/main3.mjs.map +1 -1
  86. package/dist/maplibre/types/core/canvas-in-layer/use-canvas-in-layer.d.ts +5 -1
  87. package/dist/maplibre/types/core/canvas-in-layer/use-render.d.ts +5 -1
  88. package/dist/maplibre/types/core/generic-map.d.ts +2 -2
  89. package/dist/maplibre/types/{mapbox → maplibre}/canvas.d.ts +1 -1
  90. package/dist/maplibre/types/maplibre.index.d.ts +1 -1
  91. package/dist/types/core/canvas-in-layer/use-canvas-in-layer.d.ts +5 -1
  92. package/dist/types/core/canvas-in-layer/use-render.d.ts +5 -1
  93. package/dist/types/core/generic-map.d.ts +2 -2
  94. package/dist/types/mapbox/canvas.d.ts +1 -1
  95. package/package.json +7 -7
  96. package/stories/package.json +3 -3
  97. package/stories/yarn.lock +171 -94
@@ -0,0 +1,501 @@
1
+ import { syncProjection, cloneTransform, applyViewStateToTransform, transformToViewState } from "./main41.mjs";
2
+ import { normalizeStyle } from "./main42.mjs";
3
+ import { deepEqual } from "./main38.mjs";
4
+ const DEFAULT_STYLE = { version: 8, sources: {}, layers: [] };
5
+ const pointerEvents = {
6
+ mousedown: "onMouseDown",
7
+ mouseup: "onMouseUp",
8
+ mouseover: "onMouseOver",
9
+ mousemove: "onMouseMove",
10
+ click: "onClick",
11
+ dblclick: "onDblClick",
12
+ mouseenter: "onMouseEnter",
13
+ mouseleave: "onMouseLeave",
14
+ mouseout: "onMouseOut",
15
+ contextmenu: "onContextMenu",
16
+ touchstart: "onTouchStart",
17
+ touchend: "onTouchEnd",
18
+ touchmove: "onTouchMove",
19
+ touchcancel: "onTouchCancel"
20
+ };
21
+ const cameraEvents = {
22
+ movestart: "onMoveStart",
23
+ move: "onMove",
24
+ moveend: "onMoveEnd",
25
+ dragstart: "onDragStart",
26
+ drag: "onDrag",
27
+ dragend: "onDragEnd",
28
+ zoomstart: "onZoomStart",
29
+ zoom: "onZoom",
30
+ zoomend: "onZoomEnd",
31
+ rotatestart: "onRotateStart",
32
+ rotate: "onRotate",
33
+ rotateend: "onRotateEnd",
34
+ pitchstart: "onPitchStart",
35
+ pitch: "onPitch",
36
+ pitchend: "onPitchEnd"
37
+ };
38
+ const otherEvents = {
39
+ wheel: "onWheel",
40
+ boxzoomstart: "onBoxZoomStart",
41
+ boxzoomend: "onBoxZoomEnd",
42
+ boxzoomcancel: "onBoxZoomCancel",
43
+ resize: "onResize",
44
+ load: "onLoad",
45
+ render: "onRender",
46
+ idle: "onIdle",
47
+ remove: "onRemove",
48
+ data: "onData",
49
+ styledata: "onStyleData",
50
+ sourcedata: "onSourceData",
51
+ error: "onError"
52
+ };
53
+ const settingNames = [
54
+ "minZoom",
55
+ "maxZoom",
56
+ "minPitch",
57
+ "maxPitch",
58
+ "maxBounds",
59
+ "projection",
60
+ "renderWorldCopies"
61
+ ];
62
+ const handlerNames = [
63
+ "scrollZoom",
64
+ "boxZoom",
65
+ "dragRotate",
66
+ "dragPan",
67
+ "keyboard",
68
+ "doubleClickZoom",
69
+ "touchZoomRotate",
70
+ "touchPitch"
71
+ ];
72
+ class Mapbox {
73
+ constructor(MapClass, props, container) {
74
+ this._map = null;
75
+ this._internalUpdate = false;
76
+ this._inRender = false;
77
+ this._hoveredFeatures = null;
78
+ this._deferredEvents = {
79
+ move: false,
80
+ zoom: false,
81
+ pitch: false,
82
+ rotate: false
83
+ };
84
+ this._onEvent = (e) => {
85
+ const cb = this.props[otherEvents[e.type]];
86
+ if (cb) {
87
+ cb(e);
88
+ } else if (e.type === "error") {
89
+ console.error(e.error);
90
+ }
91
+ };
92
+ this._onPointerEvent = (e) => {
93
+ if (e.type === "mousemove" || e.type === "mouseout") {
94
+ this._updateHover(e);
95
+ }
96
+ const cb = this.props[pointerEvents[e.type]];
97
+ if (cb) {
98
+ if (this.props.interactiveLayerIds && e.type !== "mouseover" && e.type !== "mouseout") {
99
+ e.features = this._hoveredFeatures || this._queryRenderedFeatures(e.point);
100
+ }
101
+ cb(e);
102
+ delete e.features;
103
+ }
104
+ };
105
+ this._onCameraEvent = (e) => {
106
+ if (!this._internalUpdate) {
107
+ const cb = this.props[cameraEvents[e.type]];
108
+ if (cb) {
109
+ cb(e);
110
+ }
111
+ }
112
+ if (e.type in this._deferredEvents) {
113
+ this._deferredEvents[e.type] = false;
114
+ }
115
+ };
116
+ this._MapClass = MapClass;
117
+ this.props = props;
118
+ this._initialize(container);
119
+ }
120
+ get map() {
121
+ return this._map;
122
+ }
123
+ get transform() {
124
+ return this._renderTransform;
125
+ }
126
+ setProps(props) {
127
+ const oldProps = this.props;
128
+ this.props = props;
129
+ const settingsChanged = this._updateSettings(props, oldProps);
130
+ if (settingsChanged) {
131
+ this._createShadowTransform(this._map);
132
+ }
133
+ const sizeChanged = this._updateSize(props);
134
+ const viewStateChanged = this._updateViewState(props, true);
135
+ this._updateStyle(props, oldProps);
136
+ this._updateStyleComponents(props, oldProps);
137
+ this._updateHandlers(props, oldProps);
138
+ if (settingsChanged || sizeChanged || viewStateChanged && !this._map.isMoving()) {
139
+ this.redraw();
140
+ }
141
+ }
142
+ static reuse(props, container) {
143
+ const that = Mapbox.savedMaps.pop();
144
+ if (!that) {
145
+ return null;
146
+ }
147
+ const map = that.map;
148
+ const oldContainer = map.getContainer();
149
+ container.className = oldContainer.className;
150
+ while (oldContainer.childNodes.length > 0) {
151
+ container.appendChild(oldContainer.childNodes[0]);
152
+ }
153
+ map._container = container;
154
+ that.setProps({ ...props, styleDiffing: false });
155
+ map.resize();
156
+ const { initialViewState } = props;
157
+ if (initialViewState) {
158
+ if (initialViewState.bounds) {
159
+ map.fitBounds(initialViewState.bounds, { ...initialViewState.fitBoundsOptions, duration: 0 });
160
+ } else {
161
+ that._updateViewState(initialViewState, false);
162
+ }
163
+ }
164
+ if (map.isStyleLoaded()) {
165
+ map.fire("load");
166
+ } else {
167
+ map.once("styledata", () => map.fire("load"));
168
+ }
169
+ map._update();
170
+ return that;
171
+ }
172
+ /* eslint-disable complexity,max-statements */
173
+ _initialize(container) {
174
+ const { props } = this;
175
+ const { mapStyle = DEFAULT_STYLE } = props;
176
+ const mapOptions = {
177
+ ...props,
178
+ ...props.initialViewState,
179
+ accessToken: props.mapboxAccessToken || getAccessTokenFromEnv() || null,
180
+ container,
181
+ style: normalizeStyle(mapStyle)
182
+ };
183
+ const viewState = mapOptions.initialViewState || mapOptions.viewState || mapOptions;
184
+ Object.assign(mapOptions, {
185
+ center: [viewState.longitude || 0, viewState.latitude || 0],
186
+ zoom: viewState.zoom || 0,
187
+ pitch: viewState.pitch || 0,
188
+ bearing: viewState.bearing || 0
189
+ });
190
+ if (props.gl) {
191
+ const getContext = HTMLCanvasElement.prototype.getContext;
192
+ HTMLCanvasElement.prototype.getContext = () => {
193
+ HTMLCanvasElement.prototype.getContext = getContext;
194
+ return props.gl;
195
+ };
196
+ }
197
+ const map = new this._MapClass(mapOptions);
198
+ if (viewState.padding) {
199
+ map.setPadding(viewState.padding);
200
+ }
201
+ if (props.cursor) {
202
+ map.getCanvas().style.cursor = props.cursor;
203
+ }
204
+ this._createShadowTransform(map);
205
+ const renderMap = map._render;
206
+ map._render = (arg) => {
207
+ this._inRender = true;
208
+ renderMap.call(map, arg);
209
+ this._inRender = false;
210
+ };
211
+ const runRenderTaskQueue = map._renderTaskQueue.run;
212
+ map._renderTaskQueue.run = (arg) => {
213
+ runRenderTaskQueue.call(map._renderTaskQueue, arg);
214
+ this._onBeforeRepaint();
215
+ };
216
+ map.on("render", () => this._onAfterRepaint());
217
+ const fireEvent = map.fire;
218
+ map.fire = this._fireEvent.bind(this, fireEvent);
219
+ map.on("resize", () => {
220
+ this._renderTransform.resize(map.transform.width, map.transform.height);
221
+ });
222
+ map.on("styledata", () => {
223
+ this._updateStyleComponents(this.props, {});
224
+ syncProjection(map.transform, this._renderTransform);
225
+ });
226
+ map.on("sourcedata", () => this._updateStyleComponents(this.props, {}));
227
+ for (const eventName in pointerEvents) {
228
+ map.on(eventName, this._onPointerEvent);
229
+ }
230
+ for (const eventName in cameraEvents) {
231
+ map.on(eventName, this._onCameraEvent);
232
+ }
233
+ for (const eventName in otherEvents) {
234
+ map.on(eventName, this._onEvent);
235
+ }
236
+ this._map = map;
237
+ }
238
+ /* eslint-enable complexity,max-statements */
239
+ recycle() {
240
+ const container = this.map.getContainer();
241
+ const children = container.querySelector("[mapboxgl-children]");
242
+ children == null ? void 0 : children.remove();
243
+ Mapbox.savedMaps.push(this);
244
+ }
245
+ destroy() {
246
+ this._map.remove();
247
+ }
248
+ // Force redraw the map now. Typically resize() and jumpTo() is reflected in the next
249
+ // render cycle, which is managed by Mapbox's animation loop.
250
+ // This removes the synchronization issue caused by requestAnimationFrame.
251
+ redraw() {
252
+ const map = this._map;
253
+ if (!this._inRender && map.style) {
254
+ if (map._frame) {
255
+ map._frame.cancel();
256
+ map._frame = null;
257
+ }
258
+ map._render();
259
+ }
260
+ }
261
+ _createShadowTransform(map) {
262
+ const renderTransform = cloneTransform(map.transform);
263
+ map.painter.transform = renderTransform;
264
+ this._renderTransform = renderTransform;
265
+ }
266
+ /* Trigger map resize if size is controlled
267
+ @param {object} nextProps
268
+ @returns {bool} true if size has changed
269
+ */
270
+ _updateSize(nextProps) {
271
+ const { viewState } = nextProps;
272
+ if (viewState) {
273
+ const map = this._map;
274
+ if (viewState.width !== map.transform.width || viewState.height !== map.transform.height) {
275
+ map.resize();
276
+ return true;
277
+ }
278
+ }
279
+ return false;
280
+ }
281
+ // Adapted from map.jumpTo
282
+ /* Update camera to match props
283
+ @param {object} nextProps
284
+ @param {bool} triggerEvents - should fire camera events
285
+ @returns {bool} true if anything is changed
286
+ */
287
+ _updateViewState(nextProps, triggerEvents) {
288
+ if (this._internalUpdate) {
289
+ return false;
290
+ }
291
+ const map = this._map;
292
+ const tr = this._renderTransform;
293
+ const { zoom, pitch, bearing } = tr;
294
+ const isMoving = map.isMoving();
295
+ if (isMoving) {
296
+ tr.cameraElevationReference = "sea";
297
+ }
298
+ const changed = applyViewStateToTransform(tr, {
299
+ ...transformToViewState(map.transform),
300
+ ...nextProps
301
+ });
302
+ if (isMoving) {
303
+ tr.cameraElevationReference = "ground";
304
+ }
305
+ if (changed && triggerEvents) {
306
+ const deferredEvents = this._deferredEvents;
307
+ deferredEvents.move = true;
308
+ deferredEvents.zoom || (deferredEvents.zoom = zoom !== tr.zoom);
309
+ deferredEvents.rotate || (deferredEvents.rotate = bearing !== tr.bearing);
310
+ deferredEvents.pitch || (deferredEvents.pitch = pitch !== tr.pitch);
311
+ }
312
+ if (!isMoving) {
313
+ applyViewStateToTransform(map.transform, nextProps);
314
+ }
315
+ return changed;
316
+ }
317
+ /* Update camera constraints and projection settings to match props
318
+ @param {object} nextProps
319
+ @param {object} currProps
320
+ @returns {bool} true if anything is changed
321
+ */
322
+ _updateSettings(nextProps, currProps) {
323
+ const map = this._map;
324
+ let changed = false;
325
+ for (const propName of settingNames) {
326
+ if (propName in nextProps && !deepEqual(nextProps[propName], currProps[propName])) {
327
+ changed = true;
328
+ const setter = map[`set${propName[0].toUpperCase()}${propName.slice(1)}`];
329
+ setter == null ? void 0 : setter.call(map, nextProps[propName]);
330
+ }
331
+ }
332
+ return changed;
333
+ }
334
+ /* Update map style to match props
335
+ @param {object} nextProps
336
+ @param {object} currProps
337
+ @returns {bool} true if style is changed
338
+ */
339
+ _updateStyle(nextProps, currProps) {
340
+ if (nextProps.cursor !== currProps.cursor) {
341
+ this._map.getCanvas().style.cursor = nextProps.cursor || "";
342
+ }
343
+ if (nextProps.mapStyle !== currProps.mapStyle) {
344
+ const { mapStyle = DEFAULT_STYLE, styleDiffing = true } = nextProps;
345
+ const options = {
346
+ diff: styleDiffing
347
+ };
348
+ if ("localIdeographFontFamily" in nextProps) {
349
+ options.localIdeographFontFamily = nextProps.localIdeographFontFamily;
350
+ }
351
+ this._map.setStyle(normalizeStyle(mapStyle), options);
352
+ return true;
353
+ }
354
+ return false;
355
+ }
356
+ /* Update fog, light and terrain to match props
357
+ @param {object} nextProps
358
+ @param {object} currProps
359
+ @returns {bool} true if anything is changed
360
+ */
361
+ _updateStyleComponents(nextProps, currProps) {
362
+ const map = this._map;
363
+ let changed = false;
364
+ if (map.isStyleLoaded()) {
365
+ if ("light" in nextProps && map.setLight && !deepEqual(nextProps.light, currProps.light)) {
366
+ changed = true;
367
+ map.setLight(nextProps.light);
368
+ }
369
+ if ("fog" in nextProps && map.setFog && !deepEqual(nextProps.fog, currProps.fog)) {
370
+ changed = true;
371
+ map.setFog(nextProps.fog);
372
+ }
373
+ if ("terrain" in nextProps && map.setTerrain && !deepEqual(nextProps.terrain, currProps.terrain)) {
374
+ if (!nextProps.terrain || map.getSource(nextProps.terrain.source)) {
375
+ changed = true;
376
+ map.setTerrain(nextProps.terrain);
377
+ }
378
+ }
379
+ }
380
+ return changed;
381
+ }
382
+ /* Update interaction handlers to match props
383
+ @param {object} nextProps
384
+ @param {object} currProps
385
+ @returns {bool} true if anything is changed
386
+ */
387
+ _updateHandlers(nextProps, currProps) {
388
+ const map = this._map;
389
+ let changed = false;
390
+ for (const propName of handlerNames) {
391
+ const newValue = nextProps[propName] ?? true;
392
+ const oldValue = currProps[propName] ?? true;
393
+ if (!deepEqual(newValue, oldValue)) {
394
+ changed = true;
395
+ if (newValue) {
396
+ map[propName].enable(newValue);
397
+ } else {
398
+ map[propName].disable();
399
+ }
400
+ }
401
+ }
402
+ return changed;
403
+ }
404
+ _queryRenderedFeatures(point) {
405
+ const map = this._map;
406
+ const tr = map.transform;
407
+ const { interactiveLayerIds = [] } = this.props;
408
+ try {
409
+ map.transform = this._renderTransform;
410
+ return map.queryRenderedFeatures(point, {
411
+ layers: interactiveLayerIds.filter(map.getLayer.bind(map))
412
+ });
413
+ } catch {
414
+ return [];
415
+ } finally {
416
+ map.transform = tr;
417
+ }
418
+ }
419
+ _updateHover(e) {
420
+ var _a;
421
+ const { props } = this;
422
+ const shouldTrackHoveredFeatures = props.interactiveLayerIds && (props.onMouseMove || props.onMouseEnter || props.onMouseLeave);
423
+ if (shouldTrackHoveredFeatures) {
424
+ const eventType = e.type;
425
+ const wasHovering = ((_a = this._hoveredFeatures) == null ? void 0 : _a.length) > 0;
426
+ const features = this._queryRenderedFeatures(e.point);
427
+ const isHovering = features.length > 0;
428
+ if (!isHovering && wasHovering) {
429
+ e.type = "mouseleave";
430
+ this._onPointerEvent(e);
431
+ }
432
+ this._hoveredFeatures = features;
433
+ if (isHovering && !wasHovering) {
434
+ e.type = "mouseenter";
435
+ this._onPointerEvent(e);
436
+ }
437
+ e.type = eventType;
438
+ } else {
439
+ this._hoveredFeatures = null;
440
+ }
441
+ }
442
+ _fireEvent(baseFire, event, properties) {
443
+ const map = this._map;
444
+ const tr = map.transform;
445
+ const eventType = typeof event === "string" ? event : event.type;
446
+ if (eventType === "move") {
447
+ this._updateViewState(this.props, false);
448
+ }
449
+ if (eventType in cameraEvents) {
450
+ if (typeof event === "object") {
451
+ event.viewState = transformToViewState(tr);
452
+ }
453
+ if (this._map.isMoving()) {
454
+ map.transform = this._renderTransform;
455
+ baseFire.call(map, event, properties);
456
+ map.transform = tr;
457
+ return map;
458
+ }
459
+ }
460
+ baseFire.call(map, event, properties);
461
+ return map;
462
+ }
463
+ // All camera manipulations are complete, ready to repaint
464
+ _onBeforeRepaint() {
465
+ const map = this._map;
466
+ this._internalUpdate = true;
467
+ for (const eventType in this._deferredEvents) {
468
+ if (this._deferredEvents[eventType]) {
469
+ map.fire(eventType);
470
+ }
471
+ }
472
+ this._internalUpdate = false;
473
+ const tr = this._map.transform;
474
+ map.transform = this._renderTransform;
475
+ this._onAfterRepaint = () => {
476
+ syncProjection(this._renderTransform, tr);
477
+ map.transform = tr;
478
+ };
479
+ }
480
+ }
481
+ Mapbox.savedMaps = [];
482
+ function getAccessTokenFromEnv() {
483
+ let accessToken = null;
484
+ if (typeof location !== "undefined") {
485
+ const match = /access_token=([^&\/]*)/.exec(location.search);
486
+ accessToken = match && match[1];
487
+ }
488
+ try {
489
+ accessToken = accessToken || process.env.MapboxAccessToken;
490
+ } catch {
491
+ }
492
+ try {
493
+ accessToken = accessToken || process.env.REACT_APP_MAPBOX_ACCESS_TOKEN;
494
+ } catch {
495
+ }
496
+ return accessToken;
497
+ }
498
+ export {
499
+ Mapbox as default
500
+ };
501
+ //# sourceMappingURL=main33.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main33.mjs","sources":["../../node_modules/@vis.gl/react-mapbox/dist/mapbox/mapbox.js"],"sourcesContent":["import { transformToViewState, applyViewStateToTransform, cloneTransform, syncProjection } from \"../utils/transform.js\";\nimport { normalizeStyle } from \"../utils/style-utils.js\";\nimport { deepEqual } from \"../utils/deep-equal.js\";\nconst DEFAULT_STYLE = { version: 8, sources: {}, layers: [] };\nconst pointerEvents = {\n mousedown: 'onMouseDown',\n mouseup: 'onMouseUp',\n mouseover: 'onMouseOver',\n mousemove: 'onMouseMove',\n click: 'onClick',\n dblclick: 'onDblClick',\n mouseenter: 'onMouseEnter',\n mouseleave: 'onMouseLeave',\n mouseout: 'onMouseOut',\n contextmenu: 'onContextMenu',\n touchstart: 'onTouchStart',\n touchend: 'onTouchEnd',\n touchmove: 'onTouchMove',\n touchcancel: 'onTouchCancel'\n};\nconst cameraEvents = {\n movestart: 'onMoveStart',\n move: 'onMove',\n moveend: 'onMoveEnd',\n dragstart: 'onDragStart',\n drag: 'onDrag',\n dragend: 'onDragEnd',\n zoomstart: 'onZoomStart',\n zoom: 'onZoom',\n zoomend: 'onZoomEnd',\n rotatestart: 'onRotateStart',\n rotate: 'onRotate',\n rotateend: 'onRotateEnd',\n pitchstart: 'onPitchStart',\n pitch: 'onPitch',\n pitchend: 'onPitchEnd'\n};\nconst otherEvents = {\n wheel: 'onWheel',\n boxzoomstart: 'onBoxZoomStart',\n boxzoomend: 'onBoxZoomEnd',\n boxzoomcancel: 'onBoxZoomCancel',\n resize: 'onResize',\n load: 'onLoad',\n render: 'onRender',\n idle: 'onIdle',\n remove: 'onRemove',\n data: 'onData',\n styledata: 'onStyleData',\n sourcedata: 'onSourceData',\n error: 'onError'\n};\nconst settingNames = [\n 'minZoom',\n 'maxZoom',\n 'minPitch',\n 'maxPitch',\n 'maxBounds',\n 'projection',\n 'renderWorldCopies'\n];\nconst handlerNames = [\n 'scrollZoom',\n 'boxZoom',\n 'dragRotate',\n 'dragPan',\n 'keyboard',\n 'doubleClickZoom',\n 'touchZoomRotate',\n 'touchPitch'\n];\n/**\n * A wrapper for mapbox-gl's Map class\n */\nclass Mapbox {\n constructor(MapClass, props, container) {\n // mapboxgl.Map instance\n this._map = null;\n // Internal states\n this._internalUpdate = false;\n this._inRender = false;\n this._hoveredFeatures = null;\n this._deferredEvents = {\n move: false,\n zoom: false,\n pitch: false,\n rotate: false\n };\n this._onEvent = (e) => {\n // @ts-ignore\n const cb = this.props[otherEvents[e.type]];\n if (cb) {\n cb(e);\n }\n else if (e.type === 'error') {\n console.error(e.error); // eslint-disable-line\n }\n };\n this._onPointerEvent = (e) => {\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n this._updateHover(e);\n }\n // @ts-ignore\n const cb = this.props[pointerEvents[e.type]];\n if (cb) {\n if (this.props.interactiveLayerIds && e.type !== 'mouseover' && e.type !== 'mouseout') {\n e.features = this._hoveredFeatures || this._queryRenderedFeatures(e.point);\n }\n cb(e);\n delete e.features;\n }\n };\n this._onCameraEvent = (e) => {\n if (!this._internalUpdate) {\n // @ts-ignore\n const cb = this.props[cameraEvents[e.type]];\n if (cb) {\n cb(e);\n }\n }\n if (e.type in this._deferredEvents) {\n this._deferredEvents[e.type] = false;\n }\n };\n this._MapClass = MapClass;\n this.props = props;\n this._initialize(container);\n }\n get map() {\n return this._map;\n }\n get transform() {\n return this._renderTransform;\n }\n setProps(props) {\n const oldProps = this.props;\n this.props = props;\n const settingsChanged = this._updateSettings(props, oldProps);\n if (settingsChanged) {\n this._createShadowTransform(this._map);\n }\n const sizeChanged = this._updateSize(props);\n const viewStateChanged = this._updateViewState(props, true);\n this._updateStyle(props, oldProps);\n this._updateStyleComponents(props, oldProps);\n this._updateHandlers(props, oldProps);\n // If 1) view state has changed to match props and\n // 2) the props change is not triggered by map events,\n // it's driven by an external state change. Redraw immediately\n if (settingsChanged || sizeChanged || (viewStateChanged && !this._map.isMoving())) {\n this.redraw();\n }\n }\n static reuse(props, container) {\n const that = Mapbox.savedMaps.pop();\n if (!that) {\n return null;\n }\n const map = that.map;\n // When reusing the saved map, we need to reparent the map(canvas) and other child nodes\n // intoto the new container from the props.\n // Step 1: reparenting child nodes from old container to new container\n const oldContainer = map.getContainer();\n container.className = oldContainer.className;\n while (oldContainer.childNodes.length > 0) {\n container.appendChild(oldContainer.childNodes[0]);\n }\n // Step 2: replace the internal container with new container from the react component\n // @ts-ignore\n map._container = container;\n // Step 4: apply new props\n that.setProps({ ...props, styleDiffing: false });\n map.resize();\n const { initialViewState } = props;\n if (initialViewState) {\n if (initialViewState.bounds) {\n map.fitBounds(initialViewState.bounds, { ...initialViewState.fitBoundsOptions, duration: 0 });\n }\n else {\n that._updateViewState(initialViewState, false);\n }\n }\n // Simulate load event\n if (map.isStyleLoaded()) {\n map.fire('load');\n }\n else {\n map.once('styledata', () => map.fire('load'));\n }\n // Force reload\n // @ts-ignore\n map._update();\n return that;\n }\n /* eslint-disable complexity,max-statements */\n _initialize(container) {\n const { props } = this;\n const { mapStyle = DEFAULT_STYLE } = props;\n const mapOptions = {\n ...props,\n ...props.initialViewState,\n accessToken: props.mapboxAccessToken || getAccessTokenFromEnv() || null,\n container,\n style: normalizeStyle(mapStyle)\n };\n const viewState = mapOptions.initialViewState || mapOptions.viewState || mapOptions;\n Object.assign(mapOptions, {\n center: [viewState.longitude || 0, viewState.latitude || 0],\n zoom: viewState.zoom || 0,\n pitch: viewState.pitch || 0,\n bearing: viewState.bearing || 0\n });\n if (props.gl) {\n // eslint-disable-next-line\n const getContext = HTMLCanvasElement.prototype.getContext;\n // Hijack canvas.getContext to return our own WebGLContext\n // This will be called inside the mapboxgl.Map constructor\n // @ts-expect-error\n HTMLCanvasElement.prototype.getContext = () => {\n // Unhijack immediately\n HTMLCanvasElement.prototype.getContext = getContext;\n return props.gl;\n };\n }\n const map = new this._MapClass(mapOptions);\n // Props that are not part of constructor options\n if (viewState.padding) {\n map.setPadding(viewState.padding);\n }\n if (props.cursor) {\n map.getCanvas().style.cursor = props.cursor;\n }\n this._createShadowTransform(map);\n // Hack\n // Insert code into map's render cycle\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const renderMap = map._render;\n map._render = (arg) => {\n this._inRender = true;\n renderMap.call(map, arg);\n this._inRender = false;\n };\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const runRenderTaskQueue = map._renderTaskQueue.run;\n map._renderTaskQueue.run = (arg) => {\n runRenderTaskQueue.call(map._renderTaskQueue, arg);\n this._onBeforeRepaint();\n };\n map.on('render', () => this._onAfterRepaint());\n // Insert code into map's event pipeline\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const fireEvent = map.fire;\n map.fire = this._fireEvent.bind(this, fireEvent);\n // add listeners\n map.on('resize', () => {\n this._renderTransform.resize(map.transform.width, map.transform.height);\n });\n map.on('styledata', () => {\n this._updateStyleComponents(this.props, {});\n // Projection can be set in stylesheet\n syncProjection(map.transform, this._renderTransform);\n });\n map.on('sourcedata', () => this._updateStyleComponents(this.props, {}));\n for (const eventName in pointerEvents) {\n map.on(eventName, this._onPointerEvent);\n }\n for (const eventName in cameraEvents) {\n map.on(eventName, this._onCameraEvent);\n }\n for (const eventName in otherEvents) {\n map.on(eventName, this._onEvent);\n }\n this._map = map;\n }\n /* eslint-enable complexity,max-statements */\n recycle() {\n // Clean up unnecessary elements before storing for reuse.\n const container = this.map.getContainer();\n const children = container.querySelector('[mapboxgl-children]');\n children?.remove();\n Mapbox.savedMaps.push(this);\n }\n destroy() {\n this._map.remove();\n }\n // Force redraw the map now. Typically resize() and jumpTo() is reflected in the next\n // render cycle, which is managed by Mapbox's animation loop.\n // This removes the synchronization issue caused by requestAnimationFrame.\n redraw() {\n const map = this._map;\n // map._render will throw error if style does not exist\n // https://github.com/mapbox/mapbox-gl-js/blob/fb9fc316da14e99ff4368f3e4faa3888fb43c513\n // /src/ui/map.js#L1834\n if (!this._inRender && map.style) {\n // cancel the scheduled update\n if (map._frame) {\n map._frame.cancel();\n map._frame = null;\n }\n // the order is important - render() may schedule another update\n map._render();\n }\n }\n _createShadowTransform(map) {\n const renderTransform = cloneTransform(map.transform);\n map.painter.transform = renderTransform;\n this._renderTransform = renderTransform;\n }\n /* Trigger map resize if size is controlled\n @param {object} nextProps\n @returns {bool} true if size has changed\n */\n _updateSize(nextProps) {\n // Check if size is controlled\n const { viewState } = nextProps;\n if (viewState) {\n const map = this._map;\n if (viewState.width !== map.transform.width || viewState.height !== map.transform.height) {\n map.resize();\n return true;\n }\n }\n return false;\n }\n // Adapted from map.jumpTo\n /* Update camera to match props\n @param {object} nextProps\n @param {bool} triggerEvents - should fire camera events\n @returns {bool} true if anything is changed\n */\n _updateViewState(nextProps, triggerEvents) {\n if (this._internalUpdate) {\n return false;\n }\n const map = this._map;\n const tr = this._renderTransform;\n // Take a snapshot of the transform before mutation\n const { zoom, pitch, bearing } = tr;\n const isMoving = map.isMoving();\n if (isMoving) {\n // All movement of the camera is done relative to the sea level\n tr.cameraElevationReference = 'sea';\n }\n const changed = applyViewStateToTransform(tr, {\n ...transformToViewState(map.transform),\n ...nextProps\n });\n if (isMoving) {\n // Reset camera reference\n tr.cameraElevationReference = 'ground';\n }\n if (changed && triggerEvents) {\n const deferredEvents = this._deferredEvents;\n // Delay DOM control updates to the next render cycle\n deferredEvents.move = true;\n deferredEvents.zoom || (deferredEvents.zoom = zoom !== tr.zoom);\n deferredEvents.rotate || (deferredEvents.rotate = bearing !== tr.bearing);\n deferredEvents.pitch || (deferredEvents.pitch = pitch !== tr.pitch);\n }\n // Avoid manipulating the real transform when interaction/animation is ongoing\n // as it would interfere with Mapbox's handlers\n if (!isMoving) {\n applyViewStateToTransform(map.transform, nextProps);\n }\n return changed;\n }\n /* Update camera constraints and projection settings to match props\n @param {object} nextProps\n @param {object} currProps\n @returns {bool} true if anything is changed\n */\n _updateSettings(nextProps, currProps) {\n const map = this._map;\n let changed = false;\n for (const propName of settingNames) {\n if (propName in nextProps && !deepEqual(nextProps[propName], currProps[propName])) {\n changed = true;\n const setter = map[`set${propName[0].toUpperCase()}${propName.slice(1)}`];\n setter?.call(map, nextProps[propName]);\n }\n }\n return changed;\n }\n /* Update map style to match props\n @param {object} nextProps\n @param {object} currProps\n @returns {bool} true if style is changed\n */\n _updateStyle(nextProps, currProps) {\n if (nextProps.cursor !== currProps.cursor) {\n this._map.getCanvas().style.cursor = nextProps.cursor || '';\n }\n if (nextProps.mapStyle !== currProps.mapStyle) {\n const { mapStyle = DEFAULT_STYLE, styleDiffing = true } = nextProps;\n const options = {\n diff: styleDiffing\n };\n if ('localIdeographFontFamily' in nextProps) {\n // @ts-ignore Mapbox specific prop\n options.localIdeographFontFamily = nextProps.localIdeographFontFamily;\n }\n this._map.setStyle(normalizeStyle(mapStyle), options);\n return true;\n }\n return false;\n }\n /* Update fog, light and terrain to match props\n @param {object} nextProps\n @param {object} currProps\n @returns {bool} true if anything is changed\n */\n _updateStyleComponents(nextProps, currProps) {\n const map = this._map;\n let changed = false;\n if (map.isStyleLoaded()) {\n if ('light' in nextProps && map.setLight && !deepEqual(nextProps.light, currProps.light)) {\n changed = true;\n map.setLight(nextProps.light);\n }\n if ('fog' in nextProps && map.setFog && !deepEqual(nextProps.fog, currProps.fog)) {\n changed = true;\n map.setFog(nextProps.fog);\n }\n if ('terrain' in nextProps &&\n map.setTerrain &&\n !deepEqual(nextProps.terrain, currProps.terrain)) {\n if (!nextProps.terrain || map.getSource(nextProps.terrain.source)) {\n changed = true;\n map.setTerrain(nextProps.terrain);\n }\n }\n }\n return changed;\n }\n /* Update interaction handlers to match props\n @param {object} nextProps\n @param {object} currProps\n @returns {bool} true if anything is changed\n */\n _updateHandlers(nextProps, currProps) {\n const map = this._map;\n let changed = false;\n for (const propName of handlerNames) {\n const newValue = nextProps[propName] ?? true;\n const oldValue = currProps[propName] ?? true;\n if (!deepEqual(newValue, oldValue)) {\n changed = true;\n if (newValue) {\n map[propName].enable(newValue);\n }\n else {\n map[propName].disable();\n }\n }\n }\n return changed;\n }\n _queryRenderedFeatures(point) {\n const map = this._map;\n const tr = map.transform;\n const { interactiveLayerIds = [] } = this.props;\n try {\n map.transform = this._renderTransform;\n return map.queryRenderedFeatures(point, {\n layers: interactiveLayerIds.filter(map.getLayer.bind(map))\n });\n }\n catch {\n // May fail if style is not loaded\n return [];\n }\n finally {\n map.transform = tr;\n }\n }\n _updateHover(e) {\n const { props } = this;\n const shouldTrackHoveredFeatures = props.interactiveLayerIds && (props.onMouseMove || props.onMouseEnter || props.onMouseLeave);\n if (shouldTrackHoveredFeatures) {\n const eventType = e.type;\n const wasHovering = this._hoveredFeatures?.length > 0;\n const features = this._queryRenderedFeatures(e.point);\n const isHovering = features.length > 0;\n if (!isHovering && wasHovering) {\n e.type = 'mouseleave';\n this._onPointerEvent(e);\n }\n this._hoveredFeatures = features;\n if (isHovering && !wasHovering) {\n e.type = 'mouseenter';\n this._onPointerEvent(e);\n }\n e.type = eventType;\n }\n else {\n this._hoveredFeatures = null;\n }\n }\n _fireEvent(baseFire, event, properties) {\n const map = this._map;\n const tr = map.transform;\n const eventType = typeof event === 'string' ? event : event.type;\n if (eventType === 'move') {\n this._updateViewState(this.props, false);\n }\n if (eventType in cameraEvents) {\n if (typeof event === 'object') {\n event.viewState = transformToViewState(tr);\n }\n if (this._map.isMoving()) {\n // Replace map.transform with ours during the callbacks\n map.transform = this._renderTransform;\n baseFire.call(map, event, properties);\n map.transform = tr;\n return map;\n }\n }\n baseFire.call(map, event, properties);\n return map;\n }\n // All camera manipulations are complete, ready to repaint\n _onBeforeRepaint() {\n const map = this._map;\n // If there are camera changes driven by props, invoke camera events so that DOM controls are synced\n this._internalUpdate = true;\n for (const eventType in this._deferredEvents) {\n if (this._deferredEvents[eventType]) {\n map.fire(eventType);\n }\n }\n this._internalUpdate = false;\n const tr = this._map.transform;\n // Make sure camera matches the current props\n map.transform = this._renderTransform;\n this._onAfterRepaint = () => {\n // Mapbox transitions between non-mercator projection and mercator during render time\n // Copy it back to the other\n syncProjection(this._renderTransform, tr);\n // Restores camera state before render/load events are fired\n map.transform = tr;\n };\n }\n}\nMapbox.savedMaps = [];\nexport default Mapbox;\n/**\n * Access token can be provided via one of:\n * mapboxAccessToken prop\n * access_token query parameter\n * MapboxAccessToken environment variable\n * REACT_APP_MAPBOX_ACCESS_TOKEN environment variable\n * @returns access token\n */\nfunction getAccessTokenFromEnv() {\n let accessToken = null;\n /* global location, process */\n if (typeof location !== 'undefined') {\n const match = /access_token=([^&\\/]*)/.exec(location.search);\n accessToken = match && match[1];\n }\n // Note: This depends on bundler plugins (e.g. webpack) importing environment correctly\n try {\n // eslint-disable-next-line no-process-env\n accessToken = accessToken || process.env.MapboxAccessToken;\n }\n catch {\n // ignore\n }\n try {\n // eslint-disable-next-line no-process-env\n accessToken = accessToken || process.env.REACT_APP_MAPBOX_ACCESS_TOKEN;\n }\n catch {\n // ignore\n }\n return accessToken;\n}\n//# sourceMappingURL=mapbox.js.map"],"names":[],"mappings":";;;AAGA,MAAM,gBAAgB,EAAE,SAAS,GAAG,SAAS,IAAI,QAAQ,CAAA;AACzD,MAAM,gBAAgB;AAAA,EAClB,WAAW;AAAA,EACX,SAAS;AAAA,EACT,WAAW;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,WAAW;AAAA,EACX,aAAa;AACjB;AACA,MAAM,eAAe;AAAA,EACjB,WAAW;AAAA,EACX,MAAM;AAAA,EACN,SAAS;AAAA,EACT,WAAW;AAAA,EACX,MAAM;AAAA,EACN,SAAS;AAAA,EACT,WAAW;AAAA,EACX,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,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AAC1C,UAAI,KAAK,gBAAgB,SAAS,GAAG;AACjC,YAAI,KAAK,SAAS;AAAA,MACrB;AAAA,IACJ;AACD,SAAK,kBAAkB;AACvB,UAAM,KAAK,KAAK,KAAK;AAErB,QAAI,YAAY,KAAK;AACrB,SAAK,kBAAkB,MAAM;AAGzB,qBAAe,KAAK,kBAAkB,EAAE;AAExC,UAAI,YAAY;AAAA,IAC5B;AAAA,EACK;AACL;AACA,OAAO,YAAY,CAAA;AAUnB,SAAS,wBAAwB;AAC7B,MAAI,cAAc;AAElB,MAAI,OAAO,aAAa,aAAa;AACjC,UAAM,QAAQ,yBAAyB,KAAK,SAAS,MAAM;AAC3D,kBAAc,SAAS,MAAM,CAAC;AAAA,EACjC;AAED,MAAI;AAEA,kBAAc,eAAe,QAAQ,IAAI;AAAA,EAC5C,QACK;AAAA,EAEL;AACD,MAAI;AAEA,kBAAc,eAAe,QAAQ,IAAI;AAAA,EAC5C,QACK;AAAA,EAEL;AACD,SAAO;AACX;","x_google_ignoreList":[0]}
@@ -0,0 +1,90 @@
1
+ const skipMethods = [
2
+ "setMaxBounds",
3
+ "setMinZoom",
4
+ "setMaxZoom",
5
+ "setMinPitch",
6
+ "setMaxPitch",
7
+ "setRenderWorldCopies",
8
+ "setProjection",
9
+ "setStyle",
10
+ "addSource",
11
+ "removeSource",
12
+ "addLayer",
13
+ "removeLayer",
14
+ "setLayerZoomRange",
15
+ "setFilter",
16
+ "setPaintProperty",
17
+ "setLayoutProperty",
18
+ "setLight",
19
+ "setTerrain",
20
+ "setFog",
21
+ "remove"
22
+ ];
23
+ function createRef(mapInstance) {
24
+ if (!mapInstance) {
25
+ return null;
26
+ }
27
+ const map = mapInstance.map;
28
+ const ref = {
29
+ getMap: () => map,
30
+ // Overwrite getters to use our shadow transform
31
+ getCenter: () => mapInstance.transform.center,
32
+ getZoom: () => mapInstance.transform.zoom,
33
+ getBearing: () => mapInstance.transform.bearing,
34
+ getPitch: () => mapInstance.transform.pitch,
35
+ getPadding: () => mapInstance.transform.padding,
36
+ getBounds: () => mapInstance.transform.getBounds(),
37
+ project: (lnglat) => {
38
+ const tr = map.transform;
39
+ map.transform = mapInstance.transform;
40
+ const result = map.project(lnglat);
41
+ map.transform = tr;
42
+ return result;
43
+ },
44
+ unproject: (point) => {
45
+ const tr = map.transform;
46
+ map.transform = mapInstance.transform;
47
+ const result = map.unproject(point);
48
+ map.transform = tr;
49
+ return result;
50
+ },
51
+ // options diverge between mapbox and maplibre
52
+ queryTerrainElevation: (lnglat, options) => {
53
+ const tr = map.transform;
54
+ map.transform = mapInstance.transform;
55
+ const result = map.queryTerrainElevation(lnglat, options);
56
+ map.transform = tr;
57
+ return result;
58
+ },
59
+ queryRenderedFeatures: (geometry, options) => {
60
+ const tr = map.transform;
61
+ map.transform = mapInstance.transform;
62
+ const result = map.queryRenderedFeatures(geometry, options);
63
+ map.transform = tr;
64
+ return result;
65
+ }
66
+ };
67
+ for (const key of getMethodNames(map)) {
68
+ if (!(key in ref) && !skipMethods.includes(key)) {
69
+ ref[key] = map[key].bind(map);
70
+ }
71
+ }
72
+ return ref;
73
+ }
74
+ function getMethodNames(obj) {
75
+ const result = /* @__PURE__ */ new Set();
76
+ let proto = obj;
77
+ while (proto) {
78
+ for (const key of Object.getOwnPropertyNames(proto)) {
79
+ if (key[0] !== "_" && typeof obj[key] === "function" && key !== "fire" && key !== "setEventedParent") {
80
+ result.add(key);
81
+ }
82
+ }
83
+ proto = Object.getPrototypeOf(proto);
84
+ }
85
+ return Array.from(result);
86
+ }
87
+ export {
88
+ createRef as default
89
+ };
90
+ //# sourceMappingURL=main34.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main34.mjs","sources":["../../node_modules/@vis.gl/react-mapbox/dist/mapbox/create-ref.js"],"sourcesContent":["/** These methods may break the react binding if called directly */\nconst skipMethods = [\n 'setMaxBounds',\n 'setMinZoom',\n 'setMaxZoom',\n 'setMinPitch',\n 'setMaxPitch',\n 'setRenderWorldCopies',\n 'setProjection',\n 'setStyle',\n 'addSource',\n 'removeSource',\n 'addLayer',\n 'removeLayer',\n 'setLayerZoomRange',\n 'setFilter',\n 'setPaintProperty',\n 'setLayoutProperty',\n 'setLight',\n 'setTerrain',\n 'setFog',\n 'remove'\n];\nexport default function createRef(mapInstance) {\n if (!mapInstance) {\n return null;\n }\n const map = mapInstance.map;\n const ref = {\n getMap: () => map,\n // Overwrite getters to use our shadow transform\n getCenter: () => mapInstance.transform.center,\n getZoom: () => mapInstance.transform.zoom,\n getBearing: () => mapInstance.transform.bearing,\n getPitch: () => mapInstance.transform.pitch,\n getPadding: () => mapInstance.transform.padding,\n getBounds: () => mapInstance.transform.getBounds(),\n project: (lnglat) => {\n const tr = map.transform;\n map.transform = mapInstance.transform;\n const result = map.project(lnglat);\n map.transform = tr;\n return result;\n },\n unproject: (point) => {\n const tr = map.transform;\n map.transform = mapInstance.transform;\n const result = map.unproject(point);\n map.transform = tr;\n return result;\n },\n // options diverge between mapbox and maplibre\n queryTerrainElevation: (lnglat, options) => {\n const tr = map.transform;\n map.transform = mapInstance.transform;\n const result = map.queryTerrainElevation(lnglat, options);\n map.transform = tr;\n return result;\n },\n queryRenderedFeatures: (geometry, options) => {\n const tr = map.transform;\n map.transform = mapInstance.transform;\n const result = map.queryRenderedFeatures(geometry, options);\n map.transform = tr;\n return result;\n }\n };\n for (const key of getMethodNames(map)) {\n // @ts-expect-error\n if (!(key in ref) && !skipMethods.includes(key)) {\n ref[key] = map[key].bind(map);\n }\n }\n return ref;\n}\nfunction getMethodNames(obj) {\n const result = new Set();\n let proto = obj;\n while (proto) {\n for (const key of Object.getOwnPropertyNames(proto)) {\n if (key[0] !== '_' &&\n typeof obj[key] === 'function' &&\n key !== 'fire' &&\n key !== 'setEventedParent') {\n result.add(key);\n }\n }\n proto = Object.getPrototypeOf(proto);\n }\n return Array.from(result);\n}\n//# sourceMappingURL=create-ref.js.map"],"names":[],"mappings":"AACA,MAAM,cAAc;AAAA,EAChB;AAAA,EACA;AAAA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;AACI,aAAW,OAAO,eAAe,GAAG,GAAG;AAEnC,QAAI,EAAE,OAAO,QAAQ,CAAC,YAAY,SAAS,GAAG,GAAG;AAC7C,UAAI,GAAG,IAAI,IAAI,GAAG,EAAE,KAAK,GAAG;AAAA,IAC/B;AAAA,EACJ;AACD,SAAO;AACX;AACA,SAAS,eAAe,KAAK;AACzB,QAAM,SAAS,oBAAI;AACnB,MAAI,QAAQ;AACZ,SAAO,OAAO;AACV,eAAW,OAAO,OAAO,oBAAoB,KAAK,GAAG;AACjD,UAAI,IAAI,CAAC,MAAM,OACX,OAAO,IAAI,GAAG,MAAM,cACpB,QAAQ,UACR,QAAQ,oBAAoB;AAC5B,eAAO,IAAI,GAAG;AAAA,MACjB;AAAA,IACJ;AACD,YAAQ,OAAO,eAAe,KAAK;AAAA,EACtC;AACD,SAAO,MAAM,KAAK,MAAM;AAC5B;","x_google_ignoreList":[0]}
@@ -0,0 +1,6 @@
1
+ import { useLayoutEffect, useEffect } from "react";
2
+ const useIsomorphicLayoutEffect = typeof document !== "undefined" ? useLayoutEffect : useEffect;
3
+ export {
4
+ useIsomorphicLayoutEffect as default
5
+ };
6
+ //# sourceMappingURL=main35.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main35.mjs","sources":["../../node_modules/@vis.gl/react-mapbox/dist/utils/use-isomorphic-layout-effect.js"],"sourcesContent":["// From https://github.com/streamich/react-use/blob/master/src/useIsomorphicLayoutEffect.ts\n// useLayoutEffect but does not trigger warning in server-side rendering\nimport { useEffect, useLayoutEffect } from 'react';\nconst useIsomorphicLayoutEffect = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\nexport default useIsomorphicLayoutEffect;\n//# sourceMappingURL=use-isomorphic-layout-effect.js.map"],"names":[],"mappings":";AAGK,MAAC,4BAA4B,OAAO,aAAa,cAAc,kBAAkB;","x_google_ignoreList":[0]}