Custom

GeoGlobe.Visuals. Custom

可视化定制图层

Constructor

new Custom()

Author:
  • kz
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

container :Object

map的容器
Type:
  • Object

layers :Array

图层集合
Type:
  • Array

map :GeoGlobe.Map

Default Value:
  • null
地图对象
Type:

type :String

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

Methods

addLayer(layer)

向可视化图层中添加子图层
Parameters:
Name Type Description
layer Object 子图层对象

addTo(map)

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

getBounds(paddingopt) → {Array}

获取地图边界
Parameters:
Name Type Attributes Description
padding Number <optional>
外边框
Returns:
bounds 边界
Type
Array

getLayer(id) → {Object}

获取指定id图层
Parameters:
Name Type Description
id String 图层id
Returns:
layer 图层对象
Type
Object

moveLayer(id, before)

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

remove()

移除图层容器

removeLayer(id)

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

render()

绘制图层