From ab494ae5d1ee13a845819cd0fafcb80c44cdd380 Mon Sep 17 00:00:00 2001 From: Achim Hasenmueller Date: Wed, 15 Feb 2017 15:21:02 +0100 Subject: [PATCH] Updates from openlayers 4.0.1 ol.anmiation was removed Map.beforeRender was removed Observable.unByKey member function was removed (static function remains) Updated View.fit / view.FitOptions Added forgotten TextOptions.rotateWithView --- openlayers/index.d.ts | 86 ++++++------------------------------------- 1 file changed, 11 insertions(+), 75 deletions(-) diff --git a/openlayers/index.d.ts b/openlayers/index.d.ts index f81e964b4d..f551b3bde6 100644 --- a/openlayers/index.d.ts +++ b/openlayers/index.d.ts @@ -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 // 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. @@ -6645,15 +6596,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 @@ -7367,18 +7309,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.} key The key returned by `on()` - * or `once()` (or an array of keys). - * @function - * @api stable - */ - unByKey(key: (ol.EventsKey | ol.EventsKey[])): void; - } /** @@ -11672,11 +11602,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. @@ -13535,6 +13464,7 @@ declare module olx { offsetX?: number; offsetY?: number; scale?: number; + rotateWithView?: boolean; rotation?: number; text?: string; textAlign?: string; @@ -13775,18 +13705,24 @@ declare module olx { module view { /** * @typedef {{ + * size: (ol.Size|undefined), * padding: (!Array.|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); } }