Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ol/feature): allow generics for feature.getProperties() #15496

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/ol/render/Feature.js
Expand Up @@ -52,6 +52,7 @@ const tmpTransform = createTransform();
* Lightweight, read-only, {@link module:ol/Feature~Feature} and {@link module:ol/geom/Geometry~Geometry} like
* structure, optimized for vector tile rendering and styling. Geometry access
* through the API is limited to getting the type and extent of the geometry.
* @template {Object<string, *>} T Type of the properties object.
*/
class RenderFeature {
/**
Expand All @@ -60,7 +61,7 @@ class RenderFeature {
* to be right-handed for polygons.
* @param {Array<number>} ends Ends.
* @param {number} stride Stride.
* @param {Object<string, *>} properties Properties.
* @param {T} properties Properties.
* @param {number|string|undefined} id Feature id.
*/
constructor(type, flatCoordinates, ends, stride, properties, id) {
Expand Down Expand Up @@ -113,7 +114,7 @@ class RenderFeature {

/**
* @private
* @type {Object<string, *>}
* @type {T}
*/
this.properties_ = properties;

Expand Down Expand Up @@ -282,7 +283,7 @@ class RenderFeature {

/**
* Get the feature properties.
* @return {Object<string, *>} Feature properties.
* @return {T} Feature properties.
* @api
*/
getProperties() {
Expand Down