@deck.gl/mapbox 9.0.34 → 9.1.0-beta.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.
@@ -1 +1 @@
1
- {"version":3,"file":"deck-utils.d.ts","sourceRoot":"","sources":["../src/deck-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAoD,MAAM,eAAe,CAAC;AACtF,OAAO,KAAK,EAAC,SAAS,EAAE,YAAY,EAAQ,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,WAAW,0BAAuB;AAC9C,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,WAAW,CAAC;AAiBnC,wBAAgB,eAAe,CAAC,EAC9B,GAAG,EACH,EAAE,EACF,IAAI,EACL,EAAE;IACD,GAAG,EAAE,GAAG,GAAG;QAAC,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;KAAC,CAAC;IAClC,EAAE,EAAE,sBAAsB,CAAC;IAC3B,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,GAAG,IAAI,CAiEP;AAeD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,GAAG;IAAC,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;CAAC,QAGnE;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,SAAS,aAmBvD;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAGlE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAGrE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAErE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,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WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAErE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAsB7E;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,YAAY,GAAG;IACrD,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CA6BA"}
@@ -1,3 +1,6 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import { Deck, WebMercatorViewport, MapView, _flatten as flatten } from '@deck.gl/core';
2
5
  import { lngLatToWorld, unitsPerMeter } from '@math.gl/web-mercator';
3
6
  import { GL } from '@luma.gl/constants';
package/dist/dist.dev.js CHANGED
@@ -29,6 +29,10 @@ var __exports__ = (() => {
29
29
  };
30
30
  var __reExport = (target, mod2, secondTarget) => (__copyProps(target, mod2, "default"), secondTarget && __copyProps(secondTarget, mod2, "default"));
31
31
  var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
32
+ // If the importer is in node compatibility mode or this is not an ESM
33
+ // file that has been converted to a CommonJS file using a Babel-
34
+ // compatible transform (i.e. "__esModule" has not been set), then set
35
+ // "default" to the CommonJS "module.exports" for node compatibility.
32
36
  isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
33
37
  mod2
34
38
  ));
@@ -820,6 +824,7 @@ var __exports__ = (() => {
820
824
  function getInterleavedProps(currProps) {
821
825
  const nextProps = {
822
826
  ...currProps,
827
+ // TODO: remove with withParametersWebGL
823
828
  parameters: {
824
829
  depthMask: true,
825
830
  depthTest: true,
@@ -830,6 +835,7 @@ var __exports__ = (() => {
830
835
  blendEquation: GLEnum.FUNC_ADD,
831
836
  ...currProps.parameters
832
837
  },
838
+ // @ts-ignore views prop is hidden by the types because it is not expected to work the same way as in standalone Deck, see documentation
833
839
  views: currProps.views || [new import_core2.MapView({ id: "mapbox" })]
834
840
  };
835
841
  return nextProps;
@@ -866,6 +872,8 @@ var __exports__ = (() => {
866
872
  function getViewState(map) {
867
873
  const { lng, lat } = map.getCenter();
868
874
  const viewState = {
875
+ // Longitude returned by getCenter can be outside of [-180, 180] when zooming near the anti meridian
876
+ // https://github.com/visgl/deck.gl/issues/6894
869
877
  longitude: (lng + 540) % 360 - 180,
870
878
  latitude: lat,
871
879
  zoom: map.getZoom(),
@@ -896,7 +904,10 @@ var __exports__ = (() => {
896
904
  const cameraToCenterDistanceGround = Math.sqrt(dx * dx + dy * dy);
897
905
  const pitchRadians = pitch * DEGREES_TO_RADIANS3;
898
906
  const altitudePixels = 1.5 * height;
899
- const scale = pitchRadians < 1e-3 ? altitudePixels * Math.cos(pitchRadians) / cameraZ : altitudePixels * Math.sin(pitchRadians) / cameraToCenterDistanceGround;
907
+ const scale = pitchRadians < 1e-3 ? (
908
+ // Pitch angle too small to deduce the look at point, assume elevation is 0
909
+ altitudePixels * Math.cos(pitchRadians) / cameraZ
910
+ ) : altitudePixels * Math.sin(pitchRadians) / cameraToCenterDistanceGround;
900
911
  viewState.zoom = Math.log2(scale);
901
912
  const cameraZFromSurface = altitudePixels * Math.cos(pitchRadians) / scale;
902
913
  const surfaceElevation = cameraZ - cameraZFromSurface;
@@ -913,7 +924,13 @@ var __exports__ = (() => {
913
924
  width: deck.width,
914
925
  height: deck.height,
915
926
  ...getViewState(map),
916
- nearZMultiplier: useMapboxProjection ? 0.02 : 0.1,
927
+ nearZMultiplier: useMapboxProjection ? (
928
+ // match mapbox-gl@>=1.3.0's projection matrix
929
+ 0.02
930
+ ) : (
931
+ // use deck.gl's own default
932
+ 0.1
933
+ ),
917
934
  nearZ: map.transform._nearZ / map.transform.height,
918
935
  farZ: map.transform._farZ / map.transform.height
919
936
  });
@@ -970,6 +987,7 @@ var __exports__ = (() => {
970
987
 
971
988
  // src/mapbox-layer.ts
972
989
  var MapboxLayer = class {
990
+ /* eslint-disable no-this-before-super */
973
991
  constructor(props) {
974
992
  if (!props.id) {
975
993
  throw new Error("Layer must have an unique id");
@@ -981,6 +999,7 @@ var __exports__ = (() => {
981
999
  this.deck = null;
982
1000
  this.props = props;
983
1001
  }
1002
+ /* Mapbox custom layer methods */
984
1003
  onAdd(map, gl) {
985
1004
  this.map = map;
986
1005
  this.deck = getDeckInstance({ map, gl, deck: this.props.deck });
@@ -1029,6 +1048,7 @@ var __exports__ = (() => {
1029
1048
  } else {
1030
1049
  map.addLayer(
1031
1050
  new MapboxLayer({ id: layer.id, deck }),
1051
+ // @ts-expect-error beforeId is not defined in LayerProps
1032
1052
  layer.props.beforeId
1033
1053
  );
1034
1054
  }
@@ -1086,6 +1106,7 @@ var __exports__ = (() => {
1086
1106
  }
1087
1107
  }
1088
1108
  };
1109
+ // eslint-disable-next-line complexity
1089
1110
  this._handleMouseEvent = (event) => {
1090
1111
  const deck = this._deck;
1091
1112
  if (!deck || !deck.isInitialized) {
@@ -1151,6 +1172,7 @@ var __exports__ = (() => {
1151
1172
  this._interleaved = interleaved;
1152
1173
  this._props = otherProps;
1153
1174
  }
1175
+ /** Update (partial) props of the underlying Deck instance. */
1154
1176
  setProps(props) {
1155
1177
  if (this._interleaved && props.layers) {
1156
1178
  resolveLayers(this._map, this._deck, this._props.layers, props.layers);
@@ -1160,6 +1182,7 @@ var __exports__ = (() => {
1160
1182
  this._deck.setProps(this._interleaved ? getInterleavedProps(this._props) : this._props);
1161
1183
  }
1162
1184
  }
1185
+ /** Called when the control is added to a map */
1163
1186
  onAdd(map) {
1164
1187
  this._map = map;
1165
1188
  return this._interleaved ? this._onAddInterleaved(map) : this._onAddOverlaid(map);
@@ -1211,6 +1234,7 @@ var __exports__ = (() => {
1211
1234
  resolveLayers(map, this._deck, [], this._props.layers);
1212
1235
  return document.createElement("div");
1213
1236
  }
1237
+ /** Called when the control is removed from a map */
1214
1238
  onRemove() {
1215
1239
  const map = this._map;
1216
1240
  if (map) {
@@ -1245,23 +1269,28 @@ var __exports__ = (() => {
1245
1269
  getDefaultPosition() {
1246
1270
  return "top-left";
1247
1271
  }
1272
+ /** Forwards the Deck.pickObject method */
1248
1273
  pickObject(params) {
1249
1274
  (0, import_core4.assert)(this._deck);
1250
1275
  return this._deck.pickObject(params);
1251
1276
  }
1277
+ /** Forwards the Deck.pickMultipleObjects method */
1252
1278
  pickMultipleObjects(params) {
1253
1279
  (0, import_core4.assert)(this._deck);
1254
1280
  return this._deck.pickMultipleObjects(params);
1255
1281
  }
1282
+ /** Forwards the Deck.pickObjects method */
1256
1283
  pickObjects(params) {
1257
1284
  (0, import_core4.assert)(this._deck);
1258
1285
  return this._deck.pickObjects(params);
1259
1286
  }
1287
+ /** Remove from map and releases all resources */
1260
1288
  finalize() {
1261
1289
  if (this._map) {
1262
1290
  this._map.removeControl(this);
1263
1291
  }
1264
1292
  }
1293
+ /** If interleaved: true, returns base map's canvas, otherwise forwards the Deck.getCanvas method. */
1265
1294
  getCanvas() {
1266
1295
  if (!this._map) {
1267
1296
  return null;
package/dist/index.cjs CHANGED
@@ -100,6 +100,7 @@ function removeDeckInstance(map) {
100
100
  function getInterleavedProps(currProps) {
101
101
  const nextProps = {
102
102
  ...currProps,
103
+ // TODO: remove with withParametersWebGL
103
104
  parameters: {
104
105
  depthMask: true,
105
106
  depthTest: true,
@@ -110,6 +111,7 @@ function getInterleavedProps(currProps) {
110
111
  blendEquation: 32774,
111
112
  ...currProps.parameters
112
113
  },
114
+ // @ts-ignore views prop is hidden by the types because it is not expected to work the same way as in standalone Deck, see documentation
113
115
  views: currProps.views || [new import_core.MapView({ id: "mapbox" })]
114
116
  };
115
117
  return nextProps;
@@ -147,6 +149,8 @@ function getViewState(map) {
147
149
  var _a;
148
150
  const { lng, lat } = map.getCenter();
149
151
  const viewState = {
152
+ // Longitude returned by getCenter can be outside of [-180, 180] when zooming near the anti meridian
153
+ // https://github.com/visgl/deck.gl/issues/6894
150
154
  longitude: (lng + 540) % 360 - 180,
151
155
  latitude: lat,
152
156
  zoom: map.getZoom(),
@@ -177,7 +181,10 @@ function centerCameraOnTerrain(map, viewState) {
177
181
  const cameraToCenterDistanceGround = Math.sqrt(dx * dx + dy * dy);
178
182
  const pitchRadians = pitch * DEGREES_TO_RADIANS;
179
183
  const altitudePixels = 1.5 * height;
180
- const scale = pitchRadians < 1e-3 ? altitudePixels * Math.cos(pitchRadians) / cameraZ : altitudePixels * Math.sin(pitchRadians) / cameraToCenterDistanceGround;
184
+ const scale = pitchRadians < 1e-3 ? (
185
+ // Pitch angle too small to deduce the look at point, assume elevation is 0
186
+ altitudePixels * Math.cos(pitchRadians) / cameraZ
187
+ ) : altitudePixels * Math.sin(pitchRadians) / cameraToCenterDistanceGround;
181
188
  viewState.zoom = Math.log2(scale);
182
189
  const cameraZFromSurface = altitudePixels * Math.cos(pitchRadians) / scale;
183
190
  const surfaceElevation = cameraZ - cameraZFromSurface;
@@ -194,7 +201,13 @@ function getViewport(deck, map, useMapboxProjection = true) {
194
201
  width: deck.width,
195
202
  height: deck.height,
196
203
  ...getViewState(map),
197
- nearZMultiplier: useMapboxProjection ? 0.02 : 0.1,
204
+ nearZMultiplier: useMapboxProjection ? (
205
+ // match mapbox-gl@>=1.3.0's projection matrix
206
+ 0.02
207
+ ) : (
208
+ // use deck.gl's own default
209
+ 0.1
210
+ ),
198
211
  nearZ: map.transform._nearZ / map.transform.height,
199
212
  farZ: map.transform._farZ / map.transform.height
200
213
  });
@@ -249,6 +262,7 @@ var import_core2 = require("@deck.gl/core");
249
262
 
250
263
  // dist/mapbox-layer.js
251
264
  var MapboxLayer = class {
265
+ /* eslint-disable no-this-before-super */
252
266
  constructor(props) {
253
267
  if (!props.id) {
254
268
  throw new Error("Layer must have an unique id");
@@ -260,6 +274,7 @@ var MapboxLayer = class {
260
274
  this.deck = null;
261
275
  this.props = props;
262
276
  }
277
+ /* Mapbox custom layer methods */
263
278
  onAdd(map, gl) {
264
279
  this.map = map;
265
280
  this.deck = getDeckInstance({ map, gl, deck: this.props.deck });
@@ -308,6 +323,7 @@ function resolveLayers(map, deck, oldLayers, newLayers) {
308
323
  } else {
309
324
  map.addLayer(
310
325
  new MapboxLayer({ id: layer.id, deck }),
326
+ // @ts-expect-error beforeId is not defined in LayerProps
311
327
  layer.props.beforeId
312
328
  );
313
329
  }
@@ -430,6 +446,7 @@ var MapboxOverlay = class {
430
446
  this._interleaved = interleaved;
431
447
  this._props = otherProps;
432
448
  }
449
+ /** Update (partial) props of the underlying Deck instance. */
433
450
  setProps(props) {
434
451
  if (this._interleaved && props.layers) {
435
452
  resolveLayers(this._map, this._deck, this._props.layers, props.layers);
@@ -439,6 +456,7 @@ var MapboxOverlay = class {
439
456
  this._deck.setProps(this._interleaved ? getInterleavedProps(this._props) : this._props);
440
457
  }
441
458
  }
459
+ /** Called when the control is added to a map */
442
460
  onAdd(map) {
443
461
  this._map = map;
444
462
  return this._interleaved ? this._onAddInterleaved(map) : this._onAddOverlaid(map);
@@ -488,6 +506,7 @@ var MapboxOverlay = class {
488
506
  resolveLayers(map, this._deck, [], this._props.layers);
489
507
  return document.createElement("div");
490
508
  }
509
+ /** Called when the control is removed from a map */
491
510
  onRemove() {
492
511
  const map = this._map;
493
512
  if (map) {
@@ -523,23 +542,28 @@ var MapboxOverlay = class {
523
542
  getDefaultPosition() {
524
543
  return "top-left";
525
544
  }
545
+ /** Forwards the Deck.pickObject method */
526
546
  pickObject(params) {
527
547
  (0, import_core3.assert)(this._deck);
528
548
  return this._deck.pickObject(params);
529
549
  }
550
+ /** Forwards the Deck.pickMultipleObjects method */
530
551
  pickMultipleObjects(params) {
531
552
  (0, import_core3.assert)(this._deck);
532
553
  return this._deck.pickMultipleObjects(params);
533
554
  }
555
+ /** Forwards the Deck.pickObjects method */
534
556
  pickObjects(params) {
535
557
  (0, import_core3.assert)(this._deck);
536
558
  return this._deck.pickObjects(params);
537
559
  }
560
+ /** Remove from map and releases all resources */
538
561
  finalize() {
539
562
  if (this._map) {
540
563
  this._map.removeControl(this);
541
564
  }
542
565
  }
566
+ /** If interleaved: true, returns base map's canvas, otherwise forwards the Deck.getCanvas method. */
543
567
  getCanvas() {
544
568
  if (!this._map) {
545
569
  return null;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["index.js", "mapbox-overlay.js", "deck-utils.js", "resolve-layers.js", "mapbox-layer.js"],
4
- "sourcesContent": ["export { default as MapboxOverlay } from \"./mapbox-overlay.js\";\n", "import { Deck, assert } from '@deck.gl/core';\nimport { getViewState, getDeckInstance, removeDeckInstance, getInterleavedProps } from \"./deck-utils.js\";\nimport { log } from '@deck.gl/core';\nimport { resolveLayers } from \"./resolve-layers.js\";\n/**\n * Implements Mapbox [IControl](https://docs.mapbox.com/mapbox-gl-js/api/markers/#icontrol) interface\n * Renders deck.gl layers over the base map and automatically synchronizes with the map's camera\n */\nexport default class MapboxOverlay {\n constructor(props) {\n this._handleStyleChange = () => {\n resolveLayers(this._map, this._deck, this._props.layers, this._props.layers);\n };\n this._updateContainerSize = () => {\n if (this._map && this._container) {\n const { clientWidth, clientHeight } = this._map.getContainer();\n Object.assign(this._container.style, {\n width: `${clientWidth}px`,\n height: `${clientHeight}px`\n });\n }\n };\n this._updateViewState = () => {\n const deck = this._deck;\n if (deck) {\n // @ts-ignore (2345) map is always defined if deck is\n deck.setProps({ viewState: getViewState(this._map) });\n // Redraw immediately if view state has changed\n if (deck.isInitialized) {\n deck.redraw();\n }\n }\n };\n // eslint-disable-next-line complexity\n this._handleMouseEvent = (event) => {\n const deck = this._deck;\n if (!deck || !deck.isInitialized) {\n return;\n }\n const mockEvent = {\n type: event.type,\n offsetCenter: event.point,\n srcEvent: event\n };\n const lastDown = this._lastMouseDownPoint;\n if (!event.point && lastDown) {\n // drag* events do not contain a `point` field\n mockEvent.deltaX = event.originalEvent.clientX - lastDown.clientX;\n mockEvent.deltaY = event.originalEvent.clientY - lastDown.clientY;\n mockEvent.offsetCenter = {\n x: lastDown.x + mockEvent.deltaX,\n y: lastDown.y + mockEvent.deltaY\n };\n }\n switch (mockEvent.type) {\n case 'mousedown':\n deck._onPointerDown(mockEvent);\n this._lastMouseDownPoint = {\n ...event.point,\n clientX: event.originalEvent.clientX,\n clientY: event.originalEvent.clientY\n };\n break;\n case 'dragstart':\n mockEvent.type = 'panstart';\n deck._onEvent(mockEvent);\n break;\n case 'drag':\n mockEvent.type = 'panmove';\n deck._onEvent(mockEvent);\n break;\n case 'dragend':\n mockEvent.type = 'panend';\n deck._onEvent(mockEvent);\n break;\n case 'click':\n mockEvent.tapCount = 1;\n deck._onEvent(mockEvent);\n break;\n case 'dblclick':\n mockEvent.type = 'click';\n mockEvent.tapCount = 2;\n deck._onEvent(mockEvent);\n break;\n case 'mousemove':\n mockEvent.type = 'pointermove';\n deck._onPointerMove(mockEvent);\n break;\n case 'mouseout':\n mockEvent.type = 'pointerleave';\n deck._onPointerMove(mockEvent);\n break;\n default:\n return;\n }\n };\n const { interleaved = false, ...otherProps } = props;\n this._interleaved = interleaved;\n this._props = otherProps;\n }\n /** Update (partial) props of the underlying Deck instance. */\n setProps(props) {\n if (this._interleaved && props.layers) {\n resolveLayers(this._map, this._deck, this._props.layers, props.layers);\n }\n Object.assign(this._props, props);\n if (this._deck) {\n this._deck.setProps(this._interleaved ? getInterleavedProps(this._props) : this._props);\n }\n }\n /** Called when the control is added to a map */\n onAdd(map) {\n this._map = map;\n return this._interleaved ? this._onAddInterleaved(map) : this._onAddOverlaid(map);\n }\n _onAddOverlaid(map) {\n /* global document */\n const container = document.createElement('div');\n Object.assign(container.style, {\n position: 'absolute',\n left: 0,\n top: 0,\n textAlign: 'initial',\n pointerEvents: 'none'\n });\n this._container = container;\n this._deck = new Deck({\n ...this._props,\n parent: container,\n viewState: getViewState(map)\n });\n map.on('resize', this._updateContainerSize);\n map.on('render', this._updateViewState);\n map.on('mousedown', this._handleMouseEvent);\n map.on('dragstart', this._handleMouseEvent);\n map.on('drag', this._handleMouseEvent);\n map.on('dragend', this._handleMouseEvent);\n map.on('mousemove', this._handleMouseEvent);\n map.on('mouseout', this._handleMouseEvent);\n map.on('click', this._handleMouseEvent);\n map.on('dblclick', this._handleMouseEvent);\n this._updateContainerSize();\n return container;\n }\n _onAddInterleaved(map) {\n // @ts-ignore non-public map property\n const gl = map.painter.context.gl;\n if (gl instanceof WebGLRenderingContext) {\n log.warn('Incompatible basemap library. See: https://deck.gl/docs/api-reference/mapbox/overview#compatibility')();\n }\n this._deck = getDeckInstance({\n map,\n gl,\n deck: new Deck({\n ...this._props,\n gl\n })\n });\n map.on('styledata', this._handleStyleChange);\n resolveLayers(map, this._deck, [], this._props.layers);\n return document.createElement('div');\n }\n /** Called when the control is removed from a map */\n onRemove() {\n const map = this._map;\n if (map) {\n if (this._interleaved) {\n this._onRemoveInterleaved(map);\n }\n else {\n this._onRemoveOverlaid(map);\n }\n }\n this._deck = undefined;\n this._map = undefined;\n this._container = undefined;\n }\n _onRemoveOverlaid(map) {\n map.off('resize', this._updateContainerSize);\n map.off('render', this._updateViewState);\n map.off('mousedown', this._handleMouseEvent);\n map.off('dragstart', this._handleMouseEvent);\n map.off('drag', this._handleMouseEvent);\n map.off('dragend', this._handleMouseEvent);\n map.off('mousemove', this._handleMouseEvent);\n map.off('mouseout', this._handleMouseEvent);\n map.off('click', this._handleMouseEvent);\n map.off('dblclick', this._handleMouseEvent);\n this._deck?.finalize();\n }\n _onRemoveInterleaved(map) {\n map.off('styledata', this._handleStyleChange);\n resolveLayers(map, this._deck, this._props.layers, []);\n removeDeckInstance(map);\n }\n getDefaultPosition() {\n return 'top-left';\n }\n /** Forwards the Deck.pickObject method */\n pickObject(params) {\n assert(this._deck);\n return this._deck.pickObject(params);\n }\n /** Forwards the Deck.pickMultipleObjects method */\n pickMultipleObjects(params) {\n assert(this._deck);\n return this._deck.pickMultipleObjects(params);\n }\n /** Forwards the Deck.pickObjects method */\n pickObjects(params) {\n assert(this._deck);\n return this._deck.pickObjects(params);\n }\n /** Remove from map and releases all resources */\n finalize() {\n if (this._map) {\n this._map.removeControl(this);\n }\n }\n /** If interleaved: true, returns base map's canvas, otherwise forwards the Deck.getCanvas method. */\n getCanvas() {\n if (!this._map) {\n return null;\n }\n return this._interleaved ? this._map.getCanvas() : this._deck.getCanvas();\n }\n}\n", "import { Deck, WebMercatorViewport, MapView, _flatten as flatten } from '@deck.gl/core';\nimport { lngLatToWorld, unitsPerMeter } from '@math.gl/web-mercator';\nimport { GL } from '@luma.gl/constants';\n// Mercator constants\nconst TILE_SIZE = 512;\nconst DEGREES_TO_RADIANS = Math.PI / 180;\n// Create an interleaved deck instance.\nexport function getDeckInstance({ map, gl, deck }) {\n // Only create one deck instance per context\n if (map.__deck) {\n return map.__deck;\n }\n // Only initialize certain props once per context\n const customRender = deck?.props._customRender;\n const onLoad = deck?.props.onLoad;\n const deckProps = getInterleavedProps({\n ...deck?.props,\n _customRender: () => {\n map.triggerRepaint();\n // customRender may be subscribed by DeckGL React component to update child props\n // make sure it is still called\n // Hack - do not pass a redraw reason here to prevent the React component from clearing the context\n // Rerender will be triggered by MapboxLayer's render()\n customRender?.('');\n }\n });\n let deckInstance;\n if (!deck || deck.props.gl === gl) {\n // If deck isn't defined (Internal MapboxLayer use case),\n // or if deck is defined and is using the WebGLContext created by mapbox (MapboxOverlay and External MapboxLayer use case),\n // block deck from setting the canvas size, and use the map's viewState to drive deck.\n // Otherwise, we use deck's viewState to drive the map.\n Object.assign(deckProps, {\n gl,\n width: null,\n height: null,\n touchAction: 'unset',\n viewState: getViewState(map)\n });\n if (deck?.isInitialized) {\n watchMapMove(deck, map);\n }\n else {\n deckProps.onLoad = () => {\n onLoad?.();\n watchMapMove(deckInstance, map);\n };\n }\n }\n if (deck) {\n deckInstance = deck;\n deck.setProps(deckProps);\n deck.userData.isExternal = true;\n }\n else {\n deckInstance = new Deck(deckProps);\n map.on('remove', () => {\n removeDeckInstance(map);\n });\n }\n deckInstance.userData.mapboxLayers = new Set();\n // (deckInstance.userData as UserData).mapboxVersion = getMapboxVersion(map);\n map.__deck = deckInstance;\n map.on('render', () => {\n if (deckInstance.isInitialized)\n afterRender(deckInstance, map);\n });\n return deckInstance;\n}\nfunction watchMapMove(deck, map) {\n const _handleMapMove = () => {\n if (deck.isInitialized) {\n // call view state methods\n onMapMove(deck, map);\n }\n else {\n // deregister itself when deck is finalized\n map.off('move', _handleMapMove);\n }\n };\n map.on('move', _handleMapMove);\n}\nexport function removeDeckInstance(map) {\n map.__deck?.finalize();\n map.__deck = null;\n}\nexport function getInterleavedProps(currProps) {\n const nextProps = {\n ...currProps,\n // TODO: remove with withParametersWebGL\n parameters: {\n depthMask: true,\n depthTest: true,\n blend: true,\n blendFunc: [770, 771, 1, 771],\n polygonOffsetFill: true,\n depthFunc: 515,\n blendEquation: 32774,\n ...currProps.parameters\n },\n // @ts-ignore views prop is hidden by the types because it is not expected to work the same way as in standalone Deck, see documentation\n views: currProps.views || [new MapView({ id: 'mapbox' })]\n };\n return nextProps;\n}\nexport function addLayer(deck, layer) {\n deck.userData.mapboxLayers.add(layer);\n updateLayers(deck);\n}\nexport function removeLayer(deck, layer) {\n deck.userData.mapboxLayers.delete(layer);\n updateLayers(deck);\n}\nexport function updateLayer(deck, layer) {\n updateLayers(deck);\n}\nexport function drawLayer(deck, map, layer) {\n let { currentViewport } = deck.userData;\n let clearStack = false;\n if (!currentViewport) {\n // This is the first layer drawn in this render cycle.\n // Generate viewport from the current map state.\n currentViewport = getViewport(deck, map, true);\n deck.userData.currentViewport = currentViewport;\n clearStack = true;\n }\n if (!deck.isInitialized) {\n return;\n }\n deck._drawLayers('mapbox-repaint', {\n viewports: [currentViewport],\n layerFilter: ({ layer: deckLayer }) => layer.id === deckLayer.id || deckLayer.props.operation.includes('terrain'),\n clearStack,\n clearCanvas: false\n });\n}\nexport function getViewState(map) {\n const { lng, lat } = map.getCenter();\n const viewState = {\n // Longitude returned by getCenter can be outside of [-180, 180] when zooming near the anti meridian\n // https://github.com/visgl/deck.gl/issues/6894\n longitude: ((lng + 540) % 360) - 180,\n latitude: lat,\n zoom: map.getZoom(),\n bearing: map.getBearing(),\n pitch: map.getPitch(),\n padding: map.getPadding(),\n repeat: map.getRenderWorldCopies()\n };\n if (map.getTerrain?.()) {\n // When the base map has terrain, we need to target the camera at the terrain surface\n centerCameraOnTerrain(map, viewState);\n }\n return viewState;\n}\nfunction centerCameraOnTerrain(map, viewState) {\n if (map.getFreeCameraOptions) {\n // mapbox-gl v2\n const { position } = map.getFreeCameraOptions();\n if (!position || position.z === undefined) {\n return;\n }\n // @ts-ignore transform is not typed\n const height = map.transform.height;\n const { longitude, latitude, pitch } = viewState;\n // Convert mapbox mercator coordinate to deck common space\n const cameraX = position.x * TILE_SIZE;\n const cameraY = (1 - position.y) * TILE_SIZE;\n const cameraZ = position.z * TILE_SIZE;\n // Mapbox manipulates zoom in terrain mode, see discussion here: https://github.com/mapbox/mapbox-gl-js/issues/12040\n const center = lngLatToWorld([longitude, latitude]);\n const dx = cameraX - center[0];\n const dy = cameraY - center[1];\n const cameraToCenterDistanceGround = Math.sqrt(dx * dx + dy * dy);\n const pitchRadians = pitch * DEGREES_TO_RADIANS;\n const altitudePixels = 1.5 * height;\n const scale = pitchRadians < 0.001\n ? // Pitch angle too small to deduce the look at point, assume elevation is 0\n (altitudePixels * Math.cos(pitchRadians)) / cameraZ\n : (altitudePixels * Math.sin(pitchRadians)) / cameraToCenterDistanceGround;\n viewState.zoom = Math.log2(scale);\n const cameraZFromSurface = (altitudePixels * Math.cos(pitchRadians)) / scale;\n const surfaceElevation = cameraZ - cameraZFromSurface;\n viewState.position = [0, 0, surfaceElevation / unitsPerMeter(latitude)];\n }\n // @ts-ignore transform is not typed\n else if (typeof map.transform.elevation === 'number') {\n // maplibre-gl\n // @ts-ignore transform is not typed\n viewState.position = [0, 0, map.transform.elevation];\n }\n}\n// function getMapboxVersion(map: Map): {minor: number; major: number} {\n// // parse mapbox version string\n// let major = 0;\n// let minor = 0;\n// // @ts-ignore (2339) undefined property\n// const version: string = map.version;\n// if (version) {\n// [major, minor] = version.split('.').slice(0, 2).map(Number);\n// }\n// return {major, minor};\n// }\nfunction getViewport(deck, map, useMapboxProjection = true) {\n return new WebMercatorViewport({\n id: 'mapbox',\n x: 0,\n y: 0,\n width: deck.width,\n height: deck.height,\n ...getViewState(map),\n nearZMultiplier: useMapboxProjection\n ? // match mapbox-gl@>=1.3.0's projection matrix\n 0.02\n : // use deck.gl's own default\n 0.1,\n nearZ: map.transform._nearZ / map.transform.height,\n farZ: map.transform._farZ / map.transform.height\n });\n}\nfunction afterRender(deck, map) {\n const { mapboxLayers, isExternal } = deck.userData;\n if (isExternal) {\n // Draw non-Mapbox layers\n const mapboxLayerIds = Array.from(mapboxLayers, layer => layer.id);\n const deckLayers = flatten(deck.props.layers, Boolean);\n const hasNonMapboxLayers = deckLayers.some(layer => layer && !mapboxLayerIds.includes(layer.id));\n let viewports = deck.getViewports();\n const mapboxViewportIdx = viewports.findIndex(vp => vp.id === 'mapbox');\n const hasNonMapboxViews = viewports.length > 1 || mapboxViewportIdx < 0;\n if (hasNonMapboxLayers || hasNonMapboxViews) {\n if (mapboxViewportIdx >= 0) {\n viewports = viewports.slice();\n viewports[mapboxViewportIdx] = getViewport(deck, map, false);\n }\n deck._drawLayers('mapbox-repaint', {\n viewports,\n layerFilter: params => (!deck.props.layerFilter || deck.props.layerFilter(params)) &&\n (params.viewport.id !== 'mapbox' || !mapboxLayerIds.includes(params.layer.id)),\n clearCanvas: false\n });\n }\n }\n // End of render cycle, clear generated viewport\n deck.userData.currentViewport = null;\n}\nfunction onMapMove(deck, map) {\n deck.setProps({\n viewState: getViewState(map)\n });\n // Camera changed, will trigger a map repaint right after this\n // Clear any change flag triggered by setting viewState so that deck does not request\n // a second repaint\n deck.needsRedraw({ clearRedrawFlags: true });\n}\nfunction updateLayers(deck) {\n if (deck.userData.isExternal) {\n return;\n }\n const layers = [];\n deck.userData.mapboxLayers.forEach(deckLayer => {\n const LayerType = deckLayer.props.type;\n const layer = new LayerType(deckLayer.props);\n layers.push(layer);\n });\n deck.setProps({ layers });\n}\n", "import { _flatten as flatten } from '@deck.gl/core';\nimport MapboxLayer from \"./mapbox-layer.js\";\nconst UNDEFINED_BEFORE_ID = '__UNDEFINED__';\n/** Insert Deck layers into the mapbox Map according to the user-defined order */\n// eslint-disable-next-line complexity, max-statements\nexport function resolveLayers(map, deck, oldLayers, newLayers) {\n // Wait until map style is loaded\n // @ts-ignore non-public map property\n if (!map || !deck || !map.style || !map.style._loaded) {\n return;\n }\n const layers = flatten(newLayers, Boolean);\n if (oldLayers !== newLayers) {\n // Step 1: remove layers that no longer exist\n const prevLayers = flatten(oldLayers, Boolean);\n const prevLayerIds = new Set(prevLayers.map(l => l.id));\n for (const layer of layers) {\n prevLayerIds.delete(layer.id);\n }\n for (const id of prevLayerIds) {\n if (map.getLayer(id)) {\n map.removeLayer(id);\n }\n }\n }\n // Step 2: add missing layers\n for (const layer of layers) {\n const mapboxLayer = map.getLayer(layer.id);\n if (mapboxLayer) {\n // Mapbox's map.getLayer() had a breaking change in v3.6.0, see https://github.com/visgl/deck.gl/issues/9086\n // @ts-expect-error not typed\n const layerInstance = mapboxLayer.implementation || mapboxLayer;\n layerInstance.setProps(layer.props);\n }\n else {\n map.addLayer(new MapboxLayer({ id: layer.id, deck }), \n // @ts-expect-error beforeId is not defined in LayerProps\n layer.props.beforeId);\n }\n }\n // Step 3: check the order of layers\n // If beforeId is defined, the deck layer should always render before the mapbox layer [beforeId]\n // If beforeId is not defined, the deck layer should appear after all mapbox layers\n // When two deck layers share the same beforeId, they are rendered in the order that is passed into Deck props.layers\n // @ts-ignore non-public map property\n const mapLayers = map.style._order;\n // Group deck layers by beforeId\n const layerGroups = {};\n for (const layer of layers) {\n // @ts-expect-error beforeId is not defined in LayerProps\n let { beforeId } = layer.props;\n if (!beforeId || !mapLayers.includes(beforeId)) {\n beforeId = UNDEFINED_BEFORE_ID;\n }\n layerGroups[beforeId] = layerGroups[beforeId] || [];\n layerGroups[beforeId].push(layer.id);\n }\n for (const beforeId in layerGroups) {\n const layerGroup = layerGroups[beforeId];\n let lastLayerIndex = beforeId === UNDEFINED_BEFORE_ID ? mapLayers.length : mapLayers.indexOf(beforeId);\n let lastLayerId = beforeId === UNDEFINED_BEFORE_ID ? undefined : beforeId;\n for (let i = layerGroup.length - 1; i >= 0; i--) {\n const layerId = layerGroup[i];\n const layerIndex = mapLayers.indexOf(layerId);\n if (layerIndex !== lastLayerIndex - 1) {\n map.moveLayer(layerId, lastLayerId);\n if (layerIndex > lastLayerIndex) {\n // The last layer's index have changed\n lastLayerIndex++;\n }\n }\n lastLayerIndex--;\n lastLayerId = layerId;\n }\n }\n}\n", "import { getDeckInstance, addLayer, removeLayer, updateLayer, drawLayer } from \"./deck-utils.js\";\nexport default class MapboxLayer {\n /* eslint-disable no-this-before-super */\n constructor(props) {\n if (!props.id) {\n throw new Error('Layer must have an unique id');\n }\n this.id = props.id;\n this.type = 'custom';\n this.renderingMode = props.renderingMode || '3d';\n this.map = null;\n this.deck = null;\n this.props = props;\n }\n /* Mapbox custom layer methods */\n onAdd(map, gl) {\n this.map = map;\n this.deck = getDeckInstance({ map, gl, deck: this.props.deck });\n addLayer(this.deck, this);\n }\n onRemove() {\n if (this.deck) {\n removeLayer(this.deck, this);\n }\n }\n setProps(props) {\n // id cannot be changed\n Object.assign(this.props, props, { id: this.id });\n // safe guard in case setProps is called before onAdd\n if (this.deck) {\n updateLayer(this.deck, this);\n }\n }\n render() {\n drawLayer(this.deck, this.map, this);\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,eAA6B;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,WAAO;AAAA,EACX;AAAA,EAEA,WAAW,QAAQ;AACf,6BAAO,KAAK,KAAK;AACjB,WAAO,KAAK,MAAM,WAAW,MAAM;AAAA,EACvC;AAAA,EAEA,oBAAoB,QAAQ;AACxB,6BAAO,KAAK,KAAK;AACjB,WAAO,KAAK,MAAM,oBAAoB,MAAM;AAAA,EAChD;AAAA,EAEA,YAAY,QAAQ;AAChB,6BAAO,KAAK,KAAK;AACjB,WAAO,KAAK,MAAM,YAAY,MAAM;AAAA,EACxC;AAAA,EAEA,WAAW;AACP,QAAI,KAAK,MAAM;AACX,WAAK,KAAK,cAAc,IAAI;AAAA,IAChC;AAAA,EACJ;AAAA,EAEA,YAAY;AACR,QAAI,CAAC,KAAK,MAAM;AACZ,aAAO;AAAA,IACX;AACA,WAAO,KAAK,eAAe,KAAK,KAAK,UAAU,IAAI,KAAK,MAAM,UAAU;AAAA,EAC5E;AACJ;",
4
+ "sourcesContent": ["// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nexport { default as MapboxOverlay } from \"./mapbox-overlay.js\";\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Deck, assert } from '@deck.gl/core';\nimport { getViewState, getDeckInstance, removeDeckInstance, getInterleavedProps } from \"./deck-utils.js\";\nimport { log } from '@deck.gl/core';\nimport { resolveLayers } from \"./resolve-layers.js\";\n/**\n * Implements Mapbox [IControl](https://docs.mapbox.com/mapbox-gl-js/api/markers/#icontrol) interface\n * Renders deck.gl layers over the base map and automatically synchronizes with the map's camera\n */\nexport default class MapboxOverlay {\n constructor(props) {\n this._handleStyleChange = () => {\n resolveLayers(this._map, this._deck, this._props.layers, this._props.layers);\n };\n this._updateContainerSize = () => {\n if (this._map && this._container) {\n const { clientWidth, clientHeight } = this._map.getContainer();\n Object.assign(this._container.style, {\n width: `${clientWidth}px`,\n height: `${clientHeight}px`\n });\n }\n };\n this._updateViewState = () => {\n const deck = this._deck;\n if (deck) {\n // @ts-ignore (2345) map is always defined if deck is\n deck.setProps({ viewState: getViewState(this._map) });\n // Redraw immediately if view state has changed\n if (deck.isInitialized) {\n deck.redraw();\n }\n }\n };\n // eslint-disable-next-line complexity\n this._handleMouseEvent = (event) => {\n const deck = this._deck;\n if (!deck || !deck.isInitialized) {\n return;\n }\n const mockEvent = {\n type: event.type,\n offsetCenter: event.point,\n srcEvent: event\n };\n const lastDown = this._lastMouseDownPoint;\n if (!event.point && lastDown) {\n // drag* events do not contain a `point` field\n mockEvent.deltaX = event.originalEvent.clientX - lastDown.clientX;\n mockEvent.deltaY = event.originalEvent.clientY - lastDown.clientY;\n mockEvent.offsetCenter = {\n x: lastDown.x + mockEvent.deltaX,\n y: lastDown.y + mockEvent.deltaY\n };\n }\n switch (mockEvent.type) {\n case 'mousedown':\n deck._onPointerDown(mockEvent);\n this._lastMouseDownPoint = {\n ...event.point,\n clientX: event.originalEvent.clientX,\n clientY: event.originalEvent.clientY\n };\n break;\n case 'dragstart':\n mockEvent.type = 'panstart';\n deck._onEvent(mockEvent);\n break;\n case 'drag':\n mockEvent.type = 'panmove';\n deck._onEvent(mockEvent);\n break;\n case 'dragend':\n mockEvent.type = 'panend';\n deck._onEvent(mockEvent);\n break;\n case 'click':\n mockEvent.tapCount = 1;\n deck._onEvent(mockEvent);\n break;\n case 'dblclick':\n mockEvent.type = 'click';\n mockEvent.tapCount = 2;\n deck._onEvent(mockEvent);\n break;\n case 'mousemove':\n mockEvent.type = 'pointermove';\n deck._onPointerMove(mockEvent);\n break;\n case 'mouseout':\n mockEvent.type = 'pointerleave';\n deck._onPointerMove(mockEvent);\n break;\n default:\n return;\n }\n };\n const { interleaved = false, ...otherProps } = props;\n this._interleaved = interleaved;\n this._props = otherProps;\n }\n /** Update (partial) props of the underlying Deck instance. */\n setProps(props) {\n if (this._interleaved && props.layers) {\n resolveLayers(this._map, this._deck, this._props.layers, props.layers);\n }\n Object.assign(this._props, props);\n if (this._deck) {\n this._deck.setProps(this._interleaved ? getInterleavedProps(this._props) : this._props);\n }\n }\n /** Called when the control is added to a map */\n onAdd(map) {\n this._map = map;\n return this._interleaved ? this._onAddInterleaved(map) : this._onAddOverlaid(map);\n }\n _onAddOverlaid(map) {\n /* global document */\n const container = document.createElement('div');\n Object.assign(container.style, {\n position: 'absolute',\n left: 0,\n top: 0,\n textAlign: 'initial',\n pointerEvents: 'none'\n });\n this._container = container;\n this._deck = new Deck({\n ...this._props,\n parent: container,\n viewState: getViewState(map)\n });\n map.on('resize', this._updateContainerSize);\n map.on('render', this._updateViewState);\n map.on('mousedown', this._handleMouseEvent);\n map.on('dragstart', this._handleMouseEvent);\n map.on('drag', this._handleMouseEvent);\n map.on('dragend', this._handleMouseEvent);\n map.on('mousemove', this._handleMouseEvent);\n map.on('mouseout', this._handleMouseEvent);\n map.on('click', this._handleMouseEvent);\n map.on('dblclick', this._handleMouseEvent);\n this._updateContainerSize();\n return container;\n }\n _onAddInterleaved(map) {\n // @ts-ignore non-public map property\n const gl = map.painter.context.gl;\n if (gl instanceof WebGLRenderingContext) {\n log.warn('Incompatible basemap library. See: https://deck.gl/docs/api-reference/mapbox/overview#compatibility')();\n }\n this._deck = getDeckInstance({\n map,\n gl,\n deck: new Deck({\n ...this._props,\n gl\n })\n });\n map.on('styledata', this._handleStyleChange);\n resolveLayers(map, this._deck, [], this._props.layers);\n return document.createElement('div');\n }\n /** Called when the control is removed from a map */\n onRemove() {\n const map = this._map;\n if (map) {\n if (this._interleaved) {\n this._onRemoveInterleaved(map);\n }\n else {\n this._onRemoveOverlaid(map);\n }\n }\n this._deck = undefined;\n this._map = undefined;\n this._container = undefined;\n }\n _onRemoveOverlaid(map) {\n map.off('resize', this._updateContainerSize);\n map.off('render', this._updateViewState);\n map.off('mousedown', this._handleMouseEvent);\n map.off('dragstart', this._handleMouseEvent);\n map.off('drag', this._handleMouseEvent);\n map.off('dragend', this._handleMouseEvent);\n map.off('mousemove', this._handleMouseEvent);\n map.off('mouseout', this._handleMouseEvent);\n map.off('click', this._handleMouseEvent);\n map.off('dblclick', this._handleMouseEvent);\n this._deck?.finalize();\n }\n _onRemoveInterleaved(map) {\n map.off('styledata', this._handleStyleChange);\n resolveLayers(map, this._deck, this._props.layers, []);\n removeDeckInstance(map);\n }\n getDefaultPosition() {\n return 'top-left';\n }\n /** Forwards the Deck.pickObject method */\n pickObject(params) {\n assert(this._deck);\n return this._deck.pickObject(params);\n }\n /** Forwards the Deck.pickMultipleObjects method */\n pickMultipleObjects(params) {\n assert(this._deck);\n return this._deck.pickMultipleObjects(params);\n }\n /** Forwards the Deck.pickObjects method */\n pickObjects(params) {\n assert(this._deck);\n return this._deck.pickObjects(params);\n }\n /** Remove from map and releases all resources */\n finalize() {\n if (this._map) {\n this._map.removeControl(this);\n }\n }\n /** If interleaved: true, returns base map's canvas, otherwise forwards the Deck.getCanvas method. */\n getCanvas() {\n if (!this._map) {\n return null;\n }\n return this._interleaved ? this._map.getCanvas() : this._deck.getCanvas();\n }\n}\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Deck, WebMercatorViewport, MapView, _flatten as flatten } from '@deck.gl/core';\nimport { lngLatToWorld, unitsPerMeter } from '@math.gl/web-mercator';\nimport { GL } from '@luma.gl/constants';\n// Mercator constants\nconst TILE_SIZE = 512;\nconst DEGREES_TO_RADIANS = Math.PI / 180;\n// Create an interleaved deck instance.\nexport function getDeckInstance({ map, gl, deck }) {\n // Only create one deck instance per context\n if (map.__deck) {\n return map.__deck;\n }\n // Only initialize certain props once per context\n const customRender = deck?.props._customRender;\n const onLoad = deck?.props.onLoad;\n const deckProps = getInterleavedProps({\n ...deck?.props,\n _customRender: () => {\n map.triggerRepaint();\n // customRender may be subscribed by DeckGL React component to update child props\n // make sure it is still called\n // Hack - do not pass a redraw reason here to prevent the React component from clearing the context\n // Rerender will be triggered by MapboxLayer's render()\n customRender?.('');\n }\n });\n let deckInstance;\n if (!deck || deck.props.gl === gl) {\n // If deck isn't defined (Internal MapboxLayer use case),\n // or if deck is defined and is using the WebGLContext created by mapbox (MapboxOverlay and External MapboxLayer use case),\n // block deck from setting the canvas size, and use the map's viewState to drive deck.\n // Otherwise, we use deck's viewState to drive the map.\n Object.assign(deckProps, {\n gl,\n width: null,\n height: null,\n touchAction: 'unset',\n viewState: getViewState(map)\n });\n if (deck?.isInitialized) {\n watchMapMove(deck, map);\n }\n else {\n deckProps.onLoad = () => {\n onLoad?.();\n watchMapMove(deckInstance, map);\n };\n }\n }\n if (deck) {\n deckInstance = deck;\n deck.setProps(deckProps);\n deck.userData.isExternal = true;\n }\n else {\n deckInstance = new Deck(deckProps);\n map.on('remove', () => {\n removeDeckInstance(map);\n });\n }\n deckInstance.userData.mapboxLayers = new Set();\n // (deckInstance.userData as UserData).mapboxVersion = getMapboxVersion(map);\n map.__deck = deckInstance;\n map.on('render', () => {\n if (deckInstance.isInitialized)\n afterRender(deckInstance, map);\n });\n return deckInstance;\n}\nfunction watchMapMove(deck, map) {\n const _handleMapMove = () => {\n if (deck.isInitialized) {\n // call view state methods\n onMapMove(deck, map);\n }\n else {\n // deregister itself when deck is finalized\n map.off('move', _handleMapMove);\n }\n };\n map.on('move', _handleMapMove);\n}\nexport function removeDeckInstance(map) {\n map.__deck?.finalize();\n map.__deck = null;\n}\nexport function getInterleavedProps(currProps) {\n const nextProps = {\n ...currProps,\n // TODO: remove with withParametersWebGL\n parameters: {\n depthMask: true,\n depthTest: true,\n blend: true,\n blendFunc: [770, 771, 1, 771],\n polygonOffsetFill: true,\n depthFunc: 515,\n blendEquation: 32774,\n ...currProps.parameters\n },\n // @ts-ignore views prop is hidden by the types because it is not expected to work the same way as in standalone Deck, see documentation\n views: currProps.views || [new MapView({ id: 'mapbox' })]\n };\n return nextProps;\n}\nexport function addLayer(deck, layer) {\n deck.userData.mapboxLayers.add(layer);\n updateLayers(deck);\n}\nexport function removeLayer(deck, layer) {\n deck.userData.mapboxLayers.delete(layer);\n updateLayers(deck);\n}\nexport function updateLayer(deck, layer) {\n updateLayers(deck);\n}\nexport function drawLayer(deck, map, layer) {\n let { currentViewport } = deck.userData;\n let clearStack = false;\n if (!currentViewport) {\n // This is the first layer drawn in this render cycle.\n // Generate viewport from the current map state.\n currentViewport = getViewport(deck, map, true);\n deck.userData.currentViewport = currentViewport;\n clearStack = true;\n }\n if (!deck.isInitialized) {\n return;\n }\n deck._drawLayers('mapbox-repaint', {\n viewports: [currentViewport],\n layerFilter: ({ layer: deckLayer }) => layer.id === deckLayer.id || deckLayer.props.operation.includes('terrain'),\n clearStack,\n clearCanvas: false\n });\n}\nexport function getViewState(map) {\n const { lng, lat } = map.getCenter();\n const viewState = {\n // Longitude returned by getCenter can be outside of [-180, 180] when zooming near the anti meridian\n // https://github.com/visgl/deck.gl/issues/6894\n longitude: ((lng + 540) % 360) - 180,\n latitude: lat,\n zoom: map.getZoom(),\n bearing: map.getBearing(),\n pitch: map.getPitch(),\n padding: map.getPadding(),\n repeat: map.getRenderWorldCopies()\n };\n if (map.getTerrain?.()) {\n // When the base map has terrain, we need to target the camera at the terrain surface\n centerCameraOnTerrain(map, viewState);\n }\n return viewState;\n}\nfunction centerCameraOnTerrain(map, viewState) {\n if (map.getFreeCameraOptions) {\n // mapbox-gl v2\n const { position } = map.getFreeCameraOptions();\n if (!position || position.z === undefined) {\n return;\n }\n // @ts-ignore transform is not typed\n const height = map.transform.height;\n const { longitude, latitude, pitch } = viewState;\n // Convert mapbox mercator coordinate to deck common space\n const cameraX = position.x * TILE_SIZE;\n const cameraY = (1 - position.y) * TILE_SIZE;\n const cameraZ = position.z * TILE_SIZE;\n // Mapbox manipulates zoom in terrain mode, see discussion here: https://github.com/mapbox/mapbox-gl-js/issues/12040\n const center = lngLatToWorld([longitude, latitude]);\n const dx = cameraX - center[0];\n const dy = cameraY - center[1];\n const cameraToCenterDistanceGround = Math.sqrt(dx * dx + dy * dy);\n const pitchRadians = pitch * DEGREES_TO_RADIANS;\n const altitudePixels = 1.5 * height;\n const scale = pitchRadians < 0.001\n ? // Pitch angle too small to deduce the look at point, assume elevation is 0\n (altitudePixels * Math.cos(pitchRadians)) / cameraZ\n : (altitudePixels * Math.sin(pitchRadians)) / cameraToCenterDistanceGround;\n viewState.zoom = Math.log2(scale);\n const cameraZFromSurface = (altitudePixels * Math.cos(pitchRadians)) / scale;\n const surfaceElevation = cameraZ - cameraZFromSurface;\n viewState.position = [0, 0, surfaceElevation / unitsPerMeter(latitude)];\n }\n // @ts-ignore transform is not typed\n else if (typeof map.transform.elevation === 'number') {\n // maplibre-gl\n // @ts-ignore transform is not typed\n viewState.position = [0, 0, map.transform.elevation];\n }\n}\n// function getMapboxVersion(map: Map): {minor: number; major: number} {\n// // parse mapbox version string\n// let major = 0;\n// let minor = 0;\n// // @ts-ignore (2339) undefined property\n// const version: string = map.version;\n// if (version) {\n// [major, minor] = version.split('.').slice(0, 2).map(Number);\n// }\n// return {major, minor};\n// }\nfunction getViewport(deck, map, useMapboxProjection = true) {\n return new WebMercatorViewport({\n id: 'mapbox',\n x: 0,\n y: 0,\n width: deck.width,\n height: deck.height,\n ...getViewState(map),\n nearZMultiplier: useMapboxProjection\n ? // match mapbox-gl@>=1.3.0's projection matrix\n 0.02\n : // use deck.gl's own default\n 0.1,\n nearZ: map.transform._nearZ / map.transform.height,\n farZ: map.transform._farZ / map.transform.height\n });\n}\nfunction afterRender(deck, map) {\n const { mapboxLayers, isExternal } = deck.userData;\n if (isExternal) {\n // Draw non-Mapbox layers\n const mapboxLayerIds = Array.from(mapboxLayers, layer => layer.id);\n const deckLayers = flatten(deck.props.layers, Boolean);\n const hasNonMapboxLayers = deckLayers.some(layer => layer && !mapboxLayerIds.includes(layer.id));\n let viewports = deck.getViewports();\n const mapboxViewportIdx = viewports.findIndex(vp => vp.id === 'mapbox');\n const hasNonMapboxViews = viewports.length > 1 || mapboxViewportIdx < 0;\n if (hasNonMapboxLayers || hasNonMapboxViews) {\n if (mapboxViewportIdx >= 0) {\n viewports = viewports.slice();\n viewports[mapboxViewportIdx] = getViewport(deck, map, false);\n }\n deck._drawLayers('mapbox-repaint', {\n viewports,\n layerFilter: params => (!deck.props.layerFilter || deck.props.layerFilter(params)) &&\n (params.viewport.id !== 'mapbox' || !mapboxLayerIds.includes(params.layer.id)),\n clearCanvas: false\n });\n }\n }\n // End of render cycle, clear generated viewport\n deck.userData.currentViewport = null;\n}\nfunction onMapMove(deck, map) {\n deck.setProps({\n viewState: getViewState(map)\n });\n // Camera changed, will trigger a map repaint right after this\n // Clear any change flag triggered by setting viewState so that deck does not request\n // a second repaint\n deck.needsRedraw({ clearRedrawFlags: true });\n}\nfunction updateLayers(deck) {\n if (deck.userData.isExternal) {\n return;\n }\n const layers = [];\n deck.userData.mapboxLayers.forEach(deckLayer => {\n const LayerType = deckLayer.props.type;\n const layer = new LayerType(deckLayer.props);\n layers.push(layer);\n });\n deck.setProps({ layers });\n}\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { _flatten as flatten } from '@deck.gl/core';\nimport MapboxLayer from \"./mapbox-layer.js\";\nconst UNDEFINED_BEFORE_ID = '__UNDEFINED__';\n/** Insert Deck layers into the mapbox Map according to the user-defined order */\n// eslint-disable-next-line complexity, max-statements\nexport function resolveLayers(map, deck, oldLayers, newLayers) {\n // Wait until map style is loaded\n // @ts-ignore non-public map property\n if (!map || !deck || !map.style || !map.style._loaded) {\n return;\n }\n const layers = flatten(newLayers, Boolean);\n if (oldLayers !== newLayers) {\n // Step 1: remove layers that no longer exist\n const prevLayers = flatten(oldLayers, Boolean);\n const prevLayerIds = new Set(prevLayers.map(l => l.id));\n for (const layer of layers) {\n prevLayerIds.delete(layer.id);\n }\n for (const id of prevLayerIds) {\n if (map.getLayer(id)) {\n map.removeLayer(id);\n }\n }\n }\n // Step 2: add missing layers\n for (const layer of layers) {\n const mapboxLayer = map.getLayer(layer.id);\n if (mapboxLayer) {\n // Mapbox's map.getLayer() had a breaking change in v3.6.0, see https://github.com/visgl/deck.gl/issues/9086\n // @ts-expect-error not typed\n const layerInstance = mapboxLayer.implementation || mapboxLayer;\n layerInstance.setProps(layer.props);\n }\n else {\n map.addLayer(new MapboxLayer({ id: layer.id, deck }), \n // @ts-expect-error beforeId is not defined in LayerProps\n layer.props.beforeId);\n }\n }\n // Step 3: check the order of layers\n // If beforeId is defined, the deck layer should always render before the mapbox layer [beforeId]\n // If beforeId is not defined, the deck layer should appear after all mapbox layers\n // When two deck layers share the same beforeId, they are rendered in the order that is passed into Deck props.layers\n // @ts-ignore non-public map property\n const mapLayers = map.style._order;\n // Group deck layers by beforeId\n const layerGroups = {};\n for (const layer of layers) {\n // @ts-expect-error beforeId is not defined in LayerProps\n let { beforeId } = layer.props;\n if (!beforeId || !mapLayers.includes(beforeId)) {\n beforeId = UNDEFINED_BEFORE_ID;\n }\n layerGroups[beforeId] = layerGroups[beforeId] || [];\n layerGroups[beforeId].push(layer.id);\n }\n for (const beforeId in layerGroups) {\n const layerGroup = layerGroups[beforeId];\n let lastLayerIndex = beforeId === UNDEFINED_BEFORE_ID ? mapLayers.length : mapLayers.indexOf(beforeId);\n let lastLayerId = beforeId === UNDEFINED_BEFORE_ID ? undefined : beforeId;\n for (let i = layerGroup.length - 1; i >= 0; i--) {\n const layerId = layerGroup[i];\n const layerIndex = mapLayers.indexOf(layerId);\n if (layerIndex !== lastLayerIndex - 1) {\n map.moveLayer(layerId, lastLayerId);\n if (layerIndex > lastLayerIndex) {\n // The last layer's index have changed\n lastLayerIndex++;\n }\n }\n lastLayerIndex--;\n lastLayerId = layerId;\n }\n }\n}\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { getDeckInstance, addLayer, removeLayer, updateLayer, drawLayer } from \"./deck-utils.js\";\nexport default class MapboxLayer {\n /* eslint-disable no-this-before-super */\n constructor(props) {\n if (!props.id) {\n throw new Error('Layer must have an unique id');\n }\n this.id = props.id;\n this.type = 'custom';\n this.renderingMode = props.renderingMode || '3d';\n this.map = null;\n this.deck = null;\n this.props = props;\n }\n /* Mapbox custom layer methods */\n onAdd(map, gl) {\n this.map = map;\n this.deck = getDeckInstance({ map, gl, deck: this.props.deck });\n addLayer(this.deck, this);\n }\n onRemove() {\n if (this.deck) {\n removeLayer(this.deck, this);\n }\n }\n setProps(props) {\n // id cannot be changed\n Object.assign(this.props, props, { id: this.id });\n // safe guard in case setProps is called before onAdd\n if (this.deck) {\n updateLayer(this.deck, this);\n }\n }\n render() {\n drawLayer(this.deck, this.map, this);\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGA,IAAAA,eAA6B;;;ACA7B,kBAAwE;AACxE,0BAA6C;AAC7C,uBAAmB;AAEnB,IAAM,YAAY;AAClB,IAAM,qBAAqB,KAAK,KAAK;AAE9B,SAAS,gBAAgB,EAAE,KAAK,IAAI,KAAK,GAAG;AAE/C,MAAI,IAAI,QAAQ;AACZ,WAAO,IAAI;AAAA,EACf;AAEA,QAAM,eAAe,6BAAM,MAAM;AACjC,QAAM,SAAS,6BAAM,MAAM;AAC3B,QAAM,YAAY,oBAAoB;AAAA,IAClC,GAAG,6BAAM;AAAA,IACT,eAAe,MAAM;AACjB,UAAI,eAAe;AAKnB,mDAAe;AAAA,IACnB;AAAA,EACJ,CAAC;AACD,MAAI;AACJ,MAAI,CAAC,QAAQ,KAAK,MAAM,OAAO,IAAI;AAK/B,WAAO,OAAO,WAAW;AAAA,MACrB;AAAA,MACA,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,WAAW,aAAa,GAAG;AAAA,IAC/B,CAAC;AACD,QAAI,6BAAM,eAAe;AACrB,mBAAa,MAAM,GAAG;AAAA,IAC1B,OACK;AACD,gBAAU,SAAS,MAAM;AACrB;AACA,qBAAa,cAAc,GAAG;AAAA,MAClC;AAAA,IACJ;AAAA,EACJ;AACA,MAAI,MAAM;AACN,mBAAe;AACf,SAAK,SAAS,SAAS;AACvB,SAAK,SAAS,aA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- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,4BAAyB;AAE1D,YAAY,EAAC,kBAAkB,EAAC,4BAAyB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,4BAAyB;AAE1D,YAAY,EAAC,kBAAkB,EAAC,4BAAyB"}
package/dist/index.js CHANGED
@@ -1 +1,4 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  export { default as MapboxOverlay } from "./mapbox-overlay.js";
@@ -1 +1 @@
1
- {"version":3,"file":"mapbox-layer.d.ts","sourceRoot":"","sources":["../src/mapbox-layer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,GAAG,EAAE,oBAAoB,EAAC,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAE/C,MAAM,MAAM,gBAAgB,CAAC,MAAM,SAAS,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG;IAC9E,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC5B,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,WAAW,CAAC,MAAM,SAAS,KAAK,CAAE,YAAW,oBAAoB;IACpF,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,GAAG,EAAE,GAAG,GAAG,IAAI,CAAC;IAChB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,KAAK,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;gB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6 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import { getDeckInstance, addLayer, removeLayer, updateLayer, drawLayer } from "./deck-utils.js";
2
5
  export default class MapboxLayer {
3
6
  /* eslint-disable no-this-before-super */
@@ -1 +1 @@
1
- {"version":3,"file":"mapbox-overlay.d.ts","sourceRoot":"","sources":["../src/mapbox-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAS,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EAAC,GAAG,EAAE,QAAQ,EAAgB,MAAM,WAAW,CAAC;AAE5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAK7C,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,SAAS,EACP,OAAO,GACP,QAAQ,GACR,IAAI,GACJ,QAAQ,GACR,QAAQ,GACR,eAAe,GACf,WAAW,GACX,kBAAkB,GAClB,YAAY,CACf,GAAG;IACF,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AACF,KAAK,eAAe,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;AAEjF;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,QAAQ;IACpD,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,KAAK,CAAC,CAAO;IACrB,OAAO,CAAC,IAAI,CAAC,CAAM;IACnB,OAAO,CAAC,UAAU,CAAC,CAAiB;IACpC,OAAO,CAAC,YAAY,CAAU;IAC9B,OAAO,CAAC,mBAAmB,CAAC,CAA2D;gBAE3E,KAAK,EAAE,kBAAkB;IAMrC,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI;IAYzC,gDAAgD;IAChD,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,cAAc;IAK/B,OAAO,CAAC,cAAc;IAiCtB,OAAO,CAAC,iBAAiB;IAuBzB,o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QAAQ;IAMR,qGAAqG;IACrG,SAAS,IAAI,iBAAiB,GAAG,IAAI;IAOrC,OAAO,CAAC,kBAAkB,CAExB;IAEF,OAAO,CAAC,oBAAoB,CAQ1B;IAEF,OAAO,CAAC,gBAAgB,CAUtB;IAGF,OAAO,CAAC,iBAAiB,CA+EvB;CACH"}
@@ -1,3 +1,6 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import { Deck, assert } from '@deck.gl/core';
2
5
  import { getViewState, getDeckInstance, removeDeckInstance, getInterleavedProps } from "./deck-utils.js";
3
6
  import { log } from '@deck.gl/core';
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-layers.d.ts","sourceRoot":"","sources":["../src/resolve-layers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,IAAI,EAAE,UAAU,EAAQ,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,WAAW,CAAC;AAInC,iFAAiF;AAEjF,wBAAgB,aAAa,CAC3B,GAAG,CAAC,EAAE,GAAG,EACT,IAAI,CAAC,EAAE,IAAI,EACX,SAAS,CAAC,EAAE,UAAU,EACtB,SAAS,CAAC,EAAE,UAAU,QAiFvB"}
1
+ {"version":3,"file":"resolve-layers.d.ts","sourceRoot":"","sources":["../src/resolve-layers.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,IAAI,EAAE,UAAU,EAAQ,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,WAAW,CAAC;AAInC,iFAAiF;AAEjF,wBAAgB,aAAa,CAC3B,GAAG,CAAC,EAAE,GAAG,EACT,IAAI,CAAC,EAAE,IAAI,EACX,SAAS,CAAC,EAAE,UAAU,EACtB,SAAS,CAAC,EAAE,UAAU,QAiFvB"}
@@ -1,3 +1,6 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import { _flatten as flatten } from '@deck.gl/core';
2
5
  import MapboxLayer from "./mapbox-layer.js";
3
6
  const UNDEFINED_BEFORE_ID = '__UNDEFINED__';
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Use deck.gl layers as custom mapbox-gl-js layers",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
- "version": "9.0.34",
6
+ "version": "9.1.0-beta.1",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -38,12 +38,12 @@
38
38
  "prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
39
39
  },
40
40
  "dependencies": {
41
- "@luma.gl/constants": "~9.0.27",
42
- "@math.gl/web-mercator": "^4.0.0"
41
+ "@luma.gl/constants": "^9.1.0-beta.11",
42
+ "@math.gl/web-mercator": "^4.1.0"
43
43
  },
44
44
  "peerDependencies": {
45
- "@deck.gl/core": "^9.0.0",
46
- "@luma.gl/core": "~9.0.0"
45
+ "@deck.gl/core": "^9.1.0-alpha",
46
+ "@luma.gl/core": "^9.1.0-beta.11"
47
47
  },
48
- "gitHead": "eb03446717e49042747ef6f7b1be581561a2249e"
48
+ "gitHead": "a86fb154cf323eacc3f56ef087f636fb9f6c30b6"
49
49
  }
package/src/deck-utils.ts CHANGED
@@ -1,3 +1,7 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
1
5
  import {Deck, WebMercatorViewport, MapView, _flatten as flatten} from '@deck.gl/core';
2
6
  import type {DeckProps, MapViewState, Layer} from '@deck.gl/core';
3
7
  import type MapboxLayer from './mapbox-layer';
package/src/index.ts CHANGED
@@ -1,3 +1,7 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
1
5
  export {default as MapboxOverlay} from './mapbox-overlay';
2
6
 
3
7
  export type {MapboxOverlayProps} from './mapbox-overlay';
@@ -1,3 +1,7 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
1
5
  import {getDeckInstance, addLayer, removeLayer, updateLayer, drawLayer} from './deck-utils';
2
6
  import type {Map, CustomLayerInterface} from 'mapbox-gl';
3
7
  import type {Deck, Layer} from '@deck.gl/core';
@@ -1,3 +1,7 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
1
5
  import {Deck, assert} from '@deck.gl/core';
2
6
  import {getViewState, getDeckInstance, removeDeckInstance, getInterleavedProps} from './deck-utils';
3
7
 
@@ -1,3 +1,7 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
1
5
  import {_flatten as flatten} from '@deck.gl/core';
2
6
  import MapboxLayer from './mapbox-layer';
3
7