Class: WeatherModule

ov. WeatherModule

new ov.WeatherModule()

webgl/module/weatherModule/ov-Weather.js, line 6

氣候模組(需先設定氣象資料開放平台授權碼authorization才能成功獲得資料)

Members

apiServer

氣象資料開放平台伺服器位址。

Properties:
Name Type Description
apiServer String

氣象資料開放平台伺服器位址。

authorization

氣象資料開放平台授權碼,需先設定有效的氣象資料開放平台授權碼才能成功獲得資料。

Properties:
Name Type Description
authorization String

氣象資料開放平台授權碼。

readonlylayers

取得全部圖素陣列

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

圖層陣列

proxy

代理伺服器。

Properties:
Name Type Description
proxy String

代理伺服器,需支援TLS1.2以上。

Methods

addRadarReflectivityHistoryLayer(parameter, callback)

webgl/module/weatherModule/ov-Weather.js, line 107

新增雷達回波歷史圖層。

Name Type Description
parameter Object

參數物件。

Name Type Default Description
layername String optional

圖層名稱。

timeFrom Date new Date(-8640000000000000) optional

開始時間(包含),氣象資料開放平台只有保存十天(10246筆)的資料。

timeTo Date new Date() optional

結束時間(包含)。

limit Number 10 optional

限制最多回傳符合條件的最新資料筆數。

offset Number 0 optional

指定從第幾筆開始回傳。

interval Number 10 optional

資料間隔(分鐘),氣象資料開放平台的歷史資料間隔為10分鐘,可以設大一點來降低網路流量與系統負載。

url String optional

直接指定資料來源而不使用API。

callback ov.WeatherModule~addWeatherImageLayerCallback optional

完成後的回呼函式。

addWeatherImageLayer(parameter, callback)

webgl/module/weatherModule/ov-Weather.js, line 78

新增氣候觀測影像圖層,目前支援png/jpeg/網格資料。

Name Type Description
parameter Object

參數物件。

Name Type Description
layername String optional

圖層名稱。

api String optional

觀測API代碼。

url String optional

直接指定資料來源而不使用API。

callback ov.WeatherModule~addWeatherImageLayerCallback optional

完成後的回呼函式。

getCurrentFluidParam(parameter, callback)

webgl/module/weatherModule/ov-Weather.js, line 159

取得台灣海域海流預報的流體參數。

Name Type Description
parameter Object

參數物件。

Name Type Default Description
hour Number 0 optional

第n小時,值域0~72。

url String optional

直接指定資料來源而不使用API。

callback ov.WeatherModule~getCurrentFluidParamCallback optional

完成後的回呼函式。

getFishFarmData(){Array.<Object>}

webgl/module/weatherModule/ov-Weather.js, line 173

取得臺灣定置網範圍資料。

Returns:
Type Description
Array.<Object> 臺灣定置網範圍資料。

getLayerByName(){ov.WeatherLayer|null}

webgl/module/weatherModule/ov-Weather.js, line 181

取得第一個符合名稱的氣候圖層。

Returns:
Type Description
ov.WeatherLayer | null 氣候圖層物件或null。

getObservationData(parameter, callback)

webgl/module/weatherModule/ov-Weather.js, line 139

取得氣候觀測站資料。

Name Type Description
parameter Object

參數物件。

Name Type Description
api String optional

觀測API代碼。

url String optional

直接指定資料來源而不使用API。

callback ov.WeatherModule~getObservationDataCallback optional

完成後的回呼函式。

getRadarReflectivityHistoryValidTimeSpan(callback){Array.<Date>|String}

webgl/module/weatherModule/ov-Weather.js, line 123

取得雷達回波歷史可用時間區間。

Name Type Description
callback ov.WeatherModule~getRadarReflectivityHistoryValidTimeSpanCallback optional

完成後的回呼函式。

Returns:
Type Description
Array.<Date> | String 若未給callback則為同步(注意若在網速較慢的環境可能會卡很久),成功則回傳可用區間的起迄時間,失敗則回傳錯誤訊息。

removeAllLayer()

webgl/module/weatherModule/ov-Weather.js, line 206

移除所有氣候圖層。

removeLayer(entity){Boolean}

webgl/module/weatherModule/ov-Weather.js, line 197

移除指定氣候圖層。

Name Type Description
entity ov.WeatherLayer

圖素。

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

Type Definitions

addWeatherImageLayerCallback(result)

webgl/module/weatherModule/ov-Weather.js, line 88
Name Type Description
result ov.WeatherLayer | String

成功則回傳ov.WeatherLayer物件,失敗則回傳錯誤訊息。

See:

getCurrentFluidParamCallback(result)

webgl/module/weatherModule/ov-Weather.js, line 163
Name Type Description
result Object

可以直接丟給流體模組的參數物件。

See:

getObservationDataCallback(result)

webgl/module/weatherModule/ov-Weather.js, line 142
Name Type Description
result Array.<Object> | String

成功則回傳氣候觀測站資料陣列或者是流體參數,失敗則回傳錯誤訊息。

Name Type Description
title String

測站名稱。

pos GeoPoint

測站位置。

tableData Object

測站資料。

Name Type Description
header Array.<String>

測站資料名稱。

body Array.<String>

測站資料內容。

getRadarReflectivityHistoryValidTimeSpanCallback(result)

webgl/module/weatherModule/ov-Weather.js, line 126
Name Type Description
result Array.<Date> | String

成功則回傳可用區間的起迄時間,失敗則回傳錯誤訊息。

See: