美文网首页
cesium 实现卷帘

cesium 实现卷帘

作者: haibalai | 来源:发表于2022-08-11 15:24 被阅读0次

这里需要ImageryLayer 定义

参考 cesium 图层那些事

```javascript

/**

卷帘效果

*/

import {ImageryLayer} from "./ImageryLayer";

export class ShutterEffect {

private map: any;

private _wrapper: any;

private _splitter: any;

private _splitterWidthCenter: any;

private _moveActive: boolean = false;

private _handler: any = null;

private _leftImageryLayer :ImageryLayer|null = null;

private _rightImageryLayer :ImageryLayer|null = null;

constructor(map: any) {

this.map = map;

this.moveHandler = this.moveHandler.bind(this);

}

start(left:ImageryLayer|null,right?:ImageryLayer|null,splitPosition = 0.5) {

this.stop();

if(this._wrapper || this._handler){

return;

}

if(left){

this._leftImageryLayer = left;

left.splitDirection(Cesium.ImagerySplitDirection.LEFT);

}

if(right){

this._rightImageryLayer = right;

right.splitDirection(Cesium.ImagerySplitDirection.RIGHT);

}

this.createDom(splitPosition);

}

stop() {

if (this._handler) {

this._handler.destroy();

this._handler = null;

}

if(this._wrapper){

this.map.container.removeChild(this._wrapper);

this._wrapper = null;

}

if(this._leftImageryLayer){

this._leftImageryLayer.removeByMap();

}

if(this._rightImageryLayer){

this._rightImageryLayer.removeByMap();

}

 更多参考 

相关文章

  • Cesium卷帘

    cesium实现卷帘效果比较简单,在官网也提供了相应的例子[https://sandcastle.cesium.c...

  • Cesium卷帘对比(含源代码)

    Cesium卷帘对比分析实现,也经常应用在项目中,现阐述如下。 1.定义viewer并加载高德地图作为底图 var...

  • cesium流动材质应用特效

    采用vue+cesium实现 引入js部分 importCesiumfrom"cesium/Cesium"; ex...

  • Cesium(七)热力图

    一、下载cesium-heatmap.js在Cesium中实现热力图需要cesium-heatmap.js,可以使...

  • WebGL地震波

    在Cesium中实现地震波效果

  • mapboxGL卷帘实现

    概述 卷帘对比是webgis中常见的一种对比方式,本文讲述一下如何在mapboxGL中实现卷帘对比。 效果 实现思...

  • Cesium加载三维地形及WMS地图,并实现动态控制显示

    写在前面:本次工程主要实现的是cesium基础三维地形加载、视角控制、经纬度显示;重点是实现cesium加载wms...

  • 2020-12-04

    osbg倾斜文件转3DTiles文件通过Cesium实现3D地图 流程:安装Node.js,安装Cesium环境,...

  • 快速搭建Cesium离线应用

    Cesium是一个用于构建GIS应用的Javascript开源库,本节将实现基于Cesium快速搭建离线的GIS应...

  • Cesium飞线

    在学习Cesium过程中,发现Cesium的Material可以自定义自己所需的材质,看到网上其他资源有实现城市飞...

网友评论

      本文标题:cesium 实现卷帘

      本文链接:https://www.haomeiwen.com/subject/cyaxgrtx.html