@esri/wayback-core

中文文档
2.0.0发布于 2026/11/10Apache-2.0TypeScriptES Module零依赖近 30 天下载 3.6万

This package offers core functionalities to retrieve all versions of the World Imagery Wayback archieve, or find versions that contain local changes.

原始使用文档
文档目录16 节
  1. Table of Contents
  2. Installation
  3. API Documentation
  4. getWaybackItems
  5. getWaybackItemsWithLocalChanges
  6. getMetadata
  7. getWaybackServiceBaseURL
  8. setCustomWaybackConfig
  9. Type Definitions
  10. WaybackItem
  11. WaybackMetadata
  12. Issues
  13. Contributing
  14. Licensing
  15. The Imagery
  16. The Software

wayback-core

This package offers core functionalities to retrieve all versions of the World Imagery Wayback archive, or find versions that contain local changes. It is the underlying library used by the Esri World Imagery Wayback App.

Table of Contents

Installation

Install the package using npm with the command below:

npm install @esri/wayback-core

API Documentation

getWaybackItems

Return a list of WaybackItem for all World Imagery Wayback releases/versions from the Wayback archive. The output list is sorted by release date in descending order (newest release is the first item).

Parameters:
None

Returns:

TypeDescription
Promise<WaybackItem[]>When resolved, returns a list of WaybackItem sorted by release date in descending order.

Example:

import {
    getWaybackItems,
} from '@esri/wayback-core';

const waybackItems = await getWaybackItems();

Here is an example of the response returned by getWaybackItems():

[
    {
        "itemID":"f5f90c7419f24ceda396088f4e39ae83",
        "itemTitle":"World Imagery (Wayback 2023-12-07)",
        "itemURL":"https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/56102/{level}/{row}/{col}",
        "metadataLayerUrl":"https://metadata.maptiles.arcgis.com/arcgis/rest/services/World_Imagery_Metadata_2023_r11/MapServer",
        "metadataLayerItemID":"be19e857134046638a10dc2886a5398b",
        "layerIdentifier":"WB_2023_R11",
        "releaseNum":56102,
        "releaseDateLabel":"2023-12-07",
        "releaseDatetime": 1701936000000,
    },
    //...
]

getWaybackItemsWithLocalChanges

Return a list of WaybackItem with local changes for a specified geographic point at a given zoom level.

Parameters:

ParameterTypeRequiredDefaultDescription
point{ latitude: number; longitude: number; }Yes—The geographic coordinates (longitude and latitude) of the location of interest, (e.g., {longitude: -100.05, latitude: 35.10})
zoomnumberYes—The zoom level used to determine the level of detail for the geographic point
options.signalAbortSignalNo—An AbortSignal to cancel the operation. If aborted, the function throws an error.
options.onlyUseSizeToFilterDuplicatesbooleanNofalseWhen true, duplicate releases are filtered by tile size alone without fetching image data. This can significantly improve performance, but may cause some unique releases to be incorrectly excluded.

Returns:

TypeDescription
Promise<WaybackItem[]>When resolved, returns a list of WaybackItem with local changes.

Example:

import { 
    getWaybackItemsWithLocalChanges 
} from '@esri/wayback-core';

const waybackItems = await getWaybackItemsWithLocalChanges(
    {
        longitude: 117.1825,
        latitude: 34.0556,
    },
    15
);

Example with options:

const controller = new AbortController();

const waybackItems = await getWaybackItemsWithLocalChanges(
    {
        longitude: 117.1825,
        latitude: 34.0556,
    },
    15,
    {
        signal: controller.signal,
        onlyUseSizeToFilterDuplicates: true,
    }
);

Here is an example of the response returned by getWaybackItemsWithLocalChanges():

[
    {
        "itemID":"f5f90c7419f24ceda396088f4e39ae83",
        "itemTitle":"World Imagery (Wayback 2023-12-07)",
        "itemURL":"https://waybackdev.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/56102/{level}/{row}/{col}",
        "metadataLayerUrl":"https://metadatadev.maptiles.arcgis.com/arcgis/rest/services/World_Imagery_Metadata_2023_r11/MapServer",
        "metadataLayerItemID":"be19e857134046638a10dc2886a5398b",
        "layerIdentifier":"WB_2023_R11",
        "releaseNum":56102,
        "releaseDateLabel":"2023-12-07",
        "releaseDatetime": 1701936000000,
    },
    //...
]

getMetadata

Query the wayback metadata feature service associated with the given wayback release/version to retrieve information (acquisition date, provider, resolution, etc.) of the world imagery wayback tile image at the specified location and zoom level.

Parameters:

ParameterTypeRequiredDescription
point{ latitude: number; longitude: number; }YesThe geographic coordinates (longitude and latitude) of the location of interest, (e.g., {longitude: -100.05, latitude: 35.10})
zoomnumberYesThe zoom level
releaseNumbernumberYesThe release number of a given wayback release/version. (You can find the release number from the WaybackItem)
options.signalAbortSignalNoAn AbortSignal to cancel the request. If aborted, the function throws an error.

Returns:

TypeDescription
Promise<WaybackMetadata>When resolved, returns the WaybackMetadata

Example:

import { getMetadata } from '@esri/wayback-core';

const metadata = await getMetadata(
    {
        longitude: 117.1825,
        latitude: 34.0556,
    },
    15,
    56102,
);

Example with options:

const controller = new AbortController();

const metadata = await getMetadata(
    {
        longitude: 117.1825,
        latitude: 34.0556,
    },
    15,
    56102,
    {
        signal: controller.signal,
    }
);

Here is an example of the response returned by getMetadata():

{
    "date": 1680307200000, 
    "provider": 'Maxar', 
    "source": 'WV03', 
    "resolution": 0.3, 
    "accuracy": 5
}

getWaybackServiceBaseURL

Returns the base URL for the Wayback service, with a randomly selected subdomain.

Parameters: None

Returns:

TypeDescription
stringThe base URL for the Wayback service with a randomly selected subdomain.

Example:

import { getWaybackServiceBaseURL } from '@esri/wayback-core';

const baseURL = getWaybackServiceBaseURL();
console.log(baseURL);
// Example output: "https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"

setCustomWaybackConfig

Configure custom wayback settings for testing or development purposes. This allows you to override the default Wayback configuration with custom subdomains, configuration file URLs, or configuration data.

Parameters:

ParameterTypeDescription
params.subDomainsstring[](Optional) An array of custom subdomain names to use instead of the default production subdomains: ['wayback', 'wayback-a', 'wayback-b']
params.waybackConfigFileURLstring(Optional) A custom URL for the wayback configuration file to use instead of the default production URL: https://s3-us-west-2.amazonaws.com/config.maptiles.arcgis.com/waybackconfig.json
params.waybackConfigDataWaybackConfig(Optional) Custom wayback configuration data to use directly, bypassing the need to fetch it from a configuration file URL

Returns:

TypeDescription
voidThis function does not return a value

Example:

import { setCustomWaybackConfig } from '@esri/wayback-core';

// Example 1: Set custom subdomains and configuration file URL
setCustomWaybackConfig({
    subDomains: ['custom-wayback-1', 'custom-wayback-2'],
    waybackConfigFileURL: 'https://example.com/custom-wayback-config.json'
});

// Example 2: Set custom configuration data directly
setCustomWaybackConfig({
    waybackConfigData: {
        '12345': {
            itemID: 'custom-item-id',
            itemTitle: 'World Imagery (Wayback 2024-01-15)',
            itemURL: 'https://custom.url/tile/12345/{level}/{row}/{col}',
            metadataLayerUrl: 'https://custom.metadata.url/MapServer',
            metadataLayerItemID: 'custom-metadata-id',
            layerIdentifier: 'WB_2024_R01',
        }
    }
});

Type Definitions

WaybackItem

Object that represents a specific release/version of the World Imagery Wayback archive.

Usage:

import { WaybackItem } from '@esri/wayback-core';

Properties:

NameTypeDescription
itemIDstringId of the ArcGIS Online Item (WMTS Layer) for this World Imagery Wayback release (e.g., 903f0abe9c3b452dafe1ca5b8dd858b9)
itemTitlestringTitle of this World Imagery Wayback release (e.g., World Imagery (Wayback 2014-02-20))
itemURLstringURL template of the WMTS Layer for this Wayback release (e.g., https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/10/{level}/{row}/{col})
metadataLayerItemIDstringId of the ArcGIS Online Item (Feature Layer) for the metadata of this World Imagery Wayback release (e.g., 73b47bbc112b498daf85d40fb972738a)
metadataLayerUrlstringURL of the metadata Feature Layer (e.g., https://metadata.maptiles.arcgis.com/arcgis/rest/services/World_Imagery_Metadata_2014_r01/MapServer)
layerIdentifierstringA unique identifier of this World Imagery Wayback Release (e.g., WB_2014_R01)
releaseNumnumberNumber of this Wayback release, which is being used as the time parameter in the itemURL: /MapServer/tile/{releaseNum}/{level}/{row}/{col}.
releaseDateLabelstringFormatted release date for this Wayback item (e.g., "2014-02-20")
releaseDatetimenumberRelease date for this Wayback item as a Unix epoch timestamp (e.g., 1392883200000)

WaybackMetadata

This object represents the metadata of a Wayback tile image.

Usage:

import { WaybackMetadata } from '@esri/wayback-core';

Properties:

NameTypeDescription
datenumberAcquisition date of the image
providerstringProvider of the image
sourcestringSource of the image
resolutionnumberGround distance that pixels represent
accuracynumberNumber of meters objects are within

Issues

Find a bug or want to request a new feature? Please let us know by submitting an issue.

Contributing

Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.

Licensing

The Imagery

The imagery presented in the Wayback Archive is subject to the terms and conditions set forth in the Esri Master Agreement or Terms of Use. See World Imagery for additional details on the imagery content and applicable Terms of Use.

The Software

Copyright 2023 Esri

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's LICENSE file.

版本与发布记录

@esri/wayback-core 共发布 6 个版本,首次发布于 2025/10/02;过去 12 个月发布了 4 个版本。

版本发布日期距今
2.0.0latest2026/11/104 天前
1.2.02026/11/077 天前
1.1.02026/06/115 个月前
1.1.0-beta.0beta2026/05/146 个月前
1.0.102025/10/041.1 年前
1.0.92025/10/021.1 年前

关于 @esri/wayback-core 的常见问题

@esri/wayback-core 是什么?

This package offers core functionalities to retrieve all versions of the World Imagery Wayback archieve, or find versions that contain local changes.

如何安装 @esri/wayback-core?

在项目目录运行 npm install @esri/wayback-core,或使用 pnpm add / yarn add / bun add。

@esri/wayback-core 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@esri/wayback-core 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@esri/wayback-core 可以商用吗?

@esri/wayback-core 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@esri/wayback-core 的下载量有多少?

根据 npm 官方下载统计,@esri/wayback-core 在 2026/10/14 – 2026/11/12 这 30 天内被下载 36,322 次,日均约 1,211 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@esri/wayback-core 还在维护吗?

最新版本 2.0.0 发布于 2026/11/10(4 天前);至今共发布 6 个版本,其中过去 12 个月发布了 4 个;首次发布于 2025/10/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。