Skip to content

Commit 819fa36

Browse files
committed
Add dist for v13.1.1
1 parent a3889d7 commit 819fa36

File tree

10 files changed

+941
-0
lines changed

10 files changed

+941
-0
lines changed

dist/MapboxVectorLayer.d.ts

Lines changed: 278 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,278 @@
1+
/**
2+
* @typedef {Object} Options
3+
* @property {string} styleUrl The URL of the Mapbox/MapLibre Style object to use for this layer. For a
4+
* style created with Mapbox Studio and hosted on Mapbox, this will look like
5+
* 'mapbox://styles/you/your-style'.
6+
* @property {string} [accessToken] The access token for your Mapbox/MapLibre style. This has to be provided
7+
* for `mapbox://` style urls. For `https://` and other urls, any access key must be the last query
8+
* parameter of the style url.
9+
* @property {string} [source] If your style uses more than one source, you need to use either the
10+
* `source` property or the `layers` property to limit rendering to a single vector source. The
11+
* `source` property corresponds to the id of a vector source in your Mapbox/MapLibre style.
12+
* @property {Array<string>} [layers] Limit rendering to the list of included layers. All layers
13+
* must share the same vector source. If your style uses more than one source, you need to use
14+
* either the `source` property or the `layers` property to limit rendering to a single vector
15+
* source.
16+
* @property {boolean} [declutter=true] Declutter images and text. Decluttering is applied to all
17+
* image and text styles of all Vector and VectorTile layers that have set this to `true`. The priority
18+
* is defined by the z-index of the layer, the `zIndex` of the style and the render order of features.
19+
* Higher z-index means higher priority. Within the same z-index, a feature rendered before another has
20+
* higher priority.
21+
*
22+
* As an optimization decluttered features from layers with the same `className` are rendered above
23+
* the fill and stroke styles of all of those layers regardless of z-index. To opt out of this
24+
* behavior and place declutterd features with their own layer configure the layer with a `className`
25+
* other than `ol-layer`.
26+
* @property {import("ol/layer/Base.js").BackgroundColor|false} [background] Background color for the layer.
27+
* If not specified, the background from the Mapbox/MapLibre Style object will be used. Set to `false` to prevent
28+
* the Mapbox/MapLibre style's background from being used.
29+
* @property {string} [className='ol-layer'] A CSS class name to set to the layer element.
30+
* @property {number} [opacity=1] Opacity (0, 1).
31+
* @property {boolean} [visible=true] Visibility.
32+
* @property {import("ol/extent.js").Extent} [extent] The bounding extent for layer rendering. The layer will not be
33+
* rendered outside of this extent.
34+
* @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers
35+
* will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed
36+
* for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`
37+
* method was used.
38+
* @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be
39+
* visible.
40+
* @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
41+
* be visible. If neither `maxResolution` nor `minZoom` are defined, the layer's `maxResolution` will
42+
* match the style source's `minzoom`.
43+
* @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will
44+
* be visible. If neither `maxResolution` nor `minZoom` are defined, the layer's `minZoom` will match
45+
* the style source's `minzoom`.
46+
* @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will
47+
* be visible.
48+
* @property {import("ol/render.js").OrderFunction} [renderOrder] Render order. Function to be used when sorting
49+
* features before rendering. By default features are drawn in the order that they are created. Use
50+
* `null` to avoid the sort, but get an undefined draw order.
51+
* @property {number} [renderBuffer=100] The buffer in pixels around the tile extent used by the
52+
* renderer when getting features from the vector tile for the rendering or hit-detection.
53+
* Recommended value: Vector tiles are usually generated with a buffer, so this value should match
54+
* the largest possible buffer of the used tiles. It should be at least the size of the largest
55+
* point symbol or line width.
56+
* @property {import("ol/layer/VectorTile.js").VectorTileRenderType} [renderMode='hybrid'] Render mode for vector tiles:
57+
* * `'hybrid'`: Polygon and line elements are rendered as images, so pixels are scaled during zoom
58+
* animations. Point symbols and texts are accurately rendered as vectors and can stay upright on
59+
* rotated views.
60+
* * `'vector'`: Everything is rendered as vectors. Use this mode for improved performance on vector
61+
* tile layers with only a few rendered features (e.g. for highlighting a subset of features of
62+
* another layer with the same source).
63+
* @property {import("ol/Map.js").default} [map] Sets the layer as overlay on a map. The map will not manage
64+
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
65+
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
66+
* use `map.addLayer()`.
67+
* @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be
68+
* recreated during animations. This means that no vectors will be shown clipped, but the setting
69+
* will have a performance impact for large amounts of vector data. When set to `false`, batches
70+
* will be recreated when no animation is active.
71+
* @property {boolean} [updateWhileInteracting=false] When set to `true`, feature batches will be
72+
* recreated during interactions. See also `updateWhileAnimating`.
73+
* @property {number} [preload=0] Preload. Load low-resolution tiles up to `preload` levels. `0`
74+
* means no preloading.
75+
* @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error.
76+
* @property {Object<string, *>} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.
77+
*/
78+
/**
79+
* ```js
80+
* import {MapboxVectorLayer} from 'ol-mapbox-style';
81+
* ```
82+
* A vector tile layer based on a Mapbox/MapLibre style that uses a single vector source. Configure
83+
* the layer with the `styleUrl` and `accessToken` shown in Mapbox Studio's share panel.
84+
* If the style uses more than one source, use the `source` property to choose a single
85+
* vector source. If you want to render a subset of the layers in the style, use the `layers`
86+
* property (all layers must share the same vector source). See the constructor options for
87+
* more detail.
88+
*
89+
* const map = new Map({
90+
* view: new View({
91+
* center: [0, 0],
92+
* zoom: 1,
93+
* }),
94+
* layers: [
95+
* new MapboxVectorLayer({
96+
* styleUrl: 'mapbox://styles/mapbox/bright-v9',
97+
* accessToken: 'your-mapbox-access-token-here',
98+
* }),
99+
* ],
100+
* target: 'map',
101+
* });
102+
*
103+
* On configuration or loading error, the layer will trigger an `'error'` event. Listeners
104+
* will receive an object with an `error` property that can be used to diagnose the problem.
105+
*
106+
* Instances of this class emit an `error` event when an error occurs during style loading:
107+
*
108+
* layer.on('error', function() {
109+
* console.error('Error loading style');
110+
* }
111+
*
112+
* **Note for users of the full build**: The `MapboxVectorLayer` requires the
113+
* [ol-mapbox-style](https://github.com/openlayers/ol-mapbox-style) library to be loaded as well.
114+
*
115+
* @param {Options} options Options.
116+
* @extends {VectorTileLayer<import("ol/source/VectorTile.js").default>}
117+
*/
118+
export default class MapboxVectorLayer extends VectorTileLayer<VectorTileSource<import("ol/render/Feature.js").default>, import("ol/render/Feature.js").default> {
119+
/**
120+
* @param {Options} options Layer options. At a minimum, `styleUrl` and `accessToken`
121+
* must be provided.
122+
*/
123+
constructor(options: Options);
124+
accessToken: string | undefined;
125+
}
126+
export type Map = import("ol/Map.js").default;
127+
export type Options = {
128+
/**
129+
* The URL of the Mapbox/MapLibre Style object to use for this layer. For a
130+
* style created with Mapbox Studio and hosted on Mapbox, this will look like
131+
* 'mapbox://styles/you/your-style'.
132+
*/
133+
styleUrl: string;
134+
/**
135+
* The access token for your Mapbox/MapLibre style. This has to be provided
136+
* for `mapbox://` style urls. For `https://` and other urls, any access key must be the last query
137+
* parameter of the style url.
138+
*/
139+
accessToken?: string | undefined;
140+
/**
141+
* If your style uses more than one source, you need to use either the
142+
* `source` property or the `layers` property to limit rendering to a single vector source. The
143+
* `source` property corresponds to the id of a vector source in your Mapbox/MapLibre style.
144+
*/
145+
source?: string | undefined;
146+
/**
147+
* Limit rendering to the list of included layers. All layers
148+
* must share the same vector source. If your style uses more than one source, you need to use
149+
* either the `source` property or the `layers` property to limit rendering to a single vector
150+
* source.
151+
*/
152+
layers?: string[] | undefined;
153+
/**
154+
* Declutter images and text. Decluttering is applied to all
155+
* image and text styles of all Vector and VectorTile layers that have set this to `true`. The priority
156+
* is defined by the z-index of the layer, the `zIndex` of the style and the render order of features.
157+
* Higher z-index means higher priority. Within the same z-index, a feature rendered before another has
158+
* higher priority.
159+
*
160+
* As an optimization decluttered features from layers with the same `className` are rendered above
161+
* the fill and stroke styles of all of those layers regardless of z-index. To opt out of this
162+
* behavior and place declutterd features with their own layer configure the layer with a `className`
163+
* other than `ol-layer`.
164+
*/
165+
declutter?: boolean | undefined;
166+
/**
167+
* Background color for the layer.
168+
* If not specified, the background from the Mapbox/MapLibre Style object will be used. Set to `false` to prevent
169+
* the Mapbox/MapLibre style's background from being used.
170+
*/
171+
background?: false | import("ol/layer/Base.js").BackgroundColor | undefined;
172+
/**
173+
* A CSS class name to set to the layer element.
174+
*/
175+
className?: string | undefined;
176+
/**
177+
* Opacity (0, 1).
178+
*/
179+
opacity?: number | undefined;
180+
/**
181+
* Visibility.
182+
*/
183+
visible?: boolean | undefined;
184+
/**
185+
* The bounding extent for layer rendering. The layer will not be
186+
* rendered outside of this extent.
187+
*/
188+
extent?: import("ol/extent.js").Extent | undefined;
189+
/**
190+
* The z-index for layer rendering. At rendering time, the layers
191+
* will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed
192+
* for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`
193+
* method was used.
194+
*/
195+
zIndex?: number | undefined;
196+
/**
197+
* The minimum resolution (inclusive) at which this layer will be
198+
* visible.
199+
*/
200+
minResolution?: number | undefined;
201+
/**
202+
* The maximum resolution (exclusive) below which this layer will
203+
* be visible. If neither `maxResolution` nor `minZoom` are defined, the layer's `maxResolution` will
204+
* match the style source's `minzoom`.
205+
*/
206+
maxResolution?: number | undefined;
207+
/**
208+
* The minimum view zoom level (exclusive) above which this layer will
209+
* be visible. If neither `maxResolution` nor `minZoom` are defined, the layer's `minZoom` will match
210+
* the style source's `minzoom`.
211+
*/
212+
minZoom?: number | undefined;
213+
/**
214+
* The maximum view zoom level (inclusive) at which this layer will
215+
* be visible.
216+
*/
217+
maxZoom?: number | undefined;
218+
/**
219+
* Render order. Function to be used when sorting
220+
* features before rendering. By default features are drawn in the order that they are created. Use
221+
* `null` to avoid the sort, but get an undefined draw order.
222+
*/
223+
renderOrder?: import("ol/render.js").OrderFunction | undefined;
224+
/**
225+
* The buffer in pixels around the tile extent used by the
226+
* renderer when getting features from the vector tile for the rendering or hit-detection.
227+
* Recommended value: Vector tiles are usually generated with a buffer, so this value should match
228+
* the largest possible buffer of the used tiles. It should be at least the size of the largest
229+
* point symbol or line width.
230+
*/
231+
renderBuffer?: number | undefined;
232+
/**
233+
* Render mode for vector tiles:
234+
* * `'hybrid'`: Polygon and line elements are rendered as images, so pixels are scaled during zoom
235+
* animations. Point symbols and texts are accurately rendered as vectors and can stay upright on
236+
* rotated views.
237+
* * `'vector'`: Everything is rendered as vectors. Use this mode for improved performance on vector
238+
* tile layers with only a few rendered features (e.g. for highlighting a subset of features of
239+
* another layer with the same source).
240+
*/
241+
renderMode?: import("ol/layer/VectorTile.js").VectorTileRenderType | undefined;
242+
/**
243+
* Sets the layer as overlay on a map. The map will not manage
244+
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
245+
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
246+
* use `map.addLayer()`.
247+
*/
248+
map?: import("ol/Map.js").default | undefined;
249+
/**
250+
* When set to `true`, feature batches will be
251+
* recreated during animations. This means that no vectors will be shown clipped, but the setting
252+
* will have a performance impact for large amounts of vector data. When set to `false`, batches
253+
* will be recreated when no animation is active.
254+
*/
255+
updateWhileAnimating?: boolean | undefined;
256+
/**
257+
* When set to `true`, feature batches will be
258+
* recreated during interactions. See also `updateWhileAnimating`.
259+
*/
260+
updateWhileInteracting?: boolean | undefined;
261+
/**
262+
* Preload. Load low-resolution tiles up to `preload` levels. `0`
263+
* means no preloading.
264+
*/
265+
preload?: number | undefined;
266+
/**
267+
* Use interim tiles on error.
268+
*/
269+
useInterimTilesOnError?: boolean | undefined;
270+
/**
271+
* Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.
272+
*/
273+
properties?: {
274+
[x: string]: any;
275+
} | undefined;
276+
};
277+
import VectorTileSource from 'ol/source/VectorTile.js';
278+
import VectorTileLayer from 'ol/layer/VectorTile.js';

0 commit comments

Comments
 (0)