Constructor
new MapV()
Example
//构造地图对象
var map = new GeoGlobe.Map({
style: Cfg.style,
container: 'map',
zoom: 16,
bearing: 0,
pitch: 0,
units: "degrees",
center: [114.20509630753577, 30.776055193053764]
});
//构造MapV可视化图层
var mapV = new GeoGlobe.Visuals.MapV();
//添加到地图中
mapV.addTo(map);
//绑定鼠标点击事件
mapV.on('overlayerclick', function(e){
console.info(e);
});
//绑定鼠标移动事件
mapV.on('overlayerhover', function(e){
console.info(e);
});
//构造简单图层
var simple = new GeoGlobe.Visuals.MapV.Simple({
id: 'simple_1',
visibility: true,
dragdrawing: true,
data: [{
"type": "Feature",
"properties": {count:5.516636266964161,time:16.231042218116176},
"geometry": {
"type": "Point",
"coordinates": [123.3192464663197, 43.91886355937628]
}
}],
rendererOptions: {
fillStyle: 'rgba(55, 50, 250, 0.2)',
globalCompositeOperation: "lighter",
size: 15,
animation: {
type: 'time',
stepsRange: {
start: 0,
end: 100
},
trails: 10,
duration: 5
}
}
});
//添加到MapV可视化图层
simple.addTo(mapV);
//绘制
mapV.render();
Classes
Members
container :Object
map的容器
Type:
- Object
layers :Array
图层集合
Type:
- Array
map :GeoGlobe.Map
- Default Value:
- null
地图对象
Type:
type :String
- Default Value:
- 'mapv'
可视化图层类别
Type:
- String
Methods
addLayer(layer)
向可视化图层中添加子图层
Parameters:
Name | Type | Description |
---|---|---|
layer |
Object | 子图层对象 |
addTo(map)
与地图对象关联
Parameters:
Name | Type | Description |
---|---|---|
map |
Object | 地图对象 |
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()
绘制图层