new LineLayer()
三维线图层
- Source:
- View2D/Visuals/Three/LineLayer.js
Example
//构造地图对象 var map = new GeoGlobe.Map({ style: Cfg.style, container: 'map', zoom: 16, bearing: -47, pitch: 45, units: "degrees", center: [114.26734490525155, 30.594607628267966] }); //构造THREE可视化图层 var threebox = new GeoGlobe.Visuals.Three(); //添加到地图中 threebox.addTo(map); //构造线图层 var lineLayer = new GeoGlobe.Visuals.Three.LineLayer({ id: '3D line', data: [], visible: true }); //添加到THREE图层 lineLayer.addTo(threebox); //绘制 threebox.render();
Members
-
data :Array
-
数据
Type:
- Array
- Source:
- View2D/Visuals/Three/LineLayer.js
Example
[{ "type":"Feature", "properties":{ "id": 100001, "name":"", "width":1, "color":"#ddd", //颜色纹理。如果没有纹理图片时,则有效。 图片纹理优先于颜色纹理。 "texture":'' //图片纹理,顶部纹理 }, "geometry":{ "type":"LineString", "coordinates":[[114.27467721499235,30.61823619840472,19.61132758430084],[114.29877951124801,30.64353276353745,504.0792309408988]] } }]
-
id :String
-
图层id
Type:
- String
- Default Value:
-
- '1'
- Source:
- View2D/Visuals/Three/LineLayer.js
-
visible :Boolean
-
可见性
Type:
- Boolean
- Default Value:
-
- true
- Source:
- View2D/Visuals/Three/LineLayer.js
Methods
-
addTo(three)
-
关联Three
Parameters:
Name Type Description three
GeoGlobe.Visuals.Three - Source:
- View2D/Visuals/Three/LineLayer.js
-
getColor(data)
-
颜色GET属性
Parameters:
Name Type Description data
Feature geojson中的一个Feature - Source:
- View2D/Visuals/Three/LineLayer.js
Returns:
color - 颜色值- Type
- String
-
getLineString(data)
-
线几何对象GET属性
Parameters:
Name Type Description data
Feature geojson中的一个Feature - Source:
- View2D/Visuals/Three/LineLayer.js
Returns:
coordinates - 返回线的坐标数组- Type
- Array
-
getTexture(data)
-
纹理图片资源路径GET属性
Parameters:
Name Type Description data
Feature geojson中的一个Feature - Source:
- View2D/Visuals/Three/LineLayer.js
Returns:
texture - 图片纹理资源路径- Type
- String
-
getWidth(data)
-
线宽度的GET属性
Parameters:
Name Type Description data
Feature geojson中的一个Feature - Source:
- View2D/Visuals/Three/LineLayer.js
Returns:
size - 线宽值- Type
- Number
-
remove()
-
从父对象中移除自己
- Source:
- View2D/Visuals/Three/LineLayer.js
-
render()
-
绘制
- Source:
- View2D/Visuals/Three/LineLayer.js