Class: TerrainView

ov. TerrainView

new ov.TerrainView(target, options)

webgl/ov.js, line 327

三維場景視圖

Name Type Description
target String

綁定的DIV名稱。

options Object optional

環境的初始化選項。

Name Type Default Description
transparentBackground Boolean false optional

背景是否透明。

antialias Boolean true optional

抗鋸齒。

backgroundColor HexColor "#FFFFFF" optional

底色。

showSun Boolean true optional

畫太陽。

showAtmosphere Boolean true optional

畫大氣。

showOuterSpaceBox Boolean true optional

畫外太空。

outputSelectMap Boolean true optional

點選物件。

outputDepthMap Boolean true optional

深度測試。

webglImage String null optional

初始化底圖。

Example

var terrainView = ov.TerrainView("canvas", {
antialias: true,
transparentBackground: false,
showSun: true,
showOuterSpaceBox: true,
showAtmosphere: true,
outputSelectMap: true,
outputDepthMap: true,
backgroundColor: "#FFFFFF",
webglImage: url
});

Members

readonlyanalysis

分析功能物件

Properties:
Name Type Description
analysis ov.Analysis

分析功能物件,可執行視域分析等

readonlybestCommentator

最佳解說員集合

Properties:
Name Type Description
bestCommentator ov.BestCommentatorCollection

最佳解說員的劇本集合

readonlycamera

取得目前攝影機(姿態)

Properties:
Name Type Description
camera ov.Camera

攝影機(姿態)

canvas

圖台畫布

Properties:
Name Type Description
canvas HTMLCanvasElement

圖台畫布

controlPanel

是否顯示控制面板

Properties:
Name Type Description
controlPanel Boolean

是否顯示控制面板

cursor

目前滑鼠的游標樣式設定

Properties:
Name Type Description
cursorSetting Object

目前滑鼠的游標樣式設定

cursor

目前滑鼠的預設游標樣式

Properties:
Name Type Description
cursor String

目前滑鼠的預設游標樣式

date

時間戳

Properties:
Name Type Description
date Date

時間戳

drawTerrainSetting

地形的作畫設定

Properties:
Name Type Description
Setting.deepWaterColor HexColor

深水顏色

Setting.shallowWaterColor HexColor

水表面顏色

Setting.waveScale Number

波浪大小

Setting.reflectiveColor HexColor

水面反射的顏色

Setting.flowRate Number

水流流速

Setting.emptyTileImage String

指定失聯圖磚替代影像

Setting.baseColor HexColor

指定地形底色

Setting.cullingSurface Boolean

指定是否剃除反向的三角形表面

Setting.surface Boolean

指定作畫時是否要輸出三角面

Setting.vertexWireframe Boolean

輸出網格。

Setting.vertexWireframeWithBaseOverlay Boolean

指定頂點網格是否要使用紋理上色

Setting.wireframeColor HexColor

指定網格的顏色

Setting.wireframeOpacity Number

指定網格的不透明度

Setting.magFilter ENUM_GL

放大過濾

Setting.minFilter ENUM_GL

縮小過濾

Setting.mipAnisotropy Boolean

各向異性過濾

Setting.noElevation Boolean

關閉高程

Setting.showWater Boolean

是否輸出水

Setting.waterQuality Boolean

水面渲染品質,分為"very high"、"high"、"normal"、"low"

Setting.referenceColorGradientFactor Number

參考表面漸變因數

Setting.referenceBaseColorFactor Number

參考表面漸變底色最低比例

Setting.referenceBaseColor HexColor

參考表面底色

Setting.referenceSecondaryColor HexColor

參考表面輔色

Setting.referenceGrid Boolean

顯示參考表面格線

Setting.referenceGridColor HexColor

參考表面格線顏色

Setting.grid Boolean

輸出框線

Setting.skirt Boolean

輸出裙邊

Setting.referenceSurface Boolean

輸出參考表面

Setting.contourSetting Object

等高線設定

Properties
Name Type Description
isopen Boolean

是否開啟等高線

hideWhenMoving Boolean

移動時是否隱藏

interval Number

等高線級距

color HexColor

等高線顏色

alpha Number

等高線不透明度

Setting.aspectColorSetting Object

坡向填色設定,優先度最高

Properties
Name Type Description
isopen Boolean

是否開啟坡向填色

colorset Array.<HexColor>

坡向填色分層顏色

degreeset Array.<Number>

坡向填色分層坡向

alpha Number

坡向填色不透明度

Setting.slopeColorSetting Object

坡度填色設定,優先度第二

Properties
Name Type Description
isopen Boolean

是否開啟坡度填色

colorset Array.<HexColor>

坡度填色分層顏色

degreeset Array.<Number>

坡度填色分層坡向

alpha Number

坡度填色不透明度

Setting.heightColorSetting Object

高度填色設定,優先度最低

Properties
Name Type Description
isopen Boolean

是否開啟高度填色

colorset Array.<HexColor>

高度填色分層顏色

heightset Array.<Number>

高度填色分層高度

alpha Number

高度填色不透明度

Example

terrainView.drawTerrainSetting = {
contourSetting:{isopen:true},
aspectColorSetting:{isopen:true},
baseColor:"#FFFFFF",
cullingSurface:true,
surface:true,
vertexWireframeWithBaseOverlay:true,
wireframeColor:"#FFFFFF",
emptyTileImage:"img.png"
};

enableAtmoSky

是否畫天空大氣,預設為開

Properties:
Name Type Description
enableAtmoSky Boolean

天空大氣

enableDrawLightDirectionSketchMap

是否在場景中畫光線方向圖

Properties:
Name Type Description
enableDrawLightDirectionSketchMap Boolean

是否在場景中畫光線方向圖

enableLight

光線的開關

Properties:
Name Type Description
enableLight Boolean

光線的開關

enableSea

是否畫海洋,預設為關

Properties:
Name Type Description
enableSea Boolean

海洋

enableShadow

陰影的開關

Properties:
Name Type Description
enableShadow Boolean

陰影的開關

enableSun

是否畫太陽貼圖,預設為開

Properties:
Name Type Description
enableSun Boolean

太陽貼圖

enableVolumetricLightScattering

是否開啟體積光散射,預設為關

Properties:
Name Type Description
enableVolumetricLightScattering Boolean

體積光散射

freezeMouse

凍結滑鼠控制(只能用控制攝影機的方式處理)

Properties:
Name Type Description
freezeMouse Boolean

凍結滑鼠控制

freezeUpdate

凍結畫面更新

Properties:
Name Type Description
freezeUpdate Boolean

凍結畫面更新

freezeUserControl

凍結使用者輸入控制對Viewport的控制(凍結滑鼠與鍵盤)

Properties:
Name Type Description
freezeUserControl Boolean

readonlyisSpherical

是否為"球"

Properties:
Name Type Description
isSpherical Boolean

是否為"球"

keepDraw

是否保持作畫,不會休息(預設為false若無變更就不會重新作畫)

Properties:
Name Type Description
keepDraw Boolean

是否不休息

readonlylayers

所有圖層

Properties:
Name Type Description
layers Array.<ov.Layer>

圖層陣列

lightProperty

光線的特性

Properties:
Name Type Description
lightProperty ov.LightProperty

光線的特性

maxVisualDistance

最大虛擬可視距離

Properties:
Name Type Description
maxVisualDistance Number

最大虛擬可視距離(單位:公尺),用於顯示太遠的物件,預設為0(自動控制)

minHeightAboveGround

最小的離地表高度,初始化時,系統會依據地形影像的解析度來決定,使用者可於初始化後自行設定

Properties:
Name Type Description
minHeightAboveGround double

最小的離地表高度

readonlymousePos

目前滑鼠的坐標

Properties:
Name Type Description
mousePos GeoPoint | undefined

目前滑鼠的坐標,單位為Map

moveMode

移動模式:如面板模式、滑鼠模式、旋轉模式等...

Properties:
Name Type Description
moveMode ov.MOVE_TYPE

移動模式

readonlyname

取得地形圖層名稱

Properties:
Name Type Description
name String

地形圖層名稱

showMenu

開啟或關閉左側面板

Properties:
Name Type Description
showMenu Boolean

面板開啟狀態

readonlysphericalEpsg

球體EPSG

Properties:
Name Type Description
sphericalEpsg Number

球體的Epsg

terrainAlpha

地形不透明度

Properties:
Name Type Description
terrainAlpha Number

不透明度(預設1.0,介於0~1.0)

readonlyterrainEpsg

地形EPSG

Properties:
Name Type Description
terrainEpsg Number

地形的原始Epsg

terrainHitTestOpacityThreshold

地形可以被HitTest的最小不透明度閾值,若地形不透明度低於此值,則引擎允許點擊地形下的三角面

Properties:
Name Type Description
terrainHitTestOpacityThreshold Number

不透明度閾值(預設1.0,介於0~1.0)

throughSurface

是否能穿越地表

Properties:
Name Type Description
throughSurface Boolean

是否能穿越地表

readonlyurl

取得地形圖層連結

Properties:
Name Type Description
url String

地形圖層連結

Methods

abortInput()

webgl/ov.js, line 2803

中斷輸入。

abortMeasure()

webgl/ov.js, line 3224

中斷測量,並呼叫 OnMeasureCompleted({success:false, length: 0, measureObj:null});。

add3DTilesLayer(param)

webgl/ov.js, line 1716

加入Cesium 3D Tiles圖層。

Name Type Description
param Object

參數物件。

Name Type Description
url String

tileset.json位址。

callback ov.TerrainView~add3DTilesLayerCallback

回呼函式。

Example

var param = {};
param.url = "TilesetWithDiscreteLOD/tileset.json";
param.callback = function(success, layer){if(success){console.log(layer.name);}};
terrainView.add3DTilesLayer(param);

addAcute3DLayer(param)

webgl/ov.js, line 1691

加入傾斜攝影建模圖層。

Name Type Description
param Object

參數物件。

Name Type Description
url String

位址。

identifier String

圖層名稱。

callback ov.TerrainView~addAcute3DLayerCallback

回呼函式。

urlTemplate String optional

網址字串模板,不使用代理則為{URL}。

Example

var param = {};
param.url = "http://127.0.0.1:8080";
param.identifier = "Acute3d";
param.callback = function(success, layer){if(success){console.log(layer.name);}};
terrainView.addAcute3DLayer(param);

addCustomLayer(param){ov.CustomLayer}

webgl/ov.js, line 1906

加入自畫圖層。

Name Type Description
param Object

參數物件。

Name Type Description
layername String

名稱,圖層名稱不可重複。

callback ov.TerrainView~addCustomLayerCallback optional

回呼函式。

Returns:
Type Description
ov.CustomLayer 自畫圖層。
Example

var param = {};
param.layername = "custom";
var custom = terrainView.addCustomLayer(param);

addEventListener(eventName, callback){Boolean}

webgl/ov.js, line 1306

加入事件監聽器

Name Type Description
eventName String

事件名稱,目前支援以下
MeasureCompleted 測量完成
CameraPosChanged 相機位置改變
Click 滑鼠點擊
MoveEnd 移動結束
MoveStart 移動開始
MouseDown 滑鼠按下
MouseUp 滑鼠彈起

callback ov.TerrainView~addEventListenerCallback

事件觸發時要執行的回呼函式。

Returns:
Type Description
Boolean 是否加入成功。
Example

var result = terrainView.addEventListener("CameraPosChanged", myCallback);

addFigure(param){CTerrainEngine.Element.Figure|null}

webgl/ov.js, line 3252

加入提示圖片。

Name Type Description
param Object

參數物件。

Name Type Default Description
url String

圖片位址。

width String optional

圖片寬,沒設定就使用圖片檔案自身的值,使用"50px"表示寬50像素,或是"50%"表示圖片寬度同畫布寬的一半,輸入數值視同像素

height String optional

圖片高,方法同上。

alpha Number 1 optional

不透明度,值應在0~1之間。

top String "" optional

圖片離畫布頂端的距離,"50px"代表離頂端50個像素,或是"10%"代表離頂端10%的畫布高度。

left String "" optional

圖片離畫布左端的距離,方法同上。

right String "" optional

圖片離畫布右側的距離,方法同上,左右同時有值視同水平至中。

bottom String "" optional

圖片離畫布底端的距離,方法同上,上下同時有值視同垂直至中。

Returns:
Type Description
CTerrainEngine.Element.Figure | null 提示圖片物件
Example

var figure = terrainView.addFigure({ url: "images/common/logo.png", width: "300px", height: "100px", bottom: "10px", right: "10px" });

addI3SLayer(param)

webgl/ov.js, line 1741

加入Esri I3S圖層。

Name Type Description
param Object

參數物件。

Name Type Description
url String

位址。

callback ov.TerrainView~addI3SLayerCallback

回呼函式。

Example

var param = {};
param.url = "https://tiles.arcgis.com/tiles/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Buildings_NYC_BKG/SceneServer/layers/0";
param.callback = function(success, layer){if(success){console.log(layer.name);}};
terrainView.addI3SLayer(param);

addModelLayer(param)

webgl/ov.js, line 1853

加入模型圖層。

Name Type Description
param Object

參數物件。

Name Type Description
url String

位址。

identifier String

圖層名稱。

callback ov.TerrainView~addModelLayerCallback

回呼函式。

urlTemplate String optional

網址字串模板,不使用代理則為{URL}。

Example

var param = {};
param.url = "http://127.0.0.1:8080";
param.identifier = "mesh";
param.callback = function(success, layer){if(success){console.log(layer.name);}};
terrainView.addModelLayer(param);

addModelSetLayer(param)

webgl/ov.js, line 1881

加入模型集圖層。

Name Type Description
param Object

參數物件。

Name Type Description
url String

位址。

identifier String

圖層名稱。

callback ov.TerrainView~addModelSetLayerCallback

回呼函式。

urlTemplate String optional

網址字串模板,不使用代理則為{URL}。

Example

var param = {};
param.url = "http://127.0.0.1:8080";
param.identifier = "modelSet";
param.callback = function(success, layer){if(success){console.log(layer.name);}};
terrainView.addModelSetLayer(param);

addOverlayWindow(param){ov.OverlayWindow}

webgl/ov.js, line 4364

新增疊加圖層切窗視窗。

Name Type Description
param Object

參數。

Name Type Default Description
name Number

視窗名稱。

left Number 0 optional

距離左側邊界(0.0~1.0)。

top Number 0 optional

距離上方邊界(0.0~1.0)。

width Number 1 optional

視窗寬(0.0~1.0)。

height Number 1 optional

視窗長(0.0~1.0)。

Returns:
Type Description
ov.OverlayWindow 疊加圖層切窗視窗物件。

addPipelineLayer(param)

webgl/ov.js, line 1769

加入管線圖層。

Name Type Description
param Object

參數物件。

Name Type Description
url String

位址。

identifier String

圖層名稱。

callback ov.TerrainView~addPipelineLayerCallback

回呼函式。

urlTemplate String optional

網址字串模板,不使用代理則為{URL}。

Example

var param = {};
param.url = "http://127.0.0.1:8080";
param.identifier = "pipeline";
param.callback = function(success, layer){if(success){console.log(layer.name);}};
terrainView.addPipelineLayer(param);

addPointCloudLayer(param)

webgl/ov.js, line 1825

加入點雲圖層。

Name Type Description
param Object

參數物件。

Name Type Description
url String

位址。

identifier String

圖層名稱。

callback ov.TerrainView~addPointCloudLayerCallback

回呼函式。

urlTemplate String optional

網址字串模板,不使用代理則為{URL}。

Example

var param = {};
param.url = "http://127.0.0.1:8080";
param.identifier = "pointCloud";
param.callback = function(success, layer){if(success){console.log(layer.name);}};
terrainView.addPointCloudLayer(param);

addPromptText(param){CTerrainEngine.Element.Text|null}

webgl/ov.js, line 3276

加入提示文字。

Name Type Description
param Object

參數物件。

Name Type Default Description
text String

文字。

align ov.TEXT_ALIGN

對齊方式。

color HexColor "#FFFFFF" optional

文字顏色。

font String "Arial" optional

字型。

size Number 16 optional

文字大小。

borderColor HexColor #000000 optional

邊框顏色。

borderSize Number optional

邊框大小。

offsetX Number 0 optional

文字水平方向位移,單位px,右為正。

offsetY Number 0 optional

文字垂直位移,單位px,下為正。

Returns:
Type Description
CTerrainEngine.Element.Text | null 提示文字物件
Example

terrainView.addPromptText({ text: "測試文字", font: "標楷體", size: 120, color: "#00FF00", align: ov.TEXT_ALIGN.HORZ_CENTER | ov.TEXT_ALIGN.VERT_VCENTER });

addTerrainCustomTileOverlay(setting, callback, index){ov.TerrainCustomTileOverlay|null}

webgl/ov.js, line 1977

用加入的方式新增Custom tile Overlay。

Name Type Default Description
setting Object

參數物件。

settings.layername String

Overlay名稱。

settings.opacity Number 1 optional

圖層的不透明度,0~1,預設為1。

settings.onTerrain Boolean true optional

圖層是否顯示在地形上。

callback ov.TerrainView~addTerrainCustomTileOverlayCallback optional

執行新增疊加圖層後的回呼函式。

index Number optional

插入索引,若沒有填值則視為加在最後面。

Returns:
Type Description
ov.TerrainCustomTileOverlay | null 圖層物件,若加入失敗則為null。

addTerrainSceneOverlay(settings, callback, index){ov.TerrainSceneOverlay|null}

webgl/ov.js, line 2228

用加入的方式新增地景 Overlay。

Name Type Description
settings Object

參數物件。

Name Type Default Description
uri String

資源位址。

identifier String

要圖ID。

layername String

圖層名稱。

fadeOutBegin Number 4.0 optional

模型所佔螢幕空間大小,小於此值開始淡出。

fadeOutEnd Number 2.0 optional

模型所佔螢幕空間大小,小於此值完全淡出。

surfaceFadeOutBegin Number 1200.0 optional

地表貼圖開始出現的距離。

surfaceFadeOutEnd Number 2000.0 optional

地表貼圖完全出現的距離。

randomRotationMax Number 180.0 optional

模型隨機旋轉的最大角度。

randomRotationMin Number 0.0 optional

模型隨機旋轉的最小角度。

randomLightMax Number 0.75 optional

模型隨機光照的最大強度。

randomLightMin Number 0.0 optional

模型隨機光照的最小強度。

callback ov.TerrainView~addTerrainSceneOverlayCallback optional

執行新增疊加圖層後的回呼函式。

index number | null optional

插入索引,若沒有填值則視為加在最後面。

Returns:
Type Description
ov.TerrainSceneOverlay | null 圖層物件,若加入失敗則為null。

addTerrainSingleTileOverlay(settings, callback, index){ov.TerrainSingleTileOverlay|null}

webgl/ov.js, line 2006

用加入的方式新增Single tile Overlay。

Name Type Description
settings Object

參數物件。

Name Type Default Description
url String

要圖網址或base64編碼(data:image/png;base64,XXX)。

layername String

Overlay名稱。

boundary GeoBoundary

圖層的範圍。

opacity Number 1 optional

圖層的不透明度,0~1。

show Boolean true optional

圖層是否顯示。

onTerrain Boolean true optional

圖層是否顯示在地形上。

callback ov.TerrainView~addTerrainSingleTileOverlayCallback optional

執行新增疊加圖層後的回呼函式。

index Number optional

插入索引,若沒有填值則視為加在最後面。

Returns:
Type Description
ov.TerrainSingleTileOverlay | null 圖層物件,若加入失敗則為null。

addTerrainVectorTileOverlay(settings, callback, index){ov.TerrainVectorTileOverlay|null}

webgl/ov.js, line 2161

新增地形Vector Tile。

Name Type Description
settings Object

參數物件。

Name Type Default Description
url String

資料來源模板,例如"http://127.0.0.1:8080/3857/identifier/{z}/{x}/{y}.vector.mvt"。

isGeoJson Boolean false optional

資料格式是否為GeoJson,若非則是mapbox的pbf標準格式。

layername String

Overlay名稱,不得與其他地形疊加圖層名稱相同,否則失敗。

minLevel Number 0 optional

請求最小Level,小於此Level則不會載入疊加資料。

maxLevel Number 23 optional

請求最大Level,大於此Level則不會載入疊加資料。

visibleFactor Number 1.0 optional

可視範圍參數,預設為1.0,越大則可視範圍越遠,在傾斜時更明顯,但無法超越LOD的限制。

urlTemplate String "Oview.aspx?{URL}" optional

網址字串模板,不使用代理則為Oview.aspx?{URL}。

show Boolean true optional

圖層是否預設為開。

onTerrain Boolean true optional

圖層是否顯示在地形上。

opacity Number 1.0 optional

圖層的不透明度。

pointSetting Object optional

點圖資的顯示樣式,有給點圖資才會繪製。

Name Type Default Description
textLabel String "" optional

欲顯示文字的參考欄位。

fontLabel String "" optional

欲套用字型的參考欄位。

fadeEffect Boolean true optional

是否使用淡出淡入效果。

allowOverlapping Boolean true optional

是否允許重疊。

fontTable Object.<String, Object> optional

字型設定定義,以fontLabel欄位名稱當索引。若為"DEFAULT",則會將所有未匹配文字套上此設定字型。

Name Type Default Description
font String "Arial" optional

指定字型。

fontSize Number 14 optional

指定字型大小。

fontColor HexColor "#E0E0E0" optional

指定字型顏色。

fontBorderSize Number 2 optional

指定字型邊框粗細。

fontBorderColor HexColor "#000000" optional

指定字型邊框顏色。

pullUpY Number 50 optional

指定圖釘最高高度,單位為pixel或公尺。

pullUpYUnit Number 0 optional

指定圖釘最高高度的單位,0為pixel,1為公尺。

groundLineColor HexColor "#000000" optional

落地線的顏色。

groundLineWidth Number 1 optional

落地線的寬度。

polylineSetting Object optional

線圖資的顯示樣式,有給線圖資才會繪製。

Name Type Default Description
colorLabel String "" optional

欲套用顏色的參考欄位。

widthLabel Number optional

欲套用粗細的參考欄位,必須為數字。

simpleDraw Boolean false optional

使用輕便的繪圖模式,建議為false。

lineWidthScale Number 1 optional

指示線條粗細的縮放。

colorTable Object.<String, Object> optional

線圖資的顯示定義,索引為顏色參考欄位之名稱。

Name Type Default Description
color HexColor "#E8E8E8" optional

線圖資的顯示顏色。

polygonSetting Object optional

面圖資的顯示樣式,有給面圖資才會繪製。

Name Type Default Description
colorLabel String "" optional

面圖資的樣式參考欄位。

colorTable Object.<String, Object> optional

面圖資的樣式定義,索引為圖資參考欄位之名稱。

Name Type Default Description
fillColor HexColor "#FF0000" optional

面圖資的顏色。

boundaryColor HexColor "#000000" optional

面圖資的邊緣顏色。

boundaryWidth Number 2 optional

面圖資的邊緣粗細。

callback ov.TerrainView~addTerrainVectorTileOverlayCallback optional

執行新增疊加圖層後的回呼函式

index Number optional

插入索引,若沒有填值則視為加在最後面

Returns:
Type Description
ov.TerrainVectorTileOverlay | null 圖層物件,若加入失敗則為null。
Example

terrainView.addTerrainVectorTileOverlay({
url: "http://127.0.0.1:8080/3857/TEST_VECTORTILE/{z}/{x}/{y}.vector.mvt",
layername: "test_vt",
minLevel: 9,
maxLevel: 30,
opacity: 1.0,
isGeoJson: false,
urlTemplate: "{URL}",
pointSetting: {
textLabel: "show_text_label",
fontLabel: "show_font_label",
fadeEffect: true,
allowOverlapping: false,
groundLineColor: "#FF0000",
fontTable: {
"DEFAULT": {
font: "微軟正黑體",
fontSize: 16,
fontColor: "#e0e0e0",
fontBorderSize: 3,
fontBorderColor: "#000000",
pullUpY: 0,
pullUpYUnit: 0,
},
"text_label_1":{
font: "微軟正黑體",
fontSize: 20,
fontColor: "#d0d000",
fontBorderSize: 5,
fontBorderColor: "#000000",
pullUpY: 400
}
}
},
polylineSetting:{
colorLabel: "show_color_label",
realWorldWidth: false,
simpleDraw: false,
fadeEffect: true,
colorTable: {
"DEFAULT": {
color: "#e0e0e080"
},
"color_label_1": {
color: "#e0e00080"
}
}
},
polygonSetting: {
colorLabel:"show_color_label",
colorTable: {
"DEFAULT": {
fillColor: "#ffffff80",
boundaryColor: "#000000ff",
boundaryWidth: 2
},
"color_label_2": {
fillColor: "#d0d000d0",
boundaryColor: "#ff0000ff",
boundaryWidth: 2
}
}
}
}, console.log)

addTerrainVisualizedDataGridOverlay(setting, callback, index){ov.TerrainVisualizedDataGridOverlay|null}

webgl/ov.js, line 2196

新增可視化資料網格

Name Type Description
setting Object

參數物件。

Name Type Default Description
layername String

Overlay名稱,不得與其他地形疊加圖層名稱相同,否則失敗。

source Array.<Float32Array>

圖層資料位置。

boundary GeoBoundary

圖層所在經緯度。

height Number

資料高。

width Number

資料寬。

date Array.<Date>

資料時間。

filter String "linear" optional

資料過濾方式,nearest或是linear。

useStepLayeredColorMap Boolean false optional

使用分層設色。

layeredColorMapKey Array.<Number> optional

分層設色圖高度表。

layeredColorMapValue Array.<HexColor> optional

分層設色圖顏色表。

playSpeed Number 0.16 optional

播放速度。

repeat Boolean true optional

是否重播。

heightScale Number 0 optional

依高度表而拉抬地形的比例。

callback ov.TerrainView~addTerrainVisualizedDataGridOverlayCallback optional

執行新增疊加圖層後的回呼函式。

index Number optional

插入索引,若沒有填值則視為加在最後面。

Returns:
Type Description
ov.TerrainVisualizedDataGridOverlay | null 圖層物件,若加入失敗則為null。

addTerrainWMTSOverlay(settings, callback, index){ov.TerrainWMTSOverlay|null}

webgl/ov.js, line 2036

用加入的方式新增WMTS Overlay。

Name Type Description
settings Object

參數物件。

Name Type Default Description
url String

要圖網址。

identifier String

要圖ID。

layername String

Overlay名稱。

resourceUrl String optional

網址Pattern,XXX/{TileZ}/{TileR}/{TileC}。

opacity Number 1 optional

圖層不透明度,0~1。

show Boolean true optional

圖層是否顯示。

onTerrain Boolean true optional

圖層是否顯示在地形上。

username String optional

若有需要提供,帳號。

password String optional

若有需要提供,密碼。

callback ov.TerrainView~addTerrainWMTSOverlayCallback optional

執行新增疊加圖層後的回呼函式。

index number | null optional

插入索引,若沒有填值則視為加在最後面。

Returns:
Type Description
ov.TerrainWMTSOverlay | null 圖層物件,若加入失敗則為null。

addVectorLayer(param)

webgl/ov.js, line 1797

加入向量圖層。

Name Type Description
param Object

參數物件。

Name Type Description
url String

位址。

identifier String

圖層名稱。

callback ov.TerrainView~addVectorLayerCallback

回呼函式。

urlTemplate String optional

網址字串模板,不使用代理則為{URL}。

Example

var param = {};
param.url = "http://127.0.0.1:8080";
param.identifier = "vector";
param.callback = function(success, layer){if(success){console.log(layer.name);}};
terrainView.addVectorLayer(param);

beginDirectionRotate(rotSpeed)

webgl/ov.js, line 1474

攝影機的方位角開始旋轉。

Name Type Description
rotSpeed Number

旋轉速度(Arg/Sec),正表示順時針,負表示逆時針。

beginMove(speed, direction)

webgl/ov.js, line 1493

攝影機開始水平的移動。

Name Type Description
speed Number

縮放速度(畫面/sec),正表示前進,負表示後退。

direction Number

方向角(以自己的北方為0)。

beginVertRotate(rotSpeed)

webgl/ov.js, line 1465

攝影機的俯仰角開始旋轉。

Name Type Description
rotSpeed Number

旋轉速度(Arg/Sec),正表示越來越垂直,負表示越來越水平。

beginZoom(speed)

webgl/ov.js, line 1483

攝影機開始縮放。

Name Type Description
speed Number

縮放速度(畫面/sec),正表示前進,負表示後退。

cameraStop()

webgl/ov.js, line 1519

停止攝影機的持續運動。

clearFigure()

webgl/ov.js, line 3297

清除全部提示圖片ov.TerrainView#addFigure

clearMeasure()

webgl/ov.js, line 3233

清除測量結束產生的作畫。

clearPromptText()

webgl/ov.js, line 3304

清除全部提示文字ov.TerrainView#addPromptText

clearSelectedEntitys()

webgl/ov.js, line 1277

清除所有被選取的圖素。

close()

webgl/ov.js, line 1102

關閉場景視圖,並釋放所有圖層。

Example

terrainView.close();

completeInput()

webgl/ov.js, line 2795

完成輸入。

editSliceSpace(param)

webgl/ov.js, line 3344

編輯裁切空間,若還沒有設定過,則會直接完成輸入。

Name Type Description
param Object optional

參數物件。

Name Type Default Description
color HexColor "#FF0000" optional

在螢幕畫出回饋的顏色。

colorOpacity Number 1 optional

在螢幕畫出回饋的顏色不透明度。

markTagColor HexColor "#FFFF00" optional

標示測量結果文字部份的顏色。

markTagColorOpacity Number 1 optional

標示測量結果文字部份的顏色不透明度。

measureScale Number 1 optional

測量結果要再乘以之Scale。

measureDecimalPoint Number 1 optional

測量結果要留的小數點數。

enableInput(enable)

webgl/ov.js, line 1528

設定是否能以鍵盤、滑鼠或觸控操作圖台。

Name Type Description
enable Boolean

是否能以輸入方式操作圖台。

facing(azimuth, polar, timeout, easing, callback){Boolean}

webgl/ov.js, line 1542

轉動攝影機面向指定方位。

Name Type Description
azimuth Number

轉動的目標方位角(度),有效角度為180度至-180度。

polar Number optional

攝影機V方向與垂直於地面之夾角(度),有效角度為0至180度。

timeout Number optional

完成轉動的總時間(毫秒)。

easing function optional

攝影機轉動的動畫easing函數。

callback ov.TerrainView~facingCallback optional

執行完要執行的回呼。

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

findLayer(layerName){ov.Layer}

webgl/ov.js, line 2386

以圖層名稱取回圖層。

Name Type Description
layerName String

圖層名稱。

Returns:
Type Description
ov.Layer 圖層物件。

focusWindowCenterFacing(azimuth, polar, timeout, easing, callback){Boolean}

webgl/ov.js, line 1567

鎖住螢幕中心轉動攝影機面向指定方位。

Name Type Description
azimuth Number

轉動的目標方位角(度),有效角度為180度至-180度。

polar Number

攝影機V方向與垂直於地面之夾角(度),有效角度為0至180度。

timeout Number optional

完成轉動的總時間(毫秒)。

easing function optional

攝影機移動的動畫easing函數。

callback ov.TerrainView~focusWindowCenterFacingCallback optional

移動完成後執行的回呼。

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

getAbsHeight(p, epsg){Number}

webgl/ov.js, line 3217

取得指定位置地表的精確高度。

Name Type Description
p GeoPoint

指定點位置。

epsg Number

指定點的epsg。

Returns:
Type Description
Number 地表的精確高度。

getContextStatus(){Object}

webgl/ov.js, line 3171

取得渲染環境的狀態。

Returns:
Type Description
Object 渲染環境的狀態。

getFov(){Number}

webgl/ov.js, line 1456

取得圖台水平視野角度(Fov)。

Returns:
Type Description
Number 圖台水平視野角度(Fov)。

getFPS(){Number}

webgl/ov.js, line 3378

取得畫圖的FPS。

Returns:
Type Description
Number 畫圖的FPS。

getHeight(p){Number}

webgl/ov.js, line 3180

取得指定位置地表當前LOD(Level of Detail)的高度。

Name Type Description
p GeoPoint

指定位置。

Returns:
Type Description
Number 地表當前LOD的高度。

getHeightAboveGround(){Number}

webgl/ov.js, line 3188

取得攝影機離當前地面幾何的高度差。

Returns:
Type Description
Number 離地表的高度。

getLayers(){Array.<ov.Layer>}

webgl/ov.js, line 1184

取得開啟中的圖層。

Returns:
Type Description
Array.<ov.Layer> 開啟中的圖層。
Example

var layers = terrainView.getLayers();

getModule(name){ov.Module|null}

webgl/ov.js, line 1092

載入模組並取得手柄。

Name Type Description
name String

模組名稱。

Returns:
Type Description
ov.Module | null 模組手柄。

getOverlayWindow(index)

webgl/ov.js, line 4379

回傳指定索引或名稱疊加圖層切窗視窗。

Name Type Description
index Number | String

索引值或名稱。

getScreenSnap(callback)

webgl/ov.js, line 3400

取得畫布的畫面,會引起圖台立刻重新繪製畫面,並在畫面重新繪製好後返回畫面拷貝的Image物件與DataURL。

Name Type Description
callback ov.TerrainView~getScreenSnapCallback

取得畫面的回呼。

getSelectedEntitys(){Array.<Object>}

webgl/ov.js, line 1252

取得所有被選取的圖素。

Returns:
Type Description
Array.<Object> 被選取的圖素及圖層物件。

getTerrainNodeProgress(){Number}

webgl/ov.js, line 2347

取得地形節點載入的狀態百分比。

Returns:
Type Description
Number 地形節點載入的狀態百分比。

getTerrainOverlay(index){ov.TerrainOverlay|Array.<ov.TerrainOverlay>}

webgl/ov.js, line 2251

取得地形的Overlay。

Name Type Description
index Number | String

index或圖層名稱。

Returns:
Type Description
ov.TerrainOverlay | Array.<ov.TerrainOverlay> Overlay圖層。
Example

terrainView.getTerrainOverlay(0); //取得第1個Overlay
terrainView.getTerrainOverlay("Taiwan3857"); //取得指定Overlay
terrainView.getTerrainOverlay(); //全部拿回來

goto(p, distance, keepPosture, epsg, callback)

webgl/ov.js, line 1591

移動至指定位置,單位是圖面坐標。

Name Type Default Description
p GeoPoint

要飛到p點。

distance double 0 optional

距離。

keepPosture Boolean false optional

代表是否要保持目前姿態。

epsg Number 4326 optional

目標坐標的epsg,若不輸入會將輸入坐標視為與地形同epsg。

callback ov.TerrainView~gotoCallback optional

移動完成後執行的回呼。

gotoAndFocus(focusPoint, distance, param, polarAngle, azimuthAngle, timeout, epsg, callback)

webgl/ov.js, line 1622

移動至指定位置,並鎖定一個指定中心圍繞旋轉。

Name Type Default Description
focusPoint GeoPoint

要飛到並鎖定中心點。

distance Number 0 optional

離中心點的距離。

param Object optional

focus參數。

Name Type Description
allowUpdateFocusPoint Boolean optional

是否允許使用者透過滑鼠操作異動中心點。

maxPolarAngle Number optional

攝影機相對中心點,與天頂夾角的上限(度)。

minPolarAngle Number optional

攝影機相對中心點,與天頂夾角的下限(度)。

maxDistance Number optional

攝影機可以離中心點的最遠距離(公尺)。

minDistance Number optional

攝影機可以離中心點的最近距離(公尺)。

polarAngle Number 0 optional

移動完畢後,攝影機相對中心點的天頂角。

azimuthAngle Number 0 optional

移動完畢後,攝影機相對中心點的方位角。

timeout Number 1000 optional

完成移動的總時間(毫秒)。

epsg Number 4326 optional

指定focusPoint參數的EPSG。

callback ov.TerrainView~gotoAndFocusCallback optional

移動完成後執行的回呼。

gotoCamera(camera, jump, callback)

webgl/ov.js, line 1427

移動到設定的攝影機位置。

Name Type Default Description
camera ov.Camera

攝影機參數。

jump Boolean false optional

true:跳,false:瞬移。

callback ov.TerrainView~gotoCameraCallback optional

jump成功後執行的回呼。

Example

var pos = new GeoPoint(120.3, 22.5, 100);
var v = new Geo3DPoint(0, 0, -1);
var up = new Geo3DPoint(0, 1, 0);
var camera = new ov.Camera(pos, v, up);
terrainView.gotoCamera(camera, true);

input3DBall(parameter)

webgl/ov.js, line 2660

輸入球。

Name Type Description
parameter Object optional

參數物件。

Name Type Default Description
color HexColor "#FF0000" optional

顏色。

onCompleted ov.TerrainView~input3DBallOnCompleted optional

輸入完成的回呼函式。

onInputting ov.TerrainView~input3DBallOnInputting optional

輸入中的回呼函式。

input3DPoint(parameter)

webgl/ov.js, line 2431

輸入三維點。

Name Type Description
parameter Object optional

參數物件。

Name Type Description
onCompleted ov.TerrainView~input3DPointOnCompleted optional

輸入完成的回呼函式。

input3DPolyline(parameter)

webgl/ov.js, line 2510

輸入三維聚合線。

Name Type Description
parameter Object optional

參數物件。

Name Type Default Description
color HexColor "#FF0000" optional

顏色。

maxStep Number Number.MAX_SAFE_INTEGER optional

最多輸入幾段。

onCompleted ov.TerrainView~input3DPolylineOnCompleted optional

輸入完成的回呼函式。

onInputting ov.TerrainView~input3DPolylineOnInputting optional

輸入中的回呼函式。

inputScreenRectangle(parameter)

webgl/ov.js, line 2709

輸入矩形。

Name Type Description
parameter Object optional

參數物件。

Name Type Default Description
color HexColor "#FF0000" optional

顏色。

onCompleted ov.TerrainView~inputScreenRectangleOnCompleted optional

輸入完成的回呼函式。

onInputting ov.TerrainView~inputScreenRectangleOnInputting optional

輸入中的回呼函式。

inputSurfaceCircle(parameter)

webgl/ov.js, line 2611

輸入表面圓。

Name Type Description
parameter Object optional

參數物件。

Name Type Default Description
color HexColor "#FF0000" optional

顏色。

onCompleted ov.TerrainView~inputSurfaceCircleOnCompleted optional

輸入完成的回呼函式。

onInputting ov.TerrainView~inputSurfaceCircleOnInputting optional

輸入中的回呼函式。

inputSurfacePoint(parameter)

webgl/ov.js, line 2406

輸入表面點。

Name Type Description
parameter Object optional

參數物件。

Name Type Description
onCompleted ov.TerrainView~inputSurfacePointOnCompleted optional

輸入完成的回呼函式。

inputSurfacePolygon(parameter)

webgl/ov.js, line 2561

輸入表面多邊形。

Name Type Description
parameter Object optional

參數物件。

Name Type Default Description
color HexColor "#FF0000" optional

顏色。

maxStep Number Number.MAX_SAFE_INTEGER optional

最多輸入幾段。

onCompleted ov.TerrainView~inputSurfacePolygonOnCompleted optional

輸入完成的回呼函式。

onInputting ov.TerrainView~inputSurfacePolygonOnInputting optional

輸入中的回呼函式。

inputSurfacePolyline(parameter)

webgl/ov.js, line 2459

輸入表面聚合線。

Name Type Description
parameter Object

參數物件。

Name Type Default Description
color HexColor "#FF0000" optional

顏色。

maxStep Number Number.MAX_SAFE_INTEGER optional

最多輸入幾段。

onCompleted ov.TerrainView~inputSurfacePolylineOnCompleted optional

輸入完成的回呼函式。

onInputting ov.TerrainView~inputSurfacePolylineOnInputting optional

輸入中的回呼函式。

inputSurfaceRectangle(parameter)

webgl/ov.js, line 2754

輸入表面矩形。

Name Type Description
parameter Object optional

參數物件。

Name Type Default Description
color HexColor "#FF0000" optional

顏色。

onCompleted ov.TerrainView~inputSurfaceRectangleOnCompleted optional

輸入完成的回呼函式。

onInputting ov.TerrainView~inputSurfaceRectangleOnInputting optional

輸入中的回呼函式。

isOpen(){Boolean}

webgl/ov.js, line 1112

地形場景是否開啟成功。

Returns:
Type Description
Boolean 是否開啟成功。
Example

var result = terrainView.isOpen();

measure2DLength(param)

webgl/ov.js, line 2883

測量2D距離。

Name Type Description
param Object optional

參數物件。

Name Type Default Description
color HexColor "#FF0000" optional

測量時,在螢幕畫出回饋的顏色。

colorOpacity Number 1 optional

測量時,在螢幕畫出回饋的顏色不透明度。

markGeoColor HexColor "#0000FF" optional

標示測量結果幾何部份的顏色。

markGeoColorOpacity Number 1 optional

標示測量結果幾何部份的顏色不透明度。

markTagColor HexColor "#FFFF00" optional

標示測量結果文字部份的顏色。

markTagColorOpacity Number 1 optional

標示測量結果文字部份的顏色不透明度。

measureScale Number 1 optional

測量結果要再乘以之Scale。

measureDecimalPoint Number 1 optional

測量結果要留的小數點數。

measureUnitName Object optional

測量單位參數物件。

Name Type Default Description
distance String "{VALUE}(m)" optional

測量結果要標示的長度格式。

onCompleted ov.TerrainView~measure2DLengthOnCompleted optional

測量完成的回呼函式。

measureArea(param)

webgl/ov.js, line 3117

測量面積。

Name Type Description
param Object optional

參數物件。

Name Type Default Description
color HexColor "#FF0000" optional

測量時,在螢幕畫出回饋的顏色。

colorOpacity Number 0.5 optional

測量時,在螢幕畫出回饋的顏色不透明度。

markGeoColor HexColor "#0000FF" optional

標示測量結果幾何部份的顏色。

markGeoColorOpacity Number 0.5 optional

標示測量結果幾何部份的顏色不透明度。

markTagColor HexColor "#FFFF00" optional

標示測量結果文字部份的顏色。

markTagColorOpacity Number 1 optional

標示測量結果文字部份的顏色不透明度。

measureScale Number 1 optional

測量結果要再乘以之Scale。

measureDecimalPoint Number 1 optional

測量結果要留的小數點數。

measureUnitName Object optional

測量單位參數物件。

Name Type Default Description
area String "{VALUE}(m²)" optional

測量結果要標示的面積格式。

onCompleted ov.TerrainView~measureAreaOnCompleted optional

測量完成的回呼函式。

measureHeight(param)

webgl/ov.js, line 3061

測量高度。

Name Type Description
param Object optional

參數物件。

Name Type Default Description
auxiliaryPlaneSize Number 0 optional

參考平面的大小,若未輸入或給0時,則使用自適應大小。

color HexColor "#FF0000" optional

測量時,在螢幕畫出回饋的顏色。

colorOpacity Number 1 optional

測量時,在螢幕畫出回饋的顏色不透明度。

markGeoColor HexColor "#0000FF" optional

標示測量結果幾何部份的顏色。

markGeoColorOpacity Number 1 optional

標示測量結果幾何部份的顏色不透明度。

markTagColor HexColor "#FFFF00" optional

標示測量結果文字部份的顏色。

markTagColorOpacity Number 1 optional

標示測量結果文字部份的顏色不透明度。

measureScale Number 1 optional

測量結果要再乘以之Scale。

measureDecimalPoint Number 1 optional

測量結果要留的小數點數。

measureUnitName Object optional

測量單位參數物件。

Name Type Default Description
distance String "{VALUE}(m)" optional

測量結果要標示的長度格式。

onCompleted ov.TerrainView~measureHeightOnCompleted optional

測量完成的回呼函式。

measureSpatialLength(param)

webgl/ov.js, line 3005

測量空間距離。

Name Type Description
param Object optional

參數物件。

Name Type Default Description
color HexColor "#FF0000" optional

測量時,在螢幕畫出回饋的顏色。

colorOpacity Number 1 optional

測量時,在螢幕畫出回饋的顏色不透明度。

markGeoColor HexColor "#0000FF" optional

標示測量結果幾何部份的顏色。

markGeoColorOpacity Number 1 optional

標示測量結果幾何部份的顏色不透明度。

markTagColor HexColor "FFFF00" optional

標示測量結果文字部份的顏色。

markTagColorOpacity Number 1 optional

標示測量結果文字部份的顏色不透明度。

measureScale Number 1 optional

測量結果要再乘以之Scale。

measureDecimalPoint Number 1 optional

測量結果要留的小數點數。

measureUnitName Object optional

測量單位參數物件。

Name Type Default Description
distance String "{VALUE}(m)" optional

測量結果要標示的長度格式。

onCompleted ov.TerrainView~measureSpatialLengthOnCompleted optional

測量完成的回呼函式。

measureSpatialPointToPointLength(param)

webgl/ov.js, line 2942

測量點到點距離。

Name Type Description
param Object optional

參數物件。

Name Type Default Description
color HexColor "#FF0000" optional

測量時,在螢幕畫出回饋的顏色。

colorOpacity Number 1 optional

測量時,在螢幕畫出回饋的顏色不透明度。

markGeoColor HexColor "#0000FF" optional

標示測量結果幾何部份的顏色。

markGeoColorOpacity Number 1 optional

標示測量結果幾何部份的顏色不透明度。

markTagColor HexColor "#FFFF00" optional

標示測量結果文字部份的顏色。

markTagColorOpacity Number 1 optional

標示測量結果文字部份的顏色不透明度。

measureScale Number 1 optional

測量結果要再乘以之Scale。

measureDecimalPoint Number 1 optional

測量結果要留的小數點數。

measureUnitName Object optional

測量單位參數物件。

Name Type Default Description
distance String "{VALUE}(m)" optional

測量結果要標示的長度格式。

distanceHorizontal String "{VALUE}(m)" optional

測量結果要標示的水平長度格式。

distanceVertical String "{VALUE}(m)" optional

測量結果要標示的垂直長度格式。

angleIncluded String "{VALUE}°" optional

測量結果要標示的角度格式。

slope String "{VALUE}%" optional

測量結果要標示的坡度格式。

onCompleted ov.TerrainView~measureSpatialPointToPointLengthOnCompleted optional

測量完成的回呼函式。

measureSurfaceLength(param)

webgl/ov.js, line 2826

測量地表距離。

Name Type Description
param Object optional

參數物件。

Name Type Default Description
color HexColor "#FF0000" optional

測量時,在螢幕畫出回饋的顏色。

colorOpacity Number 1 optional

測量時,在螢幕畫出回饋的顏色不透明度。

markGeoColor HexColor "#0000FF" optional

標示測量結果幾何部份的顏色。

markGeoColorOpacity Number 1 optional

標示測量結果幾何部份的顏色不透明度。

markTagColor HexColor "#FFFF00" optional

標示測量結果文字部份的顏色。

markTagColorOpacity Number 1 optional

標示測量結果文字部份的顏色不透明度。

measureScale Number 1 optional

測量結果要再乘以之Scale。

measureDecimalPoint Number 1 optional

測量結果要留的小數點數。

measureSampleSize Number 300 optional

地表高程的取樣數。

measureUnitName Object optional

測量單位參數物件。

Name Type Default Description
distance String "{VALUE}(m)" optional

測量結果要標示的長度格式。

onCompleted ov.TerrainView~measureSurfaceLengthOnCompleted optional

測量完成的回呼函式。

moveFunSetting(setting)

webgl/ov.js, line 1170

設定MoveFun設定。

Name Type Description
setting Object

設定。

Name Type Description
smoothZoom Boolean optional

平滑縮放。

autoPanFactor Number optional

自動拖曳常數0~1,0:關閉自動拖曳,1不會停下。

Example

terrainView.moveFunSetting({smoothZoom: true});

moveTerrainOverlay(oldIndex, newIndex){Boolean}

webgl/ov.js, line 2297

移動地形的Overlay的順序,注意移動非交換,其餘圖層會保持原順序排列,如[0, 1, 2]->[2, 0, 1],若失敗則不移動。

Name Type Description
oldIndex Number | String

原本的index,也可以給圖層名稱當作索引。

newIndex Number | String

新的index,也可以給圖層名稱當作索引。

Returns:
Type Description
Boolean 是否成功。

openFileMesh(url, fileObject, urlTemplate, callback)

webgl/ov.js, line 1956

使用File新增Mesh,CFileMesh不用時需自行呼叫Release。

Name Type Description
url String

ServerUrl。

fileObject File

File物件。

urlTemplate String

網址字串模板,不使用代理則為{URL}。

callback ov.TerrainView~openFileMeshCallback

開啟完成後的回呼函式。

See:

openTerrain(param)

webgl/ov.js, line 1038

開啟地形場景。

Name Type Description
param Object

參數物件。

Name Type Description
url String

位址。

identifier String

地形圖層名稱。

callback ov.TerrainView~openTerrainCallback optional

執行完成後的回呼函式。

urlTemplate String optional

網址字串模板,不使用代理則為{URL}。

Example

var param = {};
param.url = "http://127.0.0.1:8080";
param.identifier = "terrainLayerName";
param.callback = function(layer, success){if(success){console.log(layer.name);}};
terrainView.openTerrain(param);

panelSetting(setting)

webgl/ov.js, line 1158

設定控制面板的參數。

Name Type Description
setting Object

設定。

Name Type Description
color HexColor optional

HexStr顏色。

offset GeoPoint optional

面板位移pixel。

posType POS_TYPE optional

面板預設位置POS_TYPE列舉,LT左上LB左下RT右上RB右下。

alwaysUseFullPanel Boolean optional

永遠顯示完整面板。

Example

terrainView.panelSetting({color: "#00E8E8", offset: new GeoPoint(10, 10), posType: POS_TYPE.LT});

randomGoto()

webgl/ov.js, line 3385

隨機飛到任意點。

reloadTerrain(identifier, callback)

webgl/ov.js, line 1055

重新載入同伺服器的另一個地形場景。

Name Type Description
identifier String

地形圖層名稱。

callback ov.TerrainView~reloadTerrainCallback

執行完成後的回呼函式。

Example

terrainView.reloadTerrain("terrain", function(success){console.log(success);});

reloadTerrainOverlay(index){Boolean}

webgl/ov.js, line 2339

強制重新載入地形的Overlay紋理。

Name Type Description
index number | string

index或圖層名稱。

Returns:
Type Description
Boolean 是否成功。
Example

terrainView.reloadTerrainOverlay(0); //重新載入第1個Overlay
terrainView.reloadTerrainOverlay("Taiwan3857"); //重新載入指定Overlay
terrainView.reloadTerrainOverlay(); //全部重載

removeConditionOverlayLayer(){Boolean}

webgl/ov.js, line 3677
Returns:
Type Description
Boolean 是否有移除成功。

removeEventListener(eventName, callback){Boolean}

webgl/ov.js, line 1370

移除事件監聽器。

Name Type Description
eventName String

事件名稱,參考ov.TerrainView#addEventListener

callback callback

加入時的事件回呼。

Returns:
Type Description
Boolean 是否移除成功。
Example

var result = terrainView.removeEventListener("InputCompleted", myCallback);

removeLayer(layer){Boolean}

webgl/ov.js, line 2369

移除圖層。

Name Type Description
layer ov.Layer

要移除的圖層物件。

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

removeOverlayWindow(overlayWindow)

webgl/ov.js, line 4397

移除指定疊加圖層切窗視窗。

Name Type Description
overlayWindow ov.OverlayWindow

疊加圖層切窗視窗物件。

removeSliceSpace()

webgl/ov.js, line 3363

移除裁切空間ov.TerrainView#setSliceSpace

removeTerrainOverlay(index){Boolean}

webgl/ov.js, line 2321

移除地形的Overlay,會造成後面的圖層往前移。

Name Type Description
index number | string | Object

index或圖層名稱或手柄。

Returns:
Type Description
Boolean 是否成功。
Example

terrainView.removeTerrainOverlay(0); //移除第1個Overlay
terrainView.removeTerrainOverlay("Taiwan3857"); //移除指定Overlay
terrainView.removeTerrainOverlay(overlay); //移除指定Overlay
terrainView.removeTerrainOverlay(); //全部移除

resumeBaseLayerSetting(){Boolean}

webgl/ov.js, line 1944

恢復地形檔的WMTS影像。

Returns:
Type Description
Boolean 是否恢復成功。

rotateBy(center, rotSpeed, maxRotArg, lookAtCenter)

webgl/ov.js, line 1653

繞著指定坐標維持固定距離旋轉。

Name Type Default Description
center GeoPoint

旋轉的中心點。

rotSpeed Number

旋轉的速率,單位為Deg/Sec。

maxRotArg Number 0 optional

最多只旋轉幾度,若0或沒輸入,代表一直旋轉。

lookAtCenter Boolean true optional

旋轉時,是否一直看著中心。

setBaseLayer(param){Boolean}

webgl/ov.js, line 1936

設定地形檔的WMTS影像。

Name Type Description
param Object

WMTS參數物件,參考ov.TerrainView#addTerrainWMTSOverlay

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

setConditionForHideOverlayLayer(setting, callback)

webgl/ov.js, line 3428

設置有隱藏條件的向量圖層(例:行政區圖層)。

Name Type Description
setting Object

參數物件。

Name Type Description
url String

MapServer網址。

layerName String

在MapServer上圖層的名稱。

drawColor HexColor

外框線顏色(#argb)。

fillColor HexColor

內部填滿色(#argb)。

sql String

要設為隱藏的條件。

callback ov.TerrainView~setConditionForHideOverlayLayerCallback optional

執行完成後的回呼。

Example

var setting = {};
setting.url = "http://127.0.0.1:8080";
setting.drawColor = "#FFFF0000"; //紅色
setting.fillColor = "#FFFFFF00"; //黃色
setting.layerName = "town"; //全台灣行政區圖
setting.sql="COUNTYNAME!='桃園市'"; //桃園市以外全部隱藏
terrainView.setConditionForHideOverlayLayer(setting);

setConditionOverlayLayer(setting, callback)

webgl/ov.js, line 3565

設置條件式向量圖層。

Name Type Description
setting Object

參數物件。

Name Type Description
url String

MapServer網址。

layerName String

在MapServer上圖層的名稱。

drawColor String

外框線顏色(#argb)。

fillColor String

內部填滿色(#argb)。

extraSettings Object optional

上述沒包含的參數,放此物件上(例:setting.extraSettings.LineWidth = "2")。

condition Array.<Object> optional

條件陣列(參數可參考MapServer上向量圖層的條件設定)。

callback ov.TerrainView~setConditionOverlayLayerCallback optional

執行完成後的回呼。

Example

var setting = {};
setting.url = "http://127.0.0.1:8080";
setting.layerName = "town";
setting.drawColor = "#FFFF0000"; //紅色
setting.fillColor = "#FFFFFF00"; //黃色
setting.conditions = [];
//1.將臺中市以外隱藏
var condition1 = {};
condition1.SQL = "COUNTYNAME !='臺中市'";
condition1.Show = "0";
//2.將西屯區設為綠色
var condition2 = {};
condition2.SQL = "TOWNNAME = '西屯區'";
condition2.FillColor = "#FF00FF00";
//3.將南屯區設為紅色
var condition3 = {};
condition3.SQL = "TOWNNAME = '南屯區'";
condition3.FillColor = "#FF0000FF";
setting.conditions.push(condition1);
setting.conditions.push(condition2);
setting.conditions.push(condition3);
terrainView.setConditionOverlayLayer(setting);

setCursorSetting(param)

webgl/ov.js, line 4413

設定游標樣式。

Name Type Description
param Object

參數。

Name Type Default Description
defaultCursor String "default" optional

預設游標樣式。

moveModeMouseCursor String "grabbing" optional

滑鼠模式游標拖曳樣式。

moveModePanelCursor String "grabbing" optional

面板模式游標拖曳樣式。

moveModeFocusCursor String "grabbing" optional

旋轉模式游標拖曳樣式。

moveModeWalkCursor String "move" optional

地面行走模式游標拖曳樣式。

measureCursor String "crosshair" optional

測量游標樣式。

inputCursor String "copy" optional

輸入游標樣式。

clickableCursor String "pointer" optional

可點擊游標樣式。

setDirection(direction)

webgl/ov.js, line 1502

設定攝影機的方位角。

Name Type Description
direction Number

方向角(以自己的北方為0)。

setFov(horizontalFov){Boolean}

webgl/ov.js, line 1447

設置圖台水平視野角度(Fov)。

Name Type Description
horizontalFov Number

水平視野角度(Field of View)。

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

setLayerSelectedEntity(layer, id)

webgl/ov.js, line 1286

在指定的圖層物件上選取或清除選取指定的圖素。

Name Type Description
layer ov.Layer

指定圖層物件。

id Number

指定的圖素Id。

setMeasureEpsg(measureEpsg){Boolean}

webgl/ov.js, line 3163

設定測量用的Epsg,測量的計算上會先轉成此Epsg才計算,不接受4326。

Name Type Description
measureEpsg Number

測量用的Epsg。

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

setMoveMode(mode, param)

webgl/ov.js, line 1069

設置操作模式。

Name Type Description
mode ov.MOVE_TYPE

操作模式。

param Object

操作模式的參數,參考ov.MOVE_TYPE

setPath(path)

webgl/ov.js, line 1122

設定程式碼所在路徑。

Name Type Description
path String

路徑。

Example

terrainView.setPath("../webgl/");

setSeaAltitude(seaAltitude){Boolean}

webgl/ov.js, line 1131

設定海平面高度。

Name Type Description
seaAltitude Number

海平面高度。

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

setSeaQuality(quality){Boolean}

webgl/ov.js, line 1144

設定海渲染品質,預設為normal。

Name Type Description
quality seaQuality

渲染品質,分成"very high"、"high"、"normal"、"low"。

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

setSliceSpace(param)

webgl/ov.js, line 3318

設定裁切空間,會直接清除舊的裁切空間。

Name Type Description
param Object optional

參數物件。

Name Type Default Description
color HexColor "#FF0000" optional

在螢幕畫出回饋的顏色。

colorOpacity Number 0.5 optional

在螢幕畫出回饋的顏色不透明度。

markTagColor HexColor "#FFFF00" optional

標示測量結果文字部份的顏色。

markTagColorOpacity Number 1 optional

標示測量結果文字部份的顏色不透明度。

measureScale Number 1 optional

測量結果要再乘以之Scale。

measureDecimalPoint Number 1 optional

測量結果要留的小數點數。

setVertArg(vertArg)

webgl/ov.js, line 1511

設定攝影機的俯仰角。

Name Type Description
vertArg Number

俯仰角(水平為0,俯正仰負)。

showTerrainBoundingVolume(show)

webgl/ov.js, line 2358

是否顯示地形的包圍盒。

Name Type Description
show Boolean

是否顯示。

Example

terrainView.showTerrainBoundingVolume(true); //顯示包圍盒
terrainView.showTerrainBoundingVolume(false); //關閉顯示包圍盒

swapTerrainOverlay(firstIndex, secondIndex){Boolean}

webgl/ov.js, line 2307

交換地形的Overlay的順序,若失敗則不交換。

Name Type Description
firstIndex Number | String

第一個圖層的index,也可以給圖層名稱當作索引。

secondIndex Number | String

第二個圖層的index,也可以給圖層名稱當作索引。

Returns:
Type Description
Boolean 是否成功。

updateScreen()

webgl/ov.js, line 3370

更新畫面。

windowToTerrain(p){Boolean}

webgl/ov.js, line 3197

將指定螢幕座標轉換成對應的地形位置。

Name Type Description
p GeoPoint

指定位置。

Returns:
Type Description
Boolean 轉換是否成功。

worldToWindow(p, absHeight){Boolean}

webgl/ov.js, line 3207

將指定的世界座標轉換至螢幕座標。

Name Type Description
p GeoPoint

指定位置。

absHeight Boolean

是否為絕對高度。

Returns:
Type Description
Boolean 轉換是否成功。

Type Definitions

add3DTilesLayerCallback(success, basic3DTilesLayer)

webgl/ov.js, line 1723
Name Type Description
success Boolean

是否成功。

basic3DTilesLayer ov.Basic3DTilesLayer

3DTiles圖層。

See:

addAcute3DLayerCallback(success, acute3dLayer)

webgl/ov.js, line 1698
Name Type Description
success Boolean

是否成功。

acute3dLayer ov.Acute3DLayer

傾斜攝影建模圖層。

See:

addCustomLayerCallback(success, customLayer)

webgl/ov.js, line 1924
Name Type Description
success Boolean

是否成功。

customLayer ov.CustomLayer

自畫圖層。

See:

addEventListenerCallback(MeasureCompletedResult, CameraPosChangedPos, CameraPosChangedV, CameraPosChangedUp, ClickResultMousePos, ClickResultWorldPos, MouseDownResultButton, MouseDownResultMousePos, MouseDownResultMapPos)

webgl/ov.js, line 1343
Name Type Description
MeasureCompletedResult Object

MeasureCompleted結果。

Name Type Description
success Boolean

測量是否成功。

length Number optional

長度測量結果。

height Number optional

高度測量結果。

area Number optional

面積測量結果。

measureObj Object optional

傳入的物件。

CameraPosChangedPos GeoPoint

CameraPosChanged結果的Pos。

CameraPosChangedV Geo3DPoint

CameraPosChanged結果的V。

CameraPosChangedUp Geo3DPoint

CameraPosChanged結果的Up。

ClickResultMousePos GeoPoint

ClickResult結果的滑鼠位置。

ClickResultWorldPos GeoPoint

ClickResult結果的世界位置。

MouseDownResultButton Number

MouseDown結果的滑鼠按鍵。

MouseDownResultMousePos GeoPoint

MouseDown結果的滑鼠位置。

MouseDownResultMapPos GeoPoint

MouseDown結果的地圖位置。

See:

addI3SLayerCallback(success, i3SLayer)

webgl/ov.js, line 1748
Name Type Description
success Boolean

是否成功。

i3SLayer ov.I3SLayer

I3S圖層。

See:

addModelLayerCallback(success, modelLayer)

webgl/ov.js, line 1860
Name Type Description
success Boolean

是否成功。

modelLayer ov.ModelLayer

模型圖層。

See:

addModelSetLayerCallback(success, modelSetLayer)

webgl/ov.js, line 1888
Name Type Description
success Boolean

是否成功。

modelSetLayer ov.ModelSetLayer

模型集圖層。

See:

addPipelineLayerCallback(success, pipelineLayer)

webgl/ov.js, line 1776
Name Type Description
success Boolean

是否成功。

pipelineLayer ov.PipelineLayer

管線圖層。

See:

addPointCloudLayerCallback(success, pointCloudLayer)

webgl/ov.js, line 1832
Name Type Description
success Boolean

是否成功。

pointCloudLayer ov.PointCloudLayer

點雲圖層。

See:

addTerrainCustomTileOverlayCallback(param)

webgl/ov.js, line 1985
Name Type Description
param Object

參數物件。

Name Type Description
success Boolean

是否成功。

message String optional

錯誤訊息。

See:

addTerrainSceneOverlayCallback(param)

webgl/ov.js, line 2234
Name Type Description
param Object

參數物件。

Name Type Description
success Boolean

是否成功。

message String optional

錯誤訊息。

See:

addTerrainSingleTileOverlayCallback(param)

webgl/ov.js, line 2012
Name Type Description
param Object

參數物件。

Name Type Description
success Boolean

是否成功。

message String optional

錯誤訊息。

See:

addTerrainVectorTileOverlayCallback(param)

webgl/ov.js, line 2167
Name Type Description
param Object

參數物件。

Name Type Description
success Boolean

是否成功。

message String optional

錯誤訊息。

layername String optional

圖層名稱。

See:

addTerrainVisualizedDataGridOverlayCallback(param)

webgl/ov.js, line 2202
Name Type Description
param Object

參數物件。

Name Type Description
success Boolean

是否成功。

message String optional

錯誤訊息。

See:

addTerrainWMTSOverlayCallback(param)

webgl/ov.js, line 2042
Name Type Description
param Object

參數物件。

Name Type Description
success Boolean

是否成功。

message String optional

錯誤訊息。

layername String optional

圖層名稱。

See:

addVectorLayerCallback(success, vectorLayer)

webgl/ov.js, line 1804
Name Type Description
success Boolean

是否成功。

vectorLayer ov.VectorLayer

向量圖層。

See:

facingCallback()

webgl/ov.js, line 1553
See:

focusWindowCenterFacingCallback()

webgl/ov.js, line 1578
See:

getScreenSnapCallback(canvasImage, canvasImageDataURL)

webgl/ov.js, line 3403
Name Type Description
canvasImage HTMLImageElement

畫面影像Image物件。

canvasImageDataURL String

畫面影像DomString。

See:

gotoAndFocusCallback()

webgl/ov.js, line 1641
See:

gotoCallback()

webgl/ov.js, line 1601
See:

gotoCameraCallback()

webgl/ov.js, line 1437
See:

input3DBallOnCompleted(onCompletedCallback)

webgl/ov.js, line 2684
Name Type Description
onCompletedCallback Object

輸入結束的結果。

Name Type Description
success Boolean

輸入是否成功。

geo Object optional

輸入結束的幾何。

Name Type Description
center GeoPoint optional

輸入的球心。

radius Number optional

輸入的半徑。

See:

input3DBallOnInputting(OnInputtingCallback)

webgl/ov.js, line 2693
Name Type Description
OnInputtingCallback Object

輸入中的結果。

Name Type Description
geo Object

輸入中的幾何。

Name Type Description
center GeoPoint

輸入中的圓心。

radius Number

輸入中的半徑。

See:

input3DPointOnCompleted(onCompletedCallback)

webgl/ov.js, line 2443
Name Type Description
onCompletedCallback Object

輸入結束的結果。

Name Type Description
success Boolean

輸入是否成功。

geo GeoPoint optional

輸入結束的幾何。

See:

input3DPolylineOnCompleted(onCompletedCallback)

webgl/ov.js, line 2539
Name Type Description
onCompletedCallback Object

輸入結束的結果。

Name Type Description
success Boolean

輸入是否成功。

geo GeoPolyline optional

輸入結束的幾何。

See:

input3DPolylineOnInputting(OnInputtingCallback)

webgl/ov.js, line 2546
Name Type Description
OnInputtingCallback Object

輸入中的結果。

Name Type Description
geo GeoPolyline

輸入中的幾何。

See:

inputScreenRectangleOnCompleted(onCompletedCallback)

webgl/ov.js, line 2733
Name Type Description
onCompletedCallback Object

輸入結束的結果。

Name Type Description
success Boolean

輸入是否成功。

geo CRect optional

輸入結束的幾何。

See:

inputScreenRectangleOnInputting(OnInputtingCallback)

webgl/ov.js, line 2740
Name Type Description
OnInputtingCallback Object

輸入中的結果。

Name Type Description
geo CRect

輸入中的幾何。

See:

inputSurfaceCircleOnCompleted(onCompletedCallback)

webgl/ov.js, line 2635
Name Type Description
onCompletedCallback Object

輸入結束的結果。

Name Type Description
success Boolean

輸入是否成功。

geo Object optional

輸入結束的幾何。

Name Type Description
center GeoPoint optional

輸入的圓心。

radius Number optional

輸入的半徑。

See:

inputSurfaceCircleOnInputting(OnInputtingCallback)

webgl/ov.js, line 2644
Name Type Description
OnInputtingCallback Object

輸入中的結果。

Name Type Description
geo Object

輸入中的幾何。

Name Type Description
center GeoPoint

輸入中的圓心。

radius Number

輸入中的半徑。

See:

inputSurfacePointOnCompleted(onCompletedCallback)

webgl/ov.js, line 2418
Name Type Description
onCompletedCallback Object

輸入結束的結果。

Name Type Description
success Boolean

輸入是否成功。

geo GeoPoint optional

輸入結束的幾何。

See:

inputSurfacePolygonOnCompleted(onCompletedCallback)

webgl/ov.js, line 2590
Name Type Description
onCompletedCallback Object

輸入結束的結果。

Name Type Description
success Boolean

輸入是否成功。

geo GeoPolygon optional

輸入結束的幾何。

See:

inputSurfacePolygonOnInputting(OnInputtingCallback)

webgl/ov.js, line 2597
Name Type Description
OnInputtingCallback Object

輸入中的結果。

Name Type Description
geo GeoPolygon

輸入中的幾何。

See:

inputSurfacePolylineOnCompleted(onCompletedCallback)

webgl/ov.js, line 2488
Name Type Description
onCompletedCallback Object

輸入結束的結果。

Name Type Description
success Boolean

輸入是否成功。

geo GeoPolyline optional

輸入結束的幾何。

See:

inputSurfacePolylineOnInputting(OnInputtingCallback)

webgl/ov.js, line 2495
Name Type Description
OnInputtingCallback Object

輸入中的結果。

Name Type Description
geo GeoPolyline

輸入中的幾何。

See:

inputSurfaceRectangleOnCompleted(onCompletedCallback)

webgl/ov.js, line 2778
Name Type Description
onCompletedCallback Object

輸入結束的結果。

Name Type Description
success Boolean

輸入是否成功。

geo CRect optional

輸入結束的幾何。

See:

inputSurfaceRectangleOnInputting(OnInputtingCallback)

webgl/ov.js, line 2785
Name Type Description
OnInputtingCallback Object

輸入中的結果。

Name Type Description
geo CRect

輸入中的幾何。

See:

measure2DLengthOnCompleted(onCompletedCallback)

webgl/ov.js, line 2914
Name Type Description
onCompletedCallback Object

測量結束結果。

Name Type Description
success Boolean

測量是否成功。

geo Object optional

測量結束的幾何。

Name Type Description
distance Number optional

測量結束的長度。

See:

measureAreaOnCompleted(onCompletedCallback)

webgl/ov.js, line 3149
Name Type Description
onCompletedCallback Object

測量結束結果。

Name Type Description
success Boolean

測量是否成功。

geo Object optional

測量結束的幾何。

Name Type Description
area Number optional

測量結束的面積。

See:

measureHeightOnCompleted(onCompletedCallback)

webgl/ov.js, line 3093
Name Type Description
onCompletedCallback Object

測量結束結果。

Name Type Description
success Boolean

測量是否成功。

geo Object optional

測量結束的幾何。

Name Type Description
height Number optional

測量結束的高度。

See:

measureSpatialLengthOnCompleted(onCompletedCallback)

webgl/ov.js, line 3036
Name Type Description
onCompletedCallback Object

測量結束結果。

Name Type Description
success Boolean

測量是否成功。

geo Object optional

測量結束的幾何。

Name Type Description
distance Number optional

測量結束的長度。

See:

measureSpatialPointToPointLengthOnCompleted(onCompletedCallback)

webgl/ov.js, line 2977
Name Type Description
onCompletedCallback Object

測量結束結果。

Name Type Description
success Boolean

測量是否成功。

geo Object optional

測量結束的幾何。

Name Type Description
distance Number optional

測量結束的長度。

distanceHorizontal Number optional

測量結束的水平長度。

distanceVertical Number optional

測量結束的垂直長度。

angleIncluded Number optional

測量結束的角度。

slope Number optional

測量結束的坡度。

See:

measureSurfaceLengthOnCompleted(onCompletedCallback)

webgl/ov.js, line 2858
Name Type Description
onCompletedCallback Object

測量結束結果。

Name Type Description
success Boolean

測量是否成功。

geo Object optional

測量結束的幾何。

Name Type Description
distance Number optional

測量結束的長度。

sphereDistance Number optional

測量結束的球體長度。

See:

openFileMeshCallback(param)

webgl/ov.js, line 1959
Name Type Description
param Object

參數物件。

Name Type Description
success Boolean

是否成功。

meshs Array.<Object> optional

物件陣列,CFileMesh可用來加入自畫模型。

See:

openTerrainCallback(terrainLayer, success)

webgl/ov.js, line 1041
Name Type Description
terrainLayer CTerrainLayer

地形圖層。

success Boolean

是否成功。

See:

reloadTerrainCallback(success)

webgl/ov.js, line 1058
Name Type Description
success Boolean

是否成功

See:

setConditionForHideOverlayLayerCallback(result)

webgl/ov.js, line 3524
Name Type Description
result Object

結果物件。

Name Type Description
success Boolean

是否成功。

See:

setConditionOverlayLayerCallback(result)

webgl/ov.js, line 3666
Name Type Description
result Object

結果物件。

Name Type Description
success Boolean

是否成功。

See: