Defaults for the Layer, Source and Feature generics

This commit is contained in:
Andreas Hocevar
2022-01-26 19:07:47 +01:00
parent 2e5c1f2af9
commit 94cc414ea2
9 changed files with 26 additions and 19 deletions

View File

@@ -1007,8 +1007,7 @@ function createFeatureStyleFunction(
if (drawName) {
const geometry = feature.getGeometry();
if (geometry) {
const type = geometry.getType();
if (type === GeometryType.GEOMETRY_COLLECTION) {
if (geometry instanceof GeometryCollection) {
multiGeometryPoints = geometry
.getGeometriesArrayRecursive()
.filter(function (geometry) {
@@ -1020,6 +1019,7 @@ function createFeatureStyleFunction(
});
drawName = multiGeometryPoints.length > 0;
} else {
const type = geometry.getType();
drawName =
type === GeometryType.POINT || type === GeometryType.MULTI_POINT;
}

View File

@@ -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.
* @protected
* @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.
* @protected
* @return {string} Text.