new ov.Widget.Timeline(parameter){ov.Widget.Timeline}
時間線Widget,支援Stop(時間走到stopTime且startTime存在且isRepeat=false時觸發)事件。
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameter |
Object |
參數物件。
|
Returns:
| Type | Description |
|---|---|
| ov.Widget.Timeline | 時間線Widget物件。 |
Example
var param = {};
param.view = terrainView;
param.stopTime = new Date('2021-1-31');
param.style = {bottom: 0};
param.barStyle = { background: "#2D53D8DD"};
param.pinStyle = { background: "#FC845EDD"};
var widget = new ov.Widget.Timeline(param);
Methods
-
addLink(link, title){Boolean}
common/PilotGaea-Widget.js, line 545 -
新增聯動,會自動判斷型別(目前支援ov.TerrainVisualizedDataGridOverlay、ov.WeatherHistoryLayer與ov.MilitarySatelliteEntity)。
Name Type Description linkObject 聯動有時序的目標,若有起終點時間的屬性則自動加入計數色塊並且只在起終點時間之間會顯示。
titleString optional 色塊的名稱,若有給將會在滑鼠移動到色塊上時顯示。
- See:
Returns:
Type Description Boolean 新增成功或失敗。 Example
var layer = terrainView.addTerrainVisualizedDataGridOverlay(layerSetting);
widget.addLink(layer);
var entity = terrainView.getModule('military').addSatelliteEntity(satelliteSetting);
widget.addLink(entity); -
addTimeBlock(parameter){Object}
common/PilotGaea-Widget.js, line 478 -
新增時段色塊。
Name Type Description parameterObject 參數物件。
Name Type Description titleString optional 色塊的名稱,若有給將會在滑鼠移動到色塊上時顯示。
startDate 開始時間。
endDate 結束時間。
colorString optional 時段的顏色,若沒給將自動採用數量相對的顏色。
linkObject optional 對應聯動物件,移除聯動物件時會一併移除這個時段色塊,addLink時系統自動填入。
- See:
Returns:
Type Description Object 時段色塊物件,用於移除時段。 Example
var param = {};
param.start = new Date('2021-1-1');
param.end = new Date('2021-1-31');
param.color = 'green';
var block = widget.addTimeBlock(param); -
getNowTime(){Date}
common/PilotGaea-Widget.js, line 827 -
取得時間軸現在的時間。
Returns:
Type Description Date 播放控制器Widget物件。 -
removeAllTimeBlock()
common/PilotGaea-Widget.js, line 516 -
移除所有時段色塊。
-
removeLink(link)
common/PilotGaea-Widget.js, line 570 -
移除聯動圖層或實體。
Name Type Description linkObject 聯動目標。
-
removeTimeBlock(parameter)
common/PilotGaea-Widget.js, line 499 -
移除時段色塊。
Name Type Description parameterObject 參數物件。
-
toStart()
common/PilotGaea-Widget.js, line 867 -
回到開始時間,若開始時間有設定。
Example
widget.toStart();
-
updateParameter(parameter)
common/PilotGaea-Widget.js, line 601 -
更新時間線Widget參數。
Name Type Description parameterObject 參數物件。
Name Type Default Description leftTimeDate optional 時間軸左邊界時間,Date或任何new Date接受的參數。
timeRangeNumber optional 起始時間範圍,預設為一天。
startTimeDate | null optional 播放開始時間,Date或任何new Date接受的參數,若為null則清除設定。
stopTimeDate | null optional 播放停止時間,Date或任何new Date接受的參數,若為null則清除設定。
addToTerrainViewBoolean true optional 是否加到圖台上。
isRepeatBoolean false optional 是否重複播放,若開始與停止時間都有設定則播放時可重複播放,但停止播放時拖曳不受影響。
styleObject optional 容器DOM元件style參數。
barStyleObject optional 色條元件style參數。
pinStyleObject optional 指針元件style參數。
timeBlocksArray.<Object> optional 時段色塊。
linksArray.<Object> optional 聯動物件。
countColorMapObject optional 計數色塊分層設色表,用於指定為給予顏色設定的色塊統計數量的顏色對照,顏色表與高度表的數量必須相同。
Name Type Description countArray.<Number> optional 計數色塊分層設色的高度表。
colorArray.<ov.Color> optional 計數色塊分層設色的顏色表。
-
updateTime(time)
common/PilotGaea-Widget.js, line 897 -
更新時間。
Name Type Description timeDate 播放時間,Date或任何new Date接受的參數。
Example
var param = { terrainView = terrainView };
var widget = new ov.Widget.Timeline(param);
widget.updateTime('2021-1-31');
widget.updateTime(new Date('2021-1-31'));
widget.updateTime(new Date().getTime()); -
updateTimeElapsed(millisecond)
common/PilotGaea-Widget.js, line 840 -
更新經過時間。
Name Type Description millisecondNumber 經過多少ms。
Example
var param = { terrainView = terrainView };
var widget = new ov.Widget.Timeline(param);
widget.updateTimeElapsed(1000);
widget.updateTimeElapsed(86400000); -
zoomToPlayList()
common/PilotGaea-Widget.js, line 878 -
時間線回到開始與結束時間之間,若開始與結束時間都有設定。
Example
widget.zoomToPlayList();