LineLayer

GeoGlobe.Visuals.Three. LineLayer

new LineLayer()

三维线图层
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
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

Default Value:
  • '1'
图层id
Type:
  • String

visible :Boolean

Default Value:
  • true
可见性
Type:
  • Boolean

Methods

addTo(three)

关联Three
Parameters:
Name Type Description
three GeoGlobe.Visuals.Three

getColor(data) → {String}

颜色GET属性
Parameters:
Name Type Description
data Feature geojson中的一个Feature
Returns:
color - 颜色值
Type
String

getLineString(data) → {Array}

线几何对象GET属性
Parameters:
Name Type Description
data Feature geojson中的一个Feature
Returns:
coordinates - 返回线的坐标数组
Type
Array

getTexture(data) → {String}

纹理图片资源路径GET属性
Parameters:
Name Type Description
data Feature geojson中的一个Feature
Returns:
texture - 图片纹理资源路径
Type
String

getWidth(data) → {Number}

线宽度的GET属性
Parameters:
Name Type Description
data Feature geojson中的一个Feature
Returns:
size - 线宽值
Type
Number

remove()

从父对象中移除自己

render()

绘制