@artstesh/maps 1.1.37 → 1.2.1
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/README.md +7 -0
- package/dist/README.md +24 -24
- package/dist/bundles/maps-components-src-map.umd.js +4 -8
- package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
- package/dist/bundles/maps-components.umd.js +4 -8
- package/dist/bundles/maps-components.umd.js.map +1 -1
- package/dist/esm2015/map/messages/executors/calculate-area.executor.js +1 -1
- package/dist/esm2015/map/messages/executors/generate-zoom-control.executor.js +1 -1
- package/dist/esm2015/map/services/drawing/drawing.service.js +5 -2
- package/dist/esm2015/map/services/map-postboy.service.js +1 -9
- package/dist/esm2015/map/services/map-state.service.js +2 -2
- package/dist/esm2015/src/map/messages/executors/calculate-area.executor.js +1 -1
- package/dist/esm2015/src/map/messages/executors/generate-zoom-control.executor.js +1 -1
- package/dist/esm2015/src/map/services/drawing/drawing.service.js +5 -2
- package/dist/esm2015/src/map/services/map-postboy.service.js +1 -9
- package/dist/esm2015/src/map/services/map-state.service.js +2 -2
- package/dist/fesm2015/maps-components-src-map.js +4 -7
- package/dist/fesm2015/maps-components-src-map.js.map +1 -1
- package/dist/fesm2015/maps-components.js +4 -7
- package/dist/fesm2015/maps-components.js.map +1 -1
- package/dist/map/messages/executors/calculate-area.executor.d.ts +1 -3
- package/dist/map/messages/executors/generate-zoom-control.executor.d.ts +2 -2
- package/dist/package.json +1 -1
- package/dist/src/map/messages/executors/calculate-area.executor.d.ts +1 -3
- package/dist/src/map/messages/executors/generate-zoom-control.executor.d.ts +2 -2
- package/package.json +13 -3
|
@@ -11,7 +11,7 @@ import { getCenter, createEmpty, extend } from 'ol/extent';
|
|
|
11
11
|
import Polygon, { circular, fromExtent } from 'ol/geom/Polygon';
|
|
12
12
|
import { Control, Zoom } from 'ol/control';
|
|
13
13
|
import { get, useGeographic, transform } from 'ol/proj';
|
|
14
|
-
import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, PostboyService, PostboyAbstractRegistrator } from '@artstesh/postboy';
|
|
14
|
+
import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, PostboyService, LockMessage, UnlockMessage, PostboyAbstractRegistrator } from '@artstesh/postboy';
|
|
15
15
|
import * as Sphere from 'ol/sphere';
|
|
16
16
|
import { getLength } from 'ol/sphere';
|
|
17
17
|
import { Draw, Modify, Translate, defaults } from 'ol/interaction';
|
|
@@ -938,11 +938,6 @@ RemoveRasterTileCommand.ID = 'd1c4bf6a-e2f2-4385-a7a2-cecb525f8939';
|
|
|
938
938
|
class MapPostboyService extends PostboyService {
|
|
939
939
|
constructor() {
|
|
940
940
|
super();
|
|
941
|
-
this.addLocker({
|
|
942
|
-
locker: StartDrawingCommand.ID,
|
|
943
|
-
unlocker: DrawingFinishedEvent.ID,
|
|
944
|
-
locking: [MapClickEvent.ID],
|
|
945
|
-
});
|
|
946
941
|
}
|
|
947
942
|
}
|
|
948
943
|
MapPostboyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapPostboyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -1090,7 +1085,7 @@ class MapStateService {
|
|
|
1090
1085
|
if (!this.map)
|
|
1091
1086
|
return null;
|
|
1092
1087
|
let [longitude, latitude] = this.map.getView().getCenter();
|
|
1093
|
-
const zoom =
|
|
1088
|
+
const zoom = this.map.getView().getZoom();
|
|
1094
1089
|
const extent = this.map.getView().calculateExtent();
|
|
1095
1090
|
return { longitude, latitude, zoom, extent };
|
|
1096
1091
|
}
|
|
@@ -1256,6 +1251,7 @@ class DrawingService {
|
|
|
1256
1251
|
}
|
|
1257
1252
|
observeDrawing() {
|
|
1258
1253
|
this.postboy.sub(StartDrawingCommand).subscribe((ev) => {
|
|
1254
|
+
this.postboy.exec(new LockMessage(MapClickEvent));
|
|
1259
1255
|
this.draw((l) => {
|
|
1260
1256
|
var _a;
|
|
1261
1257
|
if (!l || !this.map) {
|
|
@@ -1303,6 +1299,7 @@ class DrawingService {
|
|
|
1303
1299
|
(_a = this.map) === null || _a === void 0 ? void 0 : _a.removeInteraction(this.drawInteraction);
|
|
1304
1300
|
layer === null || layer === void 0 ? void 0 : layer.setSource(new Vector({}));
|
|
1305
1301
|
}
|
|
1302
|
+
this.postboy.exec(new UnlockMessage(MapClickEvent));
|
|
1306
1303
|
setTimeout(() => this.postboy.fire(new DrawingFinishedEvent()), 300);
|
|
1307
1304
|
}
|
|
1308
1305
|
}
|