@deck.gl/arcgis 8.6.4 → 8.7.0-alpha.11
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.
- package/dist/dist.dev.js +78 -104
- package/dist/es5/commons.js +21 -18
- package/dist/es5/commons.js.map +1 -1
- package/dist/es5/deck-layer-view-2d.js +19 -13
- package/dist/es5/deck-layer-view-2d.js.map +1 -1
- package/dist/es5/deck-layer.js +3 -6
- package/dist/es5/deck-layer.js.map +1 -1
- package/dist/es5/deck-props.js +50 -23
- package/dist/es5/deck-props.js.map +1 -1
- package/dist/es5/deck-renderer.js +57 -36
- package/dist/es5/deck-renderer.js.map +1 -1
- package/dist/es5/index.js +22 -42
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/load-modules.js +109 -0
- package/dist/es5/load-modules.js.map +1 -0
- package/dist/esm/deck-props.js +1 -1
- package/dist/esm/deck-props.js.map +1 -1
- package/dist/esm/index.js +9 -46
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/load-modules.js +51 -0
- package/dist/esm/load-modules.js.map +1 -0
- package/dist.min.js +1 -1
- package/package.json +4 -3
- package/src/deck-props.js +1 -1
- package/src/index.js +11 -51
- package/src/load-modules.js +58 -0
package/dist/dist.dev.js
CHANGED
|
@@ -91,15 +91,15 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
91
91
|
/******/
|
|
92
92
|
/******/
|
|
93
93
|
/******/ // Load entry module and return exports
|
|
94
|
-
/******/ return __webpack_require__(__webpack_require__.s = "./bundle.
|
|
94
|
+
/******/ return __webpack_require__(__webpack_require__.s = "./bundle.ts");
|
|
95
95
|
/******/ })
|
|
96
96
|
/************************************************************************/
|
|
97
97
|
/******/ ({
|
|
98
98
|
|
|
99
99
|
/***/ "../../node_modules/esri-loader/dist/umd/esri-loader.js":
|
|
100
|
-
|
|
101
|
-
!*** /Users/
|
|
102
|
-
|
|
100
|
+
/*!***********************************************************************************!*\
|
|
101
|
+
!*** /Users/alasarr/dev/deck.gl/node_modules/esri-loader/dist/umd/esri-loader.js ***!
|
|
102
|
+
\***********************************************************************************/
|
|
103
103
|
/*! no static exports found */
|
|
104
104
|
/***/ (function(module, exports, __webpack_require__) {
|
|
105
105
|
|
|
@@ -118,7 +118,7 @@ var utils = {
|
|
|
118
118
|
|
|
119
119
|
/* Copyright (c) 2017 Environmental Systems Research Institute, Inc.
|
|
120
120
|
* Apache-2.0 */
|
|
121
|
-
var DEFAULT_VERSION = '4.
|
|
121
|
+
var DEFAULT_VERSION = '4.21';
|
|
122
122
|
var NEXT = 'next';
|
|
123
123
|
function parseVersion(version) {
|
|
124
124
|
if (version.toLowerCase() === NEXT) {
|
|
@@ -133,7 +133,7 @@ function parseVersion(version) {
|
|
|
133
133
|
/**
|
|
134
134
|
* Get the CDN url for a given version
|
|
135
135
|
*
|
|
136
|
-
* @param version Ex: '4.
|
|
136
|
+
* @param version Ex: '4.21' or '3.38'. Defaults to the latest 4.x version.
|
|
137
137
|
*/
|
|
138
138
|
function getCdnUrl(version) {
|
|
139
139
|
if (version === void 0) { version = DEFAULT_VERSION; }
|
|
@@ -142,7 +142,7 @@ function getCdnUrl(version) {
|
|
|
142
142
|
/**
|
|
143
143
|
* Get the CDN url for a the CSS for a given version and/or theme
|
|
144
144
|
*
|
|
145
|
-
* @param version Ex: '4.
|
|
145
|
+
* @param version Ex: '4.21', '3.38', or 'next'. Defaults to the latest 4.x version.
|
|
146
146
|
*/
|
|
147
147
|
function getCdnCssUrl(version) {
|
|
148
148
|
if (version === void 0) { version = DEFAULT_VERSION; }
|
|
@@ -399,27 +399,23 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
399
399
|
|
|
400
400
|
/***/ }),
|
|
401
401
|
|
|
402
|
-
/***/ "./bundle.
|
|
402
|
+
/***/ "./bundle.ts":
|
|
403
403
|
/*!*******************!*\
|
|
404
|
-
!*** ./bundle.
|
|
404
|
+
!*** ./bundle.ts ***!
|
|
405
405
|
\*******************/
|
|
406
406
|
/*! no static exports found */
|
|
407
407
|
/***/ (function(module, exports, __webpack_require__) {
|
|
408
408
|
|
|
409
|
-
const ArcGISUtils = __webpack_require__(/*! ./src */ "./src/
|
|
409
|
+
const ArcGISUtils = __webpack_require__(/*! ./src/load-modules */ "./src/load-modules.js");
|
|
410
410
|
|
|
411
|
-
|
|
412
|
-
const _global = typeof window === 'undefined' ? global : window;
|
|
413
|
-
const deck = _global.deck || {};
|
|
411
|
+
const deck = globalThis.deck || {}; // Check if peer dependencies are included
|
|
414
412
|
|
|
415
|
-
// Check if peer dependencies are included
|
|
416
413
|
if (!deck.Layer) {
|
|
417
414
|
throw new Error('@deck.gl/core is not found');
|
|
418
415
|
}
|
|
419
416
|
|
|
420
417
|
module.exports = Object.assign(deck, ArcGISUtils);
|
|
421
418
|
|
|
422
|
-
|
|
423
419
|
/***/ }),
|
|
424
420
|
|
|
425
421
|
/***/ "./src/commons.js":
|
|
@@ -441,13 +437,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
441
437
|
/* eslint-disable no-invalid-this */
|
|
442
438
|
|
|
443
439
|
|
|
444
|
-
|
|
445
|
-
|
|
446
440
|
function initializeResources(gl) {
|
|
447
441
|
Object(_luma_gl_core__WEBPACK_IMPORTED_MODULE_1__["instrumentGLContext"])(gl);
|
|
448
|
-
|
|
449
442
|
this.buffer = new _luma_gl_core__WEBPACK_IMPORTED_MODULE_1__["Buffer"](gl, new Int8Array([-1, -1, 1, -1, -1, 1, 1, 1]));
|
|
450
|
-
|
|
451
443
|
this.model = new _luma_gl_core__WEBPACK_IMPORTED_MODULE_1__["Model"](gl, {
|
|
452
444
|
vs: `
|
|
453
445
|
attribute vec2 a_pos;
|
|
@@ -473,31 +465,26 @@ function initializeResources(gl) {
|
|
|
473
465
|
vertexCount: 4,
|
|
474
466
|
drawMode: gl.TRIANGLE_STRIP
|
|
475
467
|
});
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
468
|
+
this.deckFbo = new _luma_gl_core__WEBPACK_IMPORTED_MODULE_1__["Framebuffer"](gl, {
|
|
469
|
+
width: 1,
|
|
470
|
+
height: 1
|
|
471
|
+
});
|
|
479
472
|
this.deckInstance = new _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["Deck"]({
|
|
480
473
|
// The view state will be set dynamically to track the MapView current extent.
|
|
481
474
|
viewState: {},
|
|
482
|
-
|
|
483
475
|
// Input is handled by the ArcGIS API for JavaScript.
|
|
484
476
|
controller: false,
|
|
485
|
-
|
|
486
477
|
// We use the same WebGL context as the ArcGIS API for JavaScript.
|
|
487
478
|
gl,
|
|
488
|
-
|
|
489
479
|
// We need depth testing in general; we don't know what layers might be added to the deck.
|
|
490
480
|
parameters: {
|
|
491
481
|
depthTest: true
|
|
492
482
|
},
|
|
493
|
-
|
|
494
483
|
// This deck renders into an auxiliary framebuffer.
|
|
495
484
|
_framebuffer: this.deckFbo,
|
|
496
|
-
|
|
497
485
|
// To disable canvas resizing, since the FBO is owned by the ArcGIS API for JavaScript.
|
|
498
486
|
width: null,
|
|
499
487
|
height: null,
|
|
500
|
-
|
|
501
488
|
_customRender: redrawReason => {
|
|
502
489
|
if (redrawReason === 'arcgis') {
|
|
503
490
|
this.deckInstance._drawLayers(redrawReason);
|
|
@@ -507,46 +494,47 @@ function initializeResources(gl) {
|
|
|
507
494
|
}
|
|
508
495
|
});
|
|
509
496
|
}
|
|
510
|
-
|
|
511
|
-
|
|
497
|
+
function render({
|
|
498
|
+
gl,
|
|
499
|
+
width,
|
|
500
|
+
height,
|
|
501
|
+
viewState
|
|
502
|
+
}) {
|
|
512
503
|
const screenFbo = gl.getParameter(gl.FRAMEBUFFER_BINDING);
|
|
513
|
-
|
|
514
504
|
/* global window */
|
|
505
|
+
|
|
515
506
|
const dpr = window.devicePixelRatio;
|
|
516
507
|
width = Math.round(width * dpr);
|
|
517
508
|
height = Math.round(height * dpr);
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
(
|
|
535
|
-
|
|
536
|
-
}
|
|
537
|
-
);
|
|
509
|
+
this.deckFbo.resize({
|
|
510
|
+
width,
|
|
511
|
+
height
|
|
512
|
+
});
|
|
513
|
+
this.deckInstance.setProps({
|
|
514
|
+
viewState
|
|
515
|
+
}); // redraw deck immediately into deckFbo
|
|
516
|
+
|
|
517
|
+
this.deckInstance.redraw('arcgis'); // We overlay the texture on top of the map using the full-screen quad.
|
|
518
|
+
|
|
519
|
+
Object(_luma_gl_core__WEBPACK_IMPORTED_MODULE_1__["withParameters"])(gl, {
|
|
520
|
+
blend: true,
|
|
521
|
+
blendFunc: [gl.ONE, gl.ONE_MINUS_SRC_ALPHA],
|
|
522
|
+
framebuffer: screenFbo,
|
|
523
|
+
viewport: [0, 0, width, height]
|
|
524
|
+
}, () => {
|
|
525
|
+
this.model.setUniforms({
|
|
526
|
+
u_texture: this.deckFbo
|
|
527
|
+
}).draw();
|
|
528
|
+
});
|
|
538
529
|
}
|
|
539
|
-
|
|
540
530
|
function finalizeResources() {
|
|
541
531
|
this.deckInstance?.finalize();
|
|
542
532
|
this.deckInstance = null;
|
|
543
|
-
|
|
544
533
|
this.model?.delete();
|
|
545
534
|
this.buffer?.delete();
|
|
546
535
|
this.deckFbo?.delete();
|
|
547
536
|
}
|
|
548
537
|
|
|
549
|
-
|
|
550
538
|
/***/ }),
|
|
551
539
|
|
|
552
540
|
/***/ "./src/deck-layer-view-2d.js":
|
|
@@ -561,7 +549,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
561
549
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createDeckLayerView2D; });
|
|
562
550
|
/* harmony import */ var _commons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./commons */ "./src/commons.js");
|
|
563
551
|
|
|
564
|
-
|
|
565
552
|
function createDeckLayerView2D(BaseLayerViewGL2D) {
|
|
566
553
|
return BaseLayerViewGL2D.createSubclass({
|
|
567
554
|
properties: {
|
|
@@ -576,12 +563,10 @@ function createDeckLayerView2D(BaseLayerViewGL2D) {
|
|
|
576
563
|
// We use a full-screen quad and shaders to composite the frame rendered
|
|
577
564
|
// with deck.gl on top of the MapView. Composition uses the MapView context.
|
|
578
565
|
const gl = this.context;
|
|
579
|
-
_commons__WEBPACK_IMPORTED_MODULE_0__["initializeResources"].call(this, gl);
|
|
566
|
+
_commons__WEBPACK_IMPORTED_MODULE_0__["initializeResources"].call(this, gl); // Update deck props
|
|
580
567
|
|
|
581
|
-
//
|
|
582
|
-
this.layer.deck.on('change', props => this.deckInstance.setProps(props));
|
|
568
|
+
this.layer.deck.on('change', props => this.deckInstance.setProps(props)); // We need to start drawing the deck.gl layer immediately.
|
|
583
569
|
|
|
584
|
-
// We need to start drawing the deck.gl layer immediately.
|
|
585
570
|
this.deckInstance.setProps(this.layer.deck.toJSON());
|
|
586
571
|
},
|
|
587
572
|
|
|
@@ -596,10 +581,9 @@ function createDeckLayerView2D(BaseLayerViewGL2D) {
|
|
|
596
581
|
|
|
597
582
|
// Called every time that the layer view must be rendered.
|
|
598
583
|
render(renderParameters) {
|
|
599
|
-
const [width, height] = this.view.state.size;
|
|
600
|
-
// The view state must be kept in-sync with the MapView of the ArcGIS API.
|
|
601
|
-
const state = renderParameters.state;
|
|
584
|
+
const [width, height] = this.view.state.size; // The view state must be kept in-sync with the MapView of the ArcGIS API.
|
|
602
585
|
|
|
586
|
+
const state = renderParameters.state;
|
|
603
587
|
_commons__WEBPACK_IMPORTED_MODULE_0__["render"].call(this, {
|
|
604
588
|
gl: renderParameters.context,
|
|
605
589
|
width,
|
|
@@ -613,10 +597,10 @@ function createDeckLayerView2D(BaseLayerViewGL2D) {
|
|
|
613
597
|
}
|
|
614
598
|
});
|
|
615
599
|
}
|
|
600
|
+
|
|
616
601
|
});
|
|
617
602
|
}
|
|
618
603
|
|
|
619
|
-
|
|
620
604
|
/***/ }),
|
|
621
605
|
|
|
622
606
|
/***/ "./src/deck-layer.js":
|
|
@@ -651,19 +635,16 @@ function createDeckLayer(DeckProps, Layer, DeckLayerView2D) {
|
|
|
651
635
|
view,
|
|
652
636
|
layer: this
|
|
653
637
|
});
|
|
654
|
-
}
|
|
638
|
+
} // eslint-disable-next-line
|
|
655
639
|
|
|
656
|
-
// eslint-disable-next-line
|
|
657
|
-
console.error(
|
|
658
|
-
'DeckLayer does not support SceneView at the moment. Use DeckRenderer instead.'
|
|
659
|
-
);
|
|
660
640
|
|
|
641
|
+
console.error('DeckLayer does not support SceneView at the moment. Use DeckRenderer instead.');
|
|
661
642
|
return null;
|
|
662
643
|
}
|
|
644
|
+
|
|
663
645
|
});
|
|
664
646
|
}
|
|
665
647
|
|
|
666
|
-
|
|
667
648
|
/***/ }),
|
|
668
649
|
|
|
669
650
|
/***/ "./src/deck-props.js":
|
|
@@ -675,7 +656,7 @@ function createDeckLayer(DeckProps, Layer, DeckLayerView2D) {
|
|
|
675
656
|
|
|
676
657
|
"use strict";
|
|
677
658
|
__webpack_require__.r(__webpack_exports__);
|
|
678
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return
|
|
659
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createDeckProps; });
|
|
679
660
|
const properties = {
|
|
680
661
|
layers: {},
|
|
681
662
|
layerFilter: {},
|
|
@@ -695,27 +676,30 @@ const properties = {
|
|
|
695
676
|
getCursor: {},
|
|
696
677
|
getTooltip: {}
|
|
697
678
|
};
|
|
698
|
-
|
|
699
679
|
/* eslint-disable callback-return */
|
|
700
|
-
|
|
680
|
+
|
|
681
|
+
function createDeckProps(Accessor) {
|
|
701
682
|
const DeckProps = Accessor.createSubclass({
|
|
702
683
|
properties,
|
|
703
684
|
|
|
704
685
|
constructor() {
|
|
705
686
|
this._callbacks = {};
|
|
706
|
-
|
|
707
687
|
this.watch(Object.keys(properties), (newValue, oldValue, propName) => {
|
|
708
|
-
this.emit('change', {
|
|
688
|
+
this.emit('change', {
|
|
689
|
+
[propName]: newValue
|
|
690
|
+
});
|
|
709
691
|
});
|
|
710
692
|
},
|
|
711
693
|
|
|
712
694
|
on(eventName, cb) {
|
|
713
695
|
this._callbacks[eventName] = this._callbacks[eventName] || [];
|
|
696
|
+
|
|
714
697
|
this._callbacks[eventName].push(cb);
|
|
715
698
|
},
|
|
716
699
|
|
|
717
700
|
emit(eventName, details) {
|
|
718
701
|
const callbacks = this._callbacks[eventName];
|
|
702
|
+
|
|
719
703
|
if (callbacks) {
|
|
720
704
|
for (const cb of callbacks) {
|
|
721
705
|
cb(details);
|
|
@@ -725,19 +709,20 @@ function loadDeckProps(Accessor) {
|
|
|
725
709
|
|
|
726
710
|
toJSON() {
|
|
727
711
|
const result = {};
|
|
712
|
+
|
|
728
713
|
for (const key of this.keys()) {
|
|
729
714
|
if (this[key] !== undefined) {
|
|
730
715
|
result[key] = this[key];
|
|
731
716
|
}
|
|
732
717
|
}
|
|
718
|
+
|
|
733
719
|
return result;
|
|
734
720
|
}
|
|
735
|
-
});
|
|
736
721
|
|
|
722
|
+
});
|
|
737
723
|
return DeckProps;
|
|
738
724
|
}
|
|
739
725
|
|
|
740
|
-
|
|
741
726
|
/***/ }),
|
|
742
727
|
|
|
743
728
|
/***/ "./src/deck-renderer.js":
|
|
@@ -752,13 +737,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
752
737
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createDeckRenderer; });
|
|
753
738
|
/* harmony import */ var _commons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./commons */ "./src/commons.js");
|
|
754
739
|
/* eslint-disable no-invalid-this */
|
|
740
|
+
// ArcGIS fov is corner-to-corner
|
|
755
741
|
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
// ArcGIS fov is corner-to-corner
|
|
759
742
|
function arcgisFOVToDeckAltitude(fov, aspectRatio) {
|
|
760
743
|
const D = Math.sqrt(1 + aspectRatio ** 2);
|
|
761
|
-
const halfFOV =
|
|
744
|
+
const halfFOV = fov / 2 / 180 * Math.PI;
|
|
762
745
|
return D / 2 / Math.tan(halfFOV);
|
|
763
746
|
}
|
|
764
747
|
|
|
@@ -772,9 +755,7 @@ function createDeckRenderer(DeckProps, externalRenderers) {
|
|
|
772
755
|
setup(context) {
|
|
773
756
|
const gl = context.gl;
|
|
774
757
|
_commons__WEBPACK_IMPORTED_MODULE_0__["initializeResources"].call(this, gl);
|
|
775
|
-
|
|
776
758
|
this.deck.on('change', props => this.deckInstance.setProps(props));
|
|
777
|
-
|
|
778
759
|
this.deckInstance.setProps(this.deck.toJSON());
|
|
779
760
|
}
|
|
780
761
|
|
|
@@ -788,7 +769,6 @@ function createDeckRenderer(DeckProps, externalRenderers) {
|
|
|
788
769
|
|
|
789
770
|
render(context) {
|
|
790
771
|
const [width, height] = this.view.size;
|
|
791
|
-
|
|
792
772
|
_commons__WEBPACK_IMPORTED_MODULE_0__["render"].call(this, {
|
|
793
773
|
gl: context.gl,
|
|
794
774
|
width,
|
|
@@ -803,18 +783,18 @@ function createDeckRenderer(DeckProps, externalRenderers) {
|
|
|
803
783
|
}
|
|
804
784
|
});
|
|
805
785
|
}
|
|
786
|
+
|
|
806
787
|
}
|
|
807
788
|
|
|
808
789
|
return DeckRenderer;
|
|
809
790
|
}
|
|
810
791
|
|
|
811
|
-
|
|
812
792
|
/***/ }),
|
|
813
793
|
|
|
814
|
-
/***/ "./src/
|
|
815
|
-
|
|
816
|
-
!*** ./src/
|
|
817
|
-
|
|
794
|
+
/***/ "./src/load-modules.js":
|
|
795
|
+
/*!*****************************!*\
|
|
796
|
+
!*** ./src/load-modules.js ***!
|
|
797
|
+
\*****************************/
|
|
818
798
|
/*! exports provided: loadArcGISModules */
|
|
819
799
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
820
800
|
|
|
@@ -832,18 +812,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
832
812
|
|
|
833
813
|
|
|
834
814
|
|
|
835
|
-
|
|
836
815
|
let arcGIS = null;
|
|
837
|
-
|
|
838
816
|
async function loadArcGISModules(modules, loadScriptOptions) {
|
|
839
817
|
const namespace = Array.isArray(modules) ? null : modules;
|
|
840
818
|
await loadArcGISModule(namespace, loadScriptOptions);
|
|
841
819
|
|
|
842
820
|
if (Array.isArray(modules)) {
|
|
843
821
|
return Object(esri_loader__WEBPACK_IMPORTED_MODULE_4__["loadModules"])(modules, loadScriptOptions).then(array => {
|
|
844
|
-
return {...arcGIS,
|
|
822
|
+
return { ...arcGIS,
|
|
823
|
+
modules: array
|
|
824
|
+
};
|
|
845
825
|
});
|
|
846
826
|
}
|
|
827
|
+
|
|
847
828
|
return arcGIS;
|
|
848
829
|
}
|
|
849
830
|
|
|
@@ -852,6 +833,7 @@ function loadArcGISModule(esri, loadScriptOptions) {
|
|
|
852
833
|
// Already loaded
|
|
853
834
|
return arcGIS;
|
|
854
835
|
}
|
|
836
|
+
|
|
855
837
|
if (esri) {
|
|
856
838
|
// Using user-provided dependencies
|
|
857
839
|
// Right now this object has to be manually assembled - let @arcgis/webpack-plugin handle this?
|
|
@@ -859,19 +841,10 @@ function loadArcGISModule(esri, loadScriptOptions) {
|
|
|
859
841
|
const Accessor = esri.core.Accessor;
|
|
860
842
|
const BaseLayerViewGL2D = esri.views['2d'].layers.BaseLayerViewGL2D;
|
|
861
843
|
const externalRenderers = esri.views['3d'].externalRenderers;
|
|
862
|
-
|
|
863
844
|
return initialize(Layer, Accessor, BaseLayerViewGL2D, externalRenderers);
|
|
864
845
|
}
|
|
865
846
|
|
|
866
|
-
return Object(esri_loader__WEBPACK_IMPORTED_MODULE_4__["loadModules"])(
|
|
867
|
-
[
|
|
868
|
-
'esri/layers/Layer',
|
|
869
|
-
'esri/core/Accessor',
|
|
870
|
-
'esri/views/2d/layers/BaseLayerViewGL2D',
|
|
871
|
-
'esri/views/3d/externalRenderers'
|
|
872
|
-
],
|
|
873
|
-
loadScriptOptions
|
|
874
|
-
).then(([Layer, Accessor, BaseLayerViewGL2D, externalRenderers]) => {
|
|
847
|
+
return Object(esri_loader__WEBPACK_IMPORTED_MODULE_4__["loadModules"])(['esri/layers/Layer', 'esri/core/Accessor', 'esri/views/2d/layers/BaseLayerViewGL2D', 'esri/views/3d/externalRenderers'], loadScriptOptions).then(([Layer, Accessor, BaseLayerViewGL2D, externalRenderers]) => {
|
|
875
848
|
return initialize(Layer, Accessor, BaseLayerViewGL2D, externalRenderers);
|
|
876
849
|
});
|
|
877
850
|
}
|
|
@@ -881,12 +854,13 @@ function initialize(Layer, Accessor, BaseLayerViewGL2D, externalRenderers) {
|
|
|
881
854
|
const DeckLayerView2D = Object(_deck_layer_view_2d__WEBPACK_IMPORTED_MODULE_2__["default"])(BaseLayerViewGL2D);
|
|
882
855
|
const DeckLayer = Object(_deck_layer__WEBPACK_IMPORTED_MODULE_1__["default"])(DeckProps, Layer, DeckLayerView2D);
|
|
883
856
|
const DeckRenderer = Object(_deck_renderer__WEBPACK_IMPORTED_MODULE_3__["default"])(DeckProps, externalRenderers);
|
|
884
|
-
|
|
885
|
-
|
|
857
|
+
arcGIS = {
|
|
858
|
+
DeckLayer,
|
|
859
|
+
DeckRenderer
|
|
860
|
+
};
|
|
886
861
|
return arcGIS;
|
|
887
862
|
}
|
|
888
863
|
|
|
889
|
-
|
|
890
864
|
/***/ }),
|
|
891
865
|
|
|
892
866
|
/***/ "@deck.gl/core":
|
package/dist/es5/commons.js
CHANGED
|
@@ -12,6 +12,8 @@ var _core = require("@deck.gl/core");
|
|
|
12
12
|
var _core2 = require("@luma.gl/core");
|
|
13
13
|
|
|
14
14
|
function initializeResources(gl) {
|
|
15
|
+
var _this = this;
|
|
16
|
+
|
|
15
17
|
(0, _core2.instrumentGLContext)(gl);
|
|
16
18
|
this.buffer = new _core2.Buffer(gl, new Int8Array([-1, -1, 1, -1, -1, 1, 1, 1]));
|
|
17
19
|
this.model = new _core2.Model(gl, {
|
|
@@ -30,39 +32,40 @@ function initializeResources(gl) {
|
|
|
30
32
|
this.deckInstance = new _core.Deck({
|
|
31
33
|
viewState: {},
|
|
32
34
|
controller: false,
|
|
33
|
-
gl,
|
|
35
|
+
gl: gl,
|
|
34
36
|
parameters: {
|
|
35
37
|
depthTest: true
|
|
36
38
|
},
|
|
37
39
|
_framebuffer: this.deckFbo,
|
|
38
40
|
width: null,
|
|
39
41
|
height: null,
|
|
40
|
-
_customRender: redrawReason
|
|
42
|
+
_customRender: function _customRender(redrawReason) {
|
|
41
43
|
if (redrawReason === 'arcgis') {
|
|
42
|
-
|
|
44
|
+
_this.deckInstance._drawLayers(redrawReason);
|
|
43
45
|
} else {
|
|
44
|
-
|
|
46
|
+
_this.redraw();
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
});
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
function render({
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
function render(_ref) {
|
|
53
|
+
var _this2 = this;
|
|
54
|
+
|
|
55
|
+
var gl = _ref.gl,
|
|
56
|
+
width = _ref.width,
|
|
57
|
+
height = _ref.height,
|
|
58
|
+
viewState = _ref.viewState;
|
|
59
|
+
var screenFbo = gl.getParameter(36006);
|
|
60
|
+
var dpr = window.devicePixelRatio;
|
|
58
61
|
width = Math.round(width * dpr);
|
|
59
62
|
height = Math.round(height * dpr);
|
|
60
63
|
this.deckFbo.resize({
|
|
61
|
-
width,
|
|
62
|
-
height
|
|
64
|
+
width: width,
|
|
65
|
+
height: height
|
|
63
66
|
});
|
|
64
67
|
this.deckInstance.setProps({
|
|
65
|
-
viewState
|
|
68
|
+
viewState: viewState
|
|
66
69
|
});
|
|
67
70
|
this.deckInstance.redraw('arcgis');
|
|
68
71
|
(0, _core2.withParameters)(gl, {
|
|
@@ -70,9 +73,9 @@ function render({
|
|
|
70
73
|
blendFunc: [1, 771],
|
|
71
74
|
framebuffer: screenFbo,
|
|
72
75
|
viewport: [0, 0, width, height]
|
|
73
|
-
}, ()
|
|
74
|
-
|
|
75
|
-
u_texture:
|
|
76
|
+
}, function () {
|
|
77
|
+
_this2.model.setUniforms({
|
|
78
|
+
u_texture: _this2.deckFbo
|
|
76
79
|
}).draw();
|
|
77
80
|
});
|
|
78
81
|
}
|
package/dist/es5/commons.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commons.js"],"names":["initializeResources","gl","buffer","Buffer","Int8Array","model","Model","vs","fs","attributes","a_pos","vertexCount","drawMode","deckFbo","Framebuffer","width","height","deckInstance","Deck","viewState","controller","parameters","depthTest","_framebuffer","_customRender","redrawReason","_drawLayers","redraw","render","screenFbo","getParameter","dpr","window","devicePixelRatio","Math","round","resize","setProps","blend","blendFunc","framebuffer","viewport","setUniforms","u_texture","draw","finalizeResources","finalize","delete"],"mappings":";;;;;;;;;AAEA;;AACA;;AAEO,SAASA,mBAAT,CAA6BC,EAA7B,EAAiC;AACtC,kCAAoBA,EAApB;AAEA,OAAKC,MAAL,GAAc,IAAIC,aAAJ,CAAWF,EAAX,EAAe,IAAIG,SAAJ,CAAc,CAAC,CAAC,CAAF,EAAK,CAAC,CAAN,EAAS,CAAT,EAAY,CAAC,CAAb,EAAgB,CAAC,CAAjB,EAAoB,CAApB,EAAuB,CAAvB,EAA0B,CAA1B,CAAd,CAAf,CAAd;AAEA,OAAKC,KAAL,GAAa,IAAIC,YAAJ,CAAUL,EAAV,EAAc;AACzBM,IAAAA,EAAE,sMADuB;AASzBC,IAAAA,EAAE,wQATuB;AAmBzBC,IAAAA,UAAU,EAAE;AACVC,MAAAA,KAAK,EAAE,KAAKR;AADF,KAnBa;AAsBzBS,IAAAA,WAAW,EAAE,CAtBY;AAuBzBC,IAAAA,QAAQ;AAvBiB,GAAd,CAAb;AA0BA,OAAKC,OAAL,GAAe,IAAIC,kBAAJ,CAAgBb,EAAhB,EAAoB;AAACc,IAAAA,KAAK,EAAE,CAAR;AAAWC,IAAAA,MAAM,EAAE;AAAnB,GAApB,CAAf;AAEA,OAAKC,YAAL,GAAoB,IAAIC,UAAJ,CAAS;AAE3BC,IAAAA,SAAS,EAAE,EAFgB;AAK3BC,IAAAA,UAAU,EAAE,KALe;AAQ3BnB,IAAAA,EAR2B;AAW3BoB,IAAAA,UAAU,EAAE;AACVC,MAAAA,SAAS,EAAE;AADD,KAXe;AAgB3BC,IAAAA,YAAY,EAAE,KAAKV,OAhBQ;AAmB3BE,IAAAA,KAAK,EAAE,IAnBoB;AAoB3BC,IAAAA,MAAM,EAAE,IApBmB;AAsB3BQ,IAAAA,aAAa,
|
|
1
|
+
{"version":3,"sources":["../../src/commons.js"],"names":["initializeResources","gl","buffer","Buffer","Int8Array","model","Model","vs","fs","attributes","a_pos","vertexCount","drawMode","deckFbo","Framebuffer","width","height","deckInstance","Deck","viewState","controller","parameters","depthTest","_framebuffer","_customRender","redrawReason","_drawLayers","redraw","render","screenFbo","getParameter","dpr","window","devicePixelRatio","Math","round","resize","setProps","blend","blendFunc","framebuffer","viewport","setUniforms","u_texture","draw","finalizeResources","finalize","delete"],"mappings":"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","sourcesContent":["/* eslint-disable no-invalid-this */\n\nimport {Deck} from '@deck.gl/core';\nimport {Model, Buffer, Framebuffer, instrumentGLContext, withParameters} from '@luma.gl/core';\n\nexport function initializeResources(gl) {\n instrumentGLContext(gl);\n\n this.buffer = new Buffer(gl, new Int8Array([-1, -1, 1, -1, -1, 1, 1, 1]));\n\n this.model = new Model(gl, {\n vs: `\n attribute vec2 a_pos;\n varying vec2 v_texcoord;\n void main(void) {\n gl_Position = vec4(a_pos, 0.0, 1.0);\n v_texcoord = (a_pos + 1.0) / 2.0;\n }\n `,\n fs: `\n precision mediump float;\n uniform sampler2D u_texture;\n varying vec2 v_texcoord;\n void main(void) {\n vec4 rgba = texture2D(u_texture, v_texcoord);\n rgba.rgb *= rgba.a;\n gl_FragColor = rgba;\n }\n `,\n attributes: {\n a_pos: this.buffer\n },\n vertexCount: 4,\n drawMode: gl.TRIANGLE_STRIP\n });\n\n this.deckFbo = new Framebuffer(gl, {width: 1, height: 1});\n\n this.deckInstance = new Deck({\n // The view state will be set dynamically to track the MapView current extent.\n viewState: {},\n\n // Input is handled by the ArcGIS API for JavaScript.\n controller: false,\n\n // We use the same WebGL context as the ArcGIS API for JavaScript.\n gl,\n\n // We need depth testing in general; we don't know what layers might be added to the deck.\n parameters: {\n depthTest: true\n },\n\n // This deck renders into an auxiliary framebuffer.\n _framebuffer: this.deckFbo,\n\n // To disable canvas resizing, since the FBO is owned by the ArcGIS API for JavaScript.\n width: null,\n height: null,\n\n _customRender: redrawReason => {\n if (redrawReason === 'arcgis') {\n this.deckInstance._drawLayers(redrawReason);\n } else {\n this.redraw();\n }\n }\n });\n}\n\nexport function render({gl, width, height, viewState}) {\n const screenFbo = gl.getParameter(gl.FRAMEBUFFER_BINDING);\n\n /* global window */\n const dpr = window.devicePixelRatio;\n width = Math.round(width * dpr);\n height = Math.round(height * dpr);\n\n this.deckFbo.resize({width, height});\n\n this.deckInstance.setProps({viewState});\n // redraw deck immediately into deckFbo\n this.deckInstance.redraw('arcgis');\n\n // We overlay the texture on top of the map using the full-screen quad.\n withParameters(\n gl,\n {\n blend: true,\n blendFunc: [gl.ONE, gl.ONE_MINUS_SRC_ALPHA],\n framebuffer: screenFbo,\n viewport: [0, 0, width, height]\n },\n () => {\n this.model.setUniforms({u_texture: this.deckFbo}).draw();\n }\n );\n}\n\nexport function finalizeResources() {\n this.deckInstance?.finalize();\n this.deckInstance = null;\n\n this.model?.delete();\n this.buffer?.delete();\n this.deckFbo?.delete();\n}\n"],"file":"commons.js"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.default = createDeckLayerView2D;
|
|
7
9
|
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
|
|
8
12
|
var _commons = require("./commons");
|
|
9
13
|
|
|
10
14
|
function createDeckLayerView2D(BaseLayerViewGL2D) {
|
|
@@ -15,32 +19,35 @@ function createDeckLayerView2D(BaseLayerViewGL2D) {
|
|
|
15
19
|
model: {},
|
|
16
20
|
buffer: {}
|
|
17
21
|
},
|
|
22
|
+
attach: function attach() {
|
|
23
|
+
var _this = this;
|
|
18
24
|
|
|
19
|
-
|
|
20
|
-
const gl = this.context;
|
|
25
|
+
var gl = this.context;
|
|
21
26
|
|
|
22
27
|
_commons.initializeResources.call(this, gl);
|
|
23
28
|
|
|
24
|
-
this.layer.deck.on('change',
|
|
29
|
+
this.layer.deck.on('change', function (props) {
|
|
30
|
+
return _this.deckInstance.setProps(props);
|
|
31
|
+
});
|
|
25
32
|
this.deckInstance.setProps(this.layer.deck.toJSON());
|
|
26
33
|
},
|
|
27
|
-
|
|
28
|
-
redraw() {
|
|
34
|
+
redraw: function redraw() {
|
|
29
35
|
this.requestRender();
|
|
30
36
|
},
|
|
31
|
-
|
|
32
|
-
detach() {
|
|
37
|
+
detach: function detach() {
|
|
33
38
|
_commons.finalizeResources.call(this);
|
|
34
39
|
},
|
|
40
|
+
render: function render(renderParameters) {
|
|
41
|
+
var _this$view$state$size = (0, _slicedToArray2.default)(this.view.state.size, 2),
|
|
42
|
+
width = _this$view$state$size[0],
|
|
43
|
+
height = _this$view$state$size[1];
|
|
35
44
|
|
|
36
|
-
|
|
37
|
-
const [width, height] = this.view.state.size;
|
|
38
|
-
const state = renderParameters.state;
|
|
45
|
+
var state = renderParameters.state;
|
|
39
46
|
|
|
40
47
|
_commons.render.call(this, {
|
|
41
48
|
gl: renderParameters.context,
|
|
42
|
-
width,
|
|
43
|
-
height,
|
|
49
|
+
width: width,
|
|
50
|
+
height: height,
|
|
44
51
|
viewState: {
|
|
45
52
|
latitude: this.view.center.latitude,
|
|
46
53
|
longitude: this.view.center.longitude,
|
|
@@ -50,7 +57,6 @@ function createDeckLayerView2D(BaseLayerViewGL2D) {
|
|
|
50
57
|
}
|
|
51
58
|
});
|
|
52
59
|
}
|
|
53
|
-
|
|
54
60
|
});
|
|
55
61
|
}
|
|
56
62
|
//# sourceMappingURL=deck-layer-view-2d.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/deck-layer-view-2d.js"],"names":["createDeckLayerView2D","BaseLayerViewGL2D","createSubclass","properties","deckgl","deckFbo","model","buffer","attach","gl","context","initializeResources","call","layer","deck","on","props","deckInstance","setProps","toJSON","redraw","requestRender","detach","finalizeResources","render","renderParameters","
|
|
1
|
+
{"version":3,"sources":["../../src/deck-layer-view-2d.js"],"names":["createDeckLayerView2D","BaseLayerViewGL2D","createSubclass","properties","deckgl","deckFbo","model","buffer","attach","gl","context","initializeResources","call","layer","deck","on","props","deckInstance","setProps","toJSON","redraw","requestRender","detach","finalizeResources","render","renderParameters","view","state","size","width","height","viewState","latitude","center","longitude","zoom","featuresTilingScheme","scaleToLevel","scale","bearing","rotation","pitch"],"mappings":";;;;;;;;;;;AAAA;;AAEe,SAASA,qBAAT,CAA+BC,iBAA/B,EAAkD;AAC/D,SAAOA,iBAAiB,CAACC,cAAlB,CAAiC;AACtCC,IAAAA,UAAU,EAAE;AACVC,MAAAA,MAAM,EAAE,EADE;AAEVC,MAAAA,OAAO,EAAE,EAFC;AAGVC,MAAAA,KAAK,EAAE,EAHG;AAIVC,MAAAA,MAAM,EAAE;AAJE,KAD0B;AAStCC,IAAAA,MATsC,oBAS7B;AAAA;;AAGP,UAAMC,EAAE,GAAG,KAAKC,OAAhB;;AACAC,mCAAoBC,IAApB,CAAyB,IAAzB,EAA+BH,EAA/B;;AAGA,WAAKI,KAAL,CAAWC,IAAX,CAAgBC,EAAhB,CAAmB,QAAnB,EAA6B,UAAAC,KAAK;AAAA,eAAI,KAAI,CAACC,YAAL,CAAkBC,QAAlB,CAA2BF,KAA3B,CAAJ;AAAA,OAAlC;AAGA,WAAKC,YAAL,CAAkBC,QAAlB,CAA2B,KAAKL,KAAL,CAAWC,IAAX,CAAgBK,MAAhB,EAA3B;AACD,KApBqC;AAsBtCC,IAAAA,MAtBsC,oBAsB7B;AACP,WAAKC,aAAL;AACD,KAxBqC;AA2BtCC,IAAAA,MA3BsC,oBA2B7B;AACPC,iCAAkBX,IAAlB,CAAuB,IAAvB;AACD,KA7BqC;AAgCtCY,IAAAA,MAhCsC,kBAgC/BC,gBAhC+B,EAgCb;AACvB,+DAAwB,KAAKC,IAAL,CAAUC,KAAV,CAAgBC,IAAxC;AAAA,UAAOC,KAAP;AAAA,UAAcC,MAAd;;AAEA,UAAMH,KAAK,GAAGF,gBAAgB,CAACE,KAA/B;;AAEAH,sBAAOZ,IAAP,CAAY,IAAZ,EAAkB;AAChBH,QAAAA,EAAE,EAAEgB,gBAAgB,CAACf,OADL;AAEhBmB,QAAAA,KAAK,EAALA,KAFgB;AAGhBC,QAAAA,MAAM,EAANA,MAHgB;AAIhBC,QAAAA,SAAS,EAAE;AACTC,UAAAA,QAAQ,EAAE,KAAKN,IAAL,CAAUO,MAAV,CAAiBD,QADlB;AAETE,UAAAA,SAAS,EAAE,KAAKR,IAAL,CAAUO,MAAV,CAAiBC,SAFnB;AAGTC,UAAAA,IAAI,EAAE,KAAKT,IAAL,CAAUU,oBAAV,CAA+BC,YAA/B,CAA4CV,KAAK,CAACW,KAAlD,CAHG;AAITC,UAAAA,OAAO,EAAE,CAACZ,KAAK,CAACa,QAJP;AAKTC,UAAAA,KAAK,EAAE;AALE;AAJK,OAAlB;AAYD;AAjDqC,GAAjC,CAAP;AAmDD","sourcesContent":["import {initializeResources, render, finalizeResources} from './commons';\n\nexport default function createDeckLayerView2D(BaseLayerViewGL2D) {\n return BaseLayerViewGL2D.createSubclass({\n properties: {\n deckgl: {},\n deckFbo: {},\n model: {},\n buffer: {}\n },\n\n // Attach is called as soon as the layer view is ready to start rendering.\n attach() {\n // We use a full-screen quad and shaders to composite the frame rendered\n // with deck.gl on top of the MapView. Composition uses the MapView context.\n const gl = this.context;\n initializeResources.call(this, gl);\n\n // Update deck props\n this.layer.deck.on('change', props => this.deckInstance.setProps(props));\n\n // We need to start drawing the deck.gl layer immediately.\n this.deckInstance.setProps(this.layer.deck.toJSON());\n },\n\n redraw() {\n this.requestRender();\n },\n\n // Called when the layer must be destroyed.\n detach() {\n finalizeResources.call(this);\n },\n\n // Called every time that the layer view must be rendered.\n render(renderParameters) {\n const [width, height] = this.view.state.size;\n // The view state must be kept in-sync with the MapView of the ArcGIS API.\n const state = renderParameters.state;\n\n render.call(this, {\n gl: renderParameters.context,\n width,\n height,\n viewState: {\n latitude: this.view.center.latitude,\n longitude: this.view.center.longitude,\n zoom: this.view.featuresTilingScheme.scaleToLevel(state.scale),\n bearing: -state.rotation,\n pitch: 0\n }\n });\n }\n });\n}\n"],"file":"deck-layer-view-2d.js"}
|