Skip to content

Commit

Permalink
Properly close the drawn polygons
Browse files Browse the repository at this point in the history
**Why?** Some software seems pickier about whether the linear
rings of polygons come back to the original point or just imply
that point.
  • Loading branch information
symbioquine committed Oct 8, 2021
1 parent 25f4b29 commit a709fcc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v0.0.4] - 2021-10-08

### Fixed

- Fixed publishing from main branch to Github pages
- Properly close the drawn polygons

## [v0.0.3] - 2021-06-30

Expand Down Expand Up @@ -39,7 +42,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial check-in

[unreleased]: https://github.com/symbioquine/ol-touch-draw/compare/v0.0.3...HEAD
[unreleased]: https://github.com/symbioquine/ol-touch-draw/compare/v0.0.4...HEAD
[v0.0.4]: https://github.com/symbioquine/ol-touch-draw/compare/v0.0.3...v0.0.4
[v0.0.3]: https://github.com/symbioquine/ol-touch-draw/compare/v0.0.2...v0.0.3
[v0.0.2]: https://github.com/symbioquine/ol-touch-draw/compare/v0.0.1...v0.0.2
[v0.0.1]: https://github.com/symbioquine/ol-touch-draw/releases/tag/v0.0.1
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ol-touch-draw",
"version": "0.0.3",
"version": "0.0.4",
"description": "A simplified touch-friendly drawing interaction for OpenLayers 6",
"license": "MIT",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/touch-draw-feature-drafting-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default class TouchDrawFeatureDraftingState extends BaseObject {
const originalSegmentCoords = initialTouchDrawHandle.get('originalSegmentCoords');

const draftFeature = new Feature({
geometry: new Polygon([[...originalSegmentCoords, ...originalSegmentCoords]], 'XY'),
geometry: new Polygon([[...originalSegmentCoords, ...originalSegmentCoords, originalSegmentCoords[0]]], 'XY'),
});

const handleXMovementBasisVector = getOrthogonalBasisVector(...originalSegmentCoords);
Expand Down Expand Up @@ -215,7 +215,7 @@ export default class TouchDrawFeatureDraftingState extends BaseObject {
this.YMovePopup_.setPosition(originalSegmentCoords[1]);

const recalculateDraftFeatureGeometry = () => {
const newGeom = new Polygon([[...originalSegmentCoords, ...originalSegmentCoords]], 'XY');
const newGeom = new Polygon([[...originalSegmentCoords, ...originalSegmentCoords, originalSegmentCoords[0]]], 'XY');

const xScaleTranslation = this.xScaleHandle_.get('movementVector');

Expand Down

0 comments on commit a709fcc

Please sign in to comment.