@artstesh/maps 5.0.6 → 5.0.8
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/dist/esm2022/map/helpers/index.mjs +2 -1
- package/dist/esm2022/map/helpers/marker-style.helper.mjs +5 -1
- package/dist/esm2022/map/helpers/text-style.helper.mjs +14 -0
- package/dist/esm2022/map/map-plate/features/polygons/polygons.component.mjs +2 -2
- package/dist/esm2022/map/map-plate/layers/cluster-layer/cluster-layer-factory.service.mjs +59 -0
- package/dist/esm2022/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +52 -0
- package/dist/esm2022/map/map-plate/layers/cluster-layer/cluster-layer.manager.mjs +38 -0
- package/dist/esm2022/map/map-plate/layers/cluster-layer/cluster-layer.settings.mjs +67 -0
- package/dist/esm2022/map/map-plate/layers/index.mjs +3 -1
- package/dist/esm2022/map/map-plate/layers/tile-layer/tile-layer.component.mjs +1 -1
- package/dist/esm2022/map/map-plate/map-plate.component.mjs +23 -3
- package/dist/esm2022/map/map.module.mjs +8 -3
- package/dist/esm2022/map/messages/commands/add-layer.command.mjs +3 -3
- package/dist/esm2022/map/messages/commands/add-tile.command.mjs +3 -3
- package/dist/esm2022/map/messages/commands/cancel-drawing.command.mjs +8 -0
- package/dist/esm2022/map/messages/commands/close-tooltip.command.mjs +3 -3
- package/dist/esm2022/map/messages/commands/fit-to-features.command.mjs +15 -0
- package/dist/esm2022/map/messages/commands/place-layer-features.command.mjs +3 -3
- package/dist/esm2022/map/messages/commands/remove-layer.command.mjs +3 -3
- package/dist/esm2022/map/messages/commands/remove-tile.command.mjs +3 -3
- package/dist/esm2022/map/messages/commands/start-drawing.command.mjs +18 -0
- package/dist/esm2022/map/messages/events/drawing-finished.event.mjs +11 -0
- package/dist/esm2022/map/messages/events/map-click.event.mjs +6 -4
- package/dist/esm2022/map/messages/events/map-move-end.event.mjs +15 -0
- package/dist/esm2022/map/messages/events/map-rendered.event.mjs +3 -3
- package/dist/esm2022/map/messages/index.mjs +4 -2
- package/dist/esm2022/map/messages/queries/get-layer.query.mjs +13 -0
- package/dist/esm2022/map/models/drawing-type.enum.mjs +5 -0
- package/dist/esm2022/map/models/feature-format.enum.mjs +6 -0
- package/dist/esm2022/map/models/i-identified.mjs +2 -0
- package/dist/esm2022/map/models/index.mjs +3 -1
- package/dist/esm2022/map/models/map.constants.mjs +5 -0
- package/dist/esm2022/map/models/marker-model.mjs +3 -2
- package/dist/esm2022/map/services/drawing/drawing.service.mjs +82 -0
- package/dist/esm2022/map/services/map-click.service.mjs +7 -3
- package/dist/esm2022/map/services/map-feature.service.mjs +41 -0
- package/dist/esm2022/map/services/map-management.service.mjs +11 -3
- package/dist/esm2022/map/services/map-postboy.service.mjs +10 -4
- package/dist/esm2022/map/services/map-state.service.mjs +10 -2
- package/dist/esm2022/map/services/message-registrator.service.mjs +20 -6
- package/dist/esm2022/src/map/helpers/index.mjs +2 -1
- package/dist/esm2022/src/map/helpers/marker-style.helper.mjs +5 -1
- package/dist/esm2022/src/map/helpers/text-style.helper.mjs +14 -0
- package/dist/esm2022/src/map/map-plate/features/polygons/polygons.component.mjs +2 -2
- package/dist/esm2022/src/map/map-plate/layers/cluster-layer/cluster-layer-factory.service.mjs +59 -0
- package/dist/esm2022/src/map/map-plate/layers/cluster-layer/cluster-layer.component.mjs +52 -0
- package/dist/esm2022/src/map/map-plate/layers/cluster-layer/cluster-layer.manager.mjs +38 -0
- package/dist/esm2022/src/map/map-plate/layers/cluster-layer/cluster-layer.settings.mjs +67 -0
- package/dist/esm2022/src/map/map-plate/layers/index.mjs +3 -1
- package/dist/esm2022/src/map/map-plate/layers/tile-layer/tile-layer.component.mjs +1 -1
- package/dist/esm2022/src/map/map-plate/map-plate.component.mjs +23 -3
- package/dist/esm2022/src/map/map.module.mjs +8 -3
- package/dist/esm2022/src/map/messages/commands/add-layer.command.mjs +3 -3
- package/dist/esm2022/src/map/messages/commands/add-tile.command.mjs +3 -3
- package/dist/esm2022/src/map/messages/commands/cancel-drawing.command.mjs +8 -0
- package/dist/esm2022/src/map/messages/commands/close-tooltip.command.mjs +3 -3
- package/dist/esm2022/src/map/messages/commands/fit-to-features.command.mjs +15 -0
- package/dist/esm2022/src/map/messages/commands/place-layer-features.command.mjs +3 -3
- package/dist/esm2022/src/map/messages/commands/remove-layer.command.mjs +3 -3
- package/dist/esm2022/src/map/messages/commands/remove-tile.command.mjs +3 -3
- package/dist/esm2022/src/map/messages/commands/start-drawing.command.mjs +18 -0
- package/dist/esm2022/src/map/messages/events/drawing-finished.event.mjs +11 -0
- package/dist/esm2022/src/map/messages/events/map-click.event.mjs +6 -4
- package/dist/esm2022/src/map/messages/events/map-move-end.event.mjs +15 -0
- package/dist/esm2022/src/map/messages/events/map-rendered.event.mjs +3 -3
- package/dist/esm2022/src/map/messages/index.mjs +4 -2
- package/dist/esm2022/src/map/messages/queries/get-layer.query.mjs +13 -0
- package/dist/esm2022/src/map/models/drawing-type.enum.mjs +5 -0
- package/dist/esm2022/src/map/models/feature-format.enum.mjs +6 -0
- package/dist/esm2022/src/map/models/i-identified.mjs +2 -0
- package/dist/esm2022/src/map/models/index.mjs +3 -1
- package/dist/esm2022/src/map/models/map.constants.mjs +5 -0
- package/dist/esm2022/src/map/models/marker-model.mjs +3 -2
- package/dist/esm2022/src/map/services/drawing/drawing.service.mjs +82 -0
- package/dist/esm2022/src/map/services/map-click.service.mjs +7 -3
- package/dist/esm2022/src/map/services/map-feature.service.mjs +41 -0
- package/dist/esm2022/src/map/services/map-management.service.mjs +11 -3
- package/dist/esm2022/src/map/services/map-postboy.service.mjs +10 -4
- package/dist/esm2022/src/map/services/map-state.service.mjs +10 -2
- package/dist/esm2022/src/map/services/message-registrator.service.mjs +20 -6
- package/dist/fesm2022/maps-components-src-map.mjs +616 -176
- package/dist/fesm2022/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2022/maps-components.mjs +616 -176
- package/dist/fesm2022/maps-components.mjs.map +1 -1
- package/dist/map/helpers/index.d.ts +1 -0
- package/dist/map/helpers/marker-style.helper.d.ts +2 -0
- package/dist/map/helpers/text-style.helper.d.ts +4 -0
- package/dist/map/map-plate/layers/cluster-layer/cluster-layer-factory.service.d.ts +11 -0
- package/dist/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +21 -0
- package/dist/map/map-plate/layers/cluster-layer/cluster-layer.manager.d.ts +13 -0
- package/dist/map/map-plate/layers/cluster-layer/cluster-layer.settings.d.ts +22 -0
- package/dist/map/map-plate/layers/index.d.ts +2 -0
- package/dist/map/map-plate/map-plate.component.d.ts +2 -0
- package/dist/map/map.module.d.ts +3 -2
- package/dist/map/messages/commands/add-layer.command.d.ts +6 -5
- package/dist/map/messages/commands/add-tile.command.d.ts +3 -3
- package/dist/map/messages/commands/cancel-drawing.command.d.ts +5 -0
- package/dist/map/messages/commands/close-tooltip.command.d.ts +3 -3
- package/dist/map/messages/commands/fit-to-features.command.d.ts +10 -0
- package/dist/map/messages/commands/place-layer-features.command.d.ts +3 -3
- package/dist/map/messages/commands/remove-layer.command.d.ts +3 -3
- package/dist/map/messages/commands/remove-tile.command.d.ts +3 -3
- package/dist/map/messages/commands/start-drawing.command.d.ts +11 -0
- package/dist/map/messages/events/drawing-finished.event.d.ts +6 -0
- package/dist/map/messages/events/map-click.event.d.ts +13 -5
- package/dist/map/messages/events/map-move-end.event.d.ts +8 -0
- package/dist/map/messages/events/map-rendered.event.d.ts +3 -3
- package/dist/map/messages/index.d.ts +3 -1
- package/dist/map/messages/queries/get-layer.query.d.ts +10 -0
- package/dist/map/models/drawing-type.enum.d.ts +3 -0
- package/dist/map/models/feature-format.enum.d.ts +4 -0
- package/dist/map/models/i-identified.d.ts +3 -0
- package/dist/map/models/index.d.ts +2 -0
- package/dist/map/models/map.constants.d.ts +4 -0
- package/dist/map/services/drawing/drawing.service.d.ts +17 -0
- package/dist/map/services/map-feature.service.d.ts +14 -0
- package/dist/map/services/map-management.service.d.ts +1 -0
- package/dist/map/services/map-postboy.service.d.ts +1 -2
- package/dist/map/services/message-registrator.service.d.ts +3 -1
- package/dist/package.json +1 -1
- package/dist/src/map/helpers/index.d.ts +1 -0
- package/dist/src/map/helpers/marker-style.helper.d.ts +2 -0
- package/dist/src/map/helpers/text-style.helper.d.ts +4 -0
- package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer-factory.service.d.ts +11 -0
- package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +21 -0
- package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.manager.d.ts +13 -0
- package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.settings.d.ts +22 -0
- package/dist/src/map/map-plate/layers/index.d.ts +2 -0
- package/dist/src/map/map-plate/map-plate.component.d.ts +2 -0
- package/dist/src/map/map.module.d.ts +3 -2
- package/dist/src/map/messages/commands/add-layer.command.d.ts +6 -5
- package/dist/src/map/messages/commands/add-tile.command.d.ts +3 -3
- package/dist/src/map/messages/commands/cancel-drawing.command.d.ts +5 -0
- package/dist/src/map/messages/commands/close-tooltip.command.d.ts +3 -3
- package/dist/src/map/messages/commands/fit-to-features.command.d.ts +10 -0
- package/dist/src/map/messages/commands/place-layer-features.command.d.ts +3 -3
- package/dist/src/map/messages/commands/remove-layer.command.d.ts +3 -3
- package/dist/src/map/messages/commands/remove-tile.command.d.ts +3 -3
- package/dist/src/map/messages/commands/start-drawing.command.d.ts +11 -0
- package/dist/src/map/messages/events/drawing-finished.event.d.ts +6 -0
- package/dist/src/map/messages/events/map-click.event.d.ts +13 -5
- package/dist/src/map/messages/events/map-move-end.event.d.ts +8 -0
- package/dist/src/map/messages/events/map-rendered.event.d.ts +3 -3
- package/dist/src/map/messages/index.d.ts +3 -1
- package/dist/src/map/messages/queries/get-layer.query.d.ts +10 -0
- package/dist/src/map/models/drawing-type.enum.d.ts +3 -0
- package/dist/src/map/models/feature-format.enum.d.ts +4 -0
- package/dist/src/map/models/i-identified.d.ts +3 -0
- package/dist/src/map/models/index.d.ts +2 -0
- package/dist/src/map/models/map.constants.d.ts +4 -0
- package/dist/src/map/services/drawing/drawing.service.d.ts +17 -0
- package/dist/src/map/services/map-feature.service.d.ts +14 -0
- package/dist/src/map/services/map-management.service.d.ts +1 -0
- package/dist/src/map/services/map-postboy.service.d.ts +1 -2
- package/dist/src/map/services/message-registrator.service.d.ts +3 -1
- package/package.json +2 -2
- package/dist/esm2022/map/messages/generic-message.mjs +0 -12
- package/dist/esm2022/src/map/messages/generic-message.mjs +0 -12
- package/dist/map/messages/generic-message.d.ts +0 -9
- package/dist/src/map/messages/generic-message.d.ts +0 -9
|
@@ -5,20 +5,24 @@ import { CommonModule } from '@angular/common';
|
|
|
5
5
|
import { Feature } from 'ol';
|
|
6
6
|
import { Point } from 'ol/geom';
|
|
7
7
|
import { GeoJSON, WKT } from 'ol/format';
|
|
8
|
-
import { getCenter } from 'ol/extent';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
8
|
+
import { getCenter, createEmpty, extend } from 'ol/extent';
|
|
9
|
+
import { get, useGeographic } from 'ol/proj';
|
|
10
|
+
import { PostboyGenericMessage, PostboyCallbackMessage, PostboyService, PostboyAbstractRegistrator } from '@artstesh/postboy';
|
|
11
|
+
import { first, filter, auditTime } from 'rxjs/operators';
|
|
12
|
+
import { Vector, XYZ } from 'ol/source';
|
|
13
|
+
import { Draw } from 'ol/interaction';
|
|
14
14
|
import TileLayer from 'ol/layer/Tile';
|
|
15
15
|
import OSM from 'ol/source/OSM';
|
|
16
|
-
import { filter, first } from 'rxjs/operators';
|
|
17
|
-
import { XYZ, Vector } from 'ol/source';
|
|
18
16
|
import { Vector as Vector$1 } from 'ol/layer';
|
|
17
|
+
import { bbox } from 'ol/loadingstrategy';
|
|
18
|
+
import { fromExtent } from 'ol/geom/Polygon';
|
|
19
|
+
import Cluster from 'ol/source/Cluster';
|
|
20
|
+
import { combineLatest } from 'rxjs';
|
|
21
|
+
import Map from 'ol/Map';
|
|
22
|
+
import View from 'ol/View';
|
|
19
23
|
import Overlay from 'ol/Overlay';
|
|
20
24
|
import Style from 'ol/style/Style';
|
|
21
|
-
import { Icon, Circle, Fill, Stroke } from 'ol/style';
|
|
25
|
+
import { Icon, Circle, Fill, Stroke, Text } from 'ol/style';
|
|
22
26
|
|
|
23
27
|
class DestructibleComponent {
|
|
24
28
|
subs = [];
|
|
@@ -119,6 +123,11 @@ class IdGenerator {
|
|
|
119
123
|
}
|
|
120
124
|
}
|
|
121
125
|
|
|
126
|
+
class MapConstants {
|
|
127
|
+
static FeatureInfo = 'f-info';
|
|
128
|
+
static DrawingLayerId = '93a981756ec7';
|
|
129
|
+
}
|
|
130
|
+
|
|
122
131
|
class MarkerModel {
|
|
123
132
|
lat;
|
|
124
133
|
lng;
|
|
@@ -139,7 +148,7 @@ class MarkerModel {
|
|
|
139
148
|
const feature = new Feature(new Point([this.lng, this.lat]));
|
|
140
149
|
feature.setId(this.id);
|
|
141
150
|
if (this.info)
|
|
142
|
-
feature.set(
|
|
151
|
+
feature.set(MapConstants.FeatureInfo, this.info);
|
|
143
152
|
return feature;
|
|
144
153
|
}
|
|
145
154
|
}
|
|
@@ -171,18 +180,18 @@ class PolygonModel {
|
|
|
171
180
|
}
|
|
172
181
|
}
|
|
173
182
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
183
|
+
var DrawingType;
|
|
184
|
+
(function (DrawingType) {
|
|
185
|
+
DrawingType[DrawingType["Polygon"] = 1] = "Polygon";
|
|
186
|
+
})(DrawingType || (DrawingType = {}));
|
|
187
|
+
|
|
188
|
+
var FeatureOutputFormat;
|
|
189
|
+
(function (FeatureOutputFormat) {
|
|
190
|
+
FeatureOutputFormat[FeatureOutputFormat["GeoJson"] = 1] = "GeoJson";
|
|
191
|
+
FeatureOutputFormat[FeatureOutputFormat["WKT"] = 2] = "WKT";
|
|
192
|
+
})(FeatureOutputFormat || (FeatureOutputFormat = {}));
|
|
184
193
|
|
|
185
|
-
class MapRenderedEvent extends
|
|
194
|
+
class MapRenderedEvent extends PostboyGenericMessage {
|
|
186
195
|
map;
|
|
187
196
|
static ID = 'b6121807-3b89-4cd3-82cf-089d2cefdc4f';
|
|
188
197
|
constructor(map) {
|
|
@@ -194,21 +203,37 @@ class MapRenderedEvent extends GenericMessage {
|
|
|
194
203
|
}
|
|
195
204
|
}
|
|
196
205
|
|
|
197
|
-
class MapClickEvent extends
|
|
206
|
+
class MapClickEvent extends PostboyGenericMessage {
|
|
198
207
|
coordinates;
|
|
199
208
|
entities;
|
|
209
|
+
features;
|
|
200
210
|
static ID = '323df526-8d9c-49c6-83e8-6e9a1e7762f7';
|
|
201
|
-
constructor(coordinates, entities) {
|
|
211
|
+
constructor(coordinates, entities, features) {
|
|
202
212
|
super();
|
|
203
213
|
this.coordinates = coordinates;
|
|
204
214
|
this.entities = entities;
|
|
215
|
+
this.features = features;
|
|
205
216
|
}
|
|
206
217
|
get id() {
|
|
207
218
|
return MapClickEvent.ID;
|
|
208
219
|
}
|
|
209
220
|
}
|
|
210
221
|
|
|
211
|
-
class
|
|
222
|
+
class MapMoveEndEvent extends PostboyGenericMessage {
|
|
223
|
+
zoom;
|
|
224
|
+
extent;
|
|
225
|
+
static ID = 'f21f783e-b5af-4489-9fec-8027fd07a8ad';
|
|
226
|
+
constructor(zoom, extent) {
|
|
227
|
+
super();
|
|
228
|
+
this.zoom = zoom;
|
|
229
|
+
this.extent = extent;
|
|
230
|
+
}
|
|
231
|
+
get id() {
|
|
232
|
+
return MapMoveEndEvent.ID;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
class CloseTooltipCommand extends PostboyGenericMessage {
|
|
212
237
|
tooltipId;
|
|
213
238
|
static ID = '4896d52c-e34f-4994-bcfd-32832d12dbe4';
|
|
214
239
|
constructor(tooltipId) {
|
|
@@ -220,7 +245,30 @@ class CloseTooltipCommand extends GenericMessage {
|
|
|
220
245
|
}
|
|
221
246
|
}
|
|
222
247
|
|
|
223
|
-
class
|
|
248
|
+
class StartDrawingCommand extends PostboyCallbackMessage {
|
|
249
|
+
type;
|
|
250
|
+
style;
|
|
251
|
+
format;
|
|
252
|
+
static ID = 'da904f4b-a1c8-4db7-a6af-14d9ee18ec8c';
|
|
253
|
+
constructor(type, style, format = FeatureOutputFormat.GeoJson) {
|
|
254
|
+
super();
|
|
255
|
+
this.type = type;
|
|
256
|
+
this.style = style;
|
|
257
|
+
this.format = format;
|
|
258
|
+
}
|
|
259
|
+
get id() {
|
|
260
|
+
return StartDrawingCommand.ID;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
class CancelDrawingCommand extends PostboyGenericMessage {
|
|
265
|
+
static ID = '7d38d983-feba-4176-a66b-18175e5ecd6b';
|
|
266
|
+
get id() {
|
|
267
|
+
return CancelDrawingCommand.ID;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
class AddLayerCommand extends PostboyGenericMessage {
|
|
224
272
|
layer;
|
|
225
273
|
static ID = 'd93e250f-92bc-43ac-9c6a-46c521a1aaa5';
|
|
226
274
|
constructor(layer) {
|
|
@@ -232,7 +280,7 @@ class AddLayerCommand extends GenericMessage {
|
|
|
232
280
|
}
|
|
233
281
|
}
|
|
234
282
|
|
|
235
|
-
class PlaceLayerFeaturesCommand extends
|
|
283
|
+
class PlaceLayerFeaturesCommand extends PostboyGenericMessage {
|
|
236
284
|
layer;
|
|
237
285
|
features;
|
|
238
286
|
static ID = '8caf86bc-869b-426f-b36d-4642f6b8aab0';
|
|
@@ -246,7 +294,7 @@ class PlaceLayerFeaturesCommand extends GenericMessage {
|
|
|
246
294
|
}
|
|
247
295
|
}
|
|
248
296
|
|
|
249
|
-
class RemoveLayerCommand extends
|
|
297
|
+
class RemoveLayerCommand extends PostboyGenericMessage {
|
|
250
298
|
layer;
|
|
251
299
|
static ID = 'ab484e0e-e185-45cd-8434-12101f3c7eb1';
|
|
252
300
|
constructor(layer) {
|
|
@@ -258,7 +306,7 @@ class RemoveLayerCommand extends GenericMessage {
|
|
|
258
306
|
}
|
|
259
307
|
}
|
|
260
308
|
|
|
261
|
-
class AddTileCommand extends
|
|
309
|
+
class AddTileCommand extends PostboyGenericMessage {
|
|
262
310
|
layer;
|
|
263
311
|
static ID = '25b7df28-72ce-4453-9fe6-54285a2fdc57';
|
|
264
312
|
constructor(layer) {
|
|
@@ -270,7 +318,7 @@ class AddTileCommand extends GenericMessage {
|
|
|
270
318
|
}
|
|
271
319
|
}
|
|
272
320
|
|
|
273
|
-
class RemoveTileCommand extends
|
|
321
|
+
class RemoveTileCommand extends PostboyGenericMessage {
|
|
274
322
|
layer;
|
|
275
323
|
static ID = 'c36ccc0b-5638-4819-b148-2de57a59a5b7';
|
|
276
324
|
constructor(layer) {
|
|
@@ -282,14 +330,53 @@ class RemoveTileCommand extends GenericMessage {
|
|
|
282
330
|
}
|
|
283
331
|
}
|
|
284
332
|
|
|
333
|
+
class FitToFeaturesCommand extends PostboyGenericMessage {
|
|
334
|
+
features;
|
|
335
|
+
zoomAfter;
|
|
336
|
+
static ID = '76cdc091-3793-4b6c-82f7-1e0334cf08a8';
|
|
337
|
+
constructor(features, zoomAfter = 0) {
|
|
338
|
+
super();
|
|
339
|
+
this.features = features;
|
|
340
|
+
this.zoomAfter = zoomAfter;
|
|
341
|
+
}
|
|
342
|
+
get id() {
|
|
343
|
+
return FitToFeaturesCommand.ID;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
class GetLayerQuery extends PostboyCallbackMessage {
|
|
348
|
+
name;
|
|
349
|
+
static ID = '5c04c87b-8a93-4c2a-979e-d1e313d860ed';
|
|
350
|
+
constructor(name) {
|
|
351
|
+
super();
|
|
352
|
+
this.name = name;
|
|
353
|
+
}
|
|
354
|
+
get id() {
|
|
355
|
+
return GetLayerQuery.ID;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
class DrawingFinishedEvent extends PostboyGenericMessage {
|
|
360
|
+
static ID = 'c724b68e-b4eb-4783-90f1-a8e31973fd36';
|
|
361
|
+
constructor() {
|
|
362
|
+
super();
|
|
363
|
+
}
|
|
364
|
+
get id() {
|
|
365
|
+
return DrawingFinishedEvent.ID;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
285
369
|
class MapPostboyService extends PostboyService {
|
|
286
|
-
|
|
287
|
-
|
|
370
|
+
constructor() {
|
|
371
|
+
super();
|
|
372
|
+
this.addLocker({ locker: StartDrawingCommand.ID, unlocker: DrawingFinishedEvent.ID, locking: [MapClickEvent.ID] });
|
|
373
|
+
}
|
|
374
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPostboyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
288
375
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPostboyService });
|
|
289
376
|
}
|
|
290
377
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPostboyService, decorators: [{
|
|
291
378
|
type: Injectable
|
|
292
|
-
}] });
|
|
379
|
+
}], ctorParameters: function () { return []; } });
|
|
293
380
|
|
|
294
381
|
class MapManagementService {
|
|
295
382
|
postboy;
|
|
@@ -305,6 +392,7 @@ class MapManagementService {
|
|
|
305
392
|
this.observePlaceFeatures();
|
|
306
393
|
this.observeAddTile();
|
|
307
394
|
this.observeRemoveTile();
|
|
395
|
+
this.observeLayerQuery();
|
|
308
396
|
}
|
|
309
397
|
observeRemoveTile() {
|
|
310
398
|
this.postboy.subscribe(RemoveTileCommand.ID).subscribe((c) => {
|
|
@@ -313,6 +401,9 @@ class MapManagementService {
|
|
|
313
401
|
this.map.removeLayer(c.layer);
|
|
314
402
|
});
|
|
315
403
|
}
|
|
404
|
+
observeLayerQuery() {
|
|
405
|
+
this.postboy.subscribe(GetLayerQuery.ID).subscribe((ev) => ev.finish(this.layers[ev.name] ?? null));
|
|
406
|
+
}
|
|
316
407
|
observeAddTile() {
|
|
317
408
|
this.postboy.subscribe(AddTileCommand.ID).subscribe((c) => {
|
|
318
409
|
if (!this.map)
|
|
@@ -337,8 +428,11 @@ class MapManagementService {
|
|
|
337
428
|
this.postboy.subscribe(PlaceLayerFeaturesCommand.ID).subscribe((c) => {
|
|
338
429
|
if (!this.layers[c.layer])
|
|
339
430
|
return;
|
|
340
|
-
this.layers[c.layer]?.getSource()
|
|
341
|
-
|
|
431
|
+
let source = this.layers[c.layer]?.getSource();
|
|
432
|
+
if (!!source['getSource'])
|
|
433
|
+
source = source?.getSource();
|
|
434
|
+
source?.clear();
|
|
435
|
+
source?.addFeatures(c.features);
|
|
342
436
|
});
|
|
343
437
|
}
|
|
344
438
|
observeRemoveLayer() {
|
|
@@ -363,7 +457,14 @@ class MapStateService {
|
|
|
363
457
|
this.postboy = postboy;
|
|
364
458
|
}
|
|
365
459
|
up() {
|
|
366
|
-
this.postboy.subscribe(MapRenderedEvent.ID).subscribe((
|
|
460
|
+
this.postboy.subscribe(MapRenderedEvent.ID).subscribe((ev) => {
|
|
461
|
+
this.map = ev.map;
|
|
462
|
+
this.map?.on('moveend', () => {
|
|
463
|
+
const zoom = Math.floor(this.map?.getView().getZoom() || -1);
|
|
464
|
+
const extent = this.map?.getView().calculateExtent() || [];
|
|
465
|
+
this.postboy.fire(new MapMoveEndEvent(zoom, extent));
|
|
466
|
+
});
|
|
467
|
+
});
|
|
367
468
|
}
|
|
368
469
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapStateService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
369
470
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapStateService });
|
|
@@ -372,6 +473,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
372
473
|
type: Injectable
|
|
373
474
|
}], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
|
|
374
475
|
|
|
476
|
+
class MapFeatureService {
|
|
477
|
+
postboy;
|
|
478
|
+
map;
|
|
479
|
+
constructor(postboy) {
|
|
480
|
+
this.postboy = postboy;
|
|
481
|
+
}
|
|
482
|
+
up() {
|
|
483
|
+
this.observeMapRender();
|
|
484
|
+
this.observeFitToFeatures();
|
|
485
|
+
}
|
|
486
|
+
observeMapRender() {
|
|
487
|
+
this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
|
|
488
|
+
this.map = m.map;
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
observeFitToFeatures() {
|
|
492
|
+
this.postboy.subscribe(FitToFeaturesCommand.ID).subscribe((m) => {
|
|
493
|
+
this.fitToGeometries(m.features.map((f) => f.getGeometry()), m.zoomAfter);
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
fitToGeometries(geometries, zoomAfter) {
|
|
497
|
+
if (!geometries?.length || !this.map)
|
|
498
|
+
return;
|
|
499
|
+
const extent = createEmpty();
|
|
500
|
+
geometries.forEach((g) => extend(extent, g.getExtent()));
|
|
501
|
+
this.map.getView().fit(extent);
|
|
502
|
+
this.map.getView().setZoom(this.map.getView().getZoom() + zoomAfter);
|
|
503
|
+
}
|
|
504
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapFeatureService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
505
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapFeatureService });
|
|
506
|
+
}
|
|
507
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapFeatureService, decorators: [{
|
|
508
|
+
type: Injectable
|
|
509
|
+
}], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
|
|
510
|
+
|
|
375
511
|
class MapClickService {
|
|
376
512
|
postboy;
|
|
377
513
|
map;
|
|
@@ -390,7 +526,7 @@ class MapClickService {
|
|
|
390
526
|
});
|
|
391
527
|
}
|
|
392
528
|
onClick(ev) {
|
|
393
|
-
const model = new MapClickEvent(ev.coordinate, {});
|
|
529
|
+
const model = new MapClickEvent(ev.coordinate, {}, {});
|
|
394
530
|
this.map?.forEachFeatureAtPixel(ev.pixel, (f, l) => {
|
|
395
531
|
this.getFeatureCollectionWithInner([f])
|
|
396
532
|
.filter((f) => f.getId() != null)
|
|
@@ -398,7 +534,10 @@ class MapClickService {
|
|
|
398
534
|
let layerName = l.get('name');
|
|
399
535
|
if (!model.entities[layerName])
|
|
400
536
|
model.entities[layerName] = [];
|
|
401
|
-
model.
|
|
537
|
+
if (!model.features[layerName])
|
|
538
|
+
model.features[layerName] = [];
|
|
539
|
+
model.entities[layerName].push({ id: fs.getId(), ...fs.get(MapConstants.FeatureInfo) });
|
|
540
|
+
model.features[layerName].push(fs);
|
|
402
541
|
});
|
|
403
542
|
});
|
|
404
543
|
return model;
|
|
@@ -418,10 +557,78 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
418
557
|
type: Injectable
|
|
419
558
|
}], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
|
|
420
559
|
|
|
560
|
+
class DrawingService {
|
|
561
|
+
postboy;
|
|
562
|
+
drawInteraction;
|
|
563
|
+
map;
|
|
564
|
+
constructor(postboy) {
|
|
565
|
+
this.postboy = postboy;
|
|
566
|
+
}
|
|
567
|
+
up() {
|
|
568
|
+
this.postboy.subscribe(StartDrawingCommand.ID).subscribe((ev) => {
|
|
569
|
+
this.draw((l) => {
|
|
570
|
+
if (!l || !this.map) {
|
|
571
|
+
this.clearInteraction(l);
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
const cancelSub = this.observeCancelation(ev, l);
|
|
575
|
+
this.drawInteraction = new Draw({
|
|
576
|
+
source: l.getSource(),
|
|
577
|
+
type: DrawingType[ev.type],
|
|
578
|
+
style: ev.style,
|
|
579
|
+
});
|
|
580
|
+
this.map.addInteraction(this.drawInteraction);
|
|
581
|
+
this.drawInteraction.on('drawend', (evt) => {
|
|
582
|
+
cancelSub.unsubscribe();
|
|
583
|
+
this.onEnd(evt, ev, l);
|
|
584
|
+
});
|
|
585
|
+
});
|
|
586
|
+
});
|
|
587
|
+
this.observeMapRender();
|
|
588
|
+
}
|
|
589
|
+
onEnd(evt, command, layer) {
|
|
590
|
+
command.finish(command.format === FeatureOutputFormat.GeoJson
|
|
591
|
+
? new GeoJSON().writeFeature(evt.feature)
|
|
592
|
+
: new WKT().writeFeature(evt.feature));
|
|
593
|
+
this.clearInteraction(layer);
|
|
594
|
+
}
|
|
595
|
+
observeMapRender() {
|
|
596
|
+
this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
|
|
597
|
+
this.map = m.map;
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
draw(action) {
|
|
601
|
+
const query = new GetLayerQuery(MapConstants.DrawingLayerId);
|
|
602
|
+
query.result.subscribe((l) => action(l));
|
|
603
|
+
this.postboy.fire(query);
|
|
604
|
+
}
|
|
605
|
+
observeCancelation(ev, layer) {
|
|
606
|
+
return this.postboy
|
|
607
|
+
.subscribe(CancelDrawingCommand.ID)
|
|
608
|
+
.pipe(first())
|
|
609
|
+
.subscribe(() => {
|
|
610
|
+
ev.finish(null);
|
|
611
|
+
this.clearInteraction(layer);
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
clearInteraction(layer) {
|
|
615
|
+
if (!!this.drawInteraction) {
|
|
616
|
+
this.map?.removeInteraction(this.drawInteraction);
|
|
617
|
+
layer?.setSource(new Vector({}));
|
|
618
|
+
}
|
|
619
|
+
setTimeout(() => this.postboy.fire(new DrawingFinishedEvent()), 300);
|
|
620
|
+
}
|
|
621
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DrawingService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
622
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DrawingService });
|
|
623
|
+
}
|
|
624
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DrawingService, decorators: [{
|
|
625
|
+
type: Injectable
|
|
626
|
+
}], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
|
|
627
|
+
|
|
421
628
|
class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
422
|
-
constructor(service, management, state, interaction) {
|
|
629
|
+
constructor(service, management, state, feature, interaction, drawing) {
|
|
423
630
|
super(service);
|
|
424
|
-
this.registerServices([management, state, interaction]);
|
|
631
|
+
this.registerServices([management, state, interaction, feature, drawing]);
|
|
425
632
|
}
|
|
426
633
|
_up() {
|
|
427
634
|
this.registerReplay(MapRenderedEvent.ID);
|
|
@@ -432,143 +639,19 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
|
432
639
|
this.registerSubject(RemoveTileCommand.ID);
|
|
433
640
|
this.registerSubject(MapClickEvent.ID);
|
|
434
641
|
this.registerSubject(CloseTooltipCommand.ID);
|
|
435
|
-
|
|
436
|
-
|
|
642
|
+
this.registerSubject(FitToFeaturesCommand.ID);
|
|
643
|
+
this.registerSubject(MapMoveEndEvent.ID);
|
|
644
|
+
this.registerSubject(CancelDrawingCommand.ID);
|
|
645
|
+
this.registerSubject(StartDrawingCommand.ID);
|
|
646
|
+
this.registerSubject(GetLayerQuery.ID);
|
|
647
|
+
this.registerSubject(DrawingFinishedEvent.ID);
|
|
648
|
+
}
|
|
649
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MessageRegistratorService, deps: [{ token: MapPostboyService }, { token: MapManagementService }, { token: MapStateService }, { token: MapFeatureService }, { token: MapClickService }, { token: DrawingService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
437
650
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MessageRegistratorService });
|
|
438
651
|
}
|
|
439
652
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MessageRegistratorService, decorators: [{
|
|
440
653
|
type: Injectable
|
|
441
|
-
}], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapClickService }]; } });
|
|
442
|
-
|
|
443
|
-
class MapPlateFactory {
|
|
444
|
-
build(settings) {
|
|
445
|
-
return new Map({
|
|
446
|
-
controls: [],
|
|
447
|
-
view: new View({
|
|
448
|
-
center: settings?.center || [0, 0],
|
|
449
|
-
zoom: settings?.zoom || 4,
|
|
450
|
-
minZoom: settings?.minZoom || 0,
|
|
451
|
-
maxZoom: settings?.maxZoom || 19,
|
|
452
|
-
}),
|
|
453
|
-
layers: [],
|
|
454
|
-
});
|
|
455
|
-
}
|
|
456
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPlateFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
457
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPlateFactory, providedIn: 'root' });
|
|
458
|
-
}
|
|
459
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPlateFactory, decorators: [{
|
|
460
|
-
type: Injectable,
|
|
461
|
-
args: [{
|
|
462
|
-
providedIn: 'root',
|
|
463
|
-
}]
|
|
464
|
-
}] });
|
|
465
|
-
|
|
466
|
-
class OsmTileLayerComponent extends DestructibleComponent {
|
|
467
|
-
layer;
|
|
468
|
-
constructor() {
|
|
469
|
-
super();
|
|
470
|
-
}
|
|
471
|
-
_url = '';
|
|
472
|
-
set url(value) {
|
|
473
|
-
if (!value || this._url === value)
|
|
474
|
-
return;
|
|
475
|
-
this._url = value;
|
|
476
|
-
this.initLayer();
|
|
477
|
-
}
|
|
478
|
-
_map;
|
|
479
|
-
set map(value) {
|
|
480
|
-
if (!value || this._map === value)
|
|
481
|
-
return;
|
|
482
|
-
this._map = value;
|
|
483
|
-
this.initLayer();
|
|
484
|
-
}
|
|
485
|
-
ngOnInit() { }
|
|
486
|
-
ngOnDestroy() {
|
|
487
|
-
if (this.layer) {
|
|
488
|
-
this._map?.removeLayer(this.layer);
|
|
489
|
-
}
|
|
490
|
-
// @ts-ignore
|
|
491
|
-
this.layer?.setMap(null);
|
|
492
|
-
}
|
|
493
|
-
initLayer() {
|
|
494
|
-
if (!this._url || !this._map)
|
|
495
|
-
return;
|
|
496
|
-
if (this.layer)
|
|
497
|
-
this._map.removeLayer(this.layer);
|
|
498
|
-
this.layer = new TileLayer({
|
|
499
|
-
source: new OSM({
|
|
500
|
-
url: this._url,
|
|
501
|
-
}),
|
|
502
|
-
});
|
|
503
|
-
this.layer.set('name', 'osm-tile-layer');
|
|
504
|
-
this._map.addLayer(this.layer);
|
|
505
|
-
}
|
|
506
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: OsmTileLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
507
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: OsmTileLayerComponent, selector: "lib-osm-tile-layer", inputs: { url: "url", map: "map" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
508
|
-
}
|
|
509
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: OsmTileLayerComponent, decorators: [{
|
|
510
|
-
type: Component,
|
|
511
|
-
args: [{ selector: 'lib-osm-tile-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
512
|
-
}], ctorParameters: function () { return []; }, propDecorators: { url: [{
|
|
513
|
-
type: Input
|
|
514
|
-
}], map: [{
|
|
515
|
-
type: Input
|
|
516
|
-
}] } });
|
|
517
|
-
|
|
518
|
-
class MapPlateComponent extends DestructibleComponent {
|
|
519
|
-
elementRef;
|
|
520
|
-
postboy;
|
|
521
|
-
mapFactory;
|
|
522
|
-
registrator;
|
|
523
|
-
detector;
|
|
524
|
-
map;
|
|
525
|
-
osmUrl = '';
|
|
526
|
-
constructor(elementRef, postboy, mapFactory, registrator, detector) {
|
|
527
|
-
super();
|
|
528
|
-
this.elementRef = elementRef;
|
|
529
|
-
this.postboy = postboy;
|
|
530
|
-
this.mapFactory = mapFactory;
|
|
531
|
-
this.registrator = registrator;
|
|
532
|
-
this.detector = detector;
|
|
533
|
-
registrator.up();
|
|
534
|
-
}
|
|
535
|
-
_settings = new MapSettings();
|
|
536
|
-
set settings(value) {
|
|
537
|
-
if (!value || this._settings.isSame(value))
|
|
538
|
-
return;
|
|
539
|
-
this._settings = value;
|
|
540
|
-
this.setOsm();
|
|
541
|
-
}
|
|
542
|
-
ngOnInit() {
|
|
543
|
-
useGeographic();
|
|
544
|
-
this.map = this.mapFactory.build(this._settings);
|
|
545
|
-
this.map.setTarget(this.elementRef.nativeElement);
|
|
546
|
-
this.detector.detectChanges();
|
|
547
|
-
this.map.once('postrender', () => {
|
|
548
|
-
this.map.updateSize();
|
|
549
|
-
this.postboy.fire(new MapRenderedEvent(this.map));
|
|
550
|
-
});
|
|
551
|
-
this.setOsm();
|
|
552
|
-
}
|
|
553
|
-
setOsm() {
|
|
554
|
-
if (!this.map)
|
|
555
|
-
return;
|
|
556
|
-
this.osmUrl = `https://mt{0-3}.google.com/vt/lyrs=${MapLyrsLabel.get(this._settings.lyrs)}&hl=${this._settings.language}&x={x}&y={y}&z={z}`;
|
|
557
|
-
this.detector.detectChanges();
|
|
558
|
-
this.map.updateSize();
|
|
559
|
-
}
|
|
560
|
-
onDestroy = () => {
|
|
561
|
-
this.registrator.down();
|
|
562
|
-
};
|
|
563
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPlateComponent, deps: [{ token: i0.ElementRef }, { token: MapPostboyService }, { token: MapPlateFactory }, { token: MessageRegistratorService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
564
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MapPlateComponent, selector: "lib-map-plate", inputs: { settings: "settings" }, providers: [MessageRegistratorService, MapStateService, MapManagementService, MapClickService], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\n<lib-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\"></lib-osm-tile-layer>\n", styles: ["lib-map-plate{position:relative;display:flex;flex-direction:column;height:100%}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: OsmTileLayerComponent, selector: "lib-osm-tile-layer", inputs: ["url", "map"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
565
|
-
}
|
|
566
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPlateComponent, decorators: [{
|
|
567
|
-
type: Component,
|
|
568
|
-
args: [{ selector: 'lib-map-plate', changeDetection: ChangeDetectionStrategy.OnPush, providers: [MessageRegistratorService, MapStateService, MapManagementService, MapClickService], template: "<ng-content></ng-content>\n<lib-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\"></lib-osm-tile-layer>\n", styles: ["lib-map-plate{position:relative;display:flex;flex-direction:column;height:100%}\n"] }]
|
|
569
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { settings: [{
|
|
570
|
-
type: Input
|
|
571
|
-
}] } });
|
|
654
|
+
}], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }]; } });
|
|
572
655
|
|
|
573
656
|
class TileLayerSettings {
|
|
574
657
|
maxZoom = 19;
|
|
@@ -702,6 +785,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
702
785
|
type: Input
|
|
703
786
|
}] } });
|
|
704
787
|
|
|
788
|
+
class OsmTileLayerComponent extends DestructibleComponent {
|
|
789
|
+
layer;
|
|
790
|
+
constructor() {
|
|
791
|
+
super();
|
|
792
|
+
}
|
|
793
|
+
_url = '';
|
|
794
|
+
set url(value) {
|
|
795
|
+
if (!value || this._url === value)
|
|
796
|
+
return;
|
|
797
|
+
this._url = value;
|
|
798
|
+
this.initLayer();
|
|
799
|
+
}
|
|
800
|
+
_map;
|
|
801
|
+
set map(value) {
|
|
802
|
+
if (!value || this._map === value)
|
|
803
|
+
return;
|
|
804
|
+
this._map = value;
|
|
805
|
+
this.initLayer();
|
|
806
|
+
}
|
|
807
|
+
ngOnInit() { }
|
|
808
|
+
ngOnDestroy() {
|
|
809
|
+
if (this.layer) {
|
|
810
|
+
this._map?.removeLayer(this.layer);
|
|
811
|
+
}
|
|
812
|
+
// @ts-ignore
|
|
813
|
+
this.layer?.setMap(null);
|
|
814
|
+
}
|
|
815
|
+
initLayer() {
|
|
816
|
+
if (!this._url || !this._map)
|
|
817
|
+
return;
|
|
818
|
+
if (this.layer)
|
|
819
|
+
this._map.removeLayer(this.layer);
|
|
820
|
+
this.layer = new TileLayer({
|
|
821
|
+
source: new OSM({
|
|
822
|
+
url: this._url,
|
|
823
|
+
}),
|
|
824
|
+
});
|
|
825
|
+
this.layer.set('name', 'osm-tile-layer');
|
|
826
|
+
this._map.addLayer(this.layer);
|
|
827
|
+
}
|
|
828
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: OsmTileLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
829
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: OsmTileLayerComponent, selector: "lib-osm-tile-layer", inputs: { url: "url", map: "map" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
830
|
+
}
|
|
831
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: OsmTileLayerComponent, decorators: [{
|
|
832
|
+
type: Component,
|
|
833
|
+
args: [{ selector: 'lib-osm-tile-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
834
|
+
}], ctorParameters: function () { return []; }, propDecorators: { url: [{
|
|
835
|
+
type: Input
|
|
836
|
+
}], map: [{
|
|
837
|
+
type: Input
|
|
838
|
+
}] } });
|
|
839
|
+
|
|
705
840
|
class FeatureLayerSettings {
|
|
706
841
|
name = IdGenerator.get();
|
|
707
842
|
zIndex = 1;
|
|
@@ -813,6 +948,290 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
813
948
|
type: Input
|
|
814
949
|
}] } });
|
|
815
950
|
|
|
951
|
+
class ClusterLayerSettings {
|
|
952
|
+
name = IdGenerator.get();
|
|
953
|
+
zIndex = 1;
|
|
954
|
+
maxZoom = 19;
|
|
955
|
+
minZoom = 0;
|
|
956
|
+
distance = 20;
|
|
957
|
+
bbox = false;
|
|
958
|
+
clusterCancel = 14;
|
|
959
|
+
style;
|
|
960
|
+
static copy(model) {
|
|
961
|
+
const result = new ClusterLayerSettings();
|
|
962
|
+
result.name = model.name;
|
|
963
|
+
result.maxZoom = model.maxZoom;
|
|
964
|
+
result.minZoom = model.minZoom;
|
|
965
|
+
result.zIndex = model.zIndex;
|
|
966
|
+
result.bbox = model.bbox;
|
|
967
|
+
result.clusterCancel = model.clusterCancel;
|
|
968
|
+
result.distance = model.distance;
|
|
969
|
+
result.style = model.style;
|
|
970
|
+
return result;
|
|
971
|
+
}
|
|
972
|
+
setZIndex(zIndex) {
|
|
973
|
+
return ClusterLayerSettings.copy({ ...this, zIndex });
|
|
974
|
+
}
|
|
975
|
+
setDistance(distance) {
|
|
976
|
+
return ClusterLayerSettings.copy({ ...this, distance });
|
|
977
|
+
}
|
|
978
|
+
setName(name) {
|
|
979
|
+
return ClusterLayerSettings.copy({ ...this, name });
|
|
980
|
+
}
|
|
981
|
+
setMaxZoom(maxZoom) {
|
|
982
|
+
return ClusterLayerSettings.copy({ ...this, maxZoom });
|
|
983
|
+
}
|
|
984
|
+
setMinZoom(minZoom) {
|
|
985
|
+
return ClusterLayerSettings.copy({ ...this, minZoom });
|
|
986
|
+
}
|
|
987
|
+
setClusterCancel(clusterCancel) {
|
|
988
|
+
return ClusterLayerSettings.copy({ ...this, clusterCancel });
|
|
989
|
+
}
|
|
990
|
+
setBbox(bbox) {
|
|
991
|
+
return ClusterLayerSettings.copy({ ...this, bbox });
|
|
992
|
+
}
|
|
993
|
+
setStyle(style) {
|
|
994
|
+
return ClusterLayerSettings.copy({ ...this, style });
|
|
995
|
+
}
|
|
996
|
+
isSame(model) {
|
|
997
|
+
if (this.maxZoom !== model.maxZoom)
|
|
998
|
+
return false;
|
|
999
|
+
if (this.minZoom !== model.minZoom)
|
|
1000
|
+
return false;
|
|
1001
|
+
if (this.zIndex !== model.zIndex)
|
|
1002
|
+
return false;
|
|
1003
|
+
if (this.name !== model.name)
|
|
1004
|
+
return false;
|
|
1005
|
+
if (this.distance !== model.distance)
|
|
1006
|
+
return false;
|
|
1007
|
+
if (this.clusterCancel !== model.clusterCancel)
|
|
1008
|
+
return false;
|
|
1009
|
+
if (this.bbox !== model.bbox)
|
|
1010
|
+
return false;
|
|
1011
|
+
if (this.style !== model.style)
|
|
1012
|
+
return false;
|
|
1013
|
+
return true;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
class ClusterLayerManager {
|
|
1018
|
+
settings;
|
|
1019
|
+
layer;
|
|
1020
|
+
postboy;
|
|
1021
|
+
constructor(settings, layer, postboy) {
|
|
1022
|
+
this.settings = settings;
|
|
1023
|
+
this.layer = layer;
|
|
1024
|
+
this.postboy = postboy;
|
|
1025
|
+
this.observeClick();
|
|
1026
|
+
this.observeMapMovement();
|
|
1027
|
+
}
|
|
1028
|
+
observeMapMovement() {
|
|
1029
|
+
combineLatest([
|
|
1030
|
+
this.postboy.subscribe(MapMoveEndEvent.ID).pipe(auditTime(250)),
|
|
1031
|
+
this.postboy.subscribe(MapRenderedEvent.ID),
|
|
1032
|
+
]).subscribe(([movement, renderEvent]) => {
|
|
1033
|
+
this.checkClusterNecessity(renderEvent.map);
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
observeClick() {
|
|
1037
|
+
this.postboy.subscribe(MapClickEvent.ID).subscribe((m) => {
|
|
1038
|
+
if ((m.features[this.settings.name]?.length ?? 0) > 1) {
|
|
1039
|
+
this.postboy.fire(new FitToFeaturesCommand(m.features[this.settings.name], -1));
|
|
1040
|
+
}
|
|
1041
|
+
});
|
|
1042
|
+
}
|
|
1043
|
+
checkClusterNecessity(map) {
|
|
1044
|
+
let zoom = map.getView().getZoom() ?? 0;
|
|
1045
|
+
const distance = zoom > this.settings.clusterCancel ? 0 : this.settings.distance;
|
|
1046
|
+
this.layer?.getSource()?.setDistance(distance);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
class ClusterLayerFactory {
|
|
1051
|
+
build(settings, postboy) {
|
|
1052
|
+
const source = new Vector({
|
|
1053
|
+
strategy: settings.bbox ? bbox : undefined,
|
|
1054
|
+
});
|
|
1055
|
+
const cluster = new Cluster({
|
|
1056
|
+
distance: settings.distance,
|
|
1057
|
+
source: source,
|
|
1058
|
+
geometryFunction: (feature) => {
|
|
1059
|
+
const geom = feature.getGeometry();
|
|
1060
|
+
if (geom?.getType() == 'Point') {
|
|
1061
|
+
return geom;
|
|
1062
|
+
}
|
|
1063
|
+
else if (geom?.getType() == 'Polygon') {
|
|
1064
|
+
return geom?.getInteriorPoint();
|
|
1065
|
+
}
|
|
1066
|
+
else if (geom?.getType() == 'MultiPolygon') {
|
|
1067
|
+
return fromExtent(geom.getExtent())?.getInteriorPoint();
|
|
1068
|
+
}
|
|
1069
|
+
return undefined;
|
|
1070
|
+
},
|
|
1071
|
+
});
|
|
1072
|
+
const layer = new Vector$1({
|
|
1073
|
+
source: cluster,
|
|
1074
|
+
maxZoom: settings.maxZoom || undefined,
|
|
1075
|
+
minZoom: settings.minZoom || undefined,
|
|
1076
|
+
zIndex: settings.zIndex || 0,
|
|
1077
|
+
});
|
|
1078
|
+
layer.setStyle(this.styleFunc(settings));
|
|
1079
|
+
layer.set('name', settings.name);
|
|
1080
|
+
return new ClusterLayerManager(settings, layer, postboy);
|
|
1081
|
+
}
|
|
1082
|
+
styleFunc(settings) {
|
|
1083
|
+
return (feature) => {
|
|
1084
|
+
const features = feature.get('features');
|
|
1085
|
+
if (!settings.style)
|
|
1086
|
+
return undefined;
|
|
1087
|
+
return settings.style(features.map((f) => ({ id: f.getId(), ...f.get(MapConstants.FeatureInfo) })));
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
1090
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ClusterLayerFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1091
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ClusterLayerFactory, providedIn: 'root' });
|
|
1092
|
+
}
|
|
1093
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ClusterLayerFactory, decorators: [{
|
|
1094
|
+
type: Injectable,
|
|
1095
|
+
args: [{
|
|
1096
|
+
providedIn: 'root',
|
|
1097
|
+
}]
|
|
1098
|
+
}] });
|
|
1099
|
+
|
|
1100
|
+
class ClusterLayerComponent extends DestructibleComponent {
|
|
1101
|
+
postboy;
|
|
1102
|
+
factory;
|
|
1103
|
+
manager = null;
|
|
1104
|
+
_settings = new ClusterLayerSettings();
|
|
1105
|
+
constructor(postboy, factory) {
|
|
1106
|
+
super();
|
|
1107
|
+
this.postboy = postboy;
|
|
1108
|
+
this.factory = factory;
|
|
1109
|
+
}
|
|
1110
|
+
ngOnInit() {
|
|
1111
|
+
this.postboy
|
|
1112
|
+
.subscribe(MapRenderedEvent.ID)
|
|
1113
|
+
.pipe(filter((m) => !!m), first())
|
|
1114
|
+
.subscribe((m) => this.initLayer());
|
|
1115
|
+
}
|
|
1116
|
+
set settings(value) {
|
|
1117
|
+
if (!value || this._settings.isSame(value))
|
|
1118
|
+
return;
|
|
1119
|
+
this._settings = value;
|
|
1120
|
+
this.initLayer();
|
|
1121
|
+
}
|
|
1122
|
+
onDestroy = () => this.removeLayer();
|
|
1123
|
+
initLayer() {
|
|
1124
|
+
this.removeLayer();
|
|
1125
|
+
this.manager = this.factory.build(this._settings, this.postboy);
|
|
1126
|
+
this.postboy.fire(new AddLayerCommand(this.manager.layer));
|
|
1127
|
+
}
|
|
1128
|
+
removeLayer() {
|
|
1129
|
+
if (this.manager?.layer)
|
|
1130
|
+
this.postboy.fire(new RemoveLayerCommand(this.manager.layer));
|
|
1131
|
+
}
|
|
1132
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ClusterLayerComponent, deps: [{ token: MapPostboyService }, { token: ClusterLayerFactory }], target: i0.ɵɵFactoryTarget.Component });
|
|
1133
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ClusterLayerComponent, selector: "lib-cluster-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1134
|
+
}
|
|
1135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ClusterLayerComponent, decorators: [{
|
|
1136
|
+
type: Component,
|
|
1137
|
+
args: [{ selector: 'lib-cluster-layer', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
1138
|
+
}], ctorParameters: function () { return [{ type: MapPostboyService }, { type: ClusterLayerFactory }]; }, propDecorators: { settings: [{
|
|
1139
|
+
type: Input
|
|
1140
|
+
}] } });
|
|
1141
|
+
|
|
1142
|
+
class MapPlateFactory {
|
|
1143
|
+
build(settings) {
|
|
1144
|
+
return new Map({
|
|
1145
|
+
controls: [],
|
|
1146
|
+
view: new View({
|
|
1147
|
+
center: settings?.center || [0, 0],
|
|
1148
|
+
zoom: settings?.zoom || 4,
|
|
1149
|
+
minZoom: settings?.minZoom || 0,
|
|
1150
|
+
maxZoom: settings?.maxZoom || 19,
|
|
1151
|
+
}),
|
|
1152
|
+
layers: [],
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
1155
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPlateFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1156
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPlateFactory, providedIn: 'root' });
|
|
1157
|
+
}
|
|
1158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPlateFactory, decorators: [{
|
|
1159
|
+
type: Injectable,
|
|
1160
|
+
args: [{
|
|
1161
|
+
providedIn: 'root',
|
|
1162
|
+
}]
|
|
1163
|
+
}] });
|
|
1164
|
+
|
|
1165
|
+
class MapPlateComponent extends DestructibleComponent {
|
|
1166
|
+
elementRef;
|
|
1167
|
+
postboy;
|
|
1168
|
+
mapFactory;
|
|
1169
|
+
registrator;
|
|
1170
|
+
detector;
|
|
1171
|
+
map;
|
|
1172
|
+
osmUrl = '';
|
|
1173
|
+
constructor(elementRef, postboy, mapFactory, registrator, detector) {
|
|
1174
|
+
super();
|
|
1175
|
+
this.elementRef = elementRef;
|
|
1176
|
+
this.postboy = postboy;
|
|
1177
|
+
this.mapFactory = mapFactory;
|
|
1178
|
+
this.registrator = registrator;
|
|
1179
|
+
this.detector = detector;
|
|
1180
|
+
registrator.up();
|
|
1181
|
+
}
|
|
1182
|
+
_settings = new MapSettings();
|
|
1183
|
+
drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
|
|
1184
|
+
set settings(value) {
|
|
1185
|
+
if (!value || this._settings.isSame(value))
|
|
1186
|
+
return;
|
|
1187
|
+
this._settings = value;
|
|
1188
|
+
this.setOsm();
|
|
1189
|
+
}
|
|
1190
|
+
ngOnInit() {
|
|
1191
|
+
useGeographic();
|
|
1192
|
+
this.map = this.mapFactory.build(this._settings);
|
|
1193
|
+
this.map.setTarget(this.elementRef.nativeElement);
|
|
1194
|
+
this.detector.detectChanges();
|
|
1195
|
+
this.map.once('postrender', () => {
|
|
1196
|
+
this.map.updateSize();
|
|
1197
|
+
this.postboy.fire(new MapRenderedEvent(this.map));
|
|
1198
|
+
});
|
|
1199
|
+
this.setOsm();
|
|
1200
|
+
}
|
|
1201
|
+
setOsm() {
|
|
1202
|
+
if (!this.map)
|
|
1203
|
+
return;
|
|
1204
|
+
this.osmUrl = `https://mt{0-3}.google.com/vt/lyrs=${MapLyrsLabel.get(this._settings.lyrs)}&hl=${this._settings.language}&x={x}&y={y}&z={z}`;
|
|
1205
|
+
this.detector.detectChanges();
|
|
1206
|
+
this.map.updateSize();
|
|
1207
|
+
}
|
|
1208
|
+
onDestroy = () => {
|
|
1209
|
+
this.registrator.down();
|
|
1210
|
+
};
|
|
1211
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPlateComponent, deps: [{ token: i0.ElementRef }, { token: MapPostboyService }, { token: MapPlateFactory }, { token: MessageRegistratorService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1212
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MapPlateComponent, selector: "lib-map-plate", inputs: { settings: "settings" }, providers: [
|
|
1213
|
+
MessageRegistratorService,
|
|
1214
|
+
MapStateService,
|
|
1215
|
+
MapManagementService,
|
|
1216
|
+
MapClickService,
|
|
1217
|
+
MapFeatureService,
|
|
1218
|
+
DrawingService,
|
|
1219
|
+
], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\r\n<lib-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\"></lib-osm-tile-layer>\r\n<lib-feature-layer *ngIf=\"map\" [settings]=\"drawingLayerSettings\"></lib-feature-layer>\r\n", styles: ["lib-map-plate{position:relative;display:flex;flex-direction:column;height:100%}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: OsmTileLayerComponent, selector: "lib-osm-tile-layer", inputs: ["url", "map"] }, { kind: "component", type: FeatureLayerComponent, selector: "lib-feature-layer", inputs: ["settings"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1220
|
+
}
|
|
1221
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPlateComponent, decorators: [{
|
|
1222
|
+
type: Component,
|
|
1223
|
+
args: [{ selector: 'lib-map-plate', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1224
|
+
MessageRegistratorService,
|
|
1225
|
+
MapStateService,
|
|
1226
|
+
MapManagementService,
|
|
1227
|
+
MapClickService,
|
|
1228
|
+
MapFeatureService,
|
|
1229
|
+
DrawingService,
|
|
1230
|
+
], template: "<ng-content></ng-content>\r\n<lib-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\"></lib-osm-tile-layer>\r\n<lib-feature-layer *ngIf=\"map\" [settings]=\"drawingLayerSettings\"></lib-feature-layer>\r\n", styles: ["lib-map-plate{position:relative;display:flex;flex-direction:column;height:100%}\n"] }]
|
|
1231
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { settings: [{
|
|
1232
|
+
type: Input
|
|
1233
|
+
}] } });
|
|
1234
|
+
|
|
816
1235
|
class MarkersComponent extends DestructibleComponent {
|
|
817
1236
|
postboy;
|
|
818
1237
|
layerName = '';
|
|
@@ -969,7 +1388,7 @@ class PolygonsComponent extends DestructibleComponent {
|
|
|
969
1388
|
.subscribe(() => this.putPolygons());
|
|
970
1389
|
}
|
|
971
1390
|
putPolygons() {
|
|
972
|
-
if (!this._polygons
|
|
1391
|
+
if (!this._polygons)
|
|
973
1392
|
return;
|
|
974
1393
|
this.postboy.fire(new PlaceLayerFeaturesCommand(this.layerName, this._polygons.map((m) => m.feature)));
|
|
975
1394
|
}
|
|
@@ -994,12 +1413,14 @@ class MapModule {
|
|
|
994
1413
|
FeatureLayerComponent,
|
|
995
1414
|
MarkersComponent,
|
|
996
1415
|
TooltipComponent,
|
|
997
|
-
PolygonsComponent
|
|
1416
|
+
PolygonsComponent,
|
|
1417
|
+
ClusterLayerComponent], imports: [CommonModule], exports: [MapPlateComponent,
|
|
998
1418
|
FeatureLayerComponent,
|
|
999
1419
|
MarkersComponent,
|
|
1000
1420
|
TileLayerComponent,
|
|
1001
1421
|
TooltipComponent,
|
|
1002
|
-
PolygonsComponent
|
|
1422
|
+
PolygonsComponent,
|
|
1423
|
+
ClusterLayerComponent] });
|
|
1003
1424
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapModule, imports: [CommonModule] });
|
|
1004
1425
|
}
|
|
1005
1426
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapModule, decorators: [{
|
|
@@ -1015,6 +1436,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1015
1436
|
MarkersComponent,
|
|
1016
1437
|
TooltipComponent,
|
|
1017
1438
|
PolygonsComponent,
|
|
1439
|
+
ClusterLayerComponent,
|
|
1018
1440
|
],
|
|
1019
1441
|
exports: [
|
|
1020
1442
|
MapPlateComponent,
|
|
@@ -1023,6 +1445,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1023
1445
|
TileLayerComponent,
|
|
1024
1446
|
TooltipComponent,
|
|
1025
1447
|
PolygonsComponent,
|
|
1448
|
+
ClusterLayerComponent,
|
|
1026
1449
|
],
|
|
1027
1450
|
}]
|
|
1028
1451
|
}] });
|
|
@@ -1048,6 +1471,10 @@ class MarkerStyleHelper {
|
|
|
1048
1471
|
}),
|
|
1049
1472
|
});
|
|
1050
1473
|
}
|
|
1474
|
+
static withText(style, text) {
|
|
1475
|
+
style.setText(text);
|
|
1476
|
+
return style;
|
|
1477
|
+
}
|
|
1051
1478
|
}
|
|
1052
1479
|
|
|
1053
1480
|
class PolygonStyleHelper {
|
|
@@ -1064,6 +1491,19 @@ class PolygonStyleHelper {
|
|
|
1064
1491
|
}
|
|
1065
1492
|
}
|
|
1066
1493
|
|
|
1494
|
+
class TextStyleHelper {
|
|
1495
|
+
static get(text, font, color) {
|
|
1496
|
+
return new Text({
|
|
1497
|
+
text: text,
|
|
1498
|
+
font: font,
|
|
1499
|
+
textAlign: 'center',
|
|
1500
|
+
fill: new Fill({
|
|
1501
|
+
color: color,
|
|
1502
|
+
}),
|
|
1503
|
+
});
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1067
1507
|
/*
|
|
1068
1508
|
* Public API Surface of maps
|
|
1069
1509
|
*/
|
|
@@ -1072,5 +1512,5 @@ class PolygonStyleHelper {
|
|
|
1072
1512
|
* Generated bundle index. Do not edit.
|
|
1073
1513
|
*/
|
|
1074
1514
|
|
|
1075
|
-
export {
|
|
1515
|
+
export { CancelDrawingCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, MapClickEvent, MapLyrs, MapLyrsLabel, MapModule, MapMoveEndEvent, MapPlateComponent, MapPostboyService, MapRenderedEvent, MapSettings, MarkerModel, MarkerStyleHelper, MarkersComponent, MessageRegistratorService, OsmTileLayerComponent, PolygonModel, PolygonStyleHelper, PolygonsComponent, StartDrawingCommand, TextStyleHelper, TileLayerComponent, TileLayerSettings, TooltipComponent, TooltipSettings };
|
|
1076
1516
|
//# sourceMappingURL=maps-components-src-map.mjs.map
|