new Three()
- Source:
- View2D/Visuals/Three.js
Example
//构造地图对象 var map = new GeoGlobe.Map({ style: Cfg.style, container: 'map', zoom: 16, bearing: -138.23, pitch: 57.50, units: "degrees", center: [114.20509630753577, 30.776055193053764] }); //构造THREE可视化图层 var threebox = new GeoGlobe.Visuals.Three(); //添加到地图中 threebox.addTo(map); //绑定鼠标点击事件 threebox.on('overlayerclick', function(e){ alert(e.param.info.userData.attributes.OriginalData.aliasName); }); //绑定鼠标移动事件 threebox.on('overlayerhover', function(e){ console.info(e); }) //绘制 threebox.render();
Classes
- BrightkiteLayer
- BuildingLayer
- CurveLayer
- LineLayer
- PointLayer
- PolygonLayer
- RainLayer
- SingleBuildingLayer
- SnowLayer
- SymbolLayer
- TextLayer
- VideoLayer
Members
-
container :Object
-
map的容器
Type:
- Object
- Source:
- View2D/Visuals/Three.js
-
layers :Array
-
图层容器
Type:
- Array
- Source:
- View2D/Visuals/Three.js
-
map :GeoGlobe.Map
-
地图对象
Type:
- Default Value:
-
- null
- Source:
- View2D/Visuals/Three.js
-
type :String
-
可视化图层类别
Type:
- String
- Default Value:
-
- 'three'
- Source:
- View2D/Visuals/Three.js
Methods
-
addLayer(layer)
-
向threejs可视化图层中添加子图层
Parameters:
Name Type Description layer
Object Three命名空间下的子图层对象 - Source:
- View2D/Visuals/Three.js
-
addTo(map)
-
与gl地图对象关联
Parameters:
Name Type Description map
Object gl地图对象 - Source:
- View2D/Visuals/Three.js
-
getLayer(id)
-
获取指定id图层
Parameters:
Name Type Description id
string 图层id. - Source:
- View2D/Visuals/Three.js
Returns:
Layer- Type
- Object
-
moveLayer(id, before)
-
移动图层
Parameters:
Name Type Description id
String 要移动的图层的ID before
String 之前插入新图层的现有图层的ID。如果省略此参数,则新图层将移动到最上层 - Source:
- View2D/Visuals/Three.js
-
remove()
-
移除图层容器
- Source:
- View2D/Visuals/Three.js
-
removeLayer(id)
-
移除图层
Parameters:
Name Type Description id
string 图层id - Source:
- View2D/Visuals/Three.js
-
render()
-
绘制图层,包含子图层
- Source:
- View2D/Visuals/Three.js
-
unprojectFromWorld(point)
-
通过webgl世界坐标系坐标反算地理坐标,例如点击建筑物获取高度及其经纬度
Parameters:
Name Type Description point
Point {x:15.145329754799604, y:-73.6837176498957, z:240.09772653562322} - Source:
- View2D/Visuals/Three.js
Returns:
xyz- Type
- Array
Example
//绑定鼠标点击事件 threebox.on('overlayerclick', function(event){ if(event && event.param && event.param.pickedInfos){ var xyz = threebox.unprojectFromWorld(event.param.pickedInfos[0].point); } });