EchartsGL

GeoGlobe.Visuals. EchartsGL

基于EchartsGL的可视化图层。

Constructor

new EchartsGL()

Author:
  • liuck
Example
//构造地图对象
 var map = new GeoGlobe.Map({
    style: Cfg.style,
    container: 'map',
    zoom: 2,
    bearing: 0,
	pitch: 40,
    units: "degrees",
    center: [24.114129, 22.550339]
});
 //构造EchartsGL可视化图层
 var echartsgl = new GeoGlobe.Visuals.EchartsGL({
	visualMap: {
	    show: true,
	    max: 1000,
	    calculable: true,
	    realtime: false,
	    inRange: {
	        color: ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf', '#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026']
	    },
	    outOfRange: {
	        colorAlpha: 0
	    }
	},
	mapbox3D: {
        boxHeight: 50,
        altitudeScale: 1,
        postEffect: {
            enable: true,
            screenSpaceAmbientOcclusion: {
                enable: true,
                radius: 2
            }
        },
        light: {
            main: {
                intensity: 2,
                shadow: true,
                shadowQuality: 'high'
            },
            ambient: {
                intensity: 0.
            },
            ambientCubemap: {
                texture: '../../data/canyon.hdr',
                exposure: 2,
                diffuseIntensity: 0.5
            }
        }
    }
});
 //绑定鼠标点击事件
 echartsgl.on('overlayerclick', function(e){
	console.info(e);
});
 //绑定鼠标移动事件
 echartsgl.on('overlayerhover', function(e){
	console.info(e);
})
 //添加到地图中
 echartsgl.addTo(map);
 //绘制
 echartsgl.render();

Classes

BarLayer
LinesLayer
MapLayer
ScatterLayer

Members

container :Object

map的容器
Type:
  • Object

layers :Array

图层容器
Type:
  • Array

map :GeoGlobe.Map

Default Value:
  • null
地图对象
Type:

mapbox3D

Properties:
Type Description
Object 参见echarts配置项,http://echarts.baidu.com/option-gl.html#mapbox3D
光照和特效等渲染参数
Example
{
         boxHeight: 10,
         boxWidth:100,
         altitudeScale: 2,
         shading: 'realistic'
         postEffect: {
             enable: true,
             screenSpaceAmbientOcclusion: {
                 enable: true,
                 radius: 2
             }
         },
         light: {
             main: {
                 intensity: 2,
                 shadow: true,
                 shadowQuality: 'high'
             },
             ambient: {
                 intensity: 0.
             },
             ambientCubemap: {
                 texture: 'asset/canyon.hdr',
                 exposure: 2,
                 diffuseIntensity: 0.5
             }
         }
     }

type :String

Default Value:
  • 'echartsgl'
可视化图层类别
Type:
  • String

visualMap

Properties:
Type Description
Object 参见echarts配置项,http://echarts.baidu.com/option.html#visualMap
是视觉映射组件,用于进行『视觉编码』,也就是将数据映射到视觉元素(视觉通道)。
Example
{
	    	show: true,
	        max: 1000,
	        calculable: true,
	        realtime: false,
	        inRange: {
	            color: ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf', '#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026']
	        },
	        outOfRange: {
	            colorAlpha: 0
	        }
    	}

Methods

addLayer(layer)

向EchartsGLjs可视化图层中添加子图层
Parameters:
Name Type Description
layer Object EchartsGL命名空间下的子图层对象

addTo(map)

与gl地图对象关联
Parameters:
Name Type Description
map Object gl地图对象

clear(销毁回调)

清空画布内容,用于重绘时
Parameters:
Name Type Description
销毁回调 callback

getLayer(id)

获取指定id图层
Parameters:
Name Type Description
id string 图层id.
Returns:
Layer

moveLayer(id, before)

移动图层
Parameters:
Name Type Description
id String 要移动的图层的ID
before String 之前插入新图层的现有图层的ID。如果省略此参数,则新图层将移动到最上层

remove()

移除图层容器

removeLayer(id)

移除图层
Parameters:
Name Type Description
id string 图层id

render()

绘制图层,包含子图层