new ov2D3D.OvControl(target, mode)
2D3D圖台控制器
| Name | Type | Description |
|---|---|---|
target |
String |
ID 欲綁定DIV的ID。 |
mode |
String |
預設的顯示模式,若不指定則預設顯示3D,其值必須為ov2D3D_DISPLAY_DIMENSION的值,注意若希望預設顯示2D建議使用ov2D3D.OvControl.DefaultTo2D |
Example
var View2D3D = new ov2D3D.OvControl("view");
Classes
Members
-
Document2DCMapDocument
-
2D文件物件
-
View2DCMapView
-
2D視圖
-
View3Dov.TerrainView
-
3D地形視圖
Methods
-
abortInput()
common/PilotGaea-2D3D-glue.js, line 611 -
中斷一個輸入。
Example
View2D3D.abortInput();
-
abortMeasure()
common/PilotGaea-2D3D-glue.js, line 657 -
中斷測量。
Example
View2D3D.abortMeasure();
-
addWMTSOverlay(url, id, fromPGMapServer, layerName, token){ov2D3D.WMTSOverlayLayer2D3D}
common/PilotGaea-2D3D-glue.js, line 241 -
新增一張WMTS疊加圖層
Name Type Description urlString WMTS來源位置。
idString WMTS的索引名稱。
fromPGMapServerBoolean 此圖層服務是否來自PilotGaea伺服器。
layerNameString 圖層名稱。
tokenString 若有需要提供,token。
Returns:
Type Description ov2D3D.WMTSOverlayLayer2D3D 圖層手柄 Example
View2D3D.addWMTSOverlay('http://maps.nlsc.gov.tw/S_Maps/wmts', 'TOWN', false);
-
bounceTo(point)
common/PilotGaea-2D3D-glue.js, line 736 -
彈跳移動視圖視野到指定位置上。
Name Type Description pointGeoPoint 指定位置。
Example
View2D3D.bounceTo(new GeoPoint(13532015.083096033,2883016.813265035));
-
clearMeasure()
common/PilotGaea-2D3D-glue.js, line 621 -
清除輸入。
Example
View2D3D.clearMeasure();
-
elasticTo(point)
common/PilotGaea-2D3D-glue.js, line 718 -
吸附移動視圖視野到指定位置上。
Name Type Description pointGeoPoint 指定位置。
Example
View2D3D.elasticTo(new GeoPoint(13532015.083096033,2883016.813265035));
-
flyTo(point)
common/PilotGaea-2D3D-glue.js, line 671 -
飛越移動視圖視野到指定位置上。
Name Type Description pointGeoPoint 指定位置。
Example
View2D3D.flyTo(new GeoPoint(13532015.083096033,2883016.813265035));
-
getCurrentMode(){ov2D3D_DISPLAY_DIMENSION}
common/PilotGaea-2D3D-glue.js, line 877 -
取得目前圖台展示模式。
Returns:
Type Description ov2D3D_DISPLAY_DIMENSION 目前的展示模式。 -
getWMTSOverlayCount(){Number}
common/PilotGaea-2D3D-glue.js, line 296 -
取得所有WMTS疊加圖層數。
Returns:
Type Description Number 疊加圖層數。 Example
var count = View2D3D.getWMTSOverlayCount();
-
getWMTSOverlays(){Array.<ov2D3D.WMTSOverlayLayer2D3D>}
common/PilotGaea-2D3D-glue.js, line 286 -
取得所有WMTS疊加圖層手柄。
Returns:
Type Description Array.<ov2D3D.WMTSOverlayLayer2D3D> 疊加圖層手柄。 Example
var handles = View2D3D.getWMTSOverlays();
-
initView(epsg, terrainSrcIPAddress, terrainSrcPort, terrainSrcName, wmtsURL, wmtsID, wmtsProxy, callback)
common/PilotGaea-2D3D-glue.js, line 399 -
初始化圖台視圖。
Name Type Description epsgNumber 指示圖台的EPSG。
terrainSrcIPAddressString 地形來源的伺服器位址。
terrainSrcPortString 地形來源的伺服器埠口號。
terrainSrcNameString 地形圖層在伺服器上的名稱。
wmtsURLString 底圖的WMTS來源位置。
wmtsIDString 底圖的WMTS的索引名稱。
wmtsProxyBoolean 指示3D圖台底圖是否要使用代理來進行取圖。
callbackfunction 初始化完成後的回呼。
Example
var View2D3D = new ov2D3D.OvControl("view");
View2D3D.initView(3857, "127.0.0.1", "8080", "terrain", "http://maps.nlsc.gov.tw/S_Maps/wmts", "PHOTO2", true, function (){}); -
initViewParameter(parameter, callback)
common/PilotGaea-2D3D-glue.js, line 434 -
使用物件參數初始化圖台視圖。
Name Type Description parameterObject Name Type Description epsgNumber 指示圖台的EPSG。
terrainIpString 地形來源的伺服器位址。
terrainPortString 地形來源的伺服器埠口號。
terrainNameString 地形圖層在伺服器上的名稱。
terrainSettingObject 地形圖層的初始化設定。
wmtsUrlString 底圖的WMTS來源位置。
wmtsIdentifierString 底圖的WMTS的索引名稱。
wmtsProxyBoolean 指示3D圖台底圖是否要使用代理來進行取圖。
callbackfunction 初始化完成後的回呼。
Example
var View2D3D = new ov2D3D.OvControl("view");
View2D3D.initViewParameter({
epsg: 3857,
terrainIp: "127.0.0.1",
terrainPort: "8080",
terrainName: "terrain",
terrainSetting: {}
wmtsUrl: "http://maps.nlsc.gov.tw/S_Maps/wmts",
wmtsIdentifier: "PHOTO2",
wmtsProxy: true
}, function (){}); -
inputPoint(success, fail)
common/PilotGaea-2D3D-glue.js, line 509 -
輸入一個點。
Name Type Description successfunction 點輸入成功的回呼,會返回一個幾何。
failfunction 點輸入失敗的回呼。
Example
View2D3D.inputPoint(
function(Geo){
//TODO
},
function(){
//TODO
}
); -
inputPolygon(success, fail)
common/PilotGaea-2D3D-glue.js, line 472 -
輸入一個多邊形。
Name Type Description successfunction 多邊形輸入成功的回呼,會返回一個幾何。
failfunction 多邊形輸入失敗的回呼。
Example
View2D3D.inputPolygon(
function(Geo){
//TODO
},
function(){
//TODO
}
); -
inputPolyline(success, fail)
common/PilotGaea-2D3D-glue.js, line 583 -
輸入一個聚合線。
Name Type Description successfunction 聚合線輸入成功的回呼,會返回一個幾何。
failfunction 聚合線輸入失敗的回呼。
Example
View2D3D.inputPolyline(
function(Geo){
//TODO
},
function(){
//TODO
}
); -
inputRectangle(success, fail)
common/PilotGaea-2D3D-glue.js, line 546 -
輸入一個矩形。
Name Type Description successfunction 矩形輸入成功的回呼,會返回一個幾何。
failfunction 矩形輸入失敗的回呼。
Example
View2D3D.inputRectangle(
function(Geo){
//TODO
},
function(){
//TODO
}
); -
isUnderGround(){Boolean}
common/PilotGaea-2D3D-glue.js, line 450 -
指示目前3D攝影機位置是否在地底,若是2D模式將會直接返回false。
Returns:
Type Description Boolean 是否在地底。 -
measureArea()
common/PilotGaea-2D3D-glue.js, line 631 -
測量面積。
Example
View2D3D.measureArea();
-
measureLength()
common/PilotGaea-2D3D-glue.js, line 644 -
測量長度。
Example
View2D3D.measureLength();
-
modeSwap(complete)
common/PilotGaea-2D3D-glue.js, line 864 -
2D與3D圖台相互切換。
Name Type Description completefunction 當切換完畢時的回呼。
Example
View2D3D.modeSwap(function(){
alert("done!");
}); -
moveTo(point)
common/PilotGaea-2D3D-glue.js, line 771 -
瞬間移動視圖視野到指定位置上。
Name Type Description pointGeoPoint 指定位置。
Example
View2D3D.moveTo(new GeoPoint(13532015.083096033,2883016.813265035));
-
moveWMTSOverlayTo(overlay, index)
common/PilotGaea-2D3D-glue.js, line 327 -
移動一張WMTS疊加圖層到指定位置上。
Name Type Description overlayov2D3D.WMTSOverlayLayer2D3D 疊加圖層手柄。
indexNumber 疊加圖層位置。
Example
View2D3D.moveWMTSOverlayToBottom(handle, 3);//移到位置3
-
moveWMTSOverlayToBottom(overlay)
common/PilotGaea-2D3D-glue.js, line 316 -
移動一張WMTS疊加圖層到最底層。
Name Type Description overlayov2D3D.WMTSOverlayLayer2D3D 疊加圖層手柄。
Example
View2D3D.moveWMTSOverlayToBottom(handle);
-
moveWMTSOverlayToTop(overlay)
common/PilotGaea-2D3D-glue.js, line 306 -
移動一張WMTS疊加圖層到最上層。
Name Type Description overlayov2D3D.WMTSOverlayLayer2D3D 疊加圖層手柄。
Example
View2D3D.moveWMTSOverlayToTop(handle);
-
panTo(point)
common/PilotGaea-2D3D-glue.js, line 699 -
平移移動視圖視野到指定位置上。
Name Type Description pointGeoPoint 指定位置。
Example
View2D3D.panTo(new GeoPoint(13532015.083096033,2883016.813265035));
-
removeAllWMTSOverlay()
common/PilotGaea-2D3D-glue.js, line 272 -
移除所有WMTS疊加圖層。
Example
View2D3D.removeAllWMTSOverlay();
-
removeWMTSOverlay(overlay)
common/PilotGaea-2D3D-glue.js, line 255 -
移除一張WMTS疊加圖層。
Name Type Description overlayov2D3D.WMTSOverlayLayer2D3D 圖層手柄。
Example
View2D3D.removeWMTSOverlay(handle);
-
setBaseLayer(wmtsURL, wmtsName, fromPilotGaea, proxy)
common/PilotGaea-2D3D-glue.js, line 832 -
設定視圖底圖。
Name Type Description wmtsURLString 底圖的WMTS來源位置。
wmtsNameString 底圖的WMTS的索引名稱。
fromPilotGaeaBoolean 指示此圖層服務是否來自PilotGaea伺服器。
proxyBoolean 指示3D圖台底圖是否要使用代理來進行取圖。
Example
View2D3D.setBaseLayer('http://maps.nlsc.gov.tw/S_Maps/wmts', 'EMAP5');