new ov.ModelSetLayer()
模型集圖層
Extends
Members
-
boundary
-
Boundary
Properties:
Name Type Description BoundaryGeoBoundary 圖層邊界。
-
enableShadow
-
陰影顯示
Properties:
Name Type Description enableShadowBoolean 是否顯示陰影,若ov.TerrainView關閉陰影則不會顯示
-
readonlyname
-
圖層名稱
Properties:
Name Type Description nameString 名稱。
-
show
-
圖層顯示
Properties:
Name Type Description showBoolean 是否顯示圖層。
-
tooltipSetting
-
Tooltip設定。
Properties:
Name Type Description positionModeov.TOOLTIP_POSITION_MODE 定位模式。
showBoolean 是否顯示。
offsetGeoPoint 偏移。
styleObject Tooltip style,可自行擴充。
preProcessingov.Layer~tooltipPreProcessingCallback 內容前處理方法。
positionPreProcessingov.Layer~tooltipPositionPreProcessingCallback 座標前處理方法。
Methods
-
addBuildingFloorColor(buildingID, buildingFloor, color, mix)
webgl/ov-ModelSetLayer.js, line 387 -
設定指定建築物ID樓層顏色。
Name Type Default Description buildingIDNumber 建築物ID。
buildingFloorNumber 建築物樓層。
colorov.Color new ov.Color("#FF0000") optional 顏色。
mixNumber 1.0 optional 混色權重。
-
addClipPolygon(polygon, mode){Boolean}
webgl/ov-ModelSetLayer.js, line 446 -
在圖層上加入要裁切的區域。
Name Type Description polygonGeoPolygon 多邊形區域。
modeov.CLIP_MODE 裁切模式。
Returns:
Type Description Boolean 是否加入成功。 -
enableAlphaTest(enable)
webgl/ov-ModelSetLayer.js, line 367 -
開關Alpha測試,判斷若圖點的透明度達到一定程度便直接不輸出該點。
Name Type Description enableBoolean 是否使用Alpha Test
-
inherited enableOrderIndependentTransparency(enable)
webgl/ov-Layer.js, line 308 -
透明度是否使用OIT演算法,正確性較高但效能會降低。
Name Type Description enableBoolean 啟用OIT透明。
-
getAllClipPolygon(){Object|null}
webgl/ov-ModelSetLayer.js, line 475 -
取得所有在圖層上的裁切區域。
Returns:
Name Type Description clipPolygonObject | null 裁切多邊形資訊。 Name Type Description polygonArray.<GeoPolygon> 多邊形。 modeArray.<ov.CLIP_MODE> 模式。 -
getAttrs(param)
webgl/ov-ModelSetLayer.js, line 44 -
取得指定圖素的所有屬性值。
Name Type Description paramObject 參數。
Name Type Default Description idNumber 指定圖素的ID。
doCmdBoolean true optional true會直接發doCmd查詢屬性;false會先檢查身上有沒有帶屬性,沒有則發doCmd查詢屬性。
callbackov.ModelSetLayer~getAttrsCallback 取得屬性後的回呼。
-
getColAndAttrs(param)
webgl/ov-ModelSetLayer.js, line 131 -
取得指定圖素的所有屬性欄位名稱和屬性值。
Name Type Description paramObject 參數。
Name Type Default Description idNumber 指定建物的ID。
doCmdBoolean true optional true會直接發doCmd查詢屬性;false會先檢查身上有沒有帶屬性,沒有則發doCmd查詢屬性。
callbackov.ModelSetLayer~getColAndAttrsCallback 取得屬性後的回呼。
-
inherited getHeader(callback)
webgl/ov-Layer.js, line 96 -
取得圖層標頭物件。
Name Type Description callbackov.Layer~setOnGetHeaderCallback 請求標頭物件的回呼,不給則同步回傳(不保證回傳速度)。
-
inherited getOpacity(){Number}
webgl/ov-Layer.js, line 171 -
取得當前圖層不透明程度。
Returns:
Type Description Number opacity 圖層不透明程度(0~1)。 -
inherited goto(callback)
webgl/ov-Layer.js, line 316 -
飛到圖層的位置。
Name Type Description callbackov.Layer~gotoCallback 移動完成後執行的回呼。
-
removeBuildingFloorColor(buildingID)
webgl/ov-ModelSetLayer.js, line 400 -
移除指定建築物ID樓層顏色。
Name Type Description buildingIDNumber 建築物ID。
-
removeClipPolygon(index){Boolean}
webgl/ov-ModelSetLayer.js, line 460 -
移除先前在圖層上的裁切區域。
Name Type Description indexNumber 索引,不填則全刪。
Returns:
Type Description Boolean 是否刪除成功。 -
removeEntityColorFunction(){Boolean}
webgl/ov-ModelSetLayer.js, line 266 -
清除
ov.ModelSetLayer#setEntityColorFunction設定的顏色函數。Returns:
Type Description Boolean 是否清除成功。 -
removeEntityHideFunction(){Boolean}
webgl/ov-ModelSetLayer.js, line 308 -
清除
ov.ModelSetLayer#setEntityHideFunction設定的隱藏函數。Returns:
Type Description Boolean 是否清除成功。 -
removeEntityOverlayFunction(){Boolean}
webgl/ov-ModelSetLayer.js, line 510 -
Returns:
Type Description Boolean 是否清除成功。 -
resetAllHideEntityID(){Boolean}
webgl/ov-ModelSetLayer.js, line 190 -
重設所有圖素隱藏狀態。
Returns:
Type Description Boolean 是否重設成功。 -
resetAllOpacityEntityID(){Boolean}
webgl/ov-ModelSetLayer.js, line 218 -
重設所有建築物不透明度。
Returns:
Type Description Boolean 是否重設成功。 -
searchByDistance(epsg, geo, distance, sql, callback)
webgl/ov-ModelSetLayer.js, line 99 -
查詢在指定幾何範圍以內的圖素,並以SQL篩選。
Name Type Description epsgNumber 幾何的EPSG。
geoGeoPolygon 指定幾何。
distanceNumber 指定距離,單位公尺。
sqlString SQL篩選條件。
callbackov.ModelSetLayer~searchByDistanceCallback 查詢的回呼。
-
searchByInclude(epsg, geo, sql, callback)
webgl/ov-ModelSetLayer.js, line 82 -
查詢被指定幾何包圍的圖素,並以SQL篩選。
Name Type Description epsgNumber 幾何的EPSG。
geoGeoPolygon 指定幾何。
sqlString SQL篩選條件。
callbackov.ModelSetLayer~searchByIncludeCallback 查詢的回呼。
-
searchByIntersect(epsg, geo, sql, callback)
webgl/ov-ModelSetLayer.js, line 115 -
查詢在指定幾何相交的圖素,並以SQL篩選。
Name Type Description epsgNumber 幾何的EPSG。
geoGeoPolygon 指定幾何。
sqlString SQL篩選條件。
callbackov.ModelSetLayer~searchByIntersectCallback 查詢的回呼。
-
searchBySQL(sql, callback)
webgl/ov-ModelSetLayer.js, line 66 -
以SQL條件查詢圖層中的圖素。
Name Type Description sqlString SQL查詢條件。
callbackov.ModelSetLayer~searchBySQLCallback 查詢的回呼。
-
inherited setAllowHoverEntity(allow)
webgl/ov-Layer.js, line 227 -
設定圖層的圖素是否能Hover。
Name Type Description allowBoolean 是否能Hover。
-
inherited setAllowSelectEntity(allow)
webgl/ov-Layer.js, line 235 -
設定圖層的圖素是否能被選取。
Name Type Description allowBoolean 是否能被點選。
-
setAlphaFunc(func, ref)
webgl/ov-ModelSetLayer.js, line 376 -
若有使用Alpha測試,則可設定Alpha參考值的值與比較方法
Name Type Description funcov.ALPHA_TEST_FUNC 比較的方法
refNumber 比較的值,0.0 ~ 1.0
-
setCullType(type)
webgl/ov-ModelSetLayer.js, line 57 -
設置剔除模式。
Name Type Description typeov.ENUM_MESH_CULLTYPE 剔除模式。
-
inherited setDepthFunc(depthFunc)
webgl/ov-Layer.js, line 341 -
設置圖層深度測試的方式。
Name Type Description depthFuncov.DEPTH_FUNC 深度測試的方式。
-
setDrawEdge(enable)
webgl/ov-ModelSetLayer.js, line 408 -
設定是否繪製建物邊緣線。
Name Type Description enableBoolean 是否繪製建物邊緣線。
-
setDrawMode(meshType, drawMode)
webgl/ov-ModelSetLayer.js, line 145 -
對指定模型類型設定作畫模式,不同類型可以有各自的作畫模式。
Name Type Description meshTypeov.MODEL_TYPE 要設定的建物類型。
drawModeov.MODEL_DRAWMODE 作畫模式。
-
inherited setDrawSelectedEntityOutline(isDraw)
webgl/ov-Layer.js, line 179 -
設定圖層的圖素是否顯示outline。
Name Type Description isDrawBoolean 是否顯示。
-
setEdgeColor(color, opacity)
webgl/ov-ModelSetLayer.js, line 417 -
設定邊緣線顏色。
Name Type Description colorov.Color 顏色。
opacityNumber 不透明度。
-
setEdgeDashScale(dashScale)
webgl/ov-ModelSetLayer.js, line 436 -
設定虛線間隔。
Name Type Description dashScaleNumber 虛線間隔(公尺),大於0才有虛線,否則為實線。
-
setEdgeZScale(scale)
webgl/ov-ModelSetLayer.js, line 428 -
設定邊緣線ZScale。
Name Type Description scaleNumber ZScale的值。
-
setEntityColor(entityId, color, mix)
webgl/ov-ModelSetLayer.js, line 328 -
設定指定圖素顏色。
Name Type Description entityIdNumber 指定圖素Id。
colorov.Color optional 指定的顏色。
mixNumber optional 指定的混色比例。
Example
modelSetLayer.setEntityColor(1234, new ov.Color("#FFFFFF"), 1.0); //白色
modelSetLayer.setEntityColor(1234, new ov.Color("#FFFFFF"), 0.5); //原本的顏色與白色各半混色,比如這樣,會看起來有些像高亮
modelSetLayer.setEntityColor(1234, null); //清除顏色設定
modelSetLayer.setEntityColor(-1); //清除整張圖層的顏色設定 -
setEntityColorFunction(entityField, colorFunction){Boolean}
webgl/ov-ModelSetLayer.js, line 246 -
以圖素屬性來設置各圖素的顏色,要注意提供的colorFunction性能。
Name Type Description entityFieldArray.<String> 依據的屬性欄位。
colorFunctionov.ModelSetLayer~setEntityColorFunctionCallback 依據屬性輸出顏色的函數,傳入圖素ID、屬性、設定用的顏色。
Returns:
Type Description Boolean 是否設置成功。 Example
modelSetLayer.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;
}
}); -
setEntityColors(entityIds, colors, mix)
webgl/ov-ModelSetLayer.js, line 345 -
批次設定指定圖素顏色。
Name Type Description entityIdsArray.<Number> 批次指定圖素Id。
colorsArray.<ov.Color> optional 批次指定的顏色,若只給一個ov.Color則全部使用這個顏色。
mixNumber optional 指定的混色比例。
Example
modelSetLayer.setEntityColors([1,2,3,4], new ov.Color("#FFFFFF"), 1.0); //白色
modelSetLayer.setEntityColor([1,2,3,4], [new ov.Color("#FFFF00"), new ov.Color("#00FFFF"), new ("#FF00FF"), new ov.Color("#FFFF00")], 1.0);
modelSetLayer.setEntityColor([1,2,3,4], null); //清除顏色設定 -
setEntityHideFunction(attributeField, hideFunction){Boolean}
webgl/ov-ModelSetLayer.js, line 289 -
以圖素屬性來設置各圖素的隱藏模式,要注意提供的hideFunction性能。
Name Type Description attributeFieldArray.<String> 依據的屬性欄位。
hideFunctionov.ModelSetLayer~setEntityHideFunctionCallback 根據屬性輸出隱藏的函數,傳入圖素屬性。
Returns:
Type Description Boolean 是否設置成功。 Example
modelSetLayer.setEntityHideFunction(["Type"], function(attrs) {
if (attrs[0] === "工業") {
return ov.HIDE.DISABLE_DRAW_SELECT;
} else {
return ov.HIDE.NONE;
}
}); -
setEntityOverlayFunction(attributeField, overlayFunction){Boolean}
webgl/ov-ModelSetLayer.js, line 490 -
以圖素屬性來設置各圖素是否要套疊,要注意提供的overlayFunction性能。
Name Type Description attributeFieldArray.<String> 依據的屬性欄位。
overlayFunctionov.ModelSetLayer~setEntityOverlayFunctionCallback 依據屬性輸出是否要套疊的函數,傳入圖素ID、屬性。
Returns:
Type Description Boolean 是否設置成功。 -
inherited setEntitySelected(entityID)
webgl/ov-Layer.js, line 352 -
設定圖素選取狀態。
未選取則變成選取狀態。
選取則變成未選取狀態。
-1清除所有選取狀態。Name Type Description entityIDNumber 圖素ID。
-
inherited setExposure(exposure)
webgl/ov-Layer.js, line 147 -
設定顏色曝光度。
Name Type Description exposureNumber 曝光度。
-
inherited setFadeNearFar(near, far){Boolean}
webgl/ov-Layer.js, line 300 -
設定圖層開始淡出與完全消失的距離。
Name Type Description nearNumber 開始淡出的距離。
farNumber 完全消失的距離。
Returns:
Type Description Boolean 設定是否成功,當near > far時,會失敗。 -
setFloorModeScale(scale)
webgl/ov-ModelSetLayer.js, line 153 -
設定作畫時外牆的單位比例。
Name Type Description scaleNumber 作畫時外牆的單位比例。
-
inherited setFreezeAdjust(freezeAdjust)
webgl/ov-Layer.js, line 360 -
設定圖層是否暫停分裂。
Name Type Description freezeAdjustBoolean 是否暫停分裂。
-
inherited setGamma(gamma)
webgl/ov-Layer.js, line 155 -
設定顏色伽碼值。
Name Type Description gammaNumber 伽碼值。
-
inherited setHide(mode)
webgl/ov-Layer.js, line 333 -
設定圖層隱藏模式。
Name Type Description modeov.HIDE 隱藏模式。
-
setHideByEntityID(entityId, mode){Boolean}
webgl/ov-ModelSetLayer.js, line 177 -
設定圖素隱藏模式。
Name Type Description entityIdNumber 圖素ID。
modeov.HIDE 隱藏模式,0:無, 1:隱藏繪圖, 2:隱藏選取, 3:隱藏繪圖及選取。
Returns:
Type Description Boolean 是否設定成功。 -
inherited setHoverEntityHighlightColor(color, opacity)
webgl/ov-Layer.js, line 216 -
設定圖層圖素的Hover高亮顏色。
Name Type Description colorov.Color Hover高亮的顏色。
opacityNumber 不透明度。
-
setInvisibleDraw(invisibleDraw){Boolean}
webgl/ov-ModelSetLayer.js, line 33 -
設定是否將圖素隱藏,與Show不同,仍可以被點選。
Name Type Description invisibleDrawBoolean 是否隱藏圖素。
Returns:
Type Description Boolean 是否成功。 -
inherited setLightAmbientColor(lightAmbientColor)
webgl/ov-Layer.js, line 139 -
設定環境光顏色。
Name Type Description lightAmbientColorov.Color 環境光顏色。
-
inherited setLightColor(lightColor)
webgl/ov-Layer.js, line 131 -
設定光線顏色。
Name Type Description lightColorov.Color 光線顏色。
-
inherited setOffset(x, y, z){Boolean}
webgl/ov-Layer.js, line 246 -
設定圖層的公尺平移量(目前僅支援PhotogrammetryModel、PointCloud、Model、ModelSet、Pipeline)。
Name Type Description xNumber 向東西方向偏移,單位為公尺。
yNumber 向南北方向偏移,單位為公尺。
zNumber 向垂直於地表方向偏移,單位為公尺。
Returns:
Type Description Boolean 變換是否成功,某些圖層不支持此操作時返回false。 -
inherited setOnClickEntity(callback)
webgl/ov-Layer.js, line 109 -
設定此圖層圖素被點擊時的回呼。
Name Type Description callbackov.Layer~setOnClickEntityCallback 圖素被點擊時的回呼,若輸入非function將被忽略,輸入null則清除設定。
-
inherited setOpacity(opacity)
webgl/ov-Layer.js, line 163 -
設置圖層不透明程度。
Name Type Description opacityNumber 圖層不透明程度(0~1)。
-
setOpacityByEntityID(entityId, opacity){Boolean}
webgl/ov-ModelSetLayer.js, line 205 -
設定圖素不透明度。
Name Type Description entityIdNumber 圖素ID。
opacityNumber 不透明度。
Returns:
Type Description Boolean 是否設定成功。 -
inherited setOutlineColor(visibleColor, hiddenColor)
webgl/ov-Layer.js, line 188 -
設定選取圖層圖素的Outline顏色。
Name Type Description visibleColorov.Color outline可視的顏色。
hiddenColorov.Color outline不可視的顏色。
-
setOverlayName(layerName){Boolean}
webgl/ov-ModelSetLayer.js, line 162 -
設定要疊加在ModelSetLayer上的Overlay圖層名稱,需先自行加Overlay。
Name Type Description layerNameArray.<String> 疊加的Overlay圖層名稱。
Returns:
Type Description Boolean 是否設定成功。 -
inherited setResolutionScale(resolutionScale){Boolean}
webgl/ov-Layer.js, line 273 -
設定圖層解析度條件的Scale比例。
Name Type Description resolutionScaleNumber 解析度條件的Scale比例(初始值1,越大越容易分裂,模型越細緻)。
Returns:
Type Description Boolean 是否設定成功。 -
inherited setRotate(degree){Boolean}
webgl/ov-Layer.js, line 255 -
設定圖層的旋轉量(目前僅支援PhotogrammetryModel、PointCloud、Model、ModelSet、Pipeline)。
Name Type Description degreeNumber 旋轉角度。
Returns:
Type Description Boolean 變換是否成功,某些圖層不支持此操作時返回false。 -
inherited setScale(scale){Boolean}
webgl/ov-Layer.js, line 264 -
設定圖層的縮放量(目前僅支援PhotogrammetryModel、PointCloud、Model、ModelSet、Pipeline)。
Name Type Description scaleNumber 縮放比例。
Returns:
Type Description Boolean 變換是否成功,某些圖層不支持此操作時返回false。 -
inherited setSelectedEntityHighlightColor(color, opacity)
webgl/ov-Layer.js, line 204 -
設定圖層圖素的選取高亮顏色。
Name Type Description colorov.Color 選取高亮的顏色。
opacityNumber 不透明度。
-
inherited setUseFade(useFade)
webgl/ov-Layer.js, line 290 -
設定圖層是否開啟淡出功能。
Name Type Description useFadeBoolean 淡出開關。
-
inherited setUseLight(useLight)
webgl/ov-Layer.js, line 123 -
設定是否使用光線。
Name Type Description useLightBoolean 是否使用光線。
-
inherited setZScale(zScale){Boolean}
webgl/ov-Layer.js, line 282 -
設定圖層的ZScale(ZScale:越小圖層越不會被遮擋)。
Name Type Description zScaleNumber ZScale的值。
Returns:
Type Description Boolean 是否設定成功。
Type Definitions
-
getAttrsCallback(attrs)
webgl/ov-ModelSetLayer.js, line 47 -
Name Type Description attrsObject | null 屬性物件。
- See:
-
getColAndAttrsCallback(attrs)
webgl/ov-ModelSetLayer.js, line 134 -
Name Type Description attrsObject 屬性物件。
- See:
-
searchByDistanceCallback(entities)
webgl/ov-ModelSetLayer.js, line 102 -
Name Type Description entitiesObject 圖素物件。
- See:
-
searchByIncludeCallback(entities)
webgl/ov-ModelSetLayer.js, line 85 -
Name Type Description entitiesObject 圖素物件。
- See:
-
searchByIntersectCallback(entities)
webgl/ov-ModelSetLayer.js, line 118 -
Name Type Description entitiesObject 圖素物件。
- See:
-
searchBySQLCallback(entities)
webgl/ov-ModelSetLayer.js, line 69 -
Name Type Description entitiesObject 圖素物件。
- See:
-
setEntityColorFunctionCallback(id, attr, color)
webgl/ov-ModelSetLayer.js, line 254 -
Name Type Description idNumber 圖素id。
attrArray 屬性。
colorUint8Array 顏色。
-
setEntityHideFunctionCallback(attr){ov.HIDE}
webgl/ov-ModelSetLayer.js, line 297 -
Name Type Description attrArray 屬性。
Returns:
Type Description ov.HIDE 隱藏模式。 -
setEntityOverlayFunctionCallback(id, attr){Boolean}
webgl/ov-ModelSetLayer.js, line 498 -
Name Type Description idNumber 圖素id。
attrArray 屬性。
Returns:
Type Description Boolean 是否要套疊。