@artstesh/maps 1.1.21 → 1.1.23
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/bundles/maps-components-src-map.umd.js +100 -8
- package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
- package/dist/bundles/maps-components.umd.js +100 -8
- package/dist/bundles/maps-components.umd.js.map +1 -1
- package/dist/esm2015/map/map-plate/features/polygons/polygons.component.js +6 -2
- package/dist/esm2015/map/map-plate/layers/feature-layer/feature-layer.settings.js +13 -1
- package/dist/esm2015/map/map-plate/map-plate.component.js +5 -1
- package/dist/esm2015/map/messages/events/map-feature-hovered.event.js +21 -0
- package/dist/esm2015/map/messages/events/map-pointer-move.event.js +20 -0
- package/dist/esm2015/map/messages/index.js +3 -1
- package/dist/esm2015/map/models/feature-format.enum.js +2 -1
- package/dist/esm2015/map/models/map.constants.js +2 -1
- package/dist/esm2015/map/services/drawing/drawing.service.js +4 -2
- package/dist/esm2015/map/services/drawing/feature-modification.service.js +4 -2
- package/dist/esm2015/map/services/map-feature.service.js +22 -2
- package/dist/esm2015/map/services/message-registrator.service.js +7 -2
- package/dist/esm2015/src/map/map-plate/features/polygons/polygons.component.js +6 -2
- package/dist/esm2015/src/map/map-plate/layers/feature-layer/feature-layer.settings.js +13 -1
- package/dist/esm2015/src/map/map-plate/map-plate.component.js +5 -1
- package/dist/esm2015/src/map/messages/events/map-feature-hovered.event.js +21 -0
- package/dist/esm2015/src/map/messages/events/map-pointer-move.event.js +20 -0
- package/dist/esm2015/src/map/messages/index.js +3 -1
- package/dist/esm2015/src/map/models/feature-format.enum.js +2 -1
- package/dist/esm2015/src/map/models/map.constants.js +2 -1
- package/dist/esm2015/src/map/services/drawing/drawing.service.js +4 -2
- package/dist/esm2015/src/map/services/drawing/feature-modification.service.js +4 -2
- package/dist/esm2015/src/map/services/map-feature.service.js +22 -2
- package/dist/esm2015/src/map/services/message-registrator.service.js +7 -2
- package/dist/fesm2015/maps-components-src-map.js +89 -7
- package/dist/fesm2015/maps-components-src-map.js.map +1 -1
- package/dist/fesm2015/maps-components.js +89 -7
- package/dist/fesm2015/maps-components.js.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/feature-format.enum.d.ts +2 -1
- 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/feature-format.enum.d.ts +2 -1
- 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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('ol'), require('ol/geom'), require('ol/format'), require('ol/extent'), require('ol/geom/Polygon'), require('ol/control'), require('ol/proj'), require('@artstesh/postboy'), require('ol/interaction'), require('ol/interaction/Draw'), require('ol/sphere'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('maps-components/src/map', ['exports', '@angular/core', '@angular/common', 'ol', 'ol/geom', 'ol/format', 'ol/extent', 'ol/geom/Polygon', 'ol/control', 'ol/proj', '@artstesh/postboy', 'ol/interaction', 'ol/interaction/Draw', 'ol/sphere', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["maps-components"] = global["maps-components"] || {}, global["maps-components"].src = global["maps-components"].src || {}, global["maps-components"].src.map = {}), global.ng.core, global.ng.common, global.ol, global.geom, global.format, global.extent, global.Polygon, global.control, global.proj, global.postboy, global.interaction, global.Draw, global.Sphere, global.
|
|
5
|
-
})(this, (function (exports, i0, i6, ol, geom, format, extent, Polygon, control, proj, postboy, interaction, Draw, Sphere,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('ol'), require('ol/geom'), require('ol/format'), require('ol/extent'), require('ol/geom/Polygon'), require('ol/control'), require('ol/proj'), require('@artstesh/postboy'), require('ol/interaction'), require('ol/interaction/Draw'), require('ol/sphere'), require('rxjs'), require('rxjs/operators'), require('@artstesh/collections'), require('ol/source'), require('ol/layer/Tile'), require('ol/source/OSM'), require('ol/layer'), require('ol/loadingstrategy'), require('ol/source/Cluster'), require('ol/Map'), require('ol/View'), require('ol/Overlay'), require('ol/style/Style'), require('ol/style'), require('ol/proj/epsg4326')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('maps-components/src/map', ['exports', '@angular/core', '@angular/common', 'ol', 'ol/geom', 'ol/format', 'ol/extent', 'ol/geom/Polygon', 'ol/control', 'ol/proj', '@artstesh/postboy', 'ol/interaction', 'ol/interaction/Draw', 'ol/sphere', 'rxjs', 'rxjs/operators', '@artstesh/collections', 'ol/source', 'ol/layer/Tile', 'ol/source/OSM', 'ol/layer', 'ol/loadingstrategy', 'ol/source/Cluster', 'ol/Map', 'ol/View', 'ol/Overlay', 'ol/style/Style', 'ol/style', 'ol/proj/epsg4326'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["maps-components"] = global["maps-components"] || {}, global["maps-components"].src = global["maps-components"].src || {}, global["maps-components"].src.map = {}), global.ng.core, global.ng.common, global.ol, global.geom, global.format, global.extent, global.Polygon, global.control, global.proj, global.postboy, global.interaction, global.Draw, global.Sphere, global.rxjs, global.rxjs.operators, global.collections, global.source, global.TileLayer, global.OSM, global.layer, global.loadingstrategy, global.Cluster, global.Map, global.View, global.Overlay, global.Style, global.style, global.epsg4326));
|
|
5
|
+
})(this, (function (exports, i0, i6, ol, geom, format, extent, Polygon, control, proj, postboy, interaction, Draw, Sphere, rxjs, operators, collections, source, TileLayer, OSM, layer, loadingstrategy, Cluster, Map, View, Overlay, Style, style, epsg4326) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -677,7 +677,8 @@
|
|
|
677
677
|
return MapConstants;
|
|
678
678
|
}());
|
|
679
679
|
MapConstants.FeatureInfo = 'f-info';
|
|
680
|
-
MapConstants.DrawingLayerId = '93a981756ec7';
|
|
680
|
+
MapConstants.DrawingLayerId = '93a981756ec7';
|
|
681
|
+
MapConstants.FeatureLayerName = 'L-253';
|
|
681
682
|
|
|
682
683
|
var MarkerModel = /** @class */ (function () {
|
|
683
684
|
function MarkerModel(lat, lng, id, info) {
|
|
@@ -774,6 +775,7 @@
|
|
|
774
775
|
(function (FeatureOutputFormat) {
|
|
775
776
|
FeatureOutputFormat[FeatureOutputFormat["GeoJson"] = 1] = "GeoJson";
|
|
776
777
|
FeatureOutputFormat[FeatureOutputFormat["WKT"] = 2] = "WKT";
|
|
778
|
+
FeatureOutputFormat[FeatureOutputFormat["Geometry"] = 3] = "Geometry";
|
|
777
779
|
})(exports.FeatureOutputFormat || (exports.FeatureOutputFormat = {}));
|
|
778
780
|
|
|
779
781
|
/**
|
|
@@ -1062,6 +1064,51 @@
|
|
|
1062
1064
|
}(postboy.PostboyGenericMessage));
|
|
1063
1065
|
MapMoveEndEvent.ID = 'd210ec7e-032f-4ce8-8a39-7b816519eaae';
|
|
1064
1066
|
|
|
1067
|
+
/**
|
|
1068
|
+
* Represents an event that is triggered when the pointer moves on a map.
|
|
1069
|
+
* This class extends PostboyGenericMessage.
|
|
1070
|
+
*
|
|
1071
|
+
* It contains information about the coordinates of the pointer when the event occurs.
|
|
1072
|
+
*/
|
|
1073
|
+
var MapPointerMoveEvent = /** @class */ (function (_super) {
|
|
1074
|
+
__extends(MapPointerMoveEvent, _super);
|
|
1075
|
+
/**
|
|
1076
|
+
* Constructor for initializing an instance with a given point.
|
|
1077
|
+
*
|
|
1078
|
+
* @param {Array<number>} point - An array representing the coordinates of the point.
|
|
1079
|
+
*/
|
|
1080
|
+
function MapPointerMoveEvent(point) {
|
|
1081
|
+
var _this = _super.call(this) || this;
|
|
1082
|
+
_this.point = point;
|
|
1083
|
+
return _this;
|
|
1084
|
+
}
|
|
1085
|
+
return MapPointerMoveEvent;
|
|
1086
|
+
}(postboy.PostboyGenericMessage));
|
|
1087
|
+
MapPointerMoveEvent.ID = '193cb41d-2489-45cc-b349-59c3ec18ed72';
|
|
1088
|
+
|
|
1089
|
+
/**
|
|
1090
|
+
* Represents an event triggered when a map feature is hovered over.
|
|
1091
|
+
* This event contains information about the hovered feature and its associated layer.
|
|
1092
|
+
* Extends the PostboyGenericMessage class.
|
|
1093
|
+
*/
|
|
1094
|
+
var MapFeatureHoveredEvent = /** @class */ (function (_super) {
|
|
1095
|
+
__extends(MapFeatureHoveredEvent, _super);
|
|
1096
|
+
/**
|
|
1097
|
+
* Constructs an instance of the class.
|
|
1098
|
+
*
|
|
1099
|
+
* @param {Feature|null} feature - The feature associated with this instance. Can be null.
|
|
1100
|
+
* @param {string|null} layer - The layer associated with this instance. Can be null.
|
|
1101
|
+
*/
|
|
1102
|
+
function MapFeatureHoveredEvent(feature, layer) {
|
|
1103
|
+
var _this = _super.call(this) || this;
|
|
1104
|
+
_this.feature = feature;
|
|
1105
|
+
_this.layer = layer;
|
|
1106
|
+
return _this;
|
|
1107
|
+
}
|
|
1108
|
+
return MapFeatureHoveredEvent;
|
|
1109
|
+
}(postboy.PostboyGenericMessage));
|
|
1110
|
+
MapFeatureHoveredEvent.ID = 'eb9b032a-1616-4823-a628-0fd8ffc3b57a';
|
|
1111
|
+
|
|
1065
1112
|
/**
|
|
1066
1113
|
* A class responsible for executing filtering of geographical features
|
|
1067
1114
|
* based on a specific geographical point (latitude and longitude).
|
|
@@ -1558,6 +1605,7 @@
|
|
|
1558
1605
|
this.observeMapRender();
|
|
1559
1606
|
this.observeFitToFeatures();
|
|
1560
1607
|
this.observeFitToPolygons();
|
|
1608
|
+
this.observePointerMove();
|
|
1561
1609
|
};
|
|
1562
1610
|
MapFeatureService.prototype.observeMapRender = function () {
|
|
1563
1611
|
var _this = this;
|
|
@@ -1567,6 +1615,23 @@
|
|
|
1567
1615
|
_this.postboy.fire(_this.fitPolygonsWaiting);
|
|
1568
1616
|
});
|
|
1569
1617
|
};
|
|
1618
|
+
MapFeatureService.prototype.observePointerMove = function () {
|
|
1619
|
+
var _this = this;
|
|
1620
|
+
this.postboy.sub(MapPointerMoveEvent).subscribe(function (ev) {
|
|
1621
|
+
if (!_this.map)
|
|
1622
|
+
return;
|
|
1623
|
+
var featureFound = false;
|
|
1624
|
+
_this.map.forEachFeatureAtPixel(ev.point, function (f) {
|
|
1625
|
+
if (f instanceof ol.Feature) {
|
|
1626
|
+
_this.postboy.fire(new MapFeatureHoveredEvent(f, f.get(MapConstants.FeatureLayerName)));
|
|
1627
|
+
featureFound = true;
|
|
1628
|
+
}
|
|
1629
|
+
return true;
|
|
1630
|
+
});
|
|
1631
|
+
if (!featureFound)
|
|
1632
|
+
_this.postboy.fire(new MapFeatureHoveredEvent(null, null));
|
|
1633
|
+
});
|
|
1634
|
+
};
|
|
1570
1635
|
MapFeatureService.prototype.observeFitToFeatures = function () {
|
|
1571
1636
|
var _this = this;
|
|
1572
1637
|
this.postboy.sub(FitToFeaturesCommand).subscribe(function (cmd) {
|
|
@@ -1696,7 +1761,9 @@
|
|
|
1696
1761
|
DrawingService.prototype.onEnd = function (evt, command, layer) {
|
|
1697
1762
|
command.finish(command.format === exports.FeatureOutputFormat.GeoJson
|
|
1698
1763
|
? new format.GeoJSON().writeFeature(evt.feature)
|
|
1699
|
-
:
|
|
1764
|
+
: command.format === exports.FeatureOutputFormat.WKT
|
|
1765
|
+
? new format.WKT().writeFeature(evt.feature)
|
|
1766
|
+
: new format.GeoJSON().writeGeometry(evt.feature.getGeometry()));
|
|
1700
1767
|
this.clearInteraction(layer);
|
|
1701
1768
|
};
|
|
1702
1769
|
DrawingService.prototype.observeMapRender = function () {
|
|
@@ -1794,7 +1861,9 @@
|
|
|
1794
1861
|
FeatureModificationService.prototype.onModified = function (command) {
|
|
1795
1862
|
command.next(command.format === exports.FeatureOutputFormat.GeoJson
|
|
1796
1863
|
? new format.GeoJSON().writeFeature(command.model.feature)
|
|
1797
|
-
:
|
|
1864
|
+
: command.format === exports.FeatureOutputFormat.WKT
|
|
1865
|
+
? new format.WKT().writeFeature(command.model.feature)
|
|
1866
|
+
: new format.GeoJSON().writeGeometry(command.model.feature.getGeometry()));
|
|
1798
1867
|
};
|
|
1799
1868
|
FeatureModificationService.prototype.observeMapRender = function () {
|
|
1800
1869
|
var _this = this;
|
|
@@ -1890,6 +1959,8 @@
|
|
|
1890
1959
|
this.recordSubject(CancelDrawingCommand);
|
|
1891
1960
|
this.recordSubject(StartDrawingCommand);
|
|
1892
1961
|
this.recordSubject(GetLayerQuery);
|
|
1962
|
+
this.recordSubject(MapFeatureHoveredEvent);
|
|
1963
|
+
this.recordWithPipe(MapPointerMoveEvent, new rxjs.Subject(), function (s) { return s.pipe(operators.debounceTime(150)); });
|
|
1893
1964
|
this.recordSubject(DrawingFinishedEvent);
|
|
1894
1965
|
this.recordSubject(GetFeaturesInAreaQuery);
|
|
1895
1966
|
this.recordSubject(DrawSelectionAreaCommand);
|
|
@@ -2284,6 +2355,7 @@
|
|
|
2284
2355
|
result.minZoom = model.minZoom;
|
|
2285
2356
|
result.zIndex = model.zIndex;
|
|
2286
2357
|
result.style = model.style;
|
|
2358
|
+
result.featureHoverStyle = model.featureHoverStyle;
|
|
2287
2359
|
return result;
|
|
2288
2360
|
};
|
|
2289
2361
|
/**
|
|
@@ -2332,6 +2404,15 @@
|
|
|
2332
2404
|
FeatureLayerSettings.prototype.setStyle = function (style) {
|
|
2333
2405
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { style: style }));
|
|
2334
2406
|
};
|
|
2407
|
+
/**
|
|
2408
|
+
* Sets the style to apply to features when they are hovered over.
|
|
2409
|
+
*
|
|
2410
|
+
* @param {Style | StyleFunction} featureHoverStyle - The style or style function to use for hovered features.
|
|
2411
|
+
* @return {FeatureLayerSettings} A new instance of FeatureLayerSettings with the updated hover style.
|
|
2412
|
+
*/
|
|
2413
|
+
FeatureLayerSettings.prototype.setFeatureHoverStyle = function (featureHoverStyle) {
|
|
2414
|
+
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { featureHoverStyle: featureHoverStyle }));
|
|
2415
|
+
};
|
|
2335
2416
|
/**
|
|
2336
2417
|
* Checks if the given FeatureLayerSettings object is identical to the current object.
|
|
2337
2418
|
*
|
|
@@ -2349,6 +2430,8 @@
|
|
|
2349
2430
|
return false;
|
|
2350
2431
|
if (this.style !== model.style)
|
|
2351
2432
|
return false;
|
|
2433
|
+
if (this.featureHoverStyle !== model.featureHoverStyle)
|
|
2434
|
+
return false;
|
|
2352
2435
|
return true;
|
|
2353
2436
|
};
|
|
2354
2437
|
return FeatureLayerSettings;
|
|
@@ -2797,6 +2880,9 @@
|
|
|
2797
2880
|
_this.map.updateSize();
|
|
2798
2881
|
_this.postboy.fire(new MapRenderedEvent(_this.map));
|
|
2799
2882
|
});
|
|
2883
|
+
this.map.on('pointermove', function (ev) {
|
|
2884
|
+
_this.postboy.fire(new MapPointerMoveEvent(ev.pixel));
|
|
2885
|
+
});
|
|
2800
2886
|
this.setOsm();
|
|
2801
2887
|
};
|
|
2802
2888
|
MapPlateComponent.prototype.setOsm = function () {
|
|
@@ -3052,9 +3138,13 @@
|
|
|
3052
3138
|
.subscribe(function () { return _this.putPolygons(); });
|
|
3053
3139
|
};
|
|
3054
3140
|
PolygonsComponent.prototype.putPolygons = function () {
|
|
3141
|
+
var _this = this;
|
|
3055
3142
|
if (!this._polygons)
|
|
3056
3143
|
return;
|
|
3057
|
-
this.postboy.fire(new PlaceLayerFeaturesCommand(this.layerName, this._polygons.map(function (m) {
|
|
3144
|
+
this.postboy.fire(new PlaceLayerFeaturesCommand(this.layerName, this._polygons.map(function (m) {
|
|
3145
|
+
m.feature.set(MapConstants.FeatureLayerName, _this.layerName);
|
|
3146
|
+
return m.feature;
|
|
3147
|
+
})));
|
|
3058
3148
|
};
|
|
3059
3149
|
return PolygonsComponent;
|
|
3060
3150
|
}(DestructibleComponent));
|
|
@@ -3547,10 +3637,12 @@
|
|
|
3547
3637
|
exports.MapConstants = MapConstants;
|
|
3548
3638
|
exports.MapControl = MapControl;
|
|
3549
3639
|
exports.MapControlZoomComponent = MapControlZoomComponent;
|
|
3640
|
+
exports.MapFeatureHoveredEvent = MapFeatureHoveredEvent;
|
|
3550
3641
|
exports.MapLyrsLabel = MapLyrsLabel;
|
|
3551
3642
|
exports.MapModule = MapModule;
|
|
3552
3643
|
exports.MapMoveEndEvent = MapMoveEndEvent;
|
|
3553
3644
|
exports.MapPlateComponent = MapPlateComponent;
|
|
3645
|
+
exports.MapPointerMoveEvent = MapPointerMoveEvent;
|
|
3554
3646
|
exports.MapPostboyService = MapPostboyService;
|
|
3555
3647
|
exports.MapRenderedEvent = MapRenderedEvent;
|
|
3556
3648
|
exports.MapSettings = MapSettings;
|