From 142f16afe4c86865aeba2d085c099037914a8c42 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Tue, 16 May 2017 08:37:30 +0200 Subject: [PATCH 1/2] Re-add the ol.render.Feature#getGeometry() method This method does have value for users that want to switch between ol.Feature and ol.render.Feature and still be able to use #getGeometry().getType() in a style function to determine the feature geometry's type. --- changelog/upgrade-notes.md | 4 ---- src/ol/render/feature.js | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index 397aa0f5e5..b8899fa73e 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -2,10 +2,6 @@ ### Next release -#### Removal of `ol.render.Feature#getGeometry()` - -The `ol.render.Feature#getGeometry()` function simply returns the feature itself. Users who relied on this function can use the `ol.render.Feature` instance directly instead. - ### v4.1.0 #### Adding duplicate layers to a map throws diff --git a/src/ol/render/feature.js b/src/ol/render/feature.js index 497e801cc6..c27fee180f 100644 --- a/src/ol/render/feature.js +++ b/src/ol/render/feature.js @@ -121,6 +121,7 @@ ol.render.Feature.prototype.getFlatCoordinates = /** * Get the feature for working with its geometry. * @return {ol.render.Feature} Feature. + * @api */ ol.render.Feature.prototype.getGeometry = function() { return this; From ac19d4d19c95707cca108ae01c5b6d38366ce7ee Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Tue, 16 May 2017 08:43:08 +0200 Subject: [PATCH 2/2] Better documentation for ol.render.Feature#getGeometry --- src/ol/render/feature.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ol/render/feature.js b/src/ol/render/feature.js index c27fee180f..e383587ece 100644 --- a/src/ol/render/feature.js +++ b/src/ol/render/feature.js @@ -119,7 +119,8 @@ ol.render.Feature.prototype.getFlatCoordinates = /** - * Get the feature for working with its geometry. + * For API compatibility with {@link ol.Feature}, this method is useful when + * determining the geometry type in style function (see {@link #getType}). * @return {ol.render.Feature} Feature. * @api */