mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
Merge pull request #14645 from achimha/patch-1
Updates from openlayers 4.0.1
This commit is contained in:
86
openlayers/index.d.ts
vendored
86
openlayers/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for OpenLayers v3.20.0
|
||||
// Type definitions for OpenLayers v4.0.1
|
||||
// Project: http://openlayers.org/
|
||||
// Definitions by: Olivier Sechet <https://github.com/osechet>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -10,55 +10,6 @@ declare type GlobalObject = Object;
|
||||
* @namespace ol
|
||||
*/
|
||||
declare module ol {
|
||||
/**
|
||||
* The animation static methods are designed to be used with the
|
||||
* {@link ol.Map#beforeRender} method. For example:
|
||||
*
|
||||
* var map = new ol.Map({ ... });
|
||||
* var zoom = ol.animation.zoom({
|
||||
* resolution: map.getView().getResolution()
|
||||
* });
|
||||
* map.beforeRender(zoom);
|
||||
* map.getView().setResolution(map.getView().getResolution() * 2);
|
||||
*
|
||||
* @namespace ol.animation
|
||||
*/
|
||||
module animation {
|
||||
/**
|
||||
* Generate an animated transition that will "bounce" the resolution as it
|
||||
* approaches the final value.
|
||||
* @param {olx.animation.BounceOptions} options Bounce options.
|
||||
* @return {ol.PreRenderFunction} Pre-render function.
|
||||
* @api
|
||||
*/
|
||||
function bounce(options: olx.animation.BounceOptions): ol.PreRenderFunction;
|
||||
|
||||
/**
|
||||
* Generate an animated transition while updating the view center.
|
||||
* @param {olx.animation.PanOptions} options Pan options.
|
||||
* @return {ol.PreRenderFunction} Pre-render function.
|
||||
* @api
|
||||
*/
|
||||
function pan(options: olx.animation.PanOptions): ol.PreRenderFunction;
|
||||
|
||||
/**
|
||||
* Generate an animated transition while updating the view rotation.
|
||||
* @param {olx.animation.RotateOptions} options Rotate options.
|
||||
* @return {ol.PreRenderFunction} Pre-render function.
|
||||
* @api
|
||||
*/
|
||||
function rotate(options: olx.animation.RotateOptions): ol.PreRenderFunction;
|
||||
|
||||
/**
|
||||
* Generate an animated transition while updating the view resolution.
|
||||
* @param {olx.animation.ZoomOptions} options Zoom options.
|
||||
* @return {ol.PreRenderFunction} Pre-render function.
|
||||
* @api
|
||||
*/
|
||||
function zoom(options: olx.animation.ZoomOptions): ol.PreRenderFunction;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Error object thrown when an assertion failed. This is an ECMA-262 Error,
|
||||
* extended with a `code` property.
|
||||
@@ -6683,15 +6634,6 @@ declare module ol {
|
||||
*/
|
||||
addOverlay(overlay: ol.Overlay): void;
|
||||
|
||||
/**
|
||||
* Add functions to be called before rendering. This can be used for attaching
|
||||
* animations before updating the map's view. The {@link ol.animation}
|
||||
* namespace provides several static methods for creating prerender functions.
|
||||
* @param {...ol.PreRenderFunction} var_args Any number of pre-render functions.
|
||||
* @api
|
||||
*/
|
||||
beforeRender(var_args: ol.PreRenderFunction): void;
|
||||
|
||||
/**
|
||||
* Detect features that intersect a pixel on the viewport, and execute a
|
||||
* callback with each intersecting feature. Layers included in the detection can
|
||||
@@ -7405,18 +7347,6 @@ declare module ol {
|
||||
* @api stable
|
||||
*/
|
||||
un(type: (string | string[]), listener: Function, opt_this?: GlobalObject): void;
|
||||
|
||||
/**
|
||||
* Removes an event listener using the key returned by `on()` or `once()`.
|
||||
* Note that using the {@link ol.Observable.unByKey} static function is to
|
||||
* be preferred.
|
||||
* @param {ol.EventsKey|Array.<ol.EventsKey>} key The key returned by `on()`
|
||||
* or `once()` (or an array of keys).
|
||||
* @function
|
||||
* @api stable
|
||||
*/
|
||||
unByKey(key: (ol.EventsKey | ol.EventsKey[])): void;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -11710,11 +11640,10 @@ declare module ol {
|
||||
* In most cases you will want to use the map size, that is `map.getSize()`.
|
||||
* Takes care of the map angle.
|
||||
* @param {ol.geom.SimpleGeometry|ol.Extent} geometry Geometry.
|
||||
* @param {ol.Size} size Box pixel size.
|
||||
* @param {olx.view.FitOptions=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
fit(geometry: (ol.geom.SimpleGeometry | ol.Extent), size: ol.Size, opt_options?: olx.view.FitOptions): void;
|
||||
fit(geometry: (ol.geom.SimpleGeometry | ol.Extent), opt_options?: olx.view.FitOptions): void;
|
||||
|
||||
/**
|
||||
* Center on coordinate and view position.
|
||||
@@ -13573,6 +13502,7 @@ declare module olx {
|
||||
offsetX?: number;
|
||||
offsetY?: number;
|
||||
scale?: number;
|
||||
rotateWithView?: boolean;
|
||||
rotation?: number;
|
||||
text?: string;
|
||||
textAlign?: string;
|
||||
@@ -13813,18 +13743,24 @@ declare module olx {
|
||||
module view {
|
||||
/**
|
||||
* @typedef {{
|
||||
* size: (ol.Size|undefined),
|
||||
* padding: (!Array.<number>|undefined),
|
||||
* constrainResolution: (boolean|undefined),
|
||||
* duration: (number|undefined),
|
||||
* nearest: (boolean|undefined),
|
||||
* maxZoom: (number|undefined),
|
||||
* minResolution: (number|undefined)}}
|
||||
* minResolution: (number|undefined),
|
||||
* easing: (function(t: number) => number) }}
|
||||
*/
|
||||
interface FitOptions {
|
||||
size?: ol.Size,
|
||||
padding?: number[];
|
||||
constrainResolution?: boolean;
|
||||
nearest?: boolean;
|
||||
maxZoom?: number;
|
||||
minResolution?: number;
|
||||
maxZoom?: number;
|
||||
duration?: number;
|
||||
easing?: ((t: number) => number);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -431,8 +431,6 @@ eventKeyMixed = observable.once(stringValue, fn);
|
||||
eventKeyMixed = observable.once([stringValue, stringValue], fn, {});
|
||||
voidValue = observable.un(stringValue, fn);
|
||||
voidValue = observable.un([stringValue, stringValue], fn, {});
|
||||
voidValue = observable.unByKey(eventKey);
|
||||
voidValue = observable.unByKey(eventKeyArray);
|
||||
|
||||
//
|
||||
// ol.proj
|
||||
@@ -462,7 +460,6 @@ let map: ol.Map = new ol.Map({
|
||||
layers: [tileLayer],
|
||||
target: stringValue
|
||||
});
|
||||
voidValue = map.beforeRender(preRenderFunction);
|
||||
|
||||
//
|
||||
// ol.source.ImageWMS
|
||||
@@ -508,39 +505,6 @@ let wmts: ol.source.WMTS = new ol.source.WMTS({
|
||||
wrapX: true,
|
||||
});
|
||||
|
||||
//
|
||||
// ol.animation
|
||||
//
|
||||
let bounceOptions: olx.animation.BounceOptions;
|
||||
bounceOptions.duration = numberValue;
|
||||
bounceOptions.start = numberValue;
|
||||
bounceOptions.resolution = numberValue;
|
||||
bounceOptions.easing = easingFunction;
|
||||
preRenderFunction = ol.animation.bounce(bounceOptions);
|
||||
|
||||
let panOptions: olx.animation.PanOptions;
|
||||
panOptions.duration = numberValue;
|
||||
panOptions.start = numberValue;
|
||||
panOptions.source = coordinate;
|
||||
panOptions.easing = easingFunction;
|
||||
preRenderFunction = ol.animation.pan(panOptions);
|
||||
|
||||
let rotateOptions: olx.animation.RotateOptions;
|
||||
rotateOptions.duration = numberValue;
|
||||
rotateOptions.start = numberValue;
|
||||
rotateOptions.anchor = coordinate;
|
||||
rotateOptions.rotation = numberValue;
|
||||
rotateOptions.easing = easingFunction;
|
||||
preRenderFunction = ol.animation.rotate(rotateOptions);
|
||||
|
||||
let zoomOptions: olx.animation.ZoomOptions;
|
||||
zoomOptions.duration = numberValue;
|
||||
zoomOptions.start = numberValue;
|
||||
zoomOptions.resolution = numberValue;
|
||||
zoomOptions.easing = easingFunction;
|
||||
preRenderFunction = ol.animation.zoom(zoomOptions);
|
||||
voidValue = map.beforeRender(preRenderFunction);
|
||||
|
||||
//
|
||||
// ol.coordinate
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user