@artstesh/maps 5.1.1 → 5.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm2022/map/map-plate/features/markers/markers.component.mjs +3 -3
- package/dist/esm2022/map/map-plate/features/polygons/polygons.component.mjs +2 -2
- package/dist/esm2022/map/map-plate/layers/feature-layer/feature-layer.settings.mjs +47 -1
- package/dist/esm2022/map/services/map-management.service.mjs +2 -2
- package/dist/esm2022/src/map/map-plate/features/markers/markers.component.mjs +3 -3
- package/dist/esm2022/src/map/map-plate/features/polygons/polygons.component.mjs +2 -2
- package/dist/esm2022/src/map/map-plate/layers/feature-layer/feature-layer.settings.mjs +47 -1
- package/dist/esm2022/src/map/services/map-management.service.mjs +2 -2
- package/dist/fesm2022/maps-components-src-map.mjs +50 -4
- package/dist/fesm2022/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2022/maps-components.mjs +50 -4
- package/dist/fesm2022/maps-components.mjs.map +1 -1
- package/dist/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +46 -0
- package/dist/src/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +46 -0
- package/package.json +1 -1
|
@@ -638,7 +638,7 @@ class MapManagementService {
|
|
|
638
638
|
if (!!source['getSource'])
|
|
639
639
|
source = source?.getSource();
|
|
640
640
|
source?.clear();
|
|
641
|
-
source?.addFeatures(c.features);
|
|
641
|
+
!!c.features?.length && source?.addFeatures(c.features);
|
|
642
642
|
});
|
|
643
643
|
}
|
|
644
644
|
observeRemoveLayer() {
|
|
@@ -1175,12 +1175,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1175
1175
|
type: Input
|
|
1176
1176
|
}] } });
|
|
1177
1177
|
|
|
1178
|
+
/**
|
|
1179
|
+
* A layer that is responsible for showing and styling main features on the map, such as markers and polygons
|
|
1180
|
+
*/
|
|
1178
1181
|
class FeatureLayerSettings {
|
|
1182
|
+
/**
|
|
1183
|
+
* The identifier of the field, it is autogenerated by default, but can be set manually
|
|
1184
|
+
*/
|
|
1179
1185
|
name = IdGenerator.get();
|
|
1186
|
+
/**
|
|
1187
|
+
* The priority of showing - layers with higher zIndex cover others in case of collisions
|
|
1188
|
+
*/
|
|
1180
1189
|
zIndex = 1;
|
|
1190
|
+
/**
|
|
1191
|
+
* The maximum zoom at which the layer is visible. 19 by default
|
|
1192
|
+
*/
|
|
1181
1193
|
maxZoom = 19;
|
|
1194
|
+
/**
|
|
1195
|
+
* The minimum zoom at which the layer is visible. 0 by default
|
|
1196
|
+
*/
|
|
1182
1197
|
minZoom = 0;
|
|
1198
|
+
/**
|
|
1199
|
+
* The styling definition of layer's features. The easiest way is to use {@link PolygonStyleHelper},{@link MarkerStyleHelper}
|
|
1200
|
+
*/
|
|
1183
1201
|
style;
|
|
1202
|
+
/**
|
|
1203
|
+
* Creates a clone of the existing settings
|
|
1204
|
+
* @param model
|
|
1205
|
+
*/
|
|
1184
1206
|
static copy(model) {
|
|
1185
1207
|
const result = new FeatureLayerSettings();
|
|
1186
1208
|
result.name = model.name;
|
|
@@ -1190,21 +1212,45 @@ class FeatureLayerSettings {
|
|
|
1190
1212
|
result.style = model.style;
|
|
1191
1213
|
return result;
|
|
1192
1214
|
}
|
|
1215
|
+
/**
|
|
1216
|
+
Setter for {@link FeatureLayerSettings.zIndex}
|
|
1217
|
+
* @param zIndex
|
|
1218
|
+
*/
|
|
1193
1219
|
setZIndex(zIndex) {
|
|
1194
1220
|
return FeatureLayerSettings.copy({ ...this, zIndex });
|
|
1195
1221
|
}
|
|
1222
|
+
/**
|
|
1223
|
+
* Setter for {@link FeatureLayerSettings.name}
|
|
1224
|
+
* @param name
|
|
1225
|
+
*/
|
|
1196
1226
|
setName(name) {
|
|
1197
1227
|
return FeatureLayerSettings.copy({ ...this, name });
|
|
1198
1228
|
}
|
|
1229
|
+
/**
|
|
1230
|
+
* Setter for {@link FeatureLayerSettings.maxZoom}
|
|
1231
|
+
* @param maxZoom
|
|
1232
|
+
*/
|
|
1199
1233
|
setMaxZoom(maxZoom) {
|
|
1200
1234
|
return FeatureLayerSettings.copy({ ...this, maxZoom });
|
|
1201
1235
|
}
|
|
1236
|
+
/**
|
|
1237
|
+
* Setter for {@link FeatureLayerSettings.minZoom}
|
|
1238
|
+
* @param minZoom
|
|
1239
|
+
*/
|
|
1202
1240
|
setMinZoom(minZoom) {
|
|
1203
1241
|
return FeatureLayerSettings.copy({ ...this, minZoom });
|
|
1204
1242
|
}
|
|
1243
|
+
/**
|
|
1244
|
+
* Setter for {@link FeatureLayerSettings.style}
|
|
1245
|
+
* @param style
|
|
1246
|
+
*/
|
|
1205
1247
|
setStyle(style) {
|
|
1206
1248
|
return FeatureLayerSettings.copy({ ...this, style });
|
|
1207
1249
|
}
|
|
1250
|
+
/**
|
|
1251
|
+
* Checks if the model has the same content
|
|
1252
|
+
* @param model - the object to compare
|
|
1253
|
+
*/
|
|
1208
1254
|
isSame(model) {
|
|
1209
1255
|
if (this.maxZoom !== model.maxZoom)
|
|
1210
1256
|
return false;
|
|
@@ -1585,7 +1631,7 @@ class MarkersComponent extends DestructibleComponent {
|
|
|
1585
1631
|
}
|
|
1586
1632
|
_markers = [];
|
|
1587
1633
|
set markers(value) {
|
|
1588
|
-
this._markers = value;
|
|
1634
|
+
this._markers = value ?? [];
|
|
1589
1635
|
this.putMarkers();
|
|
1590
1636
|
}
|
|
1591
1637
|
ngOnInit() {
|
|
@@ -1595,7 +1641,7 @@ class MarkersComponent extends DestructibleComponent {
|
|
|
1595
1641
|
.subscribe(() => this.putMarkers());
|
|
1596
1642
|
}
|
|
1597
1643
|
putMarkers() {
|
|
1598
|
-
if (!this._markers
|
|
1644
|
+
if (!this._markers)
|
|
1599
1645
|
return;
|
|
1600
1646
|
this.postboy.fire(new PlaceLayerFeaturesCommand(this.layerName, this._markers.map((m) => m.feature)));
|
|
1601
1647
|
}
|
|
@@ -1722,7 +1768,7 @@ class PolygonsComponent extends DestructibleComponent {
|
|
|
1722
1768
|
}
|
|
1723
1769
|
_polygons = [];
|
|
1724
1770
|
set polygons(value) {
|
|
1725
|
-
this._polygons = value;
|
|
1771
|
+
this._polygons = value ?? [];
|
|
1726
1772
|
this.putPolygons();
|
|
1727
1773
|
}
|
|
1728
1774
|
ngOnInit() {
|