當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


JavaScript ArcGIS timeUtils.getTimeExtentFromLayers用法及代碼示例

基本信息

以下是所在類或對象的基本信息。

AMD: require(["esri/support/timeUtils"], (timeUtils) => { /* code goes here */ });

ESM: import * as timeUtils from "@arcgis/core/support/timeUtils";

對象: esri/support/timeUtils

自從:用於 JavaScript 4.21 的 ArcGIS API

用法說明

timeUtils.getTimeExtentFromLayers函數(或屬性)的定義如下:

getTimeExtentFromLayers (layers, signal) {Promise<TimeExtent>}


返回所有圖層的時間範圍。

參數:

類型說明

用於計算時間範圍的數組或圖層集合。

signal AbortSignal

AbortSignal 允許可取消的請求。如果取消,promise 將被拒絕,並出現名為 AbortError 的錯誤。另見AbortController

返回:

類型 說明
Promise<TimeExtent> 返回一個解析為 TimeExtent 的承諾。

例子:

// Get the time extent of all layers in the view.
const fullTimeExtent = await getTimeExtentFromLayers(view.map.allLayers);
// Get the time extent from an array of layers.
const timeExtent = await getTimeExtentFromLayers([
  earthquakes,
  emergencyCalls
]);

相關用法


注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 timeUtils.getTimeExtentFromLayers。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。