Merge pull request #13291 from ahocevar/generics
Defaults for generic types
This commit is contained in:
Generated
+33
@@ -23,6 +23,7 @@
|
|||||||
"@rollup/plugin-node-resolve": "^13.0.0",
|
"@rollup/plugin-node-resolve": "^13.0.0",
|
||||||
"@types/arcgis-rest-api": "^10.4.4",
|
"@types/arcgis-rest-api": "^10.4.4",
|
||||||
"@types/geojson": "^7946.0.7",
|
"@types/geojson": "^7946.0.7",
|
||||||
|
"@types/offscreencanvas": "^2019.6.4",
|
||||||
"@types/pbf": "^3.0.2",
|
"@types/pbf": "^3.0.2",
|
||||||
"@types/topojson-specification": "^1.0.1",
|
"@types/topojson-specification": "^1.0.1",
|
||||||
"babel-loader": "^8.2.2",
|
"babel-loader": "^8.2.2",
|
||||||
@@ -62,6 +63,7 @@
|
|||||||
"shx": "^0.3.2",
|
"shx": "^0.3.2",
|
||||||
"sinon": "^12.0.1",
|
"sinon": "^12.0.1",
|
||||||
"threads": "^1.6.5",
|
"threads": "^1.6.5",
|
||||||
|
"typescript": "^4.6.0-beta",
|
||||||
"walk": "^2.3.9",
|
"walk": "^2.3.9",
|
||||||
"webpack": "^5.27.2",
|
"webpack": "^5.27.2",
|
||||||
"webpack-cli": "^4.5.0",
|
"webpack-cli": "^4.5.0",
|
||||||
@@ -2132,6 +2134,12 @@
|
|||||||
"integrity": "sha512-dueRKfaJL4RTtSa7bWeTK1M+VH+Gns73oCgzvYfHZywRCoPSd8EkXBL0mZ9unPTveBn+D9phZBaxuzpwjWkW0g==",
|
"integrity": "sha512-dueRKfaJL4RTtSa7bWeTK1M+VH+Gns73oCgzvYfHZywRCoPSd8EkXBL0mZ9unPTveBn+D9phZBaxuzpwjWkW0g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/offscreencanvas": {
|
||||||
|
"version": "2019.6.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/offscreencanvas/-/offscreencanvas-2019.6.4.tgz",
|
||||||
|
"integrity": "sha512-u8SAgdZ8ROtkTF+mfZGOscl0or6BSj9A4g37e6nvxDc+YB/oDut0wHkK2PBBiC2bNR8TS0CPV+1gAk4fNisr1Q==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/@types/pbf": {
|
"node_modules/@types/pbf": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.2.tgz",
|
||||||
@@ -9463,6 +9471,19 @@
|
|||||||
"node": ">= 0.6"
|
"node": ">= 0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/typescript": {
|
||||||
|
"version": "4.6.0-beta",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.0-beta.tgz",
|
||||||
|
"integrity": "sha512-xg5avH08DioTdxex568HFLHvnHWxGzpu9FK0ehLNwlqzx/kjy5/qEkBmkbPlvC9xs45bc7gbAbEhNqtczJsHAg==",
|
||||||
|
"dev": true,
|
||||||
|
"bin": {
|
||||||
|
"tsc": "bin/tsc",
|
||||||
|
"tsserver": "bin/tsserver"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/ua-parser-js": {
|
"node_modules/ua-parser-js": {
|
||||||
"version": "0.7.31",
|
"version": "0.7.31",
|
||||||
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz",
|
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz",
|
||||||
@@ -11915,6 +11936,12 @@
|
|||||||
"integrity": "sha512-dueRKfaJL4RTtSa7bWeTK1M+VH+Gns73oCgzvYfHZywRCoPSd8EkXBL0mZ9unPTveBn+D9phZBaxuzpwjWkW0g==",
|
"integrity": "sha512-dueRKfaJL4RTtSa7bWeTK1M+VH+Gns73oCgzvYfHZywRCoPSd8EkXBL0mZ9unPTveBn+D9phZBaxuzpwjWkW0g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"@types/offscreencanvas": {
|
||||||
|
"version": "2019.6.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/offscreencanvas/-/offscreencanvas-2019.6.4.tgz",
|
||||||
|
"integrity": "sha512-u8SAgdZ8ROtkTF+mfZGOscl0or6BSj9A4g37e6nvxDc+YB/oDut0wHkK2PBBiC2bNR8TS0CPV+1gAk4fNisr1Q==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"@types/pbf": {
|
"@types/pbf": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.2.tgz",
|
||||||
@@ -17561,6 +17588,12 @@
|
|||||||
"mime-types": "~2.1.24"
|
"mime-types": "~2.1.24"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"typescript": {
|
||||||
|
"version": "4.6.0-beta",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.0-beta.tgz",
|
||||||
|
"integrity": "sha512-xg5avH08DioTdxex568HFLHvnHWxGzpu9FK0ehLNwlqzx/kjy5/qEkBmkbPlvC9xs45bc7gbAbEhNqtczJsHAg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"ua-parser-js": {
|
"ua-parser-js": {
|
||||||
"version": "0.7.31",
|
"version": "0.7.31",
|
||||||
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz",
|
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz",
|
||||||
|
|||||||
+5
-3
@@ -25,9 +25,9 @@
|
|||||||
"build-legacy": "shx rm -rf build/legacy && npm run build-index && webpack --config config/webpack-config-legacy-build.mjs && cleancss --source-map src/ol/ol.css -o build/legacy/ol.css",
|
"build-legacy": "shx rm -rf build/legacy && npm run build-index && webpack --config config/webpack-config-legacy-build.mjs && cleancss --source-map src/ol/ol.css -o build/legacy/ol.css",
|
||||||
"build-site": "shx rm -rf build/site && npm run build-examples && npm run apidoc && npm run build-legacy && shx mkdir -p build/site && shx cp site/index.html build/site/ && shx mv build/apidoc build/examples build/legacy build/site/",
|
"build-site": "shx rm -rf build/site && npm run build-examples && npm run apidoc && npm run build-legacy && shx mkdir -p build/site && shx cp site/index.html build/site/ && shx mv build/apidoc build/examples build/legacy build/site/",
|
||||||
"copy-css": "shx cp src/ol/ol.css build/ol/ol.css",
|
"copy-css": "shx cp src/ol/ol.css build/ol/ol.css",
|
||||||
"generate-types": "npx --package=typescript@3.8.3 -y -- tsc --project config/tsconfig-build.json --declaration --declarationMap --emitDeclarationOnly --outdir build/ol",
|
"generate-types": "tsc --project config/tsconfig-build.json --declaration --declarationMap --emitDeclarationOnly --outdir build/ol",
|
||||||
"transpile": "shx rm -rf build/ol && shx mkdir -p build/ol && shx cp -rf src/ol build/ol/src && node tasks/serialize-workers.cjs && npx --package=typescript@4.3.5 -y -- tsc --project config/tsconfig-build.json",
|
"transpile": "shx rm -rf build/ol && shx mkdir -p build/ol && shx cp -rf src/ol build/ol/src && node tasks/serialize-workers.cjs && tsc --project config/tsconfig-build.json",
|
||||||
"typecheck": "npx --package=typescript@4.3.5 -y -- tsc --pretty",
|
"typecheck": "tsc --pretty",
|
||||||
"apidoc-debug": "shx rm -rf build/apidoc && node --inspect-brk=9229 ./node_modules/jsdoc/jsdoc.js -R config/jsdoc/api/index.md -c config/jsdoc/api/conf.json -P package.json -d build/apidoc",
|
"apidoc-debug": "shx rm -rf build/apidoc && node --inspect-brk=9229 ./node_modules/jsdoc/jsdoc.js -R config/jsdoc/api/index.md -c config/jsdoc/api/conf.json -P package.json -d build/apidoc",
|
||||||
"apidoc": "shx rm -rf build/apidoc && jsdoc -R config/jsdoc/api/index.md -c config/jsdoc/api/conf.json -P package.json -d build/apidoc"
|
"apidoc": "shx rm -rf build/apidoc && jsdoc -R config/jsdoc/api/index.md -c config/jsdoc/api/conf.json -P package.json -d build/apidoc"
|
||||||
},
|
},
|
||||||
@@ -59,6 +59,7 @@
|
|||||||
"@rollup/plugin-node-resolve": "^13.0.0",
|
"@rollup/plugin-node-resolve": "^13.0.0",
|
||||||
"@types/arcgis-rest-api": "^10.4.4",
|
"@types/arcgis-rest-api": "^10.4.4",
|
||||||
"@types/geojson": "^7946.0.7",
|
"@types/geojson": "^7946.0.7",
|
||||||
|
"@types/offscreencanvas": "^2019.6.4",
|
||||||
"@types/pbf": "^3.0.2",
|
"@types/pbf": "^3.0.2",
|
||||||
"@types/topojson-specification": "^1.0.1",
|
"@types/topojson-specification": "^1.0.1",
|
||||||
"babel-loader": "^8.2.2",
|
"babel-loader": "^8.2.2",
|
||||||
@@ -98,6 +99,7 @@
|
|||||||
"shx": "^0.3.2",
|
"shx": "^0.3.2",
|
||||||
"sinon": "^12.0.1",
|
"sinon": "^12.0.1",
|
||||||
"threads": "^1.6.5",
|
"threads": "^1.6.5",
|
||||||
|
"typescript": "^4.6.0-beta",
|
||||||
"walk": "^2.3.9",
|
"walk": "^2.3.9",
|
||||||
"webpack": "^5.27.2",
|
"webpack": "^5.27.2",
|
||||||
"webpack-cli": "^4.5.0",
|
"webpack-cli": "^4.5.0",
|
||||||
|
|||||||
+2
-2
@@ -11,7 +11,7 @@ import {listen, unlistenByKey} from './events.js';
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Feature<import("./geom/Geometry.js").default>|import("./render/Feature.js").default} FeatureLike
|
* @typedef {Feature|import("./render/Feature.js").default} FeatureLike
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/***
|
/***
|
||||||
@@ -70,7 +70,7 @@ import {listen, unlistenByKey} from './events.js';
|
|||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
* @template {import("./geom/Geometry.js").default} Geometry
|
* @template {import("./geom/Geometry.js").default} [Geometry=import("./geom/Geometry.js").default]
|
||||||
*/
|
*/
|
||||||
class Feature extends BaseObject {
|
class Feature extends BaseObject {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -393,7 +393,7 @@ class GML2 extends GMLBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {import("../geom/LineString.js").default} line LineString geometry.
|
* @param {import("../geom/LineString.js").default} line LineString geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
@@ -455,7 +455,7 @@ class GML2 extends GMLBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {import("../geom/Polygon.js").default} polygon Polygon geometry.
|
* @param {import("../geom/Polygon.js").default} polygon Polygon geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
@@ -467,7 +467,7 @@ class GML2 extends GMLBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {import("../geom/LinearRing.js").default} ring LinearRing geometry.
|
* @param {import("../geom/LinearRing.js").default} ring LinearRing geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
@@ -546,7 +546,7 @@ class GML2 extends GMLBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {import("../geom/Point.js").default} point Point geometry.
|
* @param {import("../geom/Point.js").default} point Point geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -720,7 +720,7 @@ class GML3 extends GMLBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {import("../geom/LinearRing.js").default} ring LinearRing geometry.
|
* @param {import("../geom/LinearRing.js").default} ring LinearRing geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
@@ -744,7 +744,7 @@ class GML3 extends GMLBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {import("../geom/Point.js").default} point Point geometry.
|
* @param {import("../geom/Point.js").default} point Point geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
@@ -768,7 +768,7 @@ class GML3 extends GMLBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Polygon} polygon Polygon geometry.
|
* @param {Polygon} polygon Polygon geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
@@ -780,7 +780,7 @@ class GML3 extends GMLBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {LineString} line LineString geometry.
|
* @param {LineString} line LineString geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ class GMLBase extends XMLFeature {
|
|||||||
if (!featureType && node.childNodes) {
|
if (!featureType && node.childNodes) {
|
||||||
(featureType = []), (featureNS = {});
|
(featureType = []), (featureNS = {});
|
||||||
for (let i = 0, ii = node.childNodes.length; i < ii; ++i) {
|
for (let i = 0, ii = node.childNodes.length; i < ii; ++i) {
|
||||||
const child = node.childNodes[i];
|
const child = /** @type {Element} */ (node.childNodes[i]);
|
||||||
if (child.nodeType === 1) {
|
if (child.nodeType === 1) {
|
||||||
const ft = child.nodeName.split(':').pop();
|
const ft = child.nodeName.split(':').pop();
|
||||||
if (featureType.indexOf(ft) === -1) {
|
if (featureType.indexOf(ft) === -1) {
|
||||||
|
|||||||
@@ -869,7 +869,7 @@ function writeRte(node, feature, objectStack) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Feature} feature Feature.
|
* @param {Feature} feature Feature.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
@@ -902,7 +902,7 @@ function writeTrk(node, feature, objectStack) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {LineString} lineString LineString.
|
* @param {LineString} lineString LineString.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
|
|||||||
+14
-14
@@ -1007,8 +1007,7 @@ function createFeatureStyleFunction(
|
|||||||
if (drawName) {
|
if (drawName) {
|
||||||
const geometry = feature.getGeometry();
|
const geometry = feature.getGeometry();
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
const type = geometry.getType();
|
if (geometry instanceof GeometryCollection) {
|
||||||
if (type === GeometryType.GEOMETRY_COLLECTION) {
|
|
||||||
multiGeometryPoints = geometry
|
multiGeometryPoints = geometry
|
||||||
.getGeometriesArrayRecursive()
|
.getGeometriesArrayRecursive()
|
||||||
.filter(function (geometry) {
|
.filter(function (geometry) {
|
||||||
@@ -1020,6 +1019,7 @@ function createFeatureStyleFunction(
|
|||||||
});
|
});
|
||||||
drawName = multiGeometryPoints.length > 0;
|
drawName = multiGeometryPoints.length > 0;
|
||||||
} else {
|
} else {
|
||||||
|
const type = geometry.getType();
|
||||||
drawName =
|
drawName =
|
||||||
type === GeometryType.POINT || type === GeometryType.MULTI_POINT;
|
type === GeometryType.POINT || type === GeometryType.MULTI_POINT;
|
||||||
}
|
}
|
||||||
@@ -2473,7 +2473,7 @@ const DOCUMENT_NODE_FACTORY = function (value, objectStack, opt_nodeName) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<Feature>} features Features.
|
* @param {Array<Feature>} features Features.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @this {KML}
|
* @this {KML}
|
||||||
@@ -2499,7 +2499,7 @@ function writeDocument(node, features, objectStack) {
|
|||||||
const DATA_NODE_FACTORY = makeSimpleNodeFactory('Data');
|
const DATA_NODE_FACTORY = makeSimpleNodeFactory('Data');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {{names: Array<string>, values: (Array<*>)}} namesAndValues Names and values.
|
* @param {{names: Array<string>, values: (Array<*>)}} namesAndValues Names and values.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
@@ -2561,7 +2561,7 @@ const GX_NODE_FACTORY = function (value, objectStack, opt_nodeName) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Object} icon Icon object.
|
* @param {Object} icon Icon object.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
@@ -2617,7 +2617,7 @@ const ICON_STYLE_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {import("../style/Icon.js").default} style Icon style.
|
* @param {import("../style/Icon.js").default} style Icon style.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
@@ -2712,7 +2712,7 @@ const LABEL_STYLE_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Text} style style.
|
* @param {Text} style style.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
@@ -2758,7 +2758,7 @@ const LINE_STYLE_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Stroke} style style.
|
* @param {Stroke} style style.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
@@ -2856,7 +2856,7 @@ const MULTI_GEOMETRY_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
@@ -2927,7 +2927,7 @@ const BOUNDARY_IS_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {import("../geom/LinearRing.js").default} linearRing Linear ring.
|
* @param {import("../geom/LinearRing.js").default} linearRing Linear ring.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
@@ -3180,7 +3180,7 @@ const PRIMITIVE_GEOMETRY_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {import("../geom/SimpleGeometry.js").default} geometry Geometry.
|
* @param {import("../geom/SimpleGeometry.js").default} geometry Geometry.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
@@ -3243,7 +3243,7 @@ const INNER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('innerBoundaryIs');
|
|||||||
const OUTER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('outerBoundaryIs');
|
const OUTER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('outerBoundaryIs');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Polygon} polygon Polygon.
|
* @param {Polygon} polygon Polygon.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
@@ -3281,7 +3281,7 @@ const POLY_STYLE_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Style} style Style.
|
* @param {Style} style Style.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
@@ -3341,7 +3341,7 @@ const STYLE_SERIALIZERS = makeStructureNS(NAMESPACE_URIS, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Object<string, Array<Style>>} styles Styles.
|
* @param {Object<string, Array<Style>>} styles Styles.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class Polyline extends TextFeature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {import("../Feature.js").default} feature Features.
|
* @param {import("../Feature.js").default<LineString>} feature Features.
|
||||||
* @param {import("./Feature.js").WriteOptions} [opt_options] Write options.
|
* @param {import("./Feature.js").WriteOptions} [opt_options] Write options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {string} Text.
|
* @return {string} Text.
|
||||||
@@ -126,7 +126,7 @@ class Polyline extends TextFeature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array<import("../Feature.js").default>} features Features.
|
* @param {Array<import("../Feature.js").default<LineString>>} features Features.
|
||||||
* @param {import("./Feature.js").WriteOptions} [opt_options] Write options.
|
* @param {import("./Feature.js").WriteOptions} [opt_options] Write options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {string} Text.
|
* @return {string} Text.
|
||||||
|
|||||||
@@ -1054,7 +1054,7 @@ function writeQuery(node, featureType, objectStack) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {import("./filter/Filter.js").default} filter Filter.
|
* @param {import("./filter/Filter.js").default} filter Filter.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
@@ -1158,7 +1158,7 @@ function writeDuringFilter(node, filter, objectStack) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {import("./filter/LogicalNary.js").default} filter Filter.
|
* @param {import("./filter/LogicalNary.js").default} filter Filter.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
@@ -1182,7 +1182,7 @@ function writeLogicalFilter(node, filter, objectStack) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {import("./filter/Not.js").default} filter Filter.
|
* @param {import("./filter/Not.js").default} filter Filter.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
@@ -1341,7 +1341,7 @@ export function writeFilter(filter, opt_version) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<string>} featureTypes Feature types.
|
* @param {Array<string>} featureTypes Feature types.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -421,7 +421,7 @@ class Draw extends PointerInteraction {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sketch feature.
|
* Sketch feature.
|
||||||
* @type {Feature}
|
* @type {Feature<import('../geom/SimpleGeometry.js').default>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.sketchFeature_ = null;
|
this.sketchFeature_ = null;
|
||||||
@@ -1022,7 +1022,7 @@ class Draw extends PointerInteraction {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop drawing without adding the sketch feature to the target layer.
|
* Stop drawing without adding the sketch feature to the target layer.
|
||||||
* @return {Feature} The sketch feature (or null if none).
|
* @return {Feature<import("../geom/SimpleGeometry.js").default>} The sketch feature (or null if none).
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
abortDrawing_() {
|
abortDrawing_() {
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ class Modify extends PointerInteraction {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Editing vertex.
|
* Editing vertex.
|
||||||
* @type {Feature}
|
* @type {Feature<Point>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.vertexFeature_ = null;
|
this.vertexFeature_ = null;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import {listen, unlistenByKey} from '../events.js';
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @template {import("../source/Source.js").default} SourceType
|
* @template {import("../source/Source.js").default} [SourceType=import("../source/Source.js").default]
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {string} [className='ol-layer'] A CSS class name to set to the layer element.
|
* @property {string} [className='ol-layer'] A CSS class name to set to the layer element.
|
||||||
* @property {number} [opacity=1] Opacity (0, 1).
|
* @property {number} [opacity=1] Opacity (0, 1).
|
||||||
@@ -93,8 +93,8 @@ import {listen, unlistenByKey} from '../events.js';
|
|||||||
* @fires import("../render/Event.js").RenderEvent#prerender
|
* @fires import("../render/Event.js").RenderEvent#prerender
|
||||||
* @fires import("../render/Event.js").RenderEvent#postrender
|
* @fires import("../render/Event.js").RenderEvent#postrender
|
||||||
*
|
*
|
||||||
* @template {import("../source/Source.js").default} SourceType
|
* @template {import("../source/Source.js").default} [SourceType=import("../source/Source.js").default]
|
||||||
* @template {import("../renderer/Layer.js").default} RendererType
|
* @template {import("../renderer/Layer.js").default} [RendererType=import("../renderer/Layer.js").default]
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
class Layer extends BaseLayer {
|
class Layer extends BaseLayer {
|
||||||
|
|||||||
@@ -96,8 +96,9 @@ function getRenderExtent(frameState, extent) {
|
|||||||
fromUserExtent(layerState.extent, frameState.viewState.projection)
|
fromUserExtent(layerState.extent, frameState.viewState.projection)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const source =
|
const source = /** @type {import("../../source/Tile.js").default} */ (
|
||||||
/** {import("../../source/Tile.js").default} */ layerState.layer.getRenderSource();
|
layerState.layer.getRenderSource()
|
||||||
|
);
|
||||||
if (!source.getWrapX()) {
|
if (!source.getWrapX()) {
|
||||||
const gridExtent = source
|
const gridExtent = source
|
||||||
.getTileGridForProjection(frameState.viewState.projection)
|
.getTileGridForProjection(frameState.viewState.projection)
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ class Cluster extends VectorSource {
|
|||||||
this.geometryFunction =
|
this.geometryFunction =
|
||||||
options.geometryFunction ||
|
options.geometryFunction ||
|
||||||
function (feature) {
|
function (feature) {
|
||||||
const geometry = feature.getGeometry();
|
const geometry = /** @type {Point} */ (feature.getGeometry());
|
||||||
assert(geometry.getType() == GeometryType.POINT, 10); // The default `geometryFunction` can only handle `Point` geometries
|
assert(geometry.getType() == GeometryType.POINT, 10); // The default `geometryFunction` can only handle `Point` geometries
|
||||||
return geometry;
|
return geometry;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ class TileJSON extends TileImage {
|
|||||||
if (!client.status || (client.status >= 200 && client.status < 300)) {
|
if (!client.status || (client.status >= 200 && client.status < 300)) {
|
||||||
let response;
|
let response;
|
||||||
try {
|
try {
|
||||||
response = /** @type {TileJSON} */ (JSON.parse(client.responseText));
|
response = /** @type {Config} */ (JSON.parse(client.responseText));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.handleTileJSONError();
|
this.handleTileJSONError();
|
||||||
return;
|
return;
|
||||||
|
|||||||
+10
-4
@@ -34,7 +34,7 @@ import {xhr} from '../featureloader.js';
|
|||||||
* @classdesc
|
* @classdesc
|
||||||
* Events emitted by {@link module:ol/source/Vector} instances are instances of this
|
* Events emitted by {@link module:ol/source/Vector} instances are instances of this
|
||||||
* type.
|
* type.
|
||||||
* @template {import("../geom/Geometry.js").default} Geometry
|
* @template {import("../geom/Geometry.js").default} [Geometry=import("../geom/Geometry.js").default]
|
||||||
*/
|
*/
|
||||||
export class VectorSourceEvent extends Event {
|
export class VectorSourceEvent extends Event {
|
||||||
/**
|
/**
|
||||||
@@ -170,7 +170,7 @@ export class VectorSourceEvent extends Event {
|
|||||||
*
|
*
|
||||||
* @fires VectorSourceEvent
|
* @fires VectorSourceEvent
|
||||||
* @api
|
* @api
|
||||||
* @template {import("../geom/Geometry.js").default} Geometry
|
* @template {import("../geom/Geometry.js").default} [Geometry=import("../geom/Geometry.js").default]
|
||||||
*/
|
*/
|
||||||
class VectorSource extends Source {
|
class VectorSource extends Source {
|
||||||
/**
|
/**
|
||||||
@@ -299,9 +299,15 @@ class VectorSource extends Source {
|
|||||||
|
|
||||||
let collection, features;
|
let collection, features;
|
||||||
if (Array.isArray(options.features)) {
|
if (Array.isArray(options.features)) {
|
||||||
features = options.features;
|
features =
|
||||||
|
/** @type {Array<import("../Feature.js").default<Geometry>>} */ (
|
||||||
|
options.features
|
||||||
|
);
|
||||||
} else if (options.features) {
|
} else if (options.features) {
|
||||||
collection = options.features;
|
collection =
|
||||||
|
/** @type {Collection<import("../Feature.js").default<Geometry>>} */ (
|
||||||
|
options.features
|
||||||
|
);
|
||||||
features = collection.getArray();
|
features = collection.getArray();
|
||||||
}
|
}
|
||||||
if (!useSpatialIndex && collection === undefined) {
|
if (!useSpatialIndex && collection === undefined) {
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ import {extend} from './array.js';
|
|||||||
* {@link module:ol/xml.makeSimpleNodeFactory}, the top `objectStack` item needs
|
* {@link module:ol/xml.makeSimpleNodeFactory}, the top `objectStack` item needs
|
||||||
* to have this structure.
|
* to have this structure.
|
||||||
* @typedef {Object} NodeStackItem
|
* @typedef {Object} NodeStackItem
|
||||||
* @property {Node} node Node.
|
* @property {Element} node Node.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user