@artstesh/maps 1.1.1 → 1.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/bundles/maps-components-src-map.umd.js +48 -6
- package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
- package/dist/bundles/maps-components.umd.js +48 -6
- package/dist/bundles/maps-components.umd.js.map +1 -1
- package/dist/esm2015/map/map-plate/features/markers/markers.component.js +3 -4
- package/dist/esm2015/map/map-plate/features/polygons/polygons.component.js +2 -2
- package/dist/esm2015/map/map-plate/layers/feature-layer/feature-layer.settings.js +44 -1
- package/dist/esm2015/map/services/map-management.service.js +3 -3
- package/dist/esm2015/src/map/map-plate/features/markers/markers.component.js +3 -4
- package/dist/esm2015/src/map/map-plate/features/polygons/polygons.component.js +2 -2
- package/dist/esm2015/src/map/map-plate/layers/feature-layer/feature-layer.settings.js +44 -1
- package/dist/esm2015/src/map/services/map-management.service.js +3 -3
- package/dist/fesm2015/maps-components-src-map.js +48 -6
- package/dist/fesm2015/maps-components-src-map.js.map +1 -1
- package/dist/fesm2015/maps-components.js +48 -6
- package/dist/fesm2015/maps-components.js.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
|
@@ -593,14 +593,14 @@ class MapManagementService {
|
|
|
593
593
|
}
|
|
594
594
|
observePlaceFeatures() {
|
|
595
595
|
this.postboy.subscribe(PlaceLayerFeaturesCommand.ID).subscribe((c) => {
|
|
596
|
-
var _a;
|
|
596
|
+
var _a, _b;
|
|
597
597
|
if (!this.layers.has(c.layer))
|
|
598
598
|
return;
|
|
599
599
|
let source = this.layers.take(c.layer).getSource();
|
|
600
600
|
if (!!source['getSource'])
|
|
601
601
|
source = (_a = source) === null || _a === void 0 ? void 0 : _a.getSource();
|
|
602
602
|
source === null || source === void 0 ? void 0 : source.clear();
|
|
603
|
-
source === null || source === void 0 ? void 0 : source.addFeatures(c.features);
|
|
603
|
+
!!((_b = c.features) === null || _b === void 0 ? void 0 : _b.length) && (source === null || source === void 0 ? void 0 : source.addFeatures(c.features));
|
|
604
604
|
});
|
|
605
605
|
}
|
|
606
606
|
observeRemoveLayer() {
|
|
@@ -1144,13 +1144,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1144
1144
|
type: Input
|
|
1145
1145
|
}] } });
|
|
1146
1146
|
|
|
1147
|
+
/**
|
|
1148
|
+
* A layer that is responsible for showing and styling main features on the map, such as markers and polygons
|
|
1149
|
+
*/
|
|
1147
1150
|
class FeatureLayerSettings {
|
|
1148
1151
|
constructor() {
|
|
1152
|
+
/**
|
|
1153
|
+
* The identifier of the field, it is autogenerated by default, but can be set manually
|
|
1154
|
+
*/
|
|
1149
1155
|
this.name = IdGenerator.get();
|
|
1156
|
+
/**
|
|
1157
|
+
* The priority of showing - layers with higher zIndex cover others in case of collisions
|
|
1158
|
+
*/
|
|
1150
1159
|
this.zIndex = 1;
|
|
1160
|
+
/**
|
|
1161
|
+
* The maximum zoom at which the layer is visible. 19 by default
|
|
1162
|
+
*/
|
|
1151
1163
|
this.maxZoom = 19;
|
|
1164
|
+
/**
|
|
1165
|
+
* The minimum zoom at which the layer is visible. 0 by default
|
|
1166
|
+
*/
|
|
1152
1167
|
this.minZoom = 0;
|
|
1153
1168
|
}
|
|
1169
|
+
/**
|
|
1170
|
+
* Creates a clone of the existing settings
|
|
1171
|
+
* @param model
|
|
1172
|
+
*/
|
|
1154
1173
|
static copy(model) {
|
|
1155
1174
|
const result = new FeatureLayerSettings();
|
|
1156
1175
|
result.name = model.name;
|
|
@@ -1160,21 +1179,45 @@ class FeatureLayerSettings {
|
|
|
1160
1179
|
result.style = model.style;
|
|
1161
1180
|
return result;
|
|
1162
1181
|
}
|
|
1182
|
+
/**
|
|
1183
|
+
Setter for {@link FeatureLayerSettings.zIndex}
|
|
1184
|
+
* @param zIndex
|
|
1185
|
+
*/
|
|
1163
1186
|
setZIndex(zIndex) {
|
|
1164
1187
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex }));
|
|
1165
1188
|
}
|
|
1189
|
+
/**
|
|
1190
|
+
* Setter for {@link FeatureLayerSettings.name}
|
|
1191
|
+
* @param name
|
|
1192
|
+
*/
|
|
1166
1193
|
setName(name) {
|
|
1167
1194
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { name }));
|
|
1168
1195
|
}
|
|
1196
|
+
/**
|
|
1197
|
+
* Setter for {@link FeatureLayerSettings.maxZoom}
|
|
1198
|
+
* @param maxZoom
|
|
1199
|
+
*/
|
|
1169
1200
|
setMaxZoom(maxZoom) {
|
|
1170
1201
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom }));
|
|
1171
1202
|
}
|
|
1203
|
+
/**
|
|
1204
|
+
* Setter for {@link FeatureLayerSettings.minZoom}
|
|
1205
|
+
* @param minZoom
|
|
1206
|
+
*/
|
|
1172
1207
|
setMinZoom(minZoom) {
|
|
1173
1208
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom }));
|
|
1174
1209
|
}
|
|
1210
|
+
/**
|
|
1211
|
+
* Setter for {@link FeatureLayerSettings.style}
|
|
1212
|
+
* @param style
|
|
1213
|
+
*/
|
|
1175
1214
|
setStyle(style) {
|
|
1176
1215
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { style }));
|
|
1177
1216
|
}
|
|
1217
|
+
/**
|
|
1218
|
+
* Checks if the model has the same content
|
|
1219
|
+
* @param model - the object to compare
|
|
1220
|
+
*/
|
|
1178
1221
|
isSame(model) {
|
|
1179
1222
|
if (this.maxZoom !== model.maxZoom)
|
|
1180
1223
|
return false;
|
|
@@ -1562,7 +1605,7 @@ class MarkersComponent extends DestructibleComponent {
|
|
|
1562
1605
|
this._markers = [];
|
|
1563
1606
|
}
|
|
1564
1607
|
set markers(value) {
|
|
1565
|
-
this._markers = value;
|
|
1608
|
+
this._markers = value !== null && value !== void 0 ? value : [];
|
|
1566
1609
|
this.putMarkers();
|
|
1567
1610
|
}
|
|
1568
1611
|
ngOnInit() {
|
|
@@ -1572,8 +1615,7 @@ class MarkersComponent extends DestructibleComponent {
|
|
|
1572
1615
|
.subscribe(() => this.putMarkers());
|
|
1573
1616
|
}
|
|
1574
1617
|
putMarkers() {
|
|
1575
|
-
|
|
1576
|
-
if (!((_a = this._markers) === null || _a === void 0 ? void 0 : _a.length))
|
|
1618
|
+
if (!this._markers)
|
|
1577
1619
|
return;
|
|
1578
1620
|
this.postboy.fire(new PlaceLayerFeaturesCommand(this.layerName, this._markers.map((m) => m.feature)));
|
|
1579
1621
|
}
|
|
@@ -1706,7 +1748,7 @@ class PolygonsComponent extends DestructibleComponent {
|
|
|
1706
1748
|
this._polygons = [];
|
|
1707
1749
|
}
|
|
1708
1750
|
set polygons(value) {
|
|
1709
|
-
this._polygons = value;
|
|
1751
|
+
this._polygons = value !== null && value !== void 0 ? value : [];
|
|
1710
1752
|
this.putPolygons();
|
|
1711
1753
|
}
|
|
1712
1754
|
ngOnInit() {
|