Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | 1x 2x 1x 4x 1x 209x 1x 4x 4x 4x 1x 4x 1x 4x 1x 4x 1x 4x 1x 4x 1x 4x 1x 4x 4x 4x 4x 4x 4x 1x 4x 4x 4x 4x 4x 4x 1x | import IonResource from "../Core/IonResource.js";
import ArcGisMapServerImageryProvider from "./ArcGisMapServerImageryProvider.js";
import BingMapsImageryProvider from "./BingMapsImageryProvider.js";
import TileMapServiceImageryProvider from "./TileMapServiceImageryProvider.js";
import GoogleEarthEnterpriseMapsProvider from "./GoogleEarthEnterpriseMapsProvider.js";
import MapboxImageryProvider from "./MapboxImageryProvider.js";
import SingleTileImageryProvider from "./SingleTileImageryProvider.js";
import UrlTemplateImageryProvider from "./UrlTemplateImageryProvider.js";
import WebMapServiceImageryProvider from "./WebMapServiceImageryProvider.js";
import WebMapTileServiceImageryProvider from "./WebMapTileServiceImageryProvider.js";
import Google2DImageryProvider from "./Google2DImageryProvider.js";
import Azure2DImageryProvider from "./Azure2DImageryProvider.js";
/**
* An asynchronous callback function that creates an ImageryProvider from
* a Cesium ion asset endpoint.
* @template {ImageryProvider} T
* @callback IonImageryProviderFactoryCallback
* @param {string} url The URL of the imagery service.
* @param {object} endpoint The result of the Cesium ion asset endpoint service.
* @param {Resource} endpointResource The original resource used to retrieve the endpoint.
* @returns {Promise<T>} A promise that resolves to an instance of an ImageryProvider.
* @private
*/
/**
* @private
* @type {IonImageryProviderFactoryCallback<TileMapServiceImageryProvider>}
*/
export const defaultFactoryCallback = async (url, endpoint, endpointResource) =>
TileMapServiceImageryProvider.fromUrl(
new IonResource(endpoint, endpointResource),
);
/**
* @private
* @type {IonImageryProviderFactoryCallback<ArcGisMapServerImageryProvider>}
*/
export const ARCGIS_MAPSERVER = async (url, { options }) =>
ArcGisMapServerImageryProvider.fromUrl(url, options);
/**
* @private
* @type {IonImageryProviderFactoryCallback<BingMapsImageryProvider>}
*/
export const BING = async (url, { options }) => {
return BingMapsImageryProvider.fromUrl(url, options);
};
/**
* @private
* @type {IonImageryProviderFactoryCallback<GoogleEarthEnterpriseMapsProvider>}
*/
export const GOOGLE_EARTH = async (url, { options }) => {
const channel = options.channel;
delete options.channel;
return GoogleEarthEnterpriseMapsProvider.fromUrl(url, channel, options);
};
/**
* @private
* @type {IonImageryProviderFactoryCallback<MapboxImageryProvider>}
*/
export const MAPBOX = async (url, { options }) => {
return new MapboxImageryProvider({
url: url,
...options,
});
};
/**
* @private
* @type {IonImageryProviderFactoryCallback<SingleTileImageryProvider>}
*/
export const SINGLE_TILE = async (url, { options }) =>
SingleTileImageryProvider.fromUrl(url, options);
/**
* @private
* @type {IonImageryProviderFactoryCallback<TileMapServiceImageryProvider>}
*/
export const TMS = async (url, { options }) =>
TileMapServiceImageryProvider.fromUrl(url, options);
/**
* @private
* @type {IonImageryProviderFactoryCallback<UrlTemplateImageryProvider>}
*/
export const URL_TEMPLATE = async (url, { options }) => {
return new UrlTemplateImageryProvider({
url: url,
...options,
});
};
/**
* @private
* @type {IonImageryProviderFactoryCallback<WebMapServiceImageryProvider>}
*/
export const WMS = async (url, { options }) => {
return new WebMapServiceImageryProvider({
url: url,
...options,
});
};
/**
* @private
* @type {IonImageryProviderFactoryCallback<WebMapTileServiceImageryProvider>}
*/
export const WMTS = async (url, { options }) => {
return new WebMapTileServiceImageryProvider({
url: url,
...options,
});
};
/**
* @private
* @type {IonImageryProviderFactoryCallback<Google2DImageryProvider>}
*/
export const GOOGLE_2D_MAPS = async (url, endpoint, endpointResource) => {
delete endpoint.externalType;
endpoint.url = url;
const ionResource = new IonResource(endpoint, endpointResource);
const callback = (ionRoot, endpoint) => {
delete endpoint.externalType;
endpoint.url = url;
const { options } = endpoint;
ionRoot.setQueryParameters({
session: options.session,
key: options.key,
});
};
ionResource.refreshCallback = callback;
return new Google2DImageryProvider({
...endpoint.options,
url: ionResource,
});
};
/**
* @private
* @type {IonImageryProviderFactoryCallback<Azure2DImageryProvider>}
*/
export const AZURE_MAPS = async (url, endpoint, endpointResource) => {
delete endpoint.externalType;
endpoint.url = url;
const ionResource = new IonResource(endpoint, endpointResource);
const callback = (ionRoot, endpoint) => {
delete endpoint.externalType;
endpoint.url = url;
const { options } = endpoint;
ionRoot.setQueryParameters({
"subscription-key": options["subscription-key"],
});
};
ionResource.refreshCallback = callback;
return new Azure2DImageryProvider({
...endpoint.options,
url: ionResource,
});
};
/**
* Mapping of supported external imagery asset types returned from Cesium ion to their
* corresponding ImageryProvider constructors.
* @private
* @type {object<string, IonImageryProviderFactoryCallback>}
*/
const IonImageryProviderFactory = {
ARCGIS_MAPSERVER,
BING,
GOOGLE_EARTH,
MAPBOX,
SINGLE_TILE,
TMS,
URL_TEMPLATE,
WMS,
WMTS,
GOOGLE_2D_MAPS,
AZURE_MAPS,
defaultFactoryCallback,
};
export default Object.freeze(IonImageryProviderFactory);
|