@artstesh/maps 1.1.7 → 1.1.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/bundles/maps-components-src-map.umd.js +443 -92
- package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
- package/dist/bundles/maps-components.umd.js +443 -92
- package/dist/bundles/maps-components.umd.js.map +1 -1
- package/dist/esm2015/map/helpers/marker-style.helper.js +27 -1
- package/dist/esm2015/map/helpers/polygon-style.helper.js +22 -1
- package/dist/esm2015/map/helpers/stringify-feature.helper.js +24 -21
- package/dist/esm2015/map/helpers/text-style.helper.js +12 -1
- package/dist/esm2015/map/map-plate/controls/map-control-zoom/map-control-zoom.component.js +18 -1
- package/dist/esm2015/map/map-plate/controls/map-control-zoom/zoom-control.settings.js +72 -1
- package/dist/esm2015/map/map-plate/features/markers/markers.component.js +11 -1
- package/dist/esm2015/map/map-plate/features/polygons/polygons.component.js +11 -1
- package/dist/esm2015/map/map-plate/layers/cluster-layer/cluster-layer.component.js +15 -7
- package/dist/esm2015/map/map-plate/layers/cluster-layer/cluster-layer.settings.js +79 -1
- package/dist/esm2015/map/map-plate/layers/feature-layer/feature-layer.component.js +7 -7
- package/dist/esm2015/map/map-plate/layers/feature-layer/feature-layer.settings.js +37 -17
- package/dist/esm2015/map/map-plate/layers/tile-layer/tile-layer.component.js +7 -7
- package/dist/esm2015/map/map-plate/layers/tile-layer/tile-layer.settings.js +76 -1
- package/dist/esm2015/map/map-plate/map-plate.component.js +2 -2
- package/dist/esm2015/map/map-plate/tooltips/tooltip/tooltip.component.js +15 -15
- package/dist/esm2015/map/map-plate/tooltips/tooltip/tooltip.settings.js +1 -1
- package/dist/esm2015/map/messages/commands/fit-to-polygons.command.js +1 -1
- package/dist/esm2015/map/models/map-control.js +2 -2
- package/dist/esm2015/map/models/marker-model.js +1 -1
- package/dist/esm2015/map/models/polygon.model.js +4 -4
- package/dist/esm2015/map/services/feature.service.js +6 -6
- package/dist/esm2015/map/services/map-click.service.js +10 -10
- package/dist/esm2015/map/services/map-feature.service.js +1 -1
- package/dist/esm2015/map/services/map-state.service.js +2 -3
- package/dist/esm2015/src/map/helpers/marker-style.helper.js +27 -1
- package/dist/esm2015/src/map/helpers/polygon-style.helper.js +22 -1
- package/dist/esm2015/src/map/helpers/stringify-feature.helper.js +24 -21
- package/dist/esm2015/src/map/helpers/text-style.helper.js +12 -1
- package/dist/esm2015/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.js +18 -1
- package/dist/esm2015/src/map/map-plate/controls/map-control-zoom/zoom-control.settings.js +72 -1
- package/dist/esm2015/src/map/map-plate/features/markers/markers.component.js +11 -1
- package/dist/esm2015/src/map/map-plate/features/polygons/polygons.component.js +11 -1
- package/dist/esm2015/src/map/map-plate/layers/cluster-layer/cluster-layer.component.js +15 -7
- package/dist/esm2015/src/map/map-plate/layers/cluster-layer/cluster-layer.settings.js +79 -1
- package/dist/esm2015/src/map/map-plate/layers/feature-layer/feature-layer.component.js +7 -7
- package/dist/esm2015/src/map/map-plate/layers/feature-layer/feature-layer.settings.js +37 -17
- package/dist/esm2015/src/map/map-plate/layers/tile-layer/tile-layer.component.js +7 -7
- package/dist/esm2015/src/map/map-plate/layers/tile-layer/tile-layer.settings.js +76 -1
- package/dist/esm2015/src/map/map-plate/map-plate.component.js +2 -2
- package/dist/esm2015/src/map/map-plate/tooltips/tooltip/tooltip.component.js +15 -15
- package/dist/esm2015/src/map/map-plate/tooltips/tooltip/tooltip.settings.js +1 -1
- package/dist/esm2015/src/map/messages/commands/fit-to-polygons.command.js +1 -1
- package/dist/esm2015/src/map/models/map-control.js +2 -2
- package/dist/esm2015/src/map/models/marker-model.js +1 -1
- package/dist/esm2015/src/map/models/polygon.model.js +4 -4
- package/dist/esm2015/src/map/services/feature.service.js +6 -6
- package/dist/esm2015/src/map/services/map-click.service.js +10 -10
- package/dist/esm2015/src/map/services/map-feature.service.js +1 -1
- package/dist/esm2015/src/map/services/map-state.service.js +2 -3
- package/dist/fesm2015/maps-components-src-map.js +438 -87
- package/dist/fesm2015/maps-components-src-map.js.map +1 -1
- package/dist/fesm2015/maps-components.js +438 -87
- package/dist/fesm2015/maps-components.js.map +1 -1
- package/dist/map/helpers/marker-style.helper.d.ts +26 -0
- package/dist/map/helpers/polygon-style.helper.d.ts +21 -0
- package/dist/map/helpers/stringify-feature.helper.d.ts +18 -0
- package/dist/map/helpers/text-style.helper.d.ts +11 -0
- package/dist/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +20 -3
- package/dist/map/map-plate/controls/map-control-zoom/zoom-control.settings.d.ts +71 -0
- package/dist/map/map-plate/features/markers/markers.component.d.ts +10 -0
- package/dist/map/map-plate/features/polygons/polygons.component.d.ts +10 -0
- package/dist/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +10 -2
- package/dist/map/map-plate/layers/cluster-layer/cluster-layer.settings.d.ts +78 -0
- package/dist/map/map-plate/layers/feature-layer/feature-layer.component.d.ts +2 -2
- package/dist/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +36 -16
- package/dist/map/map-plate/layers/tile-layer/tile-layer.component.d.ts +1 -1
- package/dist/map/map-plate/layers/tile-layer/tile-layer.settings.d.ts +75 -0
- package/dist/map/map-plate/map-plate.component.d.ts +2 -2
- package/dist/map/map-plate/tooltips/tooltip/tooltip.component.d.ts +5 -5
- package/dist/map/map-plate/tooltips/tooltip/tooltip.settings.d.ts +1 -1
- package/dist/map/models/map-control.d.ts +1 -1
- package/dist/map/models/polygon.model.d.ts +2 -2
- package/dist/map/services/feature.service.d.ts +1 -1
- package/dist/map/services/map-click.service.d.ts +1 -1
- package/dist/src/map/helpers/marker-style.helper.d.ts +26 -0
- package/dist/src/map/helpers/polygon-style.helper.d.ts +21 -0
- package/dist/src/map/helpers/stringify-feature.helper.d.ts +18 -0
- package/dist/src/map/helpers/text-style.helper.d.ts +11 -0
- package/dist/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +20 -3
- package/dist/src/map/map-plate/controls/map-control-zoom/zoom-control.settings.d.ts +71 -0
- package/dist/src/map/map-plate/features/markers/markers.component.d.ts +10 -0
- package/dist/src/map/map-plate/features/polygons/polygons.component.d.ts +10 -0
- package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.component.d.ts +10 -2
- package/dist/src/map/map-plate/layers/cluster-layer/cluster-layer.settings.d.ts +78 -0
- package/dist/src/map/map-plate/layers/feature-layer/feature-layer.component.d.ts +2 -2
- package/dist/src/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +36 -16
- package/dist/src/map/map-plate/layers/tile-layer/tile-layer.component.d.ts +1 -1
- package/dist/src/map/map-plate/layers/tile-layer/tile-layer.settings.d.ts +75 -0
- package/dist/src/map/map-plate/map-plate.component.d.ts +2 -2
- package/dist/src/map/map-plate/tooltips/tooltip/tooltip.component.d.ts +5 -5
- package/dist/src/map/map-plate/tooltips/tooltip/tooltip.settings.d.ts +1 -1
- package/dist/src/map/models/map-control.d.ts +1 -1
- package/dist/src/map/models/polygon.model.d.ts +2 -2
- package/dist/src/map/services/feature.service.d.ts +1 -1
- package/dist/src/map/services/map-click.service.d.ts +1 -1
- package/package.json +1 -1
|
@@ -655,6 +655,13 @@
|
|
|
655
655
|
(_a = this._feature) === null || _a === void 0 ? void 0 : _a.set(MapConstants.FeatureInfo, this.info);
|
|
656
656
|
_c = __read(extent.getCenter((_b = this._feature.getGeometry()) === null || _b === void 0 ? void 0 : _b.getExtent()), 2), this.lng = _c[0], this.lat = _c[1];
|
|
657
657
|
}
|
|
658
|
+
Object.defineProperty(PolygonModel.prototype, "feature", {
|
|
659
|
+
get: function () {
|
|
660
|
+
return this._feature;
|
|
661
|
+
},
|
|
662
|
+
enumerable: false,
|
|
663
|
+
configurable: true
|
|
664
|
+
});
|
|
658
665
|
PolygonModel.fromGeoJson = function (id, json, info) {
|
|
659
666
|
var feature = new format.GeoJSON().readFeature(json);
|
|
660
667
|
feature.setId(id);
|
|
@@ -665,13 +672,6 @@
|
|
|
665
672
|
feature.setId(id);
|
|
666
673
|
return new PolygonModel(feature, id, info);
|
|
667
674
|
};
|
|
668
|
-
Object.defineProperty(PolygonModel.prototype, "feature", {
|
|
669
|
-
get: function () {
|
|
670
|
-
return this._feature;
|
|
671
|
-
},
|
|
672
|
-
enumerable: false,
|
|
673
|
-
configurable: true
|
|
674
|
-
});
|
|
675
675
|
return PolygonModel;
|
|
676
676
|
}());
|
|
677
677
|
|
|
@@ -691,7 +691,7 @@
|
|
|
691
691
|
|
|
692
692
|
/**
|
|
693
693
|
*
|
|
694
|
-
* A control is a visible widget with a DOM element in a fixed position on the screen. They can involve user input (buttons), or be informational only; the position is determined using CSS. By default these are placed in the container with CSS class name ol-overlaycontainer-stopevent, but can use any outside DOM element.
|
|
694
|
+
* A control is a visible widget with a DOM element in a fixed position on the screen. They can involve user input (buttons), or be informational only; the position is determined using CSS. By default, these are placed in the container with CSS class name ol-overlaycontainer-stopevent, but can use any outside DOM element.
|
|
695
695
|
* This is the base class for controls. You can use it for simple custom controls by creating the element with listeners, creating an instance:
|
|
696
696
|
* var myControl = new Control({element: myElement}); and then adding this to the map.
|
|
697
697
|
* The main advantage of having this as a control rather than a simple separate DOM element is that preventing propagation is handled for you. Controls will also be objects in a module:ol/Collection~Collection, so you can use their methods.
|
|
@@ -1154,6 +1154,11 @@
|
|
|
1154
1154
|
FeatureService.filterFeaturesInArea = function (query) {
|
|
1155
1155
|
return query.features.filter(function (f) { return FeatureService.booleanIntersects(query.area, f.getGeometry()); });
|
|
1156
1156
|
};
|
|
1157
|
+
FeatureService.calculateArea = function (g) {
|
|
1158
|
+
if (!g)
|
|
1159
|
+
return 0;
|
|
1160
|
+
return Sphere__namespace.getArea(g, { projection: 'EPSG:4326' });
|
|
1161
|
+
};
|
|
1157
1162
|
FeatureService.booleanIntersects = function (g1, g2) {
|
|
1158
1163
|
if (g2.getType() === 'Point')
|
|
1159
1164
|
return g1.intersectsCoordinate(g2.getCoordinates());
|
|
@@ -1163,11 +1168,6 @@
|
|
|
1163
1168
|
return g1.intersectsCoordinate(g2.getInteriorPoint().getCoordinates());
|
|
1164
1169
|
return false;
|
|
1165
1170
|
};
|
|
1166
|
-
FeatureService.calculateArea = function (g) {
|
|
1167
|
-
if (!g)
|
|
1168
|
-
return 0;
|
|
1169
|
-
return Sphere__namespace.getArea(g, { projection: 'EPSG:4326' });
|
|
1170
|
-
};
|
|
1171
1171
|
return FeatureService;
|
|
1172
1172
|
}());
|
|
1173
1173
|
|
|
@@ -1474,16 +1474,6 @@
|
|
|
1474
1474
|
MapClickService.prototype.up = function () {
|
|
1475
1475
|
this.observeMapRender();
|
|
1476
1476
|
};
|
|
1477
|
-
MapClickService.prototype.observeMapRender = function () {
|
|
1478
|
-
var _this = this;
|
|
1479
|
-
this.postboy.subscribe(MapRenderedEvent.ID).subscribe(function (m) {
|
|
1480
|
-
var _a;
|
|
1481
|
-
_this.map = m.map;
|
|
1482
|
-
(_a = _this.map) === null || _a === void 0 ? void 0 : _a.on('singleclick', function (e) {
|
|
1483
|
-
_this.postboy.fire(_this.onClick(e));
|
|
1484
|
-
});
|
|
1485
|
-
});
|
|
1486
|
-
};
|
|
1487
1477
|
MapClickService.prototype.onClick = function (ev) {
|
|
1488
1478
|
var _this = this;
|
|
1489
1479
|
var _a;
|
|
@@ -1503,6 +1493,16 @@
|
|
|
1503
1493
|
});
|
|
1504
1494
|
return model;
|
|
1505
1495
|
};
|
|
1496
|
+
MapClickService.prototype.observeMapRender = function () {
|
|
1497
|
+
var _this = this;
|
|
1498
|
+
this.postboy.subscribe(MapRenderedEvent.ID).subscribe(function (m) {
|
|
1499
|
+
var _a;
|
|
1500
|
+
_this.map = m.map;
|
|
1501
|
+
(_a = _this.map) === null || _a === void 0 ? void 0 : _a.on('singleclick', function (e) {
|
|
1502
|
+
_this.postboy.fire(_this.onClick(e));
|
|
1503
|
+
});
|
|
1504
|
+
});
|
|
1505
|
+
};
|
|
1506
1506
|
MapClickService.prototype.getFeatureCollectionWithInner = function (features) {
|
|
1507
1507
|
var result = [];
|
|
1508
1508
|
features === null || features === void 0 ? void 0 : features.forEach(function (f) {
|
|
@@ -1787,14 +1787,53 @@
|
|
|
1787
1787
|
type: i0.Injectable
|
|
1788
1788
|
}], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: FeatureModificationService }, { type: ControlsService }]; } });
|
|
1789
1789
|
|
|
1790
|
+
/**
|
|
1791
|
+
* Class representing settings for a tile layer.
|
|
1792
|
+
*/
|
|
1790
1793
|
var TileLayerSettings = /** @class */ (function () {
|
|
1791
1794
|
function TileLayerSettings() {
|
|
1795
|
+
/**
|
|
1796
|
+
* The maximum zoom level for a map view.
|
|
1797
|
+
*
|
|
1798
|
+
* @type {number}
|
|
1799
|
+
* @default 19
|
|
1800
|
+
*/
|
|
1792
1801
|
this.maxZoom = 19;
|
|
1802
|
+
/**
|
|
1803
|
+
* The minimum zoom level allowed.
|
|
1804
|
+
*
|
|
1805
|
+
* @type {number}
|
|
1806
|
+
*/
|
|
1793
1807
|
this.minZoom = 0;
|
|
1808
|
+
/**
|
|
1809
|
+
* The opacity of an element.
|
|
1810
|
+
*
|
|
1811
|
+
* @type {number}
|
|
1812
|
+
* @default 0.6
|
|
1813
|
+
*/
|
|
1794
1814
|
this.opacity = 0.6;
|
|
1815
|
+
/**
|
|
1816
|
+
* Represents the tiles URL.
|
|
1817
|
+
* @typedef {string} url
|
|
1818
|
+
*
|
|
1819
|
+
* @example
|
|
1820
|
+
* 'https://example.ex/{z}/{x}/{y}.png'
|
|
1821
|
+
*/
|
|
1795
1822
|
this.url = '';
|
|
1823
|
+
/**
|
|
1824
|
+
* The projection of the coordinate system.
|
|
1825
|
+
*
|
|
1826
|
+
* @type {string}
|
|
1827
|
+
* @default 'EPSG:3857'
|
|
1828
|
+
*/
|
|
1796
1829
|
this.projection = 'EPSG:3857';
|
|
1797
1830
|
}
|
|
1831
|
+
/**
|
|
1832
|
+
* Creates a copy of the given tile layer settings.
|
|
1833
|
+
*
|
|
1834
|
+
* @param {TileLayerSettings} model - The tile layer settings to be copied.
|
|
1835
|
+
* @return {TileLayerSettings} - A new instance of TileLayerSettings with the same properties as the model.
|
|
1836
|
+
*/
|
|
1798
1837
|
TileLayerSettings.copy = function (model) {
|
|
1799
1838
|
var result = new TileLayerSettings();
|
|
1800
1839
|
result.maxZoom = model.maxZoom;
|
|
@@ -1804,21 +1843,57 @@
|
|
|
1804
1843
|
result.url = model.url;
|
|
1805
1844
|
return result;
|
|
1806
1845
|
};
|
|
1846
|
+
/**
|
|
1847
|
+
* Sets the URL of the TileLayerSettings object.
|
|
1848
|
+
*
|
|
1849
|
+
* @param {string} url - The URL to be set.
|
|
1850
|
+
* @return {TileLayerSettings} - The updated TileLayerSettings object.
|
|
1851
|
+
*/
|
|
1807
1852
|
TileLayerSettings.prototype.setUrl = function (url) {
|
|
1808
1853
|
return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { url: url }));
|
|
1809
1854
|
};
|
|
1855
|
+
/**
|
|
1856
|
+
* Sets the maximum zoom level for the tile layer.
|
|
1857
|
+
*
|
|
1858
|
+
* @param {number} maxZoom - The maximum zoom level.
|
|
1859
|
+
* @returns {TileLayerSettings} - The updated tile layer settings object.
|
|
1860
|
+
*/
|
|
1810
1861
|
TileLayerSettings.prototype.setMaxZoom = function (maxZoom) {
|
|
1811
1862
|
return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom: maxZoom }));
|
|
1812
1863
|
};
|
|
1864
|
+
/**
|
|
1865
|
+
* Sets the minimum zoom level for the Tile Layer.
|
|
1866
|
+
*
|
|
1867
|
+
* @param {number} minZoom - The minimum zoom level to be set.
|
|
1868
|
+
* @return {TileLayerSettings} The modified TileLayerSettings object with the updated minimum zoom level.
|
|
1869
|
+
*/
|
|
1813
1870
|
TileLayerSettings.prototype.setMinZoom = function (minZoom) {
|
|
1814
1871
|
return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom: minZoom }));
|
|
1815
1872
|
};
|
|
1873
|
+
/**
|
|
1874
|
+
* Sets the opacity of the TileLayerSettings.
|
|
1875
|
+
*
|
|
1876
|
+
* @param {number} opacity - The opacity value to set. Must be a number between 0 and 1.
|
|
1877
|
+
* @return {TileLayerSettings} - A new instance of TileLayerSettings with the opacity set.
|
|
1878
|
+
*/
|
|
1816
1879
|
TileLayerSettings.prototype.setOpacity = function (opacity) {
|
|
1817
1880
|
return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { opacity: opacity }));
|
|
1818
1881
|
};
|
|
1882
|
+
/**
|
|
1883
|
+
* Sets the projection for the tile layer settings.
|
|
1884
|
+
*
|
|
1885
|
+
* @param {string} projection - The desired projection for the tile layer settings.
|
|
1886
|
+
* @return {TileLayerSettings} - The updated tile layer settings with the new projection.
|
|
1887
|
+
*/
|
|
1819
1888
|
TileLayerSettings.prototype.setProjection = function (projection) {
|
|
1820
1889
|
return TileLayerSettings.copy(Object.assign(Object.assign({}, this), { projection: projection }));
|
|
1821
1890
|
};
|
|
1891
|
+
/**
|
|
1892
|
+
* Checks if the current instance of TileLayerSettings is equal to the given model.
|
|
1893
|
+
* @param {TileLayerSettings} model - The model to compare against.
|
|
1894
|
+
* @return {boolean} - True if all properties of the current instance matches the properties of the model;
|
|
1895
|
+
* otherwise, false.
|
|
1896
|
+
*/
|
|
1822
1897
|
TileLayerSettings.prototype.isSame = function (model) {
|
|
1823
1898
|
if (this.maxZoom !== model.maxZoom)
|
|
1824
1899
|
return false;
|
|
@@ -1894,13 +1969,6 @@
|
|
|
1894
1969
|
_this.onDestroy = function () { return _this.removeLayer(); };
|
|
1895
1970
|
return _this;
|
|
1896
1971
|
}
|
|
1897
|
-
TileLayerComponent.prototype.ngOnInit = function () {
|
|
1898
|
-
var _this = this;
|
|
1899
|
-
this.postboy
|
|
1900
|
-
.subscribe(MapRenderedEvent.ID)
|
|
1901
|
-
.pipe(operators.filter(function (m) { return !!m; }), operators.first())
|
|
1902
|
-
.subscribe(function (m) { return _this.initLayer(); });
|
|
1903
|
-
};
|
|
1904
1972
|
Object.defineProperty(TileLayerComponent.prototype, "settings", {
|
|
1905
1973
|
set: function (value) {
|
|
1906
1974
|
if (!value || this._settings.isSame(value))
|
|
@@ -1911,6 +1979,13 @@
|
|
|
1911
1979
|
enumerable: false,
|
|
1912
1980
|
configurable: true
|
|
1913
1981
|
});
|
|
1982
|
+
TileLayerComponent.prototype.ngOnInit = function () {
|
|
1983
|
+
var _this = this;
|
|
1984
|
+
this.postboy
|
|
1985
|
+
.subscribe(MapRenderedEvent.ID)
|
|
1986
|
+
.pipe(operators.filter(function (m) { return !!m; }), operators.first())
|
|
1987
|
+
.subscribe(function (m) { return _this.initLayer(); });
|
|
1988
|
+
};
|
|
1914
1989
|
TileLayerComponent.prototype.initLayer = function () {
|
|
1915
1990
|
this.removeLayer();
|
|
1916
1991
|
this.layer = this.factory.build(this._settings);
|
|
@@ -2017,17 +2092,24 @@
|
|
|
2017
2092
|
*/
|
|
2018
2093
|
this.zIndex = 1;
|
|
2019
2094
|
/**
|
|
2020
|
-
|
|
2095
|
+
The maximum view zoom level (inclusive) at which this layer will be visible.
|
|
2096
|
+
|
|
2097
|
+
@type {number}
|
|
2098
|
+
@default 19
|
|
2021
2099
|
*/
|
|
2022
2100
|
this.maxZoom = 19;
|
|
2023
2101
|
/**
|
|
2024
|
-
|
|
2102
|
+
The minimum view zoom level (exclusive) at which this layer will be visible.
|
|
2103
|
+
|
|
2104
|
+
@type {number}
|
|
2025
2105
|
*/
|
|
2026
2106
|
this.minZoom = 0;
|
|
2027
2107
|
}
|
|
2028
2108
|
/**
|
|
2029
|
-
*
|
|
2030
|
-
*
|
|
2109
|
+
* Copies the given FeatureLayerSettings object
|
|
2110
|
+
*
|
|
2111
|
+
* @param {FeatureLayerSettings} model - The FeatureLayerSettings object to be copied
|
|
2112
|
+
* @returns {FeatureLayerSettings} - A copy of the FeatureLayerSettings object
|
|
2031
2113
|
*/
|
|
2032
2114
|
FeatureLayerSettings.copy = function (model) {
|
|
2033
2115
|
var result = new FeatureLayerSettings();
|
|
@@ -2039,43 +2121,56 @@
|
|
|
2039
2121
|
return result;
|
|
2040
2122
|
};
|
|
2041
2123
|
/**
|
|
2042
|
-
|
|
2043
|
-
*
|
|
2124
|
+
* Sets the z-index value for the FeatureLayerSettings object.
|
|
2125
|
+
*
|
|
2126
|
+
* @param {number} zIndex - The new z-index value.
|
|
2127
|
+
* @return {FeatureLayerSettings} - The updated FeatureLayerSettings object.
|
|
2044
2128
|
*/
|
|
2045
2129
|
FeatureLayerSettings.prototype.setZIndex = function (zIndex) {
|
|
2046
2130
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex: zIndex }));
|
|
2047
2131
|
};
|
|
2048
2132
|
/**
|
|
2049
|
-
*
|
|
2050
|
-
*
|
|
2133
|
+
* Sets the name of the FeatureLayerSettings.
|
|
2134
|
+
*
|
|
2135
|
+
* @param {string} name - The name to set for the FeatureLayerSettings.
|
|
2136
|
+
*
|
|
2137
|
+
* @return {FeatureLayerSettings} - The updated FeatureLayerSettings object with the new name.
|
|
2051
2138
|
*/
|
|
2052
2139
|
FeatureLayerSettings.prototype.setName = function (name) {
|
|
2053
2140
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { name: name }));
|
|
2054
2141
|
};
|
|
2055
2142
|
/**
|
|
2056
|
-
*
|
|
2057
|
-
*
|
|
2143
|
+
* Sets the maximum zoom level for the FeatureLayerSettings.
|
|
2144
|
+
*
|
|
2145
|
+
* @param {number} maxZoom - The maximum zoom level.
|
|
2146
|
+
* @return {FeatureLayerSettings} - The updated FeatureLayerSettings object.
|
|
2058
2147
|
*/
|
|
2059
2148
|
FeatureLayerSettings.prototype.setMaxZoom = function (maxZoom) {
|
|
2060
2149
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom: maxZoom }));
|
|
2061
2150
|
};
|
|
2062
2151
|
/**
|
|
2063
|
-
*
|
|
2064
|
-
*
|
|
2152
|
+
* Sets the minimum zoom level for the feature layer.
|
|
2153
|
+
*
|
|
2154
|
+
* @param {number} minZoom The minimum zoom level to be set.
|
|
2155
|
+
* @returns {FeatureLayerSettings} The updated feature layer settings object.
|
|
2065
2156
|
*/
|
|
2066
2157
|
FeatureLayerSettings.prototype.setMinZoom = function (minZoom) {
|
|
2067
2158
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom: minZoom }));
|
|
2068
2159
|
};
|
|
2069
2160
|
/**
|
|
2070
|
-
*
|
|
2071
|
-
*
|
|
2161
|
+
* Sets the style for the FeatureLayerSettings object.
|
|
2162
|
+
*
|
|
2163
|
+
* @param {Style | StyleFunction} style - The new style to set. It can be either a Style object or a StyleFunction.
|
|
2164
|
+
* @return {FeatureLayerSettings} - The updated FeatureLayerSettings object with the new style.
|
|
2072
2165
|
*/
|
|
2073
2166
|
FeatureLayerSettings.prototype.setStyle = function (style) {
|
|
2074
2167
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { style: style }));
|
|
2075
2168
|
};
|
|
2076
2169
|
/**
|
|
2077
|
-
* Checks if the
|
|
2078
|
-
*
|
|
2170
|
+
* Checks if the given FeatureLayerSettings object is identical to the current object.
|
|
2171
|
+
*
|
|
2172
|
+
* @param {FeatureLayerSettings} model - The FeatureLayerSettings object to compare with.
|
|
2173
|
+
* @return {boolean} - Returns true if the given object is identical to the current object, otherwise false.
|
|
2079
2174
|
*/
|
|
2080
2175
|
FeatureLayerSettings.prototype.isSame = function (model) {
|
|
2081
2176
|
if (this.maxZoom !== model.maxZoom)
|
|
@@ -2131,13 +2226,6 @@
|
|
|
2131
2226
|
_this.onDestroy = function () { return _this.removeLayer(); };
|
|
2132
2227
|
return _this;
|
|
2133
2228
|
}
|
|
2134
|
-
FeatureLayerComponent.prototype.ngOnInit = function () {
|
|
2135
|
-
var _this = this;
|
|
2136
|
-
this.postboy
|
|
2137
|
-
.subscribe(MapRenderedEvent.ID)
|
|
2138
|
-
.pipe(operators.filter(function (m) { return !!m; }), operators.first())
|
|
2139
|
-
.subscribe(function (m) { return _this.initLayer(); });
|
|
2140
|
-
};
|
|
2141
2229
|
Object.defineProperty(FeatureLayerComponent.prototype, "settings", {
|
|
2142
2230
|
set: function (value) {
|
|
2143
2231
|
if (!value || this._settings.isSame(value))
|
|
@@ -2148,6 +2236,13 @@
|
|
|
2148
2236
|
enumerable: false,
|
|
2149
2237
|
configurable: true
|
|
2150
2238
|
});
|
|
2239
|
+
FeatureLayerComponent.prototype.ngOnInit = function () {
|
|
2240
|
+
var _this = this;
|
|
2241
|
+
this.postboy
|
|
2242
|
+
.subscribe(MapRenderedEvent.ID)
|
|
2243
|
+
.pipe(operators.filter(function (m) { return !!m; }), operators.first())
|
|
2244
|
+
.subscribe(function (m) { return _this.initLayer(); });
|
|
2245
|
+
};
|
|
2151
2246
|
FeatureLayerComponent.prototype.initLayer = function () {
|
|
2152
2247
|
this.removeLayer();
|
|
2153
2248
|
this.layer = this.factory.build(this._settings);
|
|
@@ -2177,12 +2272,34 @@
|
|
|
2177
2272
|
function ClusterLayerSettings() {
|
|
2178
2273
|
this.name = IdGenerator.get();
|
|
2179
2274
|
this.zIndex = 1;
|
|
2275
|
+
/**
|
|
2276
|
+
* The maximum view zoom level (inclusive) at which this layer will be visible.
|
|
2277
|
+
*
|
|
2278
|
+
* @type {number}
|
|
2279
|
+
* @default 19
|
|
2280
|
+
*/
|
|
2180
2281
|
this.maxZoom = 19;
|
|
2282
|
+
/**
|
|
2283
|
+
* The minimum view zoom level (exclusive) at which this layer will be visible.
|
|
2284
|
+
*
|
|
2285
|
+
* @type {number}
|
|
2286
|
+
*/
|
|
2181
2287
|
this.minZoom = 0;
|
|
2288
|
+
/**
|
|
2289
|
+
* Distance in pixels within which features will be clustered together.
|
|
2290
|
+
*
|
|
2291
|
+
* @type {number}
|
|
2292
|
+
*/
|
|
2182
2293
|
this.distance = 20;
|
|
2183
2294
|
this.bbox = false;
|
|
2184
2295
|
this.clusterCancel = 14;
|
|
2185
2296
|
}
|
|
2297
|
+
/**
|
|
2298
|
+
* Creates a copy of the given ClusterLayerSettings object.
|
|
2299
|
+
*
|
|
2300
|
+
* @param {ClusterLayerSettings} model - The ClusterLayerSettings object to be copied.
|
|
2301
|
+
* @returns {ClusterLayerSettings} - A new ClusterLayerSettings object that is a copy of the original object.
|
|
2302
|
+
*/
|
|
2186
2303
|
ClusterLayerSettings.copy = function (model) {
|
|
2187
2304
|
var result = new ClusterLayerSettings();
|
|
2188
2305
|
result.name = model.name;
|
|
@@ -2195,30 +2312,86 @@
|
|
|
2195
2312
|
result.style = model.style;
|
|
2196
2313
|
return result;
|
|
2197
2314
|
};
|
|
2315
|
+
/**
|
|
2316
|
+
* Set the z-index for the ClusterLayer.
|
|
2317
|
+
*
|
|
2318
|
+
* @param {number} zIndex - The new z-index for the ClusterLayer.
|
|
2319
|
+
* @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
|
|
2320
|
+
*/
|
|
2198
2321
|
ClusterLayerSettings.prototype.setZIndex = function (zIndex) {
|
|
2199
2322
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex: zIndex }));
|
|
2200
2323
|
};
|
|
2324
|
+
/**
|
|
2325
|
+
* Sets the distance value for ClusterLayerSettings.
|
|
2326
|
+
*
|
|
2327
|
+
* @param {number} distance - The distance value to be set.
|
|
2328
|
+
* @return {ClusterLayerSettings} - The modified ClusterLayerSettings object.
|
|
2329
|
+
*/
|
|
2201
2330
|
ClusterLayerSettings.prototype.setDistance = function (distance) {
|
|
2202
2331
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { distance: distance }));
|
|
2203
2332
|
};
|
|
2333
|
+
/**
|
|
2334
|
+
* Sets the name of the ClusterLayerSettings object.
|
|
2335
|
+
*
|
|
2336
|
+
* @param {string} name - The name to set for the ClusterLayerSettings.
|
|
2337
|
+
* @return {ClusterLayerSettings} - A new ClusterLayerSettings object with the updated name.
|
|
2338
|
+
*/
|
|
2204
2339
|
ClusterLayerSettings.prototype.setName = function (name) {
|
|
2205
2340
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { name: name }));
|
|
2206
2341
|
};
|
|
2342
|
+
/**
|
|
2343
|
+
* Sets the maximum zoom level for the Cluster Layer.
|
|
2344
|
+
*
|
|
2345
|
+
* @param {number} maxZoom - The maximum zoom level to be set.
|
|
2346
|
+
* @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
|
|
2347
|
+
*/
|
|
2207
2348
|
ClusterLayerSettings.prototype.setMaxZoom = function (maxZoom) {
|
|
2208
2349
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom: maxZoom }));
|
|
2209
2350
|
};
|
|
2351
|
+
/**
|
|
2352
|
+
* Sets the minimum zoom level for the ClusterLayerSettings.
|
|
2353
|
+
*
|
|
2354
|
+
* @param {number} minZoom - The minimum zoom level to set.
|
|
2355
|
+
* @return {ClusterLayerSettings} - The updated ClusterLayerSettings object.
|
|
2356
|
+
*/
|
|
2210
2357
|
ClusterLayerSettings.prototype.setMinZoom = function (minZoom) {
|
|
2211
2358
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom: minZoom }));
|
|
2212
2359
|
};
|
|
2360
|
+
/**
|
|
2361
|
+
* Sets the cluster cancel number for the ClusterLayerSettings.
|
|
2362
|
+
*
|
|
2363
|
+
* @param {number} clusterCancel - The new cluster cancel number.
|
|
2364
|
+
* @returns {ClusterLayerSettings} - The updated ClusterLayerSettings object.
|
|
2365
|
+
*/
|
|
2213
2366
|
ClusterLayerSettings.prototype.setClusterCancel = function (clusterCancel) {
|
|
2214
2367
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { clusterCancel: clusterCancel }));
|
|
2215
2368
|
};
|
|
2369
|
+
/**
|
|
2370
|
+
* Sets the value of 'bbox' property in the ClusterLayerSettings object.
|
|
2371
|
+
*
|
|
2372
|
+
* @param {boolean} bbox - A boolean value indicating whether to include bounding box calculation in the cluster layer settings.
|
|
2373
|
+
* @returns {ClusterLayerSettings} - The updated ClusterLayerSettings object with the newly set 'bbox' value.
|
|
2374
|
+
*/
|
|
2216
2375
|
ClusterLayerSettings.prototype.setBbox = function (bbox) {
|
|
2217
2376
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { bbox: bbox }));
|
|
2218
2377
|
};
|
|
2378
|
+
/**
|
|
2379
|
+
* Sets the style for the ClusterLayerSettings.
|
|
2380
|
+
*
|
|
2381
|
+
* @param {function} style - A function that takes an array of identified features as input and returns a Style or StyleFunction.
|
|
2382
|
+
*
|
|
2383
|
+
* @return {ClusterLayerSettings} - The updated ClusterLayerSettings object with the new style applied.
|
|
2384
|
+
*/
|
|
2219
2385
|
ClusterLayerSettings.prototype.setStyle = function (style) {
|
|
2220
2386
|
return ClusterLayerSettings.copy(Object.assign(Object.assign({}, this), { style: style }));
|
|
2221
2387
|
};
|
|
2388
|
+
/**
|
|
2389
|
+
* Checks if the current ClusterLayerSettings object is the same as the specified model.
|
|
2390
|
+
*
|
|
2391
|
+
* @param {ClusterLayerSettings} model - The model to compare with the current object.
|
|
2392
|
+
*
|
|
2393
|
+
* @return {boolean} - Returns true if the current ClusterLayerSettings object is the same as the specified model, otherwise false.
|
|
2394
|
+
*/
|
|
2222
2395
|
ClusterLayerSettings.prototype.isSame = function (model) {
|
|
2223
2396
|
if (this.maxZoom !== model.maxZoom)
|
|
2224
2397
|
return false;
|
|
@@ -2331,6 +2504,9 @@
|
|
|
2331
2504
|
}]
|
|
2332
2505
|
}] });
|
|
2333
2506
|
|
|
2507
|
+
/**
|
|
2508
|
+
* Represents a cluster layer component.
|
|
2509
|
+
*/
|
|
2334
2510
|
var ClusterLayerComponent = /** @class */ (function (_super) {
|
|
2335
2511
|
__extends(ClusterLayerComponent, _super);
|
|
2336
2512
|
function ClusterLayerComponent(postboy, factory) {
|
|
@@ -2342,14 +2518,12 @@
|
|
|
2342
2518
|
_this.onDestroy = function () { return _this.removeLayer(); };
|
|
2343
2519
|
return _this;
|
|
2344
2520
|
}
|
|
2345
|
-
ClusterLayerComponent.prototype.ngOnInit = function () {
|
|
2346
|
-
var _this = this;
|
|
2347
|
-
this.postboy
|
|
2348
|
-
.subscribe(MapRenderedEvent.ID)
|
|
2349
|
-
.pipe(operators.filter(function (m) { return !!m; }), operators.first())
|
|
2350
|
-
.subscribe(function (m) { return _this.initLayer(); });
|
|
2351
|
-
};
|
|
2352
2521
|
Object.defineProperty(ClusterLayerComponent.prototype, "settings", {
|
|
2522
|
+
/**
|
|
2523
|
+
* Sets the settings for the cluster layer.
|
|
2524
|
+
*
|
|
2525
|
+
* @param {ClusterLayerSettings | undefined} value - The settings for the cluster layer.
|
|
2526
|
+
*/
|
|
2353
2527
|
set: function (value) {
|
|
2354
2528
|
if (!value || this._settings.isSame(value))
|
|
2355
2529
|
return;
|
|
@@ -2359,6 +2533,13 @@
|
|
|
2359
2533
|
enumerable: false,
|
|
2360
2534
|
configurable: true
|
|
2361
2535
|
});
|
|
2536
|
+
ClusterLayerComponent.prototype.ngOnInit = function () {
|
|
2537
|
+
var _this = this;
|
|
2538
|
+
this.postboy
|
|
2539
|
+
.subscribe(MapRenderedEvent.ID)
|
|
2540
|
+
.pipe(operators.filter(function (m) { return !!m; }), operators.first())
|
|
2541
|
+
.subscribe(function (m) { return _this.initLayer(); });
|
|
2542
|
+
};
|
|
2362
2543
|
ClusterLayerComponent.prototype.initLayer = function () {
|
|
2363
2544
|
this.removeLayer();
|
|
2364
2545
|
this.manager = this.factory.build(this._settings, this.postboy);
|
|
@@ -2421,8 +2602,8 @@
|
|
|
2421
2602
|
_this.registrator = registrator;
|
|
2422
2603
|
_this.detector = detector;
|
|
2423
2604
|
_this.osmUrl = '';
|
|
2424
|
-
_this._settings = new MapSettings();
|
|
2425
2605
|
_this.drawingLayerSettings = new FeatureLayerSettings().setName(MapConstants.DrawingLayerId);
|
|
2606
|
+
_this._settings = new MapSettings();
|
|
2426
2607
|
_this.onDestroy = function () {
|
|
2427
2608
|
_this.registrator.down();
|
|
2428
2609
|
};
|
|
@@ -2497,6 +2678,11 @@
|
|
|
2497
2678
|
type: i0.Input
|
|
2498
2679
|
}] } });
|
|
2499
2680
|
|
|
2681
|
+
/**
|
|
2682
|
+
* MarkersComponent is a component that displays markers on a map.
|
|
2683
|
+
* It listens for changes in the `markers` input property and
|
|
2684
|
+
* automatically puts the markers on the map using the MapPostboyService.
|
|
2685
|
+
*/
|
|
2500
2686
|
var MarkersComponent = /** @class */ (function (_super) {
|
|
2501
2687
|
__extends(MarkersComponent, _super);
|
|
2502
2688
|
function MarkersComponent(postboy) {
|
|
@@ -2507,6 +2693,11 @@
|
|
|
2507
2693
|
return _this;
|
|
2508
2694
|
}
|
|
2509
2695
|
Object.defineProperty(MarkersComponent.prototype, "markers", {
|
|
2696
|
+
/**
|
|
2697
|
+
* Sets the markers property.
|
|
2698
|
+
*
|
|
2699
|
+
* @param {MarkerModel[]} value - The array of MarkerModel objects to set as markers.
|
|
2700
|
+
*/
|
|
2510
2701
|
set: function (value) {
|
|
2511
2702
|
this._markers = value !== null && value !== void 0 ? value : [];
|
|
2512
2703
|
this.putMarkers();
|
|
@@ -2580,13 +2771,8 @@
|
|
|
2580
2771
|
var _this = _super.call(this) || this;
|
|
2581
2772
|
_this.postboy = postboy;
|
|
2582
2773
|
_this.detector = detector;
|
|
2583
|
-
_this._settings = new TooltipSettings();
|
|
2584
2774
|
_this.show = false;
|
|
2585
|
-
_this.
|
|
2586
|
-
var _a;
|
|
2587
|
-
!!_this.overlay && ((_a = _this.map) === null || _a === void 0 ? void 0 : _a.removeOverlay(_this.overlay));
|
|
2588
|
-
_this.show = false;
|
|
2589
|
-
};
|
|
2775
|
+
_this._settings = new TooltipSettings();
|
|
2590
2776
|
_this.options = function (coordinates) {
|
|
2591
2777
|
var _a;
|
|
2592
2778
|
return {
|
|
@@ -2596,6 +2782,11 @@
|
|
|
2596
2782
|
position: coordinates,
|
|
2597
2783
|
};
|
|
2598
2784
|
};
|
|
2785
|
+
_this.removeOverlay = function () {
|
|
2786
|
+
var _a;
|
|
2787
|
+
!!_this.overlay && ((_a = _this.map) === null || _a === void 0 ? void 0 : _a.removeOverlay(_this.overlay));
|
|
2788
|
+
_this.show = false;
|
|
2789
|
+
};
|
|
2599
2790
|
return _this;
|
|
2600
2791
|
}
|
|
2601
2792
|
Object.defineProperty(TooltipComponent.prototype, "settings", {
|
|
@@ -2613,6 +2804,14 @@
|
|
|
2613
2804
|
this.subs.push(this.observeMapClick());
|
|
2614
2805
|
this.subs.push(this.observeClose());
|
|
2615
2806
|
};
|
|
2807
|
+
TooltipComponent.prototype.addOverlay = function (coordinates) {
|
|
2808
|
+
var _a;
|
|
2809
|
+
this.removeOverlay();
|
|
2810
|
+
this.overlay = new Overlay__default["default"](this.options(coordinates));
|
|
2811
|
+
(_a = this.map) === null || _a === void 0 ? void 0 : _a.addOverlay(this.overlay);
|
|
2812
|
+
this.show = true;
|
|
2813
|
+
this.detector.detectChanges();
|
|
2814
|
+
};
|
|
2616
2815
|
TooltipComponent.prototype.observeMapClick = function () {
|
|
2617
2816
|
var _this = this;
|
|
2618
2817
|
return this.postboy.subscribe(MapClickEvent.ID).subscribe(function (ev) {
|
|
@@ -2632,14 +2831,6 @@
|
|
|
2632
2831
|
_this.map = m.map;
|
|
2633
2832
|
});
|
|
2634
2833
|
};
|
|
2635
|
-
TooltipComponent.prototype.addOverlay = function (coordinates) {
|
|
2636
|
-
var _a;
|
|
2637
|
-
this.removeOverlay();
|
|
2638
|
-
this.overlay = new Overlay__default["default"](this.options(coordinates));
|
|
2639
|
-
(_a = this.map) === null || _a === void 0 ? void 0 : _a.addOverlay(this.overlay);
|
|
2640
|
-
this.show = true;
|
|
2641
|
-
this.detector.detectChanges();
|
|
2642
|
-
};
|
|
2643
2834
|
return TooltipComponent;
|
|
2644
2835
|
}(DestructibleComponent));
|
|
2645
2836
|
TooltipComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TooltipComponent, deps: [{ token: MapPostboyService }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
@@ -2659,6 +2850,11 @@
|
|
|
2659
2850
|
type: i0.Input
|
|
2660
2851
|
}] } });
|
|
2661
2852
|
|
|
2853
|
+
/**
|
|
2854
|
+
* Component for rendering polygons on a map.
|
|
2855
|
+
* It listens for changes in the `polygons` input property and
|
|
2856
|
+
* automatically puts the polygons on the map using the MapPostboyService.
|
|
2857
|
+
*/
|
|
2662
2858
|
var PolygonsComponent = /** @class */ (function (_super) {
|
|
2663
2859
|
__extends(PolygonsComponent, _super);
|
|
2664
2860
|
function PolygonsComponent(postboy) {
|
|
@@ -2669,6 +2865,11 @@
|
|
|
2669
2865
|
return _this;
|
|
2670
2866
|
}
|
|
2671
2867
|
Object.defineProperty(PolygonsComponent.prototype, "polygons", {
|
|
2868
|
+
/**
|
|
2869
|
+
* Sets the value of polygons.
|
|
2870
|
+
*
|
|
2871
|
+
* @param {PolygonModel[]} value - The new value for polygons.
|
|
2872
|
+
*/
|
|
2672
2873
|
set: function (value) {
|
|
2673
2874
|
this._polygons = value !== null && value !== void 0 ? value : [];
|
|
2674
2875
|
this.putPolygons();
|
|
@@ -2706,14 +2907,47 @@
|
|
|
2706
2907
|
type: i0.Input
|
|
2707
2908
|
}] } });
|
|
2708
2909
|
|
|
2910
|
+
/**
|
|
2911
|
+
* Represents the settings for a zoom control.
|
|
2912
|
+
*/
|
|
2709
2913
|
var ZoomControlSettings = /** @class */ (function () {
|
|
2710
2914
|
function ZoomControlSettings() {
|
|
2915
|
+
/**
|
|
2916
|
+
* The CSS class name of the control element.
|
|
2917
|
+
*
|
|
2918
|
+
* @type {string}
|
|
2919
|
+
*/
|
|
2711
2920
|
this.controlClass = 'ol-zoom';
|
|
2921
|
+
/**
|
|
2922
|
+
* The CSS class name for zoom in button.
|
|
2923
|
+
* @type {string}
|
|
2924
|
+
*/
|
|
2712
2925
|
this.zoomInClass = 'ol-zoom-in';
|
|
2926
|
+
/**
|
|
2927
|
+
* The CSS class name for the zoom out button element.
|
|
2928
|
+
*
|
|
2929
|
+
* @type {string}
|
|
2930
|
+
*/
|
|
2713
2931
|
this.zoomOutClass = 'ol-zoom-out';
|
|
2932
|
+
/**
|
|
2933
|
+
* The label for the zoom in action.
|
|
2934
|
+
*
|
|
2935
|
+
* @type {string}
|
|
2936
|
+
*/
|
|
2714
2937
|
this.zoomInLabel = 'Zoom In';
|
|
2938
|
+
/**
|
|
2939
|
+
* The label for the zoom out control.
|
|
2940
|
+
*
|
|
2941
|
+
* @type {string}
|
|
2942
|
+
*/
|
|
2715
2943
|
this.zoomOutLabel = 'Zoom Out';
|
|
2716
2944
|
}
|
|
2945
|
+
/**
|
|
2946
|
+
* Copies the provided ZoomControlSettings object.
|
|
2947
|
+
*
|
|
2948
|
+
* @param {ZoomControlSettings} model - The ZoomControlSettings object to be copied.
|
|
2949
|
+
* @return {ZoomControlSettings} - The copied ZoomControlSettings object.
|
|
2950
|
+
*/
|
|
2717
2951
|
ZoomControlSettings.copy = function (model) {
|
|
2718
2952
|
var result = new ZoomControlSettings();
|
|
2719
2953
|
result.controlClass = model.controlClass;
|
|
@@ -2723,6 +2957,13 @@
|
|
|
2723
2957
|
result.zoomOutLabel = model.zoomOutLabel;
|
|
2724
2958
|
return result;
|
|
2725
2959
|
};
|
|
2960
|
+
/**
|
|
2961
|
+
* Checks if the current ZoomControlSettings object is equal to the given model.
|
|
2962
|
+
*
|
|
2963
|
+
* @param {ZoomControlSettings} model - The ZoomControlSettings object to compare with.
|
|
2964
|
+
*
|
|
2965
|
+
* @return {boolean} - true if the current object is equal to the given model, false otherwise.
|
|
2966
|
+
*/
|
|
2726
2967
|
ZoomControlSettings.prototype.isSame = function (model) {
|
|
2727
2968
|
if (this.zoomInClass !== model.zoomInClass)
|
|
2728
2969
|
return false;
|
|
@@ -2736,24 +2977,61 @@
|
|
|
2736
2977
|
return false;
|
|
2737
2978
|
return true;
|
|
2738
2979
|
};
|
|
2980
|
+
/**
|
|
2981
|
+
* Sets the zoom in label of the Zoom Control Settings.
|
|
2982
|
+
*
|
|
2983
|
+
* @param {string} zoomInLabel - The label for the zoom in button.
|
|
2984
|
+
* @return {ZoomControlSettings} - The new Zoom Control Settings object with the updated zoom in label.
|
|
2985
|
+
*/
|
|
2739
2986
|
ZoomControlSettings.prototype.setZoomInLabel = function (zoomInLabel) {
|
|
2740
2987
|
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomInLabel: zoomInLabel }));
|
|
2741
2988
|
};
|
|
2989
|
+
/**
|
|
2990
|
+
* Sets the zoomOutClass property of the ZoomControlSettings object.
|
|
2991
|
+
*
|
|
2992
|
+
* @param {string} zoomOutClass - The CSS class to be assigned to the zoom out button.
|
|
2993
|
+
* @return {ZoomControlSettings} - The updated ZoomControlSettings object with the new zoomOutClass value.
|
|
2994
|
+
*/
|
|
2742
2995
|
ZoomControlSettings.prototype.setZoomOutClass = function (zoomOutClass) {
|
|
2743
2996
|
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomOutClass: zoomOutClass }));
|
|
2744
2997
|
};
|
|
2998
|
+
/**
|
|
2999
|
+
* Sets the zoom in class for the zoom control settings.
|
|
3000
|
+
*
|
|
3001
|
+
* @param {string} zoomInClass - The new zoom in class to be set.
|
|
3002
|
+
* @return {ZoomControlSettings} - The updated zoom control settings.
|
|
3003
|
+
*/
|
|
2745
3004
|
ZoomControlSettings.prototype.setZoomInClass = function (zoomInClass) {
|
|
2746
3005
|
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomInClass: zoomInClass }));
|
|
2747
3006
|
};
|
|
3007
|
+
/**
|
|
3008
|
+
* Set the label for the zoom out control.
|
|
3009
|
+
*
|
|
3010
|
+
* @param {string} zoomOutLabel - The label for the zoom out control.
|
|
3011
|
+
* @returns {ZoomControlSettings} - The updated zoom control settings.
|
|
3012
|
+
*/
|
|
2748
3013
|
ZoomControlSettings.prototype.setZoomOutLabel = function (zoomOutLabel) {
|
|
2749
3014
|
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomOutLabel: zoomOutLabel }));
|
|
2750
3015
|
};
|
|
3016
|
+
/**
|
|
3017
|
+
* Sets the control class for the ZoomControlSettings.
|
|
3018
|
+
*
|
|
3019
|
+
* @param {string} controlClass - The class name of the control to be set.
|
|
3020
|
+
*
|
|
3021
|
+
* @return {ZoomControlSettings} - The modified ZoomControlSettings object.
|
|
3022
|
+
*/
|
|
2751
3023
|
ZoomControlSettings.prototype.setControlClass = function (controlClass) {
|
|
2752
3024
|
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { controlClass: controlClass }));
|
|
2753
3025
|
};
|
|
2754
3026
|
return ZoomControlSettings;
|
|
2755
3027
|
}());
|
|
2756
3028
|
|
|
3029
|
+
/**
|
|
3030
|
+
* @class
|
|
3031
|
+
* @classdesc Represents a component for the Zoom control on a map.
|
|
3032
|
+
* @extends DestructibleComponent
|
|
3033
|
+
* @implements OnInit
|
|
3034
|
+
*/
|
|
2757
3035
|
var MapControlZoomComponent = /** @class */ (function (_super) {
|
|
2758
3036
|
__extends(MapControlZoomComponent, _super);
|
|
2759
3037
|
function MapControlZoomComponent(postboy) {
|
|
@@ -2767,6 +3045,17 @@
|
|
|
2767
3045
|
return _this;
|
|
2768
3046
|
}
|
|
2769
3047
|
Object.defineProperty(MapControlZoomComponent.prototype, "settings", {
|
|
3048
|
+
/**
|
|
3049
|
+
* Sets the settings for the Zoom Control.
|
|
3050
|
+
*
|
|
3051
|
+
* @param {ZoomControlSettings | undefined} value - The new settings for the Zoom Control.
|
|
3052
|
+
*
|
|
3053
|
+
* @description
|
|
3054
|
+
* This method sets the settings for the Zoom Control. It takes a parameter `value` which should be an object of type `ZoomControlSettings` or `undefined`.
|
|
3055
|
+
*
|
|
3056
|
+
* If the `value` is `undefined` or the same as the current settings, the method will return without making any changes.
|
|
3057
|
+
*
|
|
3058
|
+
*/
|
|
2770
3059
|
set: function (value) {
|
|
2771
3060
|
if (!value || this._settings.isSame(value))
|
|
2772
3061
|
return;
|
|
@@ -2861,9 +3150,19 @@
|
|
|
2861
3150
|
}]
|
|
2862
3151
|
}] });
|
|
2863
3152
|
|
|
3153
|
+
/**
|
|
3154
|
+
* Helper class to create and modify marker styles.
|
|
3155
|
+
*/
|
|
2864
3156
|
var MarkerStyleHelper = /** @class */ (function () {
|
|
2865
3157
|
function MarkerStyleHelper() {
|
|
2866
3158
|
}
|
|
3159
|
+
/**
|
|
3160
|
+
* Creates a new Style object from an SVG.
|
|
3161
|
+
* @param {string} svg - The SVG string.
|
|
3162
|
+
* @param {Array<number>} [size=[30, 30]] - The size of the icon image.
|
|
3163
|
+
* @param {number} [zIndex=400] - The zIndex of the style.
|
|
3164
|
+
* @returns {Style} A new Style object.
|
|
3165
|
+
*/
|
|
2867
3166
|
MarkerStyleHelper.fromSvg = function (svg, size, zIndex) {
|
|
2868
3167
|
if (size === void 0) { size = [30, 30]; }
|
|
2869
3168
|
if (zIndex === void 0) { zIndex = 400; }
|
|
@@ -2877,6 +3176,15 @@
|
|
|
2877
3176
|
zIndex: zIndex,
|
|
2878
3177
|
});
|
|
2879
3178
|
};
|
|
3179
|
+
/**
|
|
3180
|
+
* Returns a Style object with a circle style.
|
|
3181
|
+
*
|
|
3182
|
+
* @param {number} radius - The radius of the circle.
|
|
3183
|
+
* @param {string} fill - The fill color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
|
|
3184
|
+
* @param {string} strokeColor - The stroke color of the circle. Format: '#RRGGBB' or 'rgba(R, G, B, A)'.
|
|
3185
|
+
* @param {number} [strokeWidth=1] - The width of the stroke. Default is 1.
|
|
3186
|
+
* @returns {Style} - A Style object with a Circle image.
|
|
3187
|
+
*/
|
|
2880
3188
|
MarkerStyleHelper.circle = function (radius, fill, strokeColor, strokeWidth) {
|
|
2881
3189
|
if (strokeWidth === void 0) { strokeWidth = 1; }
|
|
2882
3190
|
return new Style__default["default"]({
|
|
@@ -2887,6 +3195,13 @@
|
|
|
2887
3195
|
}),
|
|
2888
3196
|
});
|
|
2889
3197
|
};
|
|
3198
|
+
/**
|
|
3199
|
+
* Applies the given Text to the provided Style.
|
|
3200
|
+
*
|
|
3201
|
+
* @param {Style} style - The Style to modify.
|
|
3202
|
+
* @param {Text} text - The Text to apply to the Style.
|
|
3203
|
+
* @return {Style} - The modified Style with the applied Text.
|
|
3204
|
+
*/
|
|
2890
3205
|
MarkerStyleHelper.withText = function (style, text) {
|
|
2891
3206
|
style.setText(text);
|
|
2892
3207
|
return style;
|
|
@@ -2894,9 +3209,21 @@
|
|
|
2894
3209
|
return MarkerStyleHelper;
|
|
2895
3210
|
}());
|
|
2896
3211
|
|
|
3212
|
+
/**
|
|
3213
|
+
* A helper class for creating polygon styles.
|
|
3214
|
+
* @class
|
|
3215
|
+
*/
|
|
2897
3216
|
var PolygonStyleHelper = /** @class */ (function () {
|
|
2898
3217
|
function PolygonStyleHelper() {
|
|
2899
3218
|
}
|
|
3219
|
+
/**
|
|
3220
|
+
* Creates a Style object with the given fill color, stroke color, and stroke width.
|
|
3221
|
+
*
|
|
3222
|
+
* @param {string} fill - The fill color in hexadecimal or RGB format.
|
|
3223
|
+
* @param {string} stroke - The stroke color in hexadecimal or RGB format.
|
|
3224
|
+
* @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
|
|
3225
|
+
* @return {Style} The created Style object.
|
|
3226
|
+
*/
|
|
2900
3227
|
PolygonStyleHelper.simple = function (fill, stroke, strokeWidth) {
|
|
2901
3228
|
if (strokeWidth === void 0) { strokeWidth = 1; }
|
|
2902
3229
|
return new Style__default["default"]({
|
|
@@ -2909,6 +3236,15 @@
|
|
|
2909
3236
|
}),
|
|
2910
3237
|
});
|
|
2911
3238
|
};
|
|
3239
|
+
/**
|
|
3240
|
+
* Creates a new Style object with the given fill, stroke, stroke width, and pin radius.
|
|
3241
|
+
*
|
|
3242
|
+
* @param {string} fill - The color to use for the fill of the style.
|
|
3243
|
+
* @param {string} stroke - The color to use for the stroke of the style.
|
|
3244
|
+
* @param {number} [strokeWidth=1] - The width of the stroke. Defaults to 1.
|
|
3245
|
+
* @param {number} [pinRadius=5] - The radius of the circle used as the image for the style. Defaults to 5.
|
|
3246
|
+
* @returns {Style} - The newly created Style object.
|
|
3247
|
+
*/
|
|
2912
3248
|
PolygonStyleHelper.edit = function (fill, stroke, strokeWidth, pinRadius) {
|
|
2913
3249
|
if (strokeWidth === void 0) { strokeWidth = 1; }
|
|
2914
3250
|
if (pinRadius === void 0) { pinRadius = 5; }
|
|
@@ -2931,9 +3267,20 @@
|
|
|
2931
3267
|
return PolygonStyleHelper;
|
|
2932
3268
|
}());
|
|
2933
3269
|
|
|
3270
|
+
/**
|
|
3271
|
+
* Helper class for creating text styles.
|
|
3272
|
+
*/
|
|
2934
3273
|
var TextStyleHelper = /** @class */ (function () {
|
|
2935
3274
|
function TextStyleHelper() {
|
|
2936
3275
|
}
|
|
3276
|
+
/**
|
|
3277
|
+
* Creates a new instance of the Text class with the specified properties.
|
|
3278
|
+
*
|
|
3279
|
+
* @param {string} text - The text content of the Text object.
|
|
3280
|
+
* @param {string} font - The font style of the Text object.
|
|
3281
|
+
* @param {string} color - The color of the Text object.
|
|
3282
|
+
* @return {Text} A new instance of the Text class.
|
|
3283
|
+
*/
|
|
2937
3284
|
TextStyleHelper.get = function (text, font, color) {
|
|
2938
3285
|
return new style.Text({
|
|
2939
3286
|
text: text,
|
|
@@ -2947,6 +3294,9 @@
|
|
|
2947
3294
|
return TextStyleHelper;
|
|
2948
3295
|
}());
|
|
2949
3296
|
|
|
3297
|
+
/**
|
|
3298
|
+
* A helper class for converting and stringify features.
|
|
3299
|
+
*/
|
|
2950
3300
|
var StringifyFeatureHelper = /** @class */ (function () {
|
|
2951
3301
|
function StringifyFeatureHelper() {
|
|
2952
3302
|
}
|
|
@@ -2956,29 +3306,30 @@
|
|
|
2956
3306
|
? new format.GeoJSON().writeFeature(feature)
|
|
2957
3307
|
: new format.WKT().writeFeature(feature);
|
|
2958
3308
|
};
|
|
3309
|
+
/**
|
|
3310
|
+
* Creates a polygon feature representing a circle based on a given feature with a circle geometry.
|
|
3311
|
+
*
|
|
3312
|
+
* @param {Feature<Geometry>} feature - The input feature with a circle geometry.
|
|
3313
|
+
* @param {FeatureOutputFormat} format - The format for outputting the polygon feature. (default: FeatureOutputFormat.GeoJson)
|
|
3314
|
+
*
|
|
3315
|
+
* @return {string} - The string representation of the polygon feature.
|
|
3316
|
+
*/
|
|
2959
3317
|
StringifyFeatureHelper.circle = function (feature, format) {
|
|
2960
3318
|
if (format === void 0) { format = exports.FeatureOutputFormat.GeoJson; }
|
|
2961
|
-
// const clone = feature.clone();
|
|
2962
|
-
// clone.setGeometry(fromCircle(feature.getGeometry()! as Circle));
|
|
2963
|
-
var tetemp = feature.getGeometryName();
|
|
2964
3319
|
var circle = feature.getGeometry();
|
|
2965
|
-
|
|
2966
|
-
var
|
|
2967
|
-
var
|
|
2968
|
-
var aaa = __spreadArray(__spreadArray([], __read(proj.transform([ttt[0], ttt[1]], 'EPSG:4326', 'EPSG:3857'))), __read(proj.transform([ttt[2], ttt[3]], 'EPSG:4326', 'EPSG:3857')));
|
|
2969
|
-
var radius = (aaa[2] - aaa[0]) / 2;
|
|
2970
|
-
var radius2 = new geom.LineString([circle.getCenter(), eastPoint]).getLength();
|
|
3320
|
+
var ext = feature.getGeometry().getExtent();
|
|
3321
|
+
var coords = __spreadArray(__spreadArray([], __read(proj.transform([ext[0], ext[1]], 'EPSG:4326', 'EPSG:3857'))), __read(proj.transform([ext[2], ext[3]], 'EPSG:4326', 'EPSG:3857')));
|
|
3322
|
+
var radius = (coords[2] - coords[0]) / 2;
|
|
2971
3323
|
var polygonGeom = new Polygon__default["default"](StringifyFeatureHelper.drawCircle(circle.getCenter(), radius));
|
|
2972
|
-
// var edgeCoordinate = [circle.getCenter()[0] + radius, circle.getCenter()[1]];
|
|
2973
|
-
// var wgs84Sphere = new Sphere(6378137);
|
|
2974
3324
|
return StringifyFeatureHelper.polygon(new ol.Feature(polygonGeom), format);
|
|
2975
|
-
// const rad = circle.getRadius();
|
|
2976
|
-
// const degrees = 180 / Math.PI; // radians to degrees
|
|
2977
|
-
// const radians = Math.PI / 180; // degrees to radians
|
|
2978
|
-
// const rlat = rad * degrees * 1000;
|
|
2979
|
-
// const rlng = rad * radians;
|
|
2980
|
-
// return StringifyFeatureHelper.polygon(new Feature<Geometry>(circular(circle.getCenter(),circle.getRadius() * METERS_PER_UNIT)), format);
|
|
2981
3325
|
};
|
|
3326
|
+
/**
|
|
3327
|
+
* Draw a circle based on a center point and radius.
|
|
3328
|
+
*
|
|
3329
|
+
* @param {number[]} point - The center point coordinates in EPSG:4326 format.
|
|
3330
|
+
* @param {number} radius - The radius of the circle in meters.
|
|
3331
|
+
* @return {Coordinate[][]} - The coordinates of the circle boundary in EPSG:4326 format.
|
|
3332
|
+
*/
|
|
2982
3333
|
StringifyFeatureHelper.drawCircle = function (point, radius) {
|
|
2983
3334
|
var tetetemp = proj.transform(point, 'EPSG:4326', 'EPSG:3857');
|
|
2984
3335
|
// const tetetemp = point;
|