UNPKG

ol

Version:

OpenLayers mapping library

172 lines 7.39 kB
export default XYZ; export type Options = { /** * Attributions. */ attributions?: string | string[] | ((arg0: import("../PluggableMap.js").FrameState) => string | string[]); /** * Attributions are collapsible. */ attributionsCollapsible?: boolean; /** * Tile cache size. The default depends on the screen size. Will be ignored if too small. */ cacheSize?: number; /** * The `crossOrigin` attribute for loaded images. Note that * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer. * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. */ crossOrigin?: string; /** * Whether the layer is opaque. */ opaque?: boolean; /** * Projection. */ projection?: string | import("../proj/Projection.js").default; /** * Maximum allowed reprojection error (in pixels). * Higher values can increase reprojection performance, but decrease precision. */ reprojectionErrorThreshold?: number; /** * Optional max zoom level. Not used if `tileGrid` is provided. */ maxZoom?: number; /** * Optional min zoom level. Not used if `tileGrid` is provided. */ minZoom?: number; /** * Optional tile grid resolution at level zero. Not used if `tileGrid` is provided. */ maxResolution?: number; /** * Tile grid. */ tileGrid?: import("../tilegrid/TileGrid.js").default; /** * Optional function to load a tile given a URL. The default is * ```js * function(imageTile, src) { * imageTile.getImage().src = src; * }; * ``` */ tileLoadFunction?: (arg0: import("../Tile.js").default, arg1: string) => void; /** * The pixel ratio used by the tile service. * For example, if the tile service advertizes 256px by 256px tiles but actually sends 512px * by 512px images (for retina/hidpi devices) then `tilePixelRatio` * should be set to `2`. */ tilePixelRatio?: number; /** * The tile size used by the tile service. * Not used if `tileGrid` is provided. */ tileSize?: number | number[]; /** * Optional function to get * tile URL given a tile coordinate and the projection. * Required if `url` or `urls` are not provided. */ tileUrlFunction?: (arg0: number[], arg1: number, arg2: import("../proj/Projection.js").default) => string; /** * URL template. Must include `{x}`, `{y}` or `{-y}`, * and `{z}` placeholders. A `{?-?}` template pattern, for example `subdomain{a-f}.domain.com`, * may be used instead of defining each one separately in the `urls` option. */ url?: string; /** * An array of URL templates. */ urls?: string[]; /** * Whether to wrap the world horizontally. */ wrapX?: boolean; /** * Duration of the opacity transition for rendering. * To disable the opacity transition, pass `transition: 0`. */ transition?: number; /** * Indicate which resolution should be used * by a renderer if the view resolution does not match any resolution of the tile source. * If 0, the nearest resolution will be used. If 1, the nearest lower resolution * will be used. If -1, the nearest higher resolution will be used. */ zDirection?: number; }; /** * @typedef {Object} Options * @property {import("./Source.js").AttributionLike} [attributions] Attributions. * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible. * @property {number} [cacheSize] Tile cache size. The default depends on the screen size. Will be ignored if too small. * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer. * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. * @property {boolean} [opaque=true] Whether the layer is opaque. * @property {import("../proj.js").ProjectionLike} [projection='EPSG:3857'] Projection. * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). * Higher values can increase reprojection performance, but decrease precision. * @property {number} [maxZoom=42] Optional max zoom level. Not used if `tileGrid` is provided. * @property {number} [minZoom=0] Optional min zoom level. Not used if `tileGrid` is provided. * @property {number} [maxResolution] Optional tile grid resolution at level zero. Not used if `tileGrid` is provided. * @property {import("../tilegrid/TileGrid.js").default} [tileGrid] Tile grid. * @property {import("../Tile.js").LoadFunction} [tileLoadFunction] Optional function to load a tile given a URL. The default is * ```js * function(imageTile, src) { * imageTile.getImage().src = src; * }; * ``` * @property {number} [tilePixelRatio=1] The pixel ratio used by the tile service. * For example, if the tile service advertizes 256px by 256px tiles but actually sends 512px * by 512px images (for retina/hidpi devices) then `tilePixelRatio` * should be set to `2`. * @property {number|import("../size.js").Size} [tileSize=[256, 256]] The tile size used by the tile service. * Not used if `tileGrid` is provided. * @property {import("../Tile.js").UrlFunction} [tileUrlFunction] Optional function to get * tile URL given a tile coordinate and the projection. * Required if `url` or `urls` are not provided. * @property {string} [url] URL template. Must include `{x}`, `{y}` or `{-y}`, * and `{z}` placeholders. A `{?-?}` template pattern, for example `subdomain{a-f}.domain.com`, * may be used instead of defining each one separately in the `urls` option. * @property {Array<string>} [urls] An array of URL templates. * @property {boolean} [wrapX=true] Whether to wrap the world horizontally. * @property {number} [transition] Duration of the opacity transition for rendering. * To disable the opacity transition, pass `transition: 0`. * @property {number} [zDirection=0] Indicate which resolution should be used * by a renderer if the view resolution does not match any resolution of the tile source. * If 0, the nearest resolution will be used. If 1, the nearest lower resolution * will be used. If -1, the nearest higher resolution will be used. */ /** * @classdesc * Layer source for tile data with URLs in a set XYZ format that are * defined in a URL template. By default, this follows the widely-used * Google grid where `x` 0 and `y` 0 are in the top left. Grids like * TMS where `x` 0 and `y` 0 are in the bottom left can be used by * using the `{-y}` placeholder in the URL template, so long as the * source does not have a custom tile grid. In this case, * {@link module:ol/source/TileImage} can be used with a `tileUrlFunction` * such as: * * tileUrlFunction: function(coordinate) { * return 'http://mapserver.com/' + coordinate[0] + '/' + * coordinate[1] + '/' + coordinate[2] + '.png'; * } * * @api */ declare class XYZ extends TileImage { /** * @param {Options=} opt_options XYZ options. */ constructor(opt_options?: Options); } import TileImage from "./TileImage.js"; //# sourceMappingURL=XYZ.d.ts.map