Skip to content

Commit

Permalink
update ol to v7.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hanreev committed Nov 16, 2022
1 parent cbe5460 commit 2bbec95
Show file tree
Hide file tree
Showing 257 changed files with 2,894 additions and 2,088 deletions.
4 changes: 2 additions & 2 deletions @types/ol/Collection.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface Options {
unique?: boolean | undefined;
}
export default class Collection<T> extends BaseObject {
constructor(opt_array?: T[], opt_options?: Options);
constructor(array?: T[], options?: Options);
/**
* Remove all elements from the collection.
*/
Expand Down Expand Up @@ -88,7 +88,7 @@ export default class Collection<T> extends BaseObject {
): void;
}
export class CollectionEvent<T> extends BaseEvent {
constructor(type: CollectionEventType, opt_element?: T, opt_index?: number);
constructor(type: CollectionEventType, element: T, index: number);
/**
* The element that is added to or removed from the collection.
*/
Expand Down
4 changes: 2 additions & 2 deletions @types/ol/Feature.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type TFeatureObjectEventTypes = 'change:geometry' | 'propertychange';
export type FeatureClass = typeof Feature | typeof RenderFeature;
export type FeatureLike = Feature<Geometry_1> | RenderFeature;
export default class Feature<Geometry extends Geometry_1 = Geometry_1> extends BaseObject {
constructor(opt_geometryOrProperties?: Geometry | ObjectWithGeometry<Geometry>);
constructor(geometryOrProperties?: Geometry | ObjectWithGeometry<Geometry>);
/**
* Clone this feature. If the original feature has a geometry it
* is also cloned. The feature id is not set in the clone.
Expand Down Expand Up @@ -66,7 +66,7 @@ export default class Feature<Geometry extends Geometry_1 = Geometry_1> extends B
* resolution and returns an array of styles. To unset the feature style, call
* setStyle() without arguments or a falsey value.
*/
setStyle(opt_style?: StyleLike): void;
setStyle(style?: StyleLike): void;
on(type: TFeatureBaseEventTypes, listener: ListenerFunction<BaseEvent>): EventsKey;
on(type: TFeatureBaseEventTypes[], listener: ListenerFunction<BaseEvent>): EventsKey[];
once(type: TFeatureBaseEventTypes, listener: ListenerFunction<BaseEvent>): EventsKey;
Expand Down
2 changes: 1 addition & 1 deletion @types/ol/Geolocation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface Options {
projection?: ProjectionLike | undefined;
}
export default class Geolocation extends BaseObject {
constructor(opt_options?: Options);
constructor(options?: Options);
/**
* Clean up.
*/
Expand Down
2 changes: 1 addition & 1 deletion @types/ol/ImageCanvas.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Extent } from './extent';
*/
export type Loader = (p0: (p0?: Error) => void) => void;
export default class ImageCanvas extends ImageBase {
constructor(extent: Extent, resolution: number, pixelRatio: number, canvas: HTMLCanvasElement, opt_loader?: Loader);
constructor(extent: Extent, resolution: number, pixelRatio: number, canvas: HTMLCanvasElement, loader?: Loader);
/**
* Get any error associated with asynchronous rendering.
*/
Expand Down
32 changes: 30 additions & 2 deletions @types/ol/ImageTile.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,42 @@ export default class ImageTile extends Tile {
src: string,
crossOrigin: string,
tileLoadFunction: LoadFunction,
opt_options?: Options,
options?: Options,
);
/**
* Get the HTML image element for this tile (may be a Canvas, Image, or Video).
*/
getImage(): HTMLCanvasElement | HTMLImageElement | HTMLVideoElement;
/**
* Load not yet loaded URI.
* Load the image or retry if loading previously failed.
* Loading is taken care of by the tile queue, and calling this method is
* only needed for preloading or for reloading in case of an error.
* To retry loading tiles on failed requests, use a custom tileLoadFunction
* that checks for error status codes and reloads only when the status code is
* 408, 429, 500, 502, 503 and 504, and only when not too many retries have been
* made already:
* <code>const retryCodes = [408, 429, 500, 502, 503, 504];
* const retries = {};
* source.setTileLoadFunction((tile, src) => {
* const image = tile.getImage();
* fetch(src)
* .then((response) => {
* if (retryCodes.includes(response.status)) {
* retries[src] = (retries[src] || 0) + 1;
* if (retries[src] <= 3) {
* setTimeout(() => tile.load(), retries[src] * 1000);
* }
* return Promise.reject();
* }
* return response.blob();
* })
* .then((blob) => {
* const imageUrl = URL.createObjectURL(blob);
* image.src = imageUrl;
* setTimeout(() => URL.revokeObjectURL(imageUrl), 5000);
* })
* .catch(() => tile.setState(3)); // error
* });</code>
*/
load(): void;
/**
Expand Down
Loading

0 comments on commit 2bbec95

Please sign in to comment.