Class: ModelLayer

ov. ModelLayer

new ov.ModelLayer()

webgl/ov-ModelLayer.js, line 6

模型圖層

Extends

Members

boundary

Boundary

Properties:
Name Type Description
Boundary GeoBoundary

圖層邊界。

enableShadow

陰影的開關

Properties:
Name Type Description
enableShadow Boolean

陰影的開關

readonlyname

圖層名稱

Properties:
Name Type Description
name String

名稱。

show

圖層顯示

Properties:
Name Type Description
show Boolean

是否顯示圖層。

Methods

enableAlphaTest(enable)

webgl/ov-ModelLayer.js, line 188

開關Alpha測試,判斷若圖點的透明度達到一定程度便直接不輸出該點。

Name Type Description
enable Boolean

是否使用Alpha Test。

inherited enableOrderIndependentTransparency(enable)

webgl/ov-Layer.js, line 217

透明度是否使用OIT演算法,正確性較高但效能會降低。

Name Type Description
enable Boolean

啟用OIT透明。

getAttrs(id, callback)

webgl/ov-ModelLayer.js, line 42

取得指定圖素的所有屬性值。

Name Type Description
id Number

指定圖素的ID。

callback ov.ModelLayer~getAttrsCallback

非同步取得屬性後的回呼。

getColAndAttrs(id, callback)

webgl/ov-ModelLayer.js, line 119

取得指定圖素的所有屬性欄位名稱和屬性值。

Name Type Description
id Number

指定建物的ID。

callback ov.ModelLayer~getColAndAttrsCallback

非同步取得屬性後的回呼。

inherited goto(callback)

webgl/ov-Layer.js, line 225

飛到圖層的位置。

Name Type Description
callback ov.Layer~gotoCallback

移動完成後執行的回呼。

loadCollision(callback){Boolean}

webgl/ov-ModelLayer.js, line 228

讀取碰撞功能。

Name Type Description
callback ov.ModelLayer~loadCollisionCallback

讀取完成的回呼方法。

Returns:
Type Description
Boolean 是否成功呼叫。

removeEntityColorFunction(){Boolean}

webgl/ov-ModelLayer.js, line 175

清除ov.ModelLayer#setEntityColorFunction設定的顏色函數。

Returns:
Type Description
Boolean 是否清除成功。

searchByDistance(epsg, geo, distance, sql, callback)

webgl/ov-ModelLayer.js, line 89

查詢在指定幾何範圍以內的圖素,並以SQL篩選。

Name Type Description
epsg Number

幾何的EPSG。

geo GeoPolygon

指定幾何。

distance Number

指定距離,單位公尺。

sql String

SQL篩選條件。

callback ov.ModelLayer~searchByDistanceCallback

查詢的回呼。

searchByInclude(epsg, geo, sql, callback)

webgl/ov-ModelLayer.js, line 72

查詢被指定幾何包圍的圖素,並以SQL篩選。

Name Type Description
epsg Number

幾何的EPSG。

geo GeoPolygon

指定幾何。

sql String

SQL篩選條件。

callback ov.ModelLayer~searchByIncludeCallback

查詢的回呼。

searchByIntersect(epsg, geo, sql, callback)

webgl/ov-ModelLayer.js, line 105

查詢在指定幾何相交的圖素,並以SQL篩選。

Name Type Description
epsg Number

幾何的EPSG。

geo GeoPolygon

指定幾何。

sql String

SQL篩選條件。

callback ov.ModelLayer~searchByIntersectCallback

查詢的回呼。

searchBySQL(sql, callback)

webgl/ov-ModelLayer.js, line 56

以SQL條件查詢圖層中的圖素。

Name Type Description
sql String

SQL查詢條件。

callback ov.ModelLayer~searchBySQLCallback

查詢的回呼。

inherited setAllowHoverEntity(allow)

webgl/ov-Layer.js, line 136

設定圖層的圖素是否能Hover。

Name Type Description
allow Boolean

是否能Hover。

inherited setAllowSelectEntity(allow)

webgl/ov-Layer.js, line 144

設定圖層的圖素是否能被選取。

Name Type Description
allow Boolean

是否能被點選。

setAlphaFunc(compareFunction, reference)

webgl/ov-ModelLayer.js, line 197

若有使用Alpha測試,則可設定Alpha參考值的值與比較方法。

Name Type Description
compareFunction ENUM_COMPARE_FUN

比較的方法。

reference Number

參考值,0~255的整數。

setCullType(type)

webgl/ov-ModelLayer.js, line 132

設置剔除模式。

Name Type Description
type ov.ENUM_MESH_CULLTYPE

剔除模式。

setDrawEdge(enable)

webgl/ov-ModelLayer.js, line 250

設定是否繪製建物邊緣線。

Name Type Description
enable Boolean

是否繪製建物邊緣線。

setDrawMode(DrawMode)

webgl/ov-ModelLayer.js, line 219

對指定建物類型設定作畫模式。

Name Type Description
DrawMode ov.MODEL_DRAWMODE

作畫模式。

inherited setDrawSelectedEntityOutline(isDraw)

webgl/ov-Layer.js, line 103

設定圖層的圖素是否顯示outline。

Name Type Description
isDraw Boolean

是否顯示。

setEdgeColor(color, opacity)

webgl/ov-ModelLayer.js, line 259

設定邊緣線顏色。

Name Type Description
color HexColor

顏色。

opacity Number

不透明度。

setEdgeZScale(scale)

webgl/ov-ModelLayer.js, line 307

設定邊緣線ZScale。

Name Type Description
scale Number

ZScale的值。

setEntityColorFunction(entityField, colorFunction){Boolean}

webgl/ov-ModelLayer.js, line 155

設置顏色函數,要注意提供的colorFunction性能。

Name Type Description
entityField Array.<String>

依據屬性的欄位名稱。

colorFunction ov.ModelLayer~setEntityColorFunctionCallback

根據屬性輸出顏色的函數,傳入圖素ID、屬性、設定用的顏色,回傳false將此棟建物隱藏。

Returns:
Type Description
Boolean 是否設置成功。
Example

modelLayer.setEntityColorFunction(["Type"], function(id, attrs, color) {
if (attrs[0] === "樓梯") {
color[0] = 255;
color[1] = 0;
color[2] = 0;
} else {
color[0] = 0;
color[1] = 0;
color[2] = 0;
}
return true;
});

inherited setFadeNearFar(near, far){Boolean}

webgl/ov-Layer.js, line 209

設定圖層開始淡出與完全消失的距離。

Name Type Description
near Number

開始淡出的距離。

far Number

完全消失的距離。

Returns:
Type Description
Boolean 設定是否成功,當near > far時,會失敗。

inherited setHoverEntityHighlightColor(color)

webgl/ov-Layer.js, line 128

設定圖層圖素的Hover高亮顏色。

Name Type Description
color HexColor

Hover高亮的顏色。

setIDFilter(enable)

webgl/ov-ModelLayer.js, line 283

邊緣線是否使用ID過濾。

Name Type Description
enable Boolean

true為開,false為關。

setInvisibleDraw(invisibleDraw){Boolean}

webgl/ov-ModelLayer.js, line 33

設定是否將圖素隱藏,與Show不同,仍可以被點選。

Name Type Description
invisibleDraw Boolean

是否隱藏圖素。

Returns:
Type Description
Boolean 是否成功。

setNormalFilter(enable)

webgl/ov-ModelLayer.js, line 267

邊緣線是否使用法線向量過濾。

Name Type Description
enable Boolean

true為開,false為關。

setNormalFilterSensitivity(sensitivity)

webgl/ov-ModelLayer.js, line 291

設定邊緣線法線向量過濾靈敏度。

Name Type Description
sensitivity Number

靈敏度。

inherited setOffset(x, y, z){Boolean}

webgl/ov-Layer.js, line 155

設定圖層的公尺平移量(目前僅支援Acute3D、PointCloud、Model、ModelSet、Pipeline)。

Name Type Description
x Number

向東西方向偏移,單位為公尺。

y Number

向南北方向偏移,單位為公尺。

z Number

向垂直於地表方向偏移,單位為公尺。

Returns:
Type Description
Boolean 變換是否成功,某些圖層不支持此操作時返回false。

inherited setOnClickEntity(callback)

webgl/ov-Layer.js, line 61

設定此圖層圖素被點擊時的回呼。

Name Type Description
callback ov.Layer~setOnClickEntityCallback

圖素被點擊時的回呼。

inherited setOpacity(opacity)

webgl/ov-Layer.js, line 95

設置圖層不透明程度。

Name Type Description
opacity Number

圖層不透明程度(0~1)。

inherited setOutlineColor(VisibleColor, HiddenColor)

webgl/ov-Layer.js, line 112

設定選取圖層圖素的Outline顏色。

Name Type Description
VisibleColor HexColor

outline可視的顏色。

HiddenColor HexColor

outline不可視的顏色。

setOverlayName(layerName){Boolean}

webgl/ov-ModelLayer.js, line 206

設定要疊加在ModelLayer上的Overlay圖層名稱,需先自行加Overlay。

Name Type Description
layerName Array.<String>

疊加的Overlay圖層名稱。

Returns:
Type Description
Boolean 是否設定成功。

setPlaneFilter(enable)

webgl/ov-ModelLayer.js, line 275

邊緣線是否使用平面過濾。

Name Type Description
enable Boolean

true為開,false為關。

setPlaneFilterSensitivity(sensitivity)

webgl/ov-ModelLayer.js, line 299

設定邊緣線平面過濾靈敏度。

Name Type Description
sensitivity Number

靈敏度。

inherited setResolutionScale(resolutionScale){Boolean}

webgl/ov-Layer.js, line 182

設定圖層解析度條件的Scale比例。

Name Type Description
resolutionScale Number

解析度條件的Scale比例(初始值1,越大越容易分裂,模型越細緻)。

Returns:
Type Description
Boolean 是否設定成功。

inherited setRotate(degree){Boolean}

webgl/ov-Layer.js, line 164

設定圖層的旋轉量(目前僅支援Acute3D、PointCloud、Model、ModelSet、Pipeline)。

Name Type Description
degree Number

旋轉角度。

Returns:
Type Description
Boolean 變換是否成功,某些圖層不支持此操作時返回false。

inherited setScale(scale){Boolean}

webgl/ov-Layer.js, line 173

設定圖層的縮放量(目前僅支援Acute3D、PointCloud、Model、ModelSet、Pipeline)。

Name Type Description
scale Number

縮放比例。

Returns:
Type Description
Boolean 變換是否成功,某些圖層不支持此操作時返回false。

inherited setSelectedEntityHighlightColor(color)

webgl/ov-Layer.js, line 120

設定圖層圖素的選取高亮顏色。

Name Type Description
color HexColor

選取高亮的顏色。

inherited setUseFade(useFade)

webgl/ov-Layer.js, line 199

設定圖層是否開啟淡出功能。

Name Type Description
useFade Boolean

淡出開關。

inherited setZScale(zScale){Boolean}

webgl/ov-Layer.js, line 191

設定圖層的ZScale(ZScale:越小圖層越不會被遮擋)。

Name Type Description
zScale Number

ZScale的值。

Returns:
Type Description
Boolean 是否設定成功。

Type Definitions

getAttrsCallback(attrs)

webgl/ov-ModelLayer.js, line 45
Name Type Description
attrs Object | null

屬性物件。

See:

getColAndAttrsCallback(attrs)

webgl/ov-ModelLayer.js, line 122
Name Type Description
attrs Object

屬性物件。

See:

loadCollisionCallback(success, collision)

webgl/ov-ModelLayer.js, line 239
Name Type Description
success Boolean

讀取結果。

collision ov.Collision

碰撞操作物件。

See:

searchByDistanceCallback(entities)

webgl/ov-ModelLayer.js, line 92
Name Type Description
entities Object

圖素物件。

See:

searchByIncludeCallback(entities)

webgl/ov-ModelLayer.js, line 75
Name Type Description
entities Object

圖素物件。

See:

searchByIntersectCallback(entities)

webgl/ov-ModelLayer.js, line 108
Name Type Description
entities Object

圖素物件。

See:

searchBySQLCallback(entities)

webgl/ov-ModelLayer.js, line 59
Name Type Description
entities Object

圖素物件。

See:

setEntityColorFunctionCallback(id, attr, color)

webgl/ov-ModelLayer.js, line 163
Name Type Description
id Number

圖素id。

attr Array.<String>

屬性。

color Uint8Array

顏色。

See: