@artstesh/maps 4.1.23 → 4.1.24
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/esm2020/map/map-plate/features/polygons/polygons.component.mjs +6 -2
- package/dist/esm2020/map/map-plate/layers/feature-layer/feature-layer.settings.mjs +13 -1
- package/dist/esm2020/map/map-plate/map-plate.component.mjs +5 -1
- package/dist/esm2020/map/messages/events/map-feature-hovered.event.mjs +21 -0
- package/dist/esm2020/map/messages/events/map-pointer-move.event.mjs +20 -0
- package/dist/esm2020/map/messages/index.mjs +3 -1
- package/dist/esm2020/map/models/map.constants.mjs +2 -1
- package/dist/esm2020/map/services/map-feature.service.mjs +22 -2
- package/dist/esm2020/map/services/message-registrator.service.mjs +7 -2
- package/dist/esm2020/src/map/map-plate/features/polygons/polygons.component.mjs +6 -2
- package/dist/esm2020/src/map/map-plate/layers/feature-layer/feature-layer.settings.mjs +13 -1
- package/dist/esm2020/src/map/map-plate/map-plate.component.mjs +5 -1
- package/dist/esm2020/src/map/messages/events/map-feature-hovered.event.mjs +21 -0
- package/dist/esm2020/src/map/messages/events/map-pointer-move.event.mjs +20 -0
- package/dist/esm2020/src/map/messages/index.mjs +3 -1
- package/dist/esm2020/src/map/models/map.constants.mjs +2 -1
- package/dist/esm2020/src/map/services/map-feature.service.mjs +22 -2
- package/dist/esm2020/src/map/services/message-registrator.service.mjs +7 -2
- package/dist/fesm2015/maps-components-src-map.mjs +82 -5
- package/dist/fesm2015/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2015/maps-components.mjs +82 -5
- package/dist/fesm2015/maps-components.mjs.map +1 -1
- package/dist/fesm2020/maps-components-src-map.mjs +82 -5
- package/dist/fesm2020/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2020/maps-components.mjs +82 -5
- package/dist/fesm2020/maps-components.mjs.map +1 -1
- package/dist/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +22 -0
- package/dist/map/messages/events/map-feature-hovered.event.d.ts +19 -0
- package/dist/map/messages/events/map-pointer-move.event.d.ts +17 -0
- package/dist/map/messages/index.d.ts +2 -0
- package/dist/map/models/map.constants.d.ts +1 -0
- package/dist/map/services/map-feature.service.d.ts +1 -0
- package/dist/src/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +22 -0
- package/dist/src/map/messages/events/map-feature-hovered.event.d.ts +19 -0
- package/dist/src/map/messages/events/map-pointer-move.event.d.ts +17 -0
- package/dist/src/map/messages/index.d.ts +2 -0
- package/dist/src/map/models/map.constants.d.ts +1 -0
- package/dist/src/map/services/map-feature.service.d.ts +1 -0
- package/package.json +1 -1
|
@@ -13,15 +13,15 @@ import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, Postboy
|
|
|
13
13
|
import { Draw, Modify, Translate, defaults } from 'ol/interaction';
|
|
14
14
|
import { createRegularPolygon, createBox } from 'ol/interaction/Draw';
|
|
15
15
|
import * as Sphere from 'ol/sphere';
|
|
16
|
+
import { Subject, combineLatest } from 'rxjs';
|
|
17
|
+
import { first, debounceTime, filter, auditTime } from 'rxjs/operators';
|
|
16
18
|
import { Dictionary } from '@artstesh/collections';
|
|
17
|
-
import { first, filter, auditTime } from 'rxjs/operators';
|
|
18
19
|
import { Vector, XYZ } from 'ol/source';
|
|
19
20
|
import TileLayer from 'ol/layer/Tile';
|
|
20
21
|
import OSM from 'ol/source/OSM';
|
|
21
22
|
import { Vector as Vector$1 } from 'ol/layer';
|
|
22
23
|
import { bbox } from 'ol/loadingstrategy';
|
|
23
24
|
import Cluster from 'ol/source/Cluster';
|
|
24
|
-
import { combineLatest } from 'rxjs';
|
|
25
25
|
import Map from 'ol/Map';
|
|
26
26
|
import View from 'ol/View';
|
|
27
27
|
import Overlay from 'ol/Overlay';
|
|
@@ -194,7 +194,8 @@ IdGenerator.collection = 'ABCDEFGHIJKLMNOPQRSTUVWXTZ0123456789'.split('');
|
|
|
194
194
|
class MapConstants {
|
|
195
195
|
}
|
|
196
196
|
MapConstants.FeatureInfo = 'f-info';
|
|
197
|
-
MapConstants.DrawingLayerId = '93a981756ec7';
|
|
197
|
+
MapConstants.DrawingLayerId = '93a981756ec7';
|
|
198
|
+
MapConstants.FeatureLayerName = 'L-253';
|
|
198
199
|
|
|
199
200
|
class MarkerModel {
|
|
200
201
|
constructor(lat, lng, id, info) {
|
|
@@ -518,6 +519,45 @@ class MapMoveEndEvent extends PostboyGenericMessage {
|
|
|
518
519
|
}
|
|
519
520
|
MapMoveEndEvent.ID = 'd210ec7e-032f-4ce8-8a39-7b816519eaae';
|
|
520
521
|
|
|
522
|
+
/**
|
|
523
|
+
* Represents an event that is triggered when the pointer moves on a map.
|
|
524
|
+
* This class extends PostboyGenericMessage.
|
|
525
|
+
*
|
|
526
|
+
* It contains information about the coordinates of the pointer when the event occurs.
|
|
527
|
+
*/
|
|
528
|
+
class MapPointerMoveEvent extends PostboyGenericMessage {
|
|
529
|
+
/**
|
|
530
|
+
* Constructor for initializing an instance with a given point.
|
|
531
|
+
*
|
|
532
|
+
* @param {Array<number>} point - An array representing the coordinates of the point.
|
|
533
|
+
*/
|
|
534
|
+
constructor(point) {
|
|
535
|
+
super();
|
|
536
|
+
this.point = point;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
MapPointerMoveEvent.ID = '193cb41d-2489-45cc-b349-59c3ec18ed72';
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Represents an event triggered when a map feature is hovered over.
|
|
543
|
+
* This event contains information about the hovered feature and its associated layer.
|
|
544
|
+
* Extends the PostboyGenericMessage class.
|
|
545
|
+
*/
|
|
546
|
+
class MapFeatureHoveredEvent extends PostboyGenericMessage {
|
|
547
|
+
/**
|
|
548
|
+
* Constructs an instance of the class.
|
|
549
|
+
*
|
|
550
|
+
* @param {Feature|null} feature - The feature associated with this instance. Can be null.
|
|
551
|
+
* @param {string|null} layer - The layer associated with this instance. Can be null.
|
|
552
|
+
*/
|
|
553
|
+
constructor(feature, layer) {
|
|
554
|
+
super();
|
|
555
|
+
this.feature = feature;
|
|
556
|
+
this.layer = layer;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
MapFeatureHoveredEvent.ID = 'eb9b032a-1616-4823-a628-0fd8ffc3b57a';
|
|
560
|
+
|
|
521
561
|
/**
|
|
522
562
|
* A class responsible for executing filtering of geographical features
|
|
523
563
|
* based on a specific geographical point (latitude and longitude).
|
|
@@ -932,6 +972,7 @@ class MapFeatureService {
|
|
|
932
972
|
this.observeMapRender();
|
|
933
973
|
this.observeFitToFeatures();
|
|
934
974
|
this.observeFitToPolygons();
|
|
975
|
+
this.observePointerMove();
|
|
935
976
|
}
|
|
936
977
|
observeMapRender() {
|
|
937
978
|
this.postboy.sub(MapRenderedEvent).subscribe((m) => {
|
|
@@ -940,6 +981,22 @@ class MapFeatureService {
|
|
|
940
981
|
this.postboy.fire(this.fitPolygonsWaiting);
|
|
941
982
|
});
|
|
942
983
|
}
|
|
984
|
+
observePointerMove() {
|
|
985
|
+
this.postboy.sub(MapPointerMoveEvent).subscribe((ev) => {
|
|
986
|
+
if (!this.map)
|
|
987
|
+
return;
|
|
988
|
+
let featureFound = false;
|
|
989
|
+
this.map.forEachFeatureAtPixel(ev.point, (f) => {
|
|
990
|
+
if (f instanceof Feature) {
|
|
991
|
+
this.postboy.fire(new MapFeatureHoveredEvent(f, f.get(MapConstants.FeatureLayerName)));
|
|
992
|
+
featureFound = true;
|
|
993
|
+
}
|
|
994
|
+
return true;
|
|
995
|
+
});
|
|
996
|
+
if (!featureFound)
|
|
997
|
+
this.postboy.fire(new MapFeatureHoveredEvent(null, null));
|
|
998
|
+
});
|
|
999
|
+
}
|
|
943
1000
|
observeFitToFeatures() {
|
|
944
1001
|
this.postboy.sub(FitToFeaturesCommand).subscribe((cmd) => {
|
|
945
1002
|
this.fitToGeometries(cmd.features.map((f) => f.getGeometry()), cmd.zoomAfter);
|
|
@@ -1234,6 +1291,8 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
|
1234
1291
|
this.recordSubject(CancelDrawingCommand);
|
|
1235
1292
|
this.recordSubject(StartDrawingCommand);
|
|
1236
1293
|
this.recordSubject(GetLayerQuery);
|
|
1294
|
+
this.recordSubject(MapFeatureHoveredEvent);
|
|
1295
|
+
this.recordWithPipe(MapPointerMoveEvent, new Subject(), (s) => s.pipe(debounceTime(150)));
|
|
1237
1296
|
this.recordSubject(DrawingFinishedEvent);
|
|
1238
1297
|
this.recordSubject(GetFeaturesInAreaQuery);
|
|
1239
1298
|
this.recordSubject(DrawSelectionAreaCommand);
|
|
@@ -1590,6 +1649,7 @@ class FeatureLayerSettings {
|
|
|
1590
1649
|
result.minZoom = model.minZoom;
|
|
1591
1650
|
result.zIndex = model.zIndex;
|
|
1592
1651
|
result.style = model.style;
|
|
1652
|
+
result.featureHoverStyle = model.featureHoverStyle;
|
|
1593
1653
|
return result;
|
|
1594
1654
|
}
|
|
1595
1655
|
/**
|
|
@@ -1638,6 +1698,15 @@ class FeatureLayerSettings {
|
|
|
1638
1698
|
setStyle(style) {
|
|
1639
1699
|
return FeatureLayerSettings.copy({ ...this, style });
|
|
1640
1700
|
}
|
|
1701
|
+
/**
|
|
1702
|
+
* Sets the style to apply to features when they are hovered over.
|
|
1703
|
+
*
|
|
1704
|
+
* @param {Style | StyleFunction} featureHoverStyle - The style or style function to use for hovered features.
|
|
1705
|
+
* @return {FeatureLayerSettings} A new instance of FeatureLayerSettings with the updated hover style.
|
|
1706
|
+
*/
|
|
1707
|
+
setFeatureHoverStyle(featureHoverStyle) {
|
|
1708
|
+
return FeatureLayerSettings.copy({ ...this, featureHoverStyle });
|
|
1709
|
+
}
|
|
1641
1710
|
/**
|
|
1642
1711
|
* Checks if the given FeatureLayerSettings object is identical to the current object.
|
|
1643
1712
|
*
|
|
@@ -1655,6 +1724,8 @@ class FeatureLayerSettings {
|
|
|
1655
1724
|
return false;
|
|
1656
1725
|
if (this.style !== model.style)
|
|
1657
1726
|
return false;
|
|
1727
|
+
if (this.featureHoverStyle !== model.featureHoverStyle)
|
|
1728
|
+
return false;
|
|
1658
1729
|
return true;
|
|
1659
1730
|
}
|
|
1660
1731
|
}
|
|
@@ -2051,6 +2122,9 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
2051
2122
|
this.map.updateSize();
|
|
2052
2123
|
this.postboy.fire(new MapRenderedEvent(this.map));
|
|
2053
2124
|
});
|
|
2125
|
+
this.map.on('pointermove', (ev) => {
|
|
2126
|
+
this.postboy.fire(new MapPointerMoveEvent(ev.pixel));
|
|
2127
|
+
});
|
|
2054
2128
|
this.setOsm();
|
|
2055
2129
|
}
|
|
2056
2130
|
setOsm() {
|
|
@@ -2262,7 +2336,10 @@ class PolygonsComponent extends DestructibleComponent {
|
|
|
2262
2336
|
putPolygons() {
|
|
2263
2337
|
if (!this._polygons)
|
|
2264
2338
|
return;
|
|
2265
|
-
this.postboy.fire(new PlaceLayerFeaturesCommand(this.layerName, this._polygons.map((m) =>
|
|
2339
|
+
this.postboy.fire(new PlaceLayerFeaturesCommand(this.layerName, this._polygons.map((m) => {
|
|
2340
|
+
m.feature.set(MapConstants.FeatureLayerName, this.layerName);
|
|
2341
|
+
return m.feature;
|
|
2342
|
+
})));
|
|
2266
2343
|
}
|
|
2267
2344
|
}
|
|
2268
2345
|
PolygonsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PolygonsComponent, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -2698,5 +2775,5 @@ class StringifyFeatureHelper {
|
|
|
2698
2775
|
* Generated bundle index. Do not edit.
|
|
2699
2776
|
*/
|
|
2700
2777
|
|
|
2701
|
-
export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, FilterFeaturesInAreaExecutor, FilterFeaturesInPointExecutor, FitToFeaturesCommand, FitToPolygonsCommand, GetFeaturesInAreaQuery, GetFeaturesInPointQuery, GetMapPositionExecutor, MapClickEvent, MapConstants, MapControl, MapControlZoomComponent, MapLyrs, MapLyrsLabel, MapModule, MapMoveEndEvent, MapPlateComponent, MapPostboyService, MapRenderedEvent, MapSettings, MarkerModel, MarkerStyleHelper, MarkersComponent, MessageRegistratorService, ModifyFeatureCommand, OsmTileLayerComponent, PolygonModel, PolygonStyleHelper, PolygonsComponent, RemoveControlCommand, SetMapCenterCommand, StartDrawingCommand, StringifyFeatureHelper, TextStyleHelper, TileLayerComponent, TileLayerSettings, TooltipComponent, TooltipSettings, ZoomControlSettings };
|
|
2778
|
+
export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, FilterFeaturesInAreaExecutor, FilterFeaturesInPointExecutor, FitToFeaturesCommand, FitToPolygonsCommand, GetFeaturesInAreaQuery, GetFeaturesInPointQuery, GetMapPositionExecutor, MapClickEvent, MapConstants, MapControl, MapControlZoomComponent, MapFeatureHoveredEvent, MapLyrs, MapLyrsLabel, MapModule, MapMoveEndEvent, MapPlateComponent, MapPointerMoveEvent, MapPostboyService, MapRenderedEvent, MapSettings, MarkerModel, MarkerStyleHelper, MarkersComponent, MessageRegistratorService, ModifyFeatureCommand, OsmTileLayerComponent, PolygonModel, PolygonStyleHelper, PolygonsComponent, RemoveControlCommand, SetMapCenterCommand, StartDrawingCommand, StringifyFeatureHelper, TextStyleHelper, TileLayerComponent, TileLayerSettings, TooltipComponent, TooltipSettings, ZoomControlSettings };
|
|
2702
2779
|
//# sourceMappingURL=maps-components.mjs.map
|