Skip to content

Commit

Permalink
Merge branch 'master' into type-module
Browse files Browse the repository at this point in the history
  • Loading branch information
oterral authored Sep 26, 2024
2 parents b9476e5 + ce95cf3 commit a50e896
Show file tree
Hide file tree
Showing 5 changed files with 1,305 additions and 1,629 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [2.4.5](https://github.com/geops/openlayers-editor/compare/v2.4.4...v2.4.5) (2024-09-04)


### Bug Fixes

* avoid js error when map is not set when activate/deactivate is called ([c808a36](https://github.com/geops/openlayers-editor/commit/c808a36a6eaa5704f650adfd4b6176b0c7fc96cd))
* improve cursor behavior on pointer down and up in modify control ([5eb32b9](https://github.com/geops/openlayers-editor/commit/5eb32b9be4f4cc23dc4a17c67f459c55072f5fcf))
* use viewport to set cursor style ([62a427d](https://github.com/geops/openlayers-editor/commit/62a427d8830b1641aeec7d3a03f4e266cae3eac8))

### [2.4.4](https://github.com/geops/openlayers-editor/compare/v2.4.3...v2.4.4) (2024-08-20)


Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="stylesheet" type="text/css" href="style/style.css" />
<link
rel="stylesheet"
href="https://unpkg.com/ol@8.2.0/ol.css"
href="https://unpkg.com/ol@10.1.0/ol.css"
/>
<link
rel="stylesheet"
Expand All @@ -14,7 +14,7 @@
<meta charset="utf-8" />
</head>
<body>
<script src="https://unpkg.com/ol@8.2.0/dist/ol.js"></script>
<script src="https://unpkg.com/ol@10.1.0/dist/ol.js"></script>
<script src="https://unpkg.com/[email protected]/dist/maplibre-gl.js"></script>
<script src="https://unpkg.com/[email protected]/dist/jsts.min.js"></script>
<script src="index.js"></script>
Expand Down
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@
"ol": ">=7"
},
"devDependencies": {
"@commitlint/cli": "19.3.0",
"@commitlint/config-conventional": "19.2.2",
"cypress": "13.9.0",
"esbuild": "0.21.1",
"@commitlint/cli": "19.5.0",
"@commitlint/config-conventional": "19.5.0",
"cypress": "13.14.2",
"esbuild": "0.23.1",
"eslint": "8",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-cypress": "3.2.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-cypress": "3.5.0",
"eslint-plugin-import": "2.30.0",
"eslint-plugin-prettier": "5.2.1",
"fixpack": "4.0.0",
"happy-dom": "^14.10.1",
"husky": "9.0.11",
"happy-dom": "^15.7.4",
"husky": "9.1.6",
"is-ci": "3.0.1",
"jsdoc": "4.0.3",
"jsdoc-export-default-interop": "0.3.1",
"jsts": "2.11.3",
"lint-staged": "15.2.2",
"lint-staged": "15.2.10",
"lodash.throttle": "4.1.1",
"ol": "8",
"prettier": "3.2.5",
"ol": "^10.1.0",
"prettier": "3.3.3",
"shx": "0.3.4",
"standard-version": "9.5.0",
"start-server-and-test": "2.0.3",
"stylelint": "16.5.0",
"stylelint-config-standard": "36.0.0",
"typescript": "5.4.5",
"vitest": "^1.6.0"
"start-server-and-test": "2.0.8",
"stylelint": "16.9.0",
"stylelint-config-standard": "36.0.1",
"typescript": "5.6.2",
"vitest": "^2.1.1"
},
"scripts": {
"build": "shx rm -rf build && tsc --project config/tsconfig-build.json && shx cp -r src/img build/img && esbuild build/index.js --bundle --global-name=ole --loader:.svg=dataurl --minify --outfile=build/bundle.js && node tasks/prepare-package.mjs",
Expand Down
28 changes: 25 additions & 3 deletions src/editor.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import Collection from 'ol/Collection';
import BaseObject from 'ol/Object';
import Toolbar from './control/toolbar';

/**
* Core component of OLE.
* All controls are added to this class.
*/
class Editor {
class Editor extends BaseObject {
/**
* Initialization of the editor.
* @param {ol.Map} map The map object.
Expand All @@ -15,6 +16,7 @@ class Editor {
* the toolbar to be rendered outside of the map's viewport.
*/
constructor(map, opts) {
super();
/**
* @private
* @type {ol.Map}
Expand Down Expand Up @@ -146,7 +148,9 @@ class Editor {
* @protected
*/
setEditFeature(feature) {
this.editFeature = feature;
if (feature !== this.editFeature) {
this.editFeature = feature;
}
}

/**
Expand All @@ -165,7 +169,9 @@ class Editor {
* @protected
*/
setDrawFeature(feature) {
this.drawFeature = feature;
if (feature !== this.drawFeature) {
this.drawFeature = feature;
}
}

/**
Expand Down Expand Up @@ -204,6 +210,22 @@ class Editor {
this.activeControls.remove(ctrl);
}
}

get editFeature() {
return this.get('editFeature');
}

set editFeature(feature) {
this.set('editFeature', feature);
}

get drawFeature() {
return this.get('drawFeature');
}

set drawFeature(feature) {
this.set('drawFeature', feature);
}
}

export default Editor;
Loading

0 comments on commit a50e896

Please sign in to comment.