arcgis 在官网有个可以和webgl 结合的案例 https://developers.arcgis.com/javascript/latest/sample-code/custom-gl-visuals/ 具体做法使用webgl 制作一个自己的customLayer图层。
最近deck.gl 比较火,本质deck.gl 是基于luma.gl 来构建的可是三维组件,那么通过luma.gl 也可以做开发。今天来分享这个用luma.gl 来做。
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no"/>
<title>luma.gl 结合</title>
<script src="https://cdn.bootcdn.net/ajax/libs/gl-matrix/2.8.1/gl-matrix.js"></script>
<script src="https://unpkg.com/deck.gl@8.1.0/dist.min.js"></script>
<link rel="stylesheet" href="https://js.arcgis.com/4.19/esri/themes/light/main.css" />
<script src="https://js.arcgis.com/4.19/"></script>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<script>
require([
"esri/WebMap",
"esri/Map",
"esri/core/watchUtils",
"esri/core/promiseUtils",
"esri/geometry/support/webMercatorUtils",
"esri/layers/GraphicsLayer",
"esri/views/MapView",
"esri/views/2d/layers/BaseLayerViewGL2D"
], function(
WebMap,
Map,
watchUtils,
promiseUtils,
webMercatorUtils,
GraphicsLayer,
MapView,
BaseLayerViewGL2D
) {
let CustomLayerView2D = BaseLayerViewGL2D.createSubclass({
constructor: function() {
this.transform = mat3.create();
this.rotation = mat3.create();
this.display = mat3.create();
this.screenTranslation = vec2.create();
this.translationToCenter = vec2.create();
this.needsUpdate = false;
更多信息参考小专栏 https://xiaozhuanlan.com/topic/1726308549