Skip to content

Commit

Permalink
Merge pull request #1234 from OpenGeoscience/polygon-rdp-return-data
Browse files Browse the repository at this point in the history
perf: Allow using the rdp functions on non-feature polygons.
  • Loading branch information
manthey authored Jun 29, 2022
2 parents 52900ff + d010270 commit 8057c22
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

## Version 1.10.5

### Improvements

- Allow using the rdp functions on non-feature polygons ([#1234](../../pull/1234))
- Allow annotations to be created regardless of metakeys ([#1235](../../pull/1235))

## Version 1.10.5

### Bug Fixes

- Guard texture update calls ([#1233](../../pull/1233))

## Version 1.10.5

### Bug Fixes

- Guard converting an empty polygon ([#1232](../../pull/1232))
Expand Down
9 changes: 7 additions & 2 deletions src/polygonFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,11 @@ var polygonFeature = function (arg) {
* get the position of each vertex.
* @param {function} [polyFunc=this.style.get('polygon')] The function to
* get each polygon.
* @returns {this}
* @param {boolean} [returnData=false] If truthy, return the new data array
* rather than modifying the feature.
* @returns {this|array}
*/
this.rdpSimplifyData = function (data, tolerance, posFunc, polyFunc) {
this.rdpSimplifyData = function (data, tolerance, posFunc, polyFunc, returnData) {
var map = m_this.layer().map(),
mapgcs = map.gcs(),
featuregcs = m_this.gcs(),
Expand Down Expand Up @@ -633,6 +635,9 @@ var polygonFeature = function (arg) {
}
return elem;
});
if (returnData) {
return data;
}

/* Set the reduced polgons as the data and use simple accessors. */
m_this.style('position', util.identityFunction);
Expand Down

0 comments on commit 8057c22

Please sign in to comment.