@artstesh/maps 1.1.22 → 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 +93 -6
- package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
- package/dist/bundles/maps-components.umd.js +93 -6
- 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/map.constants.js +2 -1
- 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/map.constants.js +2 -1
- 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 +82 -5
- package/dist/fesm2015/maps-components-src-map.js.map +1 -1
- package/dist/fesm2015/maps-components.js +82 -5
- 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/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
|
@@ -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) {
|
|
@@ -1063,6 +1064,51 @@
|
|
|
1063
1064
|
}(postboy.PostboyGenericMessage));
|
|
1064
1065
|
MapMoveEndEvent.ID = 'd210ec7e-032f-4ce8-8a39-7b816519eaae';
|
|
1065
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
|
+
|
|
1066
1112
|
/**
|
|
1067
1113
|
* A class responsible for executing filtering of geographical features
|
|
1068
1114
|
* based on a specific geographical point (latitude and longitude).
|
|
@@ -1559,6 +1605,7 @@
|
|
|
1559
1605
|
this.observeMapRender();
|
|
1560
1606
|
this.observeFitToFeatures();
|
|
1561
1607
|
this.observeFitToPolygons();
|
|
1608
|
+
this.observePointerMove();
|
|
1562
1609
|
};
|
|
1563
1610
|
MapFeatureService.prototype.observeMapRender = function () {
|
|
1564
1611
|
var _this = this;
|
|
@@ -1568,6 +1615,23 @@
|
|
|
1568
1615
|
_this.postboy.fire(_this.fitPolygonsWaiting);
|
|
1569
1616
|
});
|
|
1570
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
|
+
};
|
|
1571
1635
|
MapFeatureService.prototype.observeFitToFeatures = function () {
|
|
1572
1636
|
var _this = this;
|
|
1573
1637
|
this.postboy.sub(FitToFeaturesCommand).subscribe(function (cmd) {
|
|
@@ -1895,6 +1959,8 @@
|
|
|
1895
1959
|
this.recordSubject(CancelDrawingCommand);
|
|
1896
1960
|
this.recordSubject(StartDrawingCommand);
|
|
1897
1961
|
this.recordSubject(GetLayerQuery);
|
|
1962
|
+
this.recordSubject(MapFeatureHoveredEvent);
|
|
1963
|
+
this.recordWithPipe(MapPointerMoveEvent, new rxjs.Subject(), function (s) { return s.pipe(operators.debounceTime(150)); });
|
|
1898
1964
|
this.recordSubject(DrawingFinishedEvent);
|
|
1899
1965
|
this.recordSubject(GetFeaturesInAreaQuery);
|
|
1900
1966
|
this.recordSubject(DrawSelectionAreaCommand);
|
|
@@ -2289,6 +2355,7 @@
|
|
|
2289
2355
|
result.minZoom = model.minZoom;
|
|
2290
2356
|
result.zIndex = model.zIndex;
|
|
2291
2357
|
result.style = model.style;
|
|
2358
|
+
result.featureHoverStyle = model.featureHoverStyle;
|
|
2292
2359
|
return result;
|
|
2293
2360
|
};
|
|
2294
2361
|
/**
|
|
@@ -2337,6 +2404,15 @@
|
|
|
2337
2404
|
FeatureLayerSettings.prototype.setStyle = function (style) {
|
|
2338
2405
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { style: style }));
|
|
2339
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
|
+
};
|
|
2340
2416
|
/**
|
|
2341
2417
|
* Checks if the given FeatureLayerSettings object is identical to the current object.
|
|
2342
2418
|
*
|
|
@@ -2354,6 +2430,8 @@
|
|
|
2354
2430
|
return false;
|
|
2355
2431
|
if (this.style !== model.style)
|
|
2356
2432
|
return false;
|
|
2433
|
+
if (this.featureHoverStyle !== model.featureHoverStyle)
|
|
2434
|
+
return false;
|
|
2357
2435
|
return true;
|
|
2358
2436
|
};
|
|
2359
2437
|
return FeatureLayerSettings;
|
|
@@ -2802,6 +2880,9 @@
|
|
|
2802
2880
|
_this.map.updateSize();
|
|
2803
2881
|
_this.postboy.fire(new MapRenderedEvent(_this.map));
|
|
2804
2882
|
});
|
|
2883
|
+
this.map.on('pointermove', function (ev) {
|
|
2884
|
+
_this.postboy.fire(new MapPointerMoveEvent(ev.pixel));
|
|
2885
|
+
});
|
|
2805
2886
|
this.setOsm();
|
|
2806
2887
|
};
|
|
2807
2888
|
MapPlateComponent.prototype.setOsm = function () {
|
|
@@ -3057,9 +3138,13 @@
|
|
|
3057
3138
|
.subscribe(function () { return _this.putPolygons(); });
|
|
3058
3139
|
};
|
|
3059
3140
|
PolygonsComponent.prototype.putPolygons = function () {
|
|
3141
|
+
var _this = this;
|
|
3060
3142
|
if (!this._polygons)
|
|
3061
3143
|
return;
|
|
3062
|
-
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
|
+
})));
|
|
3063
3148
|
};
|
|
3064
3149
|
return PolygonsComponent;
|
|
3065
3150
|
}(DestructibleComponent));
|
|
@@ -3552,10 +3637,12 @@
|
|
|
3552
3637
|
exports.MapConstants = MapConstants;
|
|
3553
3638
|
exports.MapControl = MapControl;
|
|
3554
3639
|
exports.MapControlZoomComponent = MapControlZoomComponent;
|
|
3640
|
+
exports.MapFeatureHoveredEvent = MapFeatureHoveredEvent;
|
|
3555
3641
|
exports.MapLyrsLabel = MapLyrsLabel;
|
|
3556
3642
|
exports.MapModule = MapModule;
|
|
3557
3643
|
exports.MapMoveEndEvent = MapMoveEndEvent;
|
|
3558
3644
|
exports.MapPlateComponent = MapPlateComponent;
|
|
3645
|
+
exports.MapPointerMoveEvent = MapPointerMoveEvent;
|
|
3559
3646
|
exports.MapPostboyService = MapPostboyService;
|
|
3560
3647
|
exports.MapRenderedEvent = MapRenderedEvent;
|
|
3561
3648
|
exports.MapSettings = MapSettings;
|