From 9a279f280eb0a5f337b82aaef359045b444f812d Mon Sep 17 00:00:00 2001 From: "Rifa'i M. Hanif" Date: Tue, 30 Nov 2021 01:38:20 +0700 Subject: [PATCH] Release v3.9.0 --- @types/ol/control/OverviewMap.d.ts | 5 +- @types/ol/render/VectorContext.d.ts | 7 ++- @types/ol/render/canvas/Builder.d.ts | 7 ++- @types/ol/source/GeoTIFF.d.ts | 15 +++++ @types/ol/style/Style.d.ts | 11 ++++ CHANGELOG.md | 2 + package.json | 4 +- patches/ol-control-Attribution.patch | 13 ----- patches/ol-control-FullScreen.patch | 14 +---- scripts/applyPatches.js | 2 +- yarn.lock | 82 +++++++++++----------------- 11 files changed, 78 insertions(+), 84 deletions(-) delete mode 100644 patches/ol-control-Attribution.patch diff --git a/@types/ol/control/OverviewMap.d.ts b/@types/ol/control/OverviewMap.d.ts index b0430b40..eac56174 100644 --- a/@types/ol/control/OverviewMap.d.ts +++ b/@types/ol/control/OverviewMap.d.ts @@ -5,8 +5,7 @@ import PluggableMap from '../PluggableMap'; import View from '../View'; import { EventsKey, ListenerFunction } from '../events'; import BaseEvent from '../events/Event'; -import Layer from '../layer/Layer'; -import Source from '../source/Source'; +import BaseLayer from '../layer/Base'; import Control from './Control'; export type TControlledMapBaseEventTypes = 'change' | 'error'; @@ -27,7 +26,7 @@ export interface Options { collapseLabel?: string | HTMLElement; collapsible?: boolean; label?: string | HTMLElement; - layers?: Layer[] | Collection>; + layers?: BaseLayer[] | Collection; render?: (p0: MapEvent) => void; rotateWithView?: boolean; target?: HTMLElement | string; diff --git a/@types/ol/render/VectorContext.d.ts b/@types/ol/render/VectorContext.d.ts index 96eed533..6338d3c5 100644 --- a/@types/ol/render/VectorContext.d.ts +++ b/@types/ol/render/VectorContext.d.ts @@ -23,7 +23,12 @@ export default class VectorContext { /** * Render a geometry with a custom renderer. */ - drawCustom(geometry: SimpleGeometry, feature: FeatureLike, renderer: () => void): void; + drawCustom( + geometry: SimpleGeometry, + feature: FeatureLike, + renderer: () => void, + hitDetectionRenderer: () => void, + ): void; drawFeature(feature: Feature, style: Style): void; /** * Render a geometry. diff --git a/@types/ol/render/canvas/Builder.d.ts b/@types/ol/render/canvas/Builder.d.ts index 7b520203..f1a229a6 100644 --- a/@types/ol/render/canvas/Builder.d.ts +++ b/@types/ol/render/canvas/Builder.d.ts @@ -39,7 +39,12 @@ export default class CanvasBuilder extends VectorContext { applyStroke(state: FillStrokeState): void; createFill(state: FillStrokeState): any[]; createStroke(state: FillStrokeState): any[]; - drawCustom(geometry: SimpleGeometry, feature: FeatureLike, renderer: () => void): void; + drawCustom( + geometry: SimpleGeometry, + feature: FeatureLike, + renderer: () => void, + hitDetectionRenderer: () => void, + ): void; drawCustomCoordinates_( flatCoordinates: number[], offset: number, diff --git a/@types/ol/source/GeoTIFF.d.ts b/@types/ol/source/GeoTIFF.d.ts index 3be5c8b0..70446e4a 100644 --- a/@types/ol/source/GeoTIFF.d.ts +++ b/@types/ol/source/GeoTIFF.d.ts @@ -20,6 +20,10 @@ export interface GeoKeys { ProjLinearUnitsGeoKey: number; ProjectedCSTypeGeoKey: number; } +export interface GeoTIFF { + getImageCount: () => Promise; + getImage: (p0: number) => Promise; +} export interface GeoTIFFImage { fileDirectory: any; geoKeys: GeoKeys; @@ -29,10 +33,21 @@ export interface GeoTIFFImage { getBoundingBox: () => number[]; getOrigin: () => number[]; getResolution: (p0: GeoTIFFImage) => number[]; + getWidth: () => number; + getHeight: () => number; + getTileWidth: () => number; + getTileHeight: () => number; + getGDALNoData: () => number | null; + getSamplesPerPixel: () => number; +} +export interface MultiGeoTIFF { + getImageCount: () => Promise; + getImage: (p0: number) => Promise; } export interface Options { sources: SourceInfo[]; convertToRGB?: boolean; + normalize?: boolean; opaque?: boolean; transition?: number; } diff --git a/@types/ol/style/Style.d.ts b/@types/ol/style/Style.d.ts index aa8ea145..d52d7204 100644 --- a/@types/ol/style/Style.d.ts +++ b/@types/ol/style/Style.d.ts @@ -19,6 +19,7 @@ export interface Options { fill?: Fill; image?: ImageStyle; renderer?: RenderFunction; + hitDetectionRenderer?: RenderFunction; stroke?: Stroke; text?: Text; zIndex?: number; @@ -61,6 +62,11 @@ export default class Style { * Get the function used to generate a geometry for rendering. */ getGeometryFunction(): GeometryFunction; + /** + * Get the custom renderer function that was configured with + * {@link #setHitDetectionRenderer} or the hitDetectionRenderer constructor option. + */ + getHitDetectionRenderer(): RenderFunction | null; /** * Get the image style. */ @@ -90,6 +96,11 @@ export default class Style { * Set a geometry that is rendered instead of the feature's geometry. */ setGeometry(geometry: string | Geometry | GeometryFunction): void; + /** + * Sets a custom renderer function for this style used + * in hit detection. + */ + setHitDetectionRenderer(renderer: RenderFunction | null): void; /** * Set the image style. */ diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e8432ea..925b3302 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Changelog +- **v3.9.0** + - Updated to OpenLayers v6.9.0 - **v3.8.0** - Updated to OpenLayers v6.8.1 - **v3.7.0** diff --git a/package.json b/package.json index 95902bc6..6c456e59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hanreev/types-ol", - "version": "3.8.0", + "version": "3.9.0", "description": "OpenLayers 6+ TypeScript definition", "author": "Rifa'i M. Hanif ", "repository": { @@ -62,7 +62,7 @@ "jsdoc-plugin-typescript": "2.0.6", "no-emit-webpack-plugin": "^4.0.1", "node-html-parser": "^5.1.0", - "ol": "6.8.1", + "ol": "6.9.0", "pinst": "^2.1.6", "prettier": "2.5.0", "pretty-quick": "3.1.2", diff --git a/patches/ol-control-Attribution.patch b/patches/ol-control-Attribution.patch deleted file mode 100644 index a0c31cd1..00000000 --- a/patches/ol-control-Attribution.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/ol/control/Attribution.js b/src/ol/control/Attribution.js -index 123d0efd3..31799b688 100644 ---- a/src/ol/control/Attribution.js -+++ b/src/ol/control/Attribution.js -@@ -20,7 +20,7 @@ import {removeChildren, replaceNode} from '../dom.js'; - * @property {boolean} [collapsed=true] Specify if attributions should - * be collapsed at startup. - * @property {string} [tipLabel='Attributions'] Text label to use for the button tip. -- * @property {string} [label='i'] Text label to use for the -+ * @property {string|HTMLElement} [label='i'] Text label to use for the - * collapsed attributions button. - * Instead of text, also an element (e.g. a `span` element) can be used. - * @property {string} [expandClassName=className + '-expand'] CSS class name for the diff --git a/patches/ol-control-FullScreen.patch b/patches/ol-control-FullScreen.patch index 384ef50c..7f679d75 100644 --- a/patches/ol-control-FullScreen.patch +++ b/patches/ol-control-FullScreen.patch @@ -1,19 +1,7 @@ diff --git a/src/ol/control/FullScreen.js b/src/ol/control/FullScreen.js -index 50906b4ce..182df897a 100644 +index 3c21dcd07..cbbe834b1 100644 --- a/src/ol/control/FullScreen.js +++ b/src/ol/control/FullScreen.js -@@ -44,9 +44,9 @@ const FullScreenEventType = { - /** - * @typedef {Object} Options - * @property {string} [className='ol-full-screen'] CSS class name. -- * @property {string|Text} [label='\u2922'] Text label to use for the button. -+ * @property {string|Text|HTMLElement} [label='\u2922'] Text label to use for the button. - * Instead of text, also an element (e.g. a `span` element) can be used. -- * @property {string|Text} [labelActive='\u00d7'] Text label to use for the -+ * @property {string|Text|HTMLElement} [labelActive='\u00d7'] Text label to use for the - * button when full-screen is active. - * @property {string} [activeClassName=className + '-true'] CSS class name for the button - * when full-screen is active. @@ -73,8 +73,8 @@ const FullScreenEventType = { * The [Fullscreen API](https://www.w3.org/TR/fullscreen/) is used to * toggle the map in full screen mode. diff --git a/scripts/applyPatches.js b/scripts/applyPatches.js index a4ecc2a8..14c4cdee 100644 --- a/scripts/applyPatches.js +++ b/scripts/applyPatches.js @@ -4,7 +4,7 @@ const glob = require('glob'); const childProcess = require('child_process'); const BASE_DIR = process.cwd(); -const OL_VERSION = 'v6.8.1'; +const OL_VERSION = 'v6.9.0'; const jsdocConfigPath = path.resolve(BASE_DIR, 'jsdoc', 'conf.json'); const jsdocConfig = require(jsdocConfigPath); diff --git a/yarn.lock b/yarn.lock index 464c9217..9f012e06 100644 --- a/yarn.lock +++ b/yarn.lock @@ -391,13 +391,10 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@petamoriken/float16@^1.0.7": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@petamoriken/float16/-/float16-1.1.1.tgz#faffb09ac1df7c93822687af4d59b6e1faadef9e" - integrity sha512-0r8nE5Q60tj3FbWWYLjAdGnWZgP7CMWXNaI5UsNzypRyxLDb/uvOl5SDw8GcPNu6pSTOt+KSI+0oL6fhSpNOFQ== - dependencies: - lodash ">=4.17.5 <5.0.0" - lodash-es ">=4.17.5 <5.0.0" +"@petamoriken/float16@^3.4.7": + version "3.5.11" + resolved "https://registry.yarnpkg.com/@petamoriken/float16/-/float16-3.5.11.tgz#69744fde033692c09dbb02191e0c391f8c857e30" + integrity sha512-aKJaQhvWcP4XRo4eb34VygcqNsE1+Ej5687oexkK+qYWC7tejxaWRkAfE54Ze3xQGnvwXHZ5Ahx6CWq5sS4q7Q== "@qiwi/npm-registry-client@^8.9.1": version "8.9.1" @@ -1857,18 +1854,18 @@ gensync@^1.0.0-beta.2: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== -geotiff@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/geotiff/-/geotiff-1.0.6.tgz#499a11e0dad8d08b99cc20ffd1765b3157e9e8a1" - integrity sha512-QpThfg270taZirnyZyN3INoo5OfUOtedYEbiotML5ts1Qou7rxtHrU9nUW2J07biEuSV6qWq784z7brUH7/gRQ== +geotiff@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/geotiff/-/geotiff-1.0.8.tgz#b5f21b51927a2118a9bd20751cae433a047040df" + integrity sha512-3YA6NpGuuXF+WwwgA7moSHIw1U0XHxBY8W5bjjoSGBCVuw6s+DOgt7Z95Y3bf5k19RHixv6zW8KpW/yrRno43Q== dependencies: - "@petamoriken/float16" "^1.0.7" + "@petamoriken/float16" "^3.4.7" lerc "^3.0.0" lru-cache "^6.0.0" pako "^2.0.4" parse-headers "^2.0.2" - threads "^1.3.1" - txml "^5.0.0" + threads "^1.7.0" + xml-utils "^1.0.2" get-caller-file@^2.0.1: version "2.0.5" @@ -2475,17 +2472,12 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -"lodash-es@>=4.17.5 <5.0.0": - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" - integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw== - lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash@4.17.21, "lodash@>=4.17.5 <5.0.0", lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19: +lodash@4.17.21, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -2781,12 +2773,12 @@ ol-mapbox-style@^6.5.1: mapbox-to-css-font "^2.4.0" webfont-matcher "^1.1.0" -ol@6.8.1: - version "6.8.1" - resolved "https://registry.yarnpkg.com/ol/-/ol-6.8.1.tgz#460f23e9359de14d651cef517d3774b2ccccd2d6" - integrity sha512-atGAkVsOf8sUhnKVdcGhpTqCAWrOREl9e07KmRi0mHsCa6j1r/BhSnjeuGTmnj0qkeMrz9MLd9PBjgWqL4EFPg== +ol@6.9.0: + version "6.9.0" + resolved "https://registry.yarnpkg.com/ol/-/ol-6.9.0.tgz#3e1b39a76f99ede117ad79e66464698d6915df0b" + integrity sha512-VmU5HKHwO2O1uGgmBcng/dL1PouVB1jKiYUbiXPR5l1i/3B3qatexl4rapZAnsGx0vsOC7lI1GLx7jEZro8C8Q== dependencies: - geotiff "1.0.6" + geotiff "^1.0.8" ol-mapbox-style "^6.5.1" pbf "3.2.1" rbush "^3.0.1" @@ -3032,15 +3024,6 @@ rbush@^3.0.1: dependencies: quickselect "^2.0.0" -"readable-stream@2 || 3", readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - readable-stream@^2.0.6, readable-stream@^2.2.2: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" @@ -3054,6 +3037,15 @@ readable-stream@^2.0.6, readable-stream@^2.2.2: string_decoder "~1.1.1" util-deprecate "~1.0.1" +readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + rechoir@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.7.0.tgz#32650fd52c21ab252aa5d65b19310441c7e03aca" @@ -3591,7 +3583,7 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= -threads@^1.3.1: +threads@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/threads/-/threads-1.7.0.tgz#d9e9627bfc1ef22ada3b733c2e7558bbe78e589c" integrity sha512-Mx5NBSHX3sQYR6iI9VYbgHKBLisyB+xROCBGjjWm1O9wb9vfLxdaGtmT/KCjUqMsSNW6nERzCW3T6H43LqjDZQ== @@ -3603,14 +3595,6 @@ threads@^1.3.1: optionalDependencies: tiny-worker ">= 2" -through2@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.2.tgz#99f88931cfc761ec7678b41d5d7336b5b6a07bf4" - integrity sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ== - dependencies: - inherits "^2.0.4" - readable-stream "2 || 3" - "tiny-worker@>= 2": version "2.3.0" resolved "https://registry.yarnpkg.com/tiny-worker/-/tiny-worker-2.3.0.tgz#715ae34304c757a9af573ae9a8e3967177e6011e" @@ -3724,13 +3708,6 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= -txml@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/txml/-/txml-5.1.0.tgz#40ec0baa6760d8e990384bea21ba35959bbc743d" - integrity sha512-B73m9YfrMK6joCrlU0AW+7E3hhX25KzViXlhljoB7cV6ODQ9vL2VojmuuOqaRObPVQHzSXw6QT5FCTz2vDgQyQ== - dependencies: - through2 "^3.0.1" - type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -3962,6 +3939,11 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= +xml-utils@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/xml-utils/-/xml-utils-1.0.2.tgz#8081bfefb87b72e03e4adbabdd217ccbbc395eeb" + integrity sha512-rEn0FvKi+YGjv9omf22oAf+0d6Ly/sgJ/CUufU/nOzS7SRLmgwSujrewc03KojXxt+aPaTRpm593TgehtUBMSQ== + xmlcreate@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/xmlcreate/-/xmlcreate-2.0.3.tgz#df9ecd518fd3890ab3548e1b811d040614993497"