new EchartsGL()
- Source:
- View2D/Visuals/EchartsGL.js
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
Members
-
container :Object
-
map的容器
Type:
- Object
- Source:
- View2D/Visuals/EchartsGL.js
-
layers :Array
-
图层容器
Type:
- Array
- Source:
- View2D/Visuals/EchartsGL.js
-
map :GeoGlobe.Map
-
地图对象
Type:
- Default Value:
-
- null
- Source:
- View2D/Visuals/EchartsGL.js
-
mapbox3D
-
光照和特效等渲染参数
- Source:
- View2D/Visuals/EchartsGL.js
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
-
可视化图层类别
Type:
- String
- Default Value:
-
- 'echartsgl'
- Source:
- View2D/Visuals/EchartsGL.js
-
visualMap
-
是视觉映射组件,用于进行『视觉编码』,也就是将数据映射到视觉元素(视觉通道)。
- Source:
- View2D/Visuals/EchartsGL.js
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 layerObject EchartsGL命名空间下的子图层对象 - Source:
- View2D/Visuals/EchartsGL.js
-
addTo(map)
-
与gl地图对象关联
Parameters:
Name Type Description mapObject gl地图对象 - Source:
- View2D/Visuals/EchartsGL.js
-
clear()
-
清空画布内容,用于重绘时
- Source:
- View2D/Visuals/EchartsGL.js
-
getLayer(id)
-
获取指定id图层
Parameters:
Name Type Description idstring 图层id. - Source:
- View2D/Visuals/EchartsGL.js
Returns:
Layer -
moveLayer(id, before)
-
移动图层
Parameters:
Name Type Description idString 要移动的图层的ID beforeString 之前插入新图层的现有图层的ID。如果省略此参数,则新图层将移动到最上层 - Source:
- View2D/Visuals/EchartsGL.js
-
remove()
-
移除图层容器
- Source:
- View2D/Visuals/EchartsGL.js
-
removeLayer(id)
-
移除图层
Parameters:
Name Type Description idstring 图层id - Source:
- View2D/Visuals/EchartsGL.js
-
render()
-
绘制图层,包含子图层
- Source:
- View2D/Visuals/EchartsGL.js