@masterportal/masterportalapi 2.21.0 → 2.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -1
- package/package.json +65 -64
- package/src/index.js +1 -3
- package/src/layer/wfs.js +226 -5
- package/src/maps/interactions/modifyInteraction.js +18 -0
- package/src/maps/interactions/selectInteraction.js +35 -0
- package/src/maps/ol/olMap.js +1 -1
- package/src/vectorStyle/lib/createLegendInfo.js +16 -8
- package/src/vectorStyle/lib/getGeometryTypeFromService.js +10 -8
- package/test/layer/wfs.test.js +633 -14
- package/test/maps/interactions/{drawInteractions.test.js → drawInteraction.test.js} +2 -2
- package/test/maps/interactions/modifyInteraction.test.js +18 -0
- package/test/maps/interactions/selectInteraction.test.js +31 -0
- /package/src/maps/interactions/{drawInteractions.js → drawInteraction.js} +0 -0
|
@@ -3,9 +3,9 @@ import Feature from "ol/Feature";
|
|
|
3
3
|
import Circle from "ol/geom/Circle";
|
|
4
4
|
import VectorSource from "ol/source/Vector";
|
|
5
5
|
|
|
6
|
-
import drawInteractions, {styleObject} from "../../../src/maps/interactions/
|
|
6
|
+
import drawInteractions, {styleObject} from "../../../src/maps/interactions/drawInteraction";
|
|
7
7
|
|
|
8
|
-
describe("src/maps/interactions/
|
|
8
|
+
describe("src/maps/interactions/drawInteraction.js", () => {
|
|
9
9
|
describe("transformMapUnitRadius", () => {
|
|
10
10
|
it("should return the input meter radius in meter ", () => {
|
|
11
11
|
const radius = 100,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {Modify} from "ol/interaction.js";
|
|
2
|
+
import VectorSource from "ol/source/Vector";
|
|
3
|
+
|
|
4
|
+
import modifyInteractions from "../../../src/maps/interactions/modifyInteraction";
|
|
5
|
+
|
|
6
|
+
describe("src/maps/interactions/modifyInteraction.js", () => {
|
|
7
|
+
describe("createModifyInteraction", () => {
|
|
8
|
+
it("should create a modify interaction", () => {
|
|
9
|
+
const source = new VectorSource(),
|
|
10
|
+
modifyInteraction = modifyInteractions.createModifyInteraction(source);
|
|
11
|
+
|
|
12
|
+
expect(modifyInteraction).not.toBeUndefined();
|
|
13
|
+
expect(modifyInteraction).not.toBeNull();
|
|
14
|
+
expect(modifyInteraction).toBeInstanceOf(Modify);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* eslint-disable no-underscore-dangle */
|
|
2
|
+
import {pointerMove, singleClick} from "ol/events/condition.js";
|
|
3
|
+
import {Select} from "ol/interaction.js";
|
|
4
|
+
import VectorLayer from "ol/layer/Vector";
|
|
5
|
+
|
|
6
|
+
import selectInteractions from "../../../src/maps/interactions/selectInteraction";
|
|
7
|
+
|
|
8
|
+
describe("src/maps/interactions/selectInteraction.js", () => {
|
|
9
|
+
describe("createSelectInteraction", () => {
|
|
10
|
+
it("should create a select interaction", () => {
|
|
11
|
+
const layers = new VectorLayer(),
|
|
12
|
+
selectInteraction = selectInteractions.createSelectInteraction(layers);
|
|
13
|
+
|
|
14
|
+
expect(selectInteraction).not.toBeUndefined();
|
|
15
|
+
expect(selectInteraction).not.toBeNull();
|
|
16
|
+
expect(selectInteraction).toBeInstanceOf(Select);
|
|
17
|
+
expect(selectInteraction.condition_).toEqual(singleClick);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("should create a select interaction with condition === pointerMove", () => {
|
|
21
|
+
const layers = new VectorLayer(),
|
|
22
|
+
selectInteraction = selectInteractions.createSelectInteraction(layers, pointerMove);
|
|
23
|
+
|
|
24
|
+
expect(selectInteraction).not.toBeUndefined();
|
|
25
|
+
expect(selectInteraction).not.toBeNull();
|
|
26
|
+
expect(selectInteraction).toBeInstanceOf(Select);
|
|
27
|
+
expect(selectInteraction.condition_).toEqual(pointerMove);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
});
|
|
File without changes
|