@vcmap/core 5.0.0-rc.29 → 5.0.0-rc.30
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/package.json +1 -1
- package/src/util/editor/createFeatureSession.js +1 -5
- package/src/util/editor/interactions/createBBoxInteraction.js +9 -3
- package/src/util/editor/interactions/createCircleInteraction.js +6 -2
- package/src/util/editor/interactions/createLineStringInteraction.js +9 -3
- package/src/util/editor/interactions/createPointInteraction.js +9 -2
- package/src/util/editor/interactions/createPolygonInteraction.js +9 -3
package/package.json
CHANGED
|
@@ -13,10 +13,7 @@ import CreatePointInteraction from './interactions/createPointInteraction.js';
|
|
|
13
13
|
import CreatePolygonInteraction from './interactions/createPolygonInteraction.js';
|
|
14
14
|
import VcsApp from '../../vcsApp.js';
|
|
15
15
|
import VectorLayer from '../../layer/vectorLayer.js';
|
|
16
|
-
import {
|
|
17
|
-
alreadyTransformedToMercator,
|
|
18
|
-
createSync,
|
|
19
|
-
} from '../../layer/vectorSymbols.js';
|
|
16
|
+
import { createSync } from '../../layer/vectorSymbols.js';
|
|
20
17
|
import geometryIsValid from './validateGeoemetry.js';
|
|
21
18
|
import ObliqueMap from '../../map/obliqueMap.js';
|
|
22
19
|
|
|
@@ -107,7 +104,6 @@ function startCreateFeatureSession(app, layer, geometryType) {
|
|
|
107
104
|
/** @type {ObliqueMap} */ (app.maps.activeMap).switchEnabled = false;
|
|
108
105
|
}
|
|
109
106
|
currentFeature = new Feature({ geometry });
|
|
110
|
-
currentFeature[alreadyTransformedToMercator] = true;
|
|
111
107
|
currentFeature[createSync] = true;
|
|
112
108
|
layer.addFeatures([currentFeature]);
|
|
113
109
|
featureCreated.raiseEvent(currentFeature);
|
|
@@ -3,7 +3,10 @@ import AbstractInteraction from '../../../interaction/abstractInteraction.js';
|
|
|
3
3
|
import { EventType } from '../../../interaction/interactionType.js';
|
|
4
4
|
import VcsEvent from '../../../vcsEvent.js';
|
|
5
5
|
import { GeometryType } from '../editorSessionHelpers.js';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
alreadyTransformedToImage,
|
|
8
|
+
alreadyTransformedToMercator,
|
|
9
|
+
} from '../../../layer/vectorSymbols.js';
|
|
7
10
|
import ObliqueMap from '../../../map/obliqueMap.js';
|
|
8
11
|
|
|
9
12
|
/**
|
|
@@ -108,8 +111,11 @@ class CreateBBoxInteraction extends AbstractInteraction {
|
|
|
108
111
|
} else {
|
|
109
112
|
this._geometry = new Polygon([[event.positionOrPixel.slice()]], 'XYZ');
|
|
110
113
|
this._geometry.set('_vcsGeomType', GeometryType.BBox);
|
|
111
|
-
|
|
112
|
-
|
|
114
|
+
if (event.map instanceof ObliqueMap) {
|
|
115
|
+
this._geometry[alreadyTransformedToImage] = true;
|
|
116
|
+
} else {
|
|
117
|
+
this._geometry[alreadyTransformedToMercator] = true;
|
|
118
|
+
}
|
|
113
119
|
this.created.raiseEvent(this._geometry);
|
|
114
120
|
this._origin = event.positionOrPixel.slice();
|
|
115
121
|
this._lastCoordinate = this._origin.slice();
|
|
@@ -5,6 +5,7 @@ import VcsEvent from '../../../vcsEvent.js';
|
|
|
5
5
|
import {
|
|
6
6
|
actuallyIsCircle,
|
|
7
7
|
alreadyTransformedToImage,
|
|
8
|
+
alreadyTransformedToMercator,
|
|
8
9
|
} from '../../../layer/vectorSymbols.js';
|
|
9
10
|
import ObliqueMap from '../../../map/obliqueMap.js';
|
|
10
11
|
|
|
@@ -75,8 +76,11 @@ class CreateCircleInteraction extends AbstractInteraction {
|
|
|
75
76
|
} else {
|
|
76
77
|
this._geometry = new Circle(event.positionOrPixel, 20, 'XYZ');
|
|
77
78
|
this._geometry[actuallyIsCircle] = event.map instanceof ObliqueMap;
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
if (event.map instanceof ObliqueMap) {
|
|
80
|
+
this._geometry[alreadyTransformedToImage] = true;
|
|
81
|
+
} else {
|
|
82
|
+
this._geometry[alreadyTransformedToMercator] = true;
|
|
83
|
+
}
|
|
80
84
|
this.created.raiseEvent(this._geometry);
|
|
81
85
|
this._coordinates = this._geometry.getCoordinates();
|
|
82
86
|
this._lastCoordinate = this._coordinates[1];
|
|
@@ -2,7 +2,10 @@ import LineString from 'ol/geom/LineString.js';
|
|
|
2
2
|
import AbstractInteraction from '../../../interaction/abstractInteraction.js';
|
|
3
3
|
import { EventType } from '../../../interaction/interactionType.js';
|
|
4
4
|
import VcsEvent from '../../../vcsEvent.js';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
alreadyTransformedToImage,
|
|
7
|
+
alreadyTransformedToMercator,
|
|
8
|
+
} from '../../../layer/vectorSymbols.js';
|
|
6
9
|
import ObliqueMap from '../../../map/obliqueMap.js';
|
|
7
10
|
|
|
8
11
|
/**
|
|
@@ -68,8 +71,11 @@ class CreateLineStringInteraction extends AbstractInteraction {
|
|
|
68
71
|
if (event.type & EventType.CLICK) {
|
|
69
72
|
if (!this._geometry) {
|
|
70
73
|
this._geometry = new LineString([event.positionOrPixel], 'XYZ');
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
if (event.map instanceof ObliqueMap) {
|
|
75
|
+
this._geometry[alreadyTransformedToImage] = true;
|
|
76
|
+
} else {
|
|
77
|
+
this._geometry[alreadyTransformedToMercator] = true;
|
|
78
|
+
}
|
|
73
79
|
this.created.raiseEvent(this._geometry);
|
|
74
80
|
this._coordinates = [event.positionOrPixel.slice()];
|
|
75
81
|
this._lastCoordinate = this._coordinates[0].slice();
|
|
@@ -2,7 +2,10 @@ import Point from 'ol/geom/Point.js';
|
|
|
2
2
|
import AbstractInteraction from '../../../interaction/abstractInteraction.js';
|
|
3
3
|
import VcsEvent from '../../../vcsEvent.js';
|
|
4
4
|
import { EventType } from '../../../interaction/interactionType.js';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
alreadyTransformedToImage,
|
|
7
|
+
alreadyTransformedToMercator,
|
|
8
|
+
} from '../../../layer/vectorSymbols.js';
|
|
6
9
|
import ObliqueMap from '../../../map/obliqueMap.js';
|
|
7
10
|
|
|
8
11
|
/**
|
|
@@ -37,7 +40,11 @@ class CreatePointInteraction extends AbstractInteraction {
|
|
|
37
40
|
*/
|
|
38
41
|
async pipe(event) {
|
|
39
42
|
this._geometry = new Point(event.positionOrPixel, 'XYZ');
|
|
40
|
-
|
|
43
|
+
if (event.map instanceof ObliqueMap) {
|
|
44
|
+
this._geometry[alreadyTransformedToImage] = true;
|
|
45
|
+
} else {
|
|
46
|
+
this._geometry[alreadyTransformedToMercator] = true;
|
|
47
|
+
}
|
|
41
48
|
this.created.raiseEvent(this._geometry);
|
|
42
49
|
this.finish();
|
|
43
50
|
return event;
|
|
@@ -2,7 +2,10 @@ import { Polygon } from 'ol/geom.js';
|
|
|
2
2
|
import AbstractInteraction from '../../../interaction/abstractInteraction.js';
|
|
3
3
|
import { EventType } from '../../../interaction/interactionType.js';
|
|
4
4
|
import VcsEvent from '../../../vcsEvent.js';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
alreadyTransformedToImage,
|
|
7
|
+
alreadyTransformedToMercator,
|
|
8
|
+
} from '../../../layer/vectorSymbols.js';
|
|
6
9
|
import ObliqueMap from '../../../map/obliqueMap.js';
|
|
7
10
|
|
|
8
11
|
/**
|
|
@@ -76,8 +79,11 @@ class CreatePolygonInteraction extends AbstractInteraction {
|
|
|
76
79
|
if (event.type & EventType.CLICK) {
|
|
77
80
|
if (!this._geometry) {
|
|
78
81
|
this._geometry = new Polygon([[event.positionOrPixel.slice()]], 'XYZ');
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
if (event.map instanceof ObliqueMap) {
|
|
83
|
+
this._geometry[alreadyTransformedToImage] = true;
|
|
84
|
+
} else {
|
|
85
|
+
this._geometry[alreadyTransformedToMercator] = true;
|
|
86
|
+
}
|
|
81
87
|
this.created.raiseEvent(this._geometry);
|
|
82
88
|
this._coordinates = [event.positionOrPixel.slice()];
|
|
83
89
|
this._lastCoordinate = [...event.positionOrPixel];
|