Class: Custom

.Visuals. Custom

可视化定制图层

new Custom()

Author:
  • kz
Source:
View2D/Visuals/Custom.js
Example
//构造地图对象
 var map = new GeoGlobe.Map({
    style: Cfg.style,
    container: 'map',
    zoom: 16,
    bearing: 0,
	pitch: 0,
    units: "degrees",
    center: [114.20509630753577, 30.776055193053764]
 });
 //构造可视化定制图层
 var custom = new GeoGlobe.Visuals.Custom();
 //添加到地图中
 custom.addTo(map);
 //绑定鼠标点击事件
 custom.on('overlayerclick', function(e){
	console.info(e);
 });
 //绑定鼠标移动事件
 custom.on('overlayerhover', function(e){
	console.info(e);
 });
 //构造气泡图层
 var bubble = new GeoGlobe.Visuals.Custom.Bubble({
    id: "bubble_1",
    visibility: true,
    dragdrawing: true,
    data: [{"type": "Feature", "properties": {name: "湖北省", value: 666}, "geometry": {"type": "Point", "coordinates": [112.26577320468478, 30.98857642486671]}}],
    rendererOptions: {
        markPoint: {
            hoverable: true,
            clickable: true,
            symbol: "bubble",
            itemStyle: {
                color: 'rgba(255,0,0,0.7)'
            }
        }
    }
 });
 //添加到可视化定制图层
 bubble.addTo(custom);
 //绘制
 custom.render();

Classes

Bubble
Cluster
Commute
Delaunay
Fluorescence
Kriging
Migration
Network
Proportion
Scatter
Voronoi
Wind

Members


_order :Array

图层id集合
Type:
  • Array
Source:
View2D/Visuals/Custom.js

container :Object

map的容器
Type:
  • Object
Source:
View2D/Visuals/Custom.js

layers :Array

图层集合
Type:
  • Array
Source:
View2D/Visuals/Custom.js

map :GeoGlobe.Map

地图对象
Type:
Default Value:
  • null
Source:
View2D/Visuals/Custom.js

type :String

可视化图层类别
Type:
  • String
Default Value:
  • 'custom'
Source:
View2D/Visuals/Custom.js

Methods


addLayer(layer)

向可视化图层中添加子图层
Parameters:
Name Type Description
layer Object 子图层对象
Source:
View2D/Visuals/Custom.js

addTo(map)

与地图对象关联
Parameters:
Name Type Description
map Object 地图对象
Source:
View2D/Visuals/Custom.js

getBounds( [padding])

获取地图边界
Parameters:
Name Type Argument Description
padding Number <optional>
外边框
Source:
View2D/Visuals/Custom.js
Returns:
bounds 边界
Type
Array

getLayer(id)

获取指定id图层
Parameters:
Name Type Description
id String 图层id
Source:
View2D/Visuals/Custom.js
Returns:
layer 图层对象
Type
Object

moveLayer(id, before)

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

remove()

移除图层容器
Source:
View2D/Visuals/Custom.js

removeLayer(id)

移除图层
Parameters:
Name Type Description
id String 图层id
Source:
View2D/Visuals/Custom.js

render()

绘制图层
Source:
View2D/Visuals/Custom.js