proximiio-js-library 1.13.3 → 1.13.4
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.
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import FillExtrusionLayer from './layers/fill_extrusion_layer';
|
|
2
2
|
import LineLayer from './layers/line_layer';
|
|
3
3
|
import SymbolLayer from './layers/symbol_layer';
|
|
4
|
-
import { PolygonOptions } from './main';
|
|
4
|
+
import { PolygonLayer, PolygonOptions } from './main';
|
|
5
5
|
export declare class PolygonsLayer extends FillExtrusionLayer {
|
|
6
|
-
constructor(data: PolygonOptions);
|
|
6
|
+
constructor(data: PolygonLayer | PolygonOptions);
|
|
7
7
|
}
|
|
8
8
|
export declare class PolygonIconsLayer extends SymbolLayer {
|
|
9
|
-
constructor(data: PolygonOptions);
|
|
9
|
+
constructor(data: PolygonLayer | PolygonOptions);
|
|
10
10
|
}
|
|
11
11
|
export declare class PolygonTitlesLayer extends SymbolLayer {
|
|
12
|
-
constructor(data: PolygonOptions);
|
|
12
|
+
constructor(data: PolygonLayer | PolygonOptions);
|
|
13
13
|
}
|
|
14
14
|
export declare class PolygonTitlesLineLayer extends LineLayer {
|
|
15
15
|
constructor(data: PolygonOptions);
|
|
@@ -4,14 +4,14 @@ import SymbolLayer, { LayoutProperties, PaintProperties as PaintPropertiesSymbol
|
|
|
4
4
|
export class PolygonsLayer extends FillExtrusionLayer {
|
|
5
5
|
constructor(data) {
|
|
6
6
|
super(data);
|
|
7
|
-
this.id =
|
|
7
|
+
this.id = `${data.layerId ? data.layerId : 'polygons'}-custom`;
|
|
8
8
|
this.type = 'fill-extrusion';
|
|
9
9
|
this.source = 'main';
|
|
10
10
|
this.filter = [
|
|
11
11
|
'all',
|
|
12
12
|
['>=', ['zoom'], ['get', 'dynamic_minZoom']],
|
|
13
13
|
['<=', ['zoom'], ['get', 'dynamic_maxZoom']],
|
|
14
|
-
['==', ['get', 'type', ['get', '_dynamic']],
|
|
14
|
+
['==', ['get', 'type', ['get', '_dynamic']], `${data.layerId ? data.layerId : 'polygons'}-custom`],
|
|
15
15
|
['==', ['to-number', ['get', 'level']], 0],
|
|
16
16
|
];
|
|
17
17
|
this.paint = new PaintProperties({
|
|
@@ -47,14 +47,14 @@ export class PolygonsLayer extends FillExtrusionLayer {
|
|
|
47
47
|
export class PolygonIconsLayer extends SymbolLayer {
|
|
48
48
|
constructor(data) {
|
|
49
49
|
super(data);
|
|
50
|
-
this.id =
|
|
50
|
+
this.id = `${data.layerId ? data.layerId : 'polygons'}-icons`;
|
|
51
51
|
this.type = 'symbol';
|
|
52
52
|
this.source = 'main';
|
|
53
53
|
this.filter = [
|
|
54
54
|
'all',
|
|
55
55
|
['>=', ['zoom'], ['get', 'dynamic_iconMinZoom']],
|
|
56
56
|
['<=', ['zoom'], ['get', 'dynamic_iconMaxZoom']],
|
|
57
|
-
['==', ['get', 'type', ['get', '_dynamic']],
|
|
57
|
+
['==', ['get', 'type', ['get', '_dynamic']], `${data.layerId ? data.layerId : 'polygons'}-label`],
|
|
58
58
|
[
|
|
59
59
|
'any',
|
|
60
60
|
['all', ['!', ['has', 'icon_only']], ['!', ['has', 'text_only']]],
|
|
@@ -97,14 +97,14 @@ export class PolygonIconsLayer extends SymbolLayer {
|
|
|
97
97
|
export class PolygonTitlesLayer extends SymbolLayer {
|
|
98
98
|
constructor(data) {
|
|
99
99
|
super(data);
|
|
100
|
-
this.id =
|
|
100
|
+
this.id = `${data.layerId ? data.layerId : 'polygons'}-labels`;
|
|
101
101
|
this.type = 'symbol';
|
|
102
102
|
this.source = 'main';
|
|
103
103
|
this.filter = [
|
|
104
104
|
'all',
|
|
105
105
|
['>=', ['zoom'], ['get', 'dynamic_labelMinZoom']],
|
|
106
106
|
['<=', ['zoom'], ['get', 'dynamic_labelMaxZoom']],
|
|
107
|
-
['==', ['get', 'type', ['get', '_dynamic']],
|
|
107
|
+
['==', ['get', 'type', ['get', '_dynamic']], `${data.layerId ? data.layerId : 'polygons'}-label`],
|
|
108
108
|
[
|
|
109
109
|
'any',
|
|
110
110
|
['all', ['!', ['has', 'icon_only']], ['!', ['has', 'text_only']]],
|
|
@@ -1397,15 +1397,77 @@ export class Map {
|
|
|
1397
1397
|
}
|
|
1398
1398
|
}
|
|
1399
1399
|
this.map.setStyle(this.state.style);
|
|
1400
|
-
const
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1400
|
+
const uniqueLayerIds = [
|
|
1401
|
+
...new Set(this.defaultOptions.polygonLayers.map((layer) => layer.layerId).filter(Boolean)),
|
|
1402
|
+
'polygons',
|
|
1403
|
+
];
|
|
1404
|
+
for (const layerId of uniqueLayerIds) {
|
|
1405
|
+
if (layerId === 'polygons') {
|
|
1406
|
+
const polygonIconsLayer = new PolygonIconsLayer(this.defaultOptions.polygonsOptions);
|
|
1407
|
+
polygonIconsLayer.setFilterLevel(this.state.floor.level);
|
|
1408
|
+
this.state.style.addLayer(polygonIconsLayer.json, 'proximiio-paths');
|
|
1409
|
+
const polygonTitlesLayer = new PolygonTitlesLayer(this.defaultOptions.polygonsOptions);
|
|
1410
|
+
polygonTitlesLayer.setFilterLevel(this.state.floor.level);
|
|
1411
|
+
this.state.style.addLayer(polygonTitlesLayer.json, 'proximiio-paths');
|
|
1412
|
+
const polygonsLayer = new PolygonsLayer(this.defaultOptions.polygonsOptions);
|
|
1413
|
+
polygonsLayer.setFilterLevel(this.state.floor.level);
|
|
1414
|
+
this.state.style.addLayer(polygonsLayer.json, 'proximiio-paths');
|
|
1415
|
+
this.map.on('click', `polygons-custom`, (e) => {
|
|
1416
|
+
this.onShopClick(e);
|
|
1417
|
+
});
|
|
1418
|
+
this.map.on('mouseenter', `polygons-custom`, (e) => {
|
|
1419
|
+
this.onShopMouseEnter(e);
|
|
1420
|
+
});
|
|
1421
|
+
this.map.on('mousemove', `polygons-custom`, (e) => {
|
|
1422
|
+
if (!this.defaultOptions.blockFeatureClickWhileRouting ||
|
|
1423
|
+
(this.defaultOptions.blockFeatureClickWhileRouting &&
|
|
1424
|
+
(!this.routingSource.route || this.routingSource.preview))) {
|
|
1425
|
+
this.onShopMouseMove(e);
|
|
1426
|
+
}
|
|
1427
|
+
});
|
|
1428
|
+
this.map.on('mouseleave', `polygons-custom`, (e) => {
|
|
1429
|
+
if (!this.defaultOptions.blockFeatureClickWhileRouting ||
|
|
1430
|
+
(this.defaultOptions.blockFeatureClickWhileRouting &&
|
|
1431
|
+
(!this.routingSource.route || this.routingSource.preview))) {
|
|
1432
|
+
this.onShopMouseLeave(e);
|
|
1433
|
+
}
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1436
|
+
else {
|
|
1437
|
+
const polygonLayer = this.defaultOptions.polygonLayers.find((layer) => layer.layerId === layerId);
|
|
1438
|
+
if (polygonLayer) {
|
|
1439
|
+
const polygonIconsLayer = new PolygonIconsLayer(polygonLayer);
|
|
1440
|
+
polygonIconsLayer.setFilterLevel(this.state.floor.level);
|
|
1441
|
+
this.state.style.addLayer(polygonIconsLayer.json, 'proximiio-paths');
|
|
1442
|
+
const polygonTitlesLayer = new PolygonTitlesLayer(polygonLayer);
|
|
1443
|
+
polygonTitlesLayer.setFilterLevel(this.state.floor.level);
|
|
1444
|
+
this.state.style.addLayer(polygonTitlesLayer.json, 'proximiio-paths');
|
|
1445
|
+
const polygonsLayer = new PolygonsLayer(polygonLayer);
|
|
1446
|
+
polygonsLayer.setFilterLevel(this.state.floor.level);
|
|
1447
|
+
this.state.style.addLayer(polygonsLayer.json, 'proximiio-paths');
|
|
1448
|
+
this.map.on('click', `${polygonLayer.layerId}-custom`, (e) => {
|
|
1449
|
+
this.onShopClick(e);
|
|
1450
|
+
});
|
|
1451
|
+
this.map.on('mouseenter', `${polygonLayer.layerId}-custom`, (e) => {
|
|
1452
|
+
this.onShopMouseEnter(e);
|
|
1453
|
+
});
|
|
1454
|
+
this.map.on('mousemove', `${polygonLayer.layerId}-custom`, (e) => {
|
|
1455
|
+
if (!this.defaultOptions.blockFeatureClickWhileRouting ||
|
|
1456
|
+
(this.defaultOptions.blockFeatureClickWhileRouting &&
|
|
1457
|
+
(!this.routingSource.route || this.routingSource.preview))) {
|
|
1458
|
+
this.onShopMouseMove(e);
|
|
1459
|
+
}
|
|
1460
|
+
});
|
|
1461
|
+
this.map.on('mouseleave', `${polygonLayer.layerId}-custom`, (e) => {
|
|
1462
|
+
if (!this.defaultOptions.blockFeatureClickWhileRouting ||
|
|
1463
|
+
(this.defaultOptions.blockFeatureClickWhileRouting &&
|
|
1464
|
+
(!this.routingSource.route || this.routingSource.preview))) {
|
|
1465
|
+
this.onShopMouseLeave(e);
|
|
1466
|
+
}
|
|
1467
|
+
});
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1409
1471
|
/*this.map.on('click', (e) => {
|
|
1410
1472
|
// Get all features at the clicked point
|
|
1411
1473
|
const features = this.map.queryRenderedFeatures(e.point);
|
|
@@ -1422,26 +1484,6 @@ export class Map {
|
|
|
1422
1484
|
console.log('No layer clicked.');
|
|
1423
1485
|
}
|
|
1424
1486
|
});*/
|
|
1425
|
-
this.map.on('click', `polygons-custom`, (e) => {
|
|
1426
|
-
this.onShopClick(e);
|
|
1427
|
-
});
|
|
1428
|
-
this.map.on('mouseenter', `polygons-custom`, (e) => {
|
|
1429
|
-
this.onShopMouseEnter(e);
|
|
1430
|
-
});
|
|
1431
|
-
this.map.on('mousemove', `polygons-custom`, (e) => {
|
|
1432
|
-
if (!this.defaultOptions.blockFeatureClickWhileRouting ||
|
|
1433
|
-
(this.defaultOptions.blockFeatureClickWhileRouting &&
|
|
1434
|
-
(!this.routingSource.route || this.routingSource.preview))) {
|
|
1435
|
-
this.onShopMouseMove(e);
|
|
1436
|
-
}
|
|
1437
|
-
});
|
|
1438
|
-
this.map.on('mouseleave', `polygons-custom`, (e) => {
|
|
1439
|
-
if (!this.defaultOptions.blockFeatureClickWhileRouting ||
|
|
1440
|
-
(this.defaultOptions.blockFeatureClickWhileRouting &&
|
|
1441
|
-
(!this.routingSource.route || this.routingSource.preview))) {
|
|
1442
|
-
this.onShopMouseLeave(e);
|
|
1443
|
-
}
|
|
1444
|
-
});
|
|
1445
1487
|
// const polygonTitlesLineLayer = new PolygonTitlesLineLayer({ featureType: 'shop' });
|
|
1446
1488
|
// polygonTitlesLineLayer.setFilterLevel(this.state.floor.level);
|
|
1447
1489
|
// this.state.style.addLayer(polygonTitlesLineLayer.json, 'proximiio-polygons-above-paths');
|
|
@@ -1575,11 +1617,15 @@ export class Map {
|
|
|
1575
1617
|
if (this.defaultOptions.polygonsOptions.handleDisabledPolygons &&
|
|
1576
1618
|
features.length === 0 &&
|
|
1577
1619
|
((Array.isArray(poi) && poi.length === 0) || !poi)) {
|
|
1620
|
+
const uniqueLayerIds = [
|
|
1621
|
+
...new Set(this.defaultOptions.polygonLayers.map((layer) => `${layer.layerId}-custom`).filter(Boolean)),
|
|
1622
|
+
'polygons-custom',
|
|
1623
|
+
];
|
|
1578
1624
|
for (const f of featuresWithPolygon) {
|
|
1579
1625
|
const polygon = this.state.allFeatures.features.find((i) => {
|
|
1580
1626
|
var _a, _b, _c;
|
|
1581
1627
|
return ((_a = i.properties._dynamic) === null || _a === void 0 ? void 0 : _a.id) === ((_b = f.properties._dynamic) === null || _b === void 0 ? void 0 : _b.polygon_id) &&
|
|
1582
|
-
((_c = i.properties._dynamic) === null || _c === void 0 ? void 0 : _c.type)
|
|
1628
|
+
uniqueLayerIds.includes((_c = i.properties._dynamic) === null || _c === void 0 ? void 0 : _c.type);
|
|
1583
1629
|
});
|
|
1584
1630
|
if (polygon) {
|
|
1585
1631
|
this.map.setFeatureState({
|
|
@@ -1605,14 +1651,18 @@ export class Map {
|
|
|
1605
1651
|
features.forEach((feat) => {
|
|
1606
1652
|
const connectedPolygonId = feat && feat.properties._dynamic ? feat.properties._dynamic.polygon_id : null;
|
|
1607
1653
|
if (connectedPolygonId) {
|
|
1608
|
-
const
|
|
1654
|
+
const uniqueLayerIds = [
|
|
1655
|
+
...new Set(this.defaultOptions.polygonLayers.map((layer) => `${layer.layerId}-custom`).filter(Boolean)),
|
|
1656
|
+
'polygons-custom',
|
|
1657
|
+
];
|
|
1658
|
+
const selectedPolygon = this.state.allFeatures.features.find((i) => { var _a, _b; return ((_a = i.properties._dynamic) === null || _a === void 0 ? void 0 : _a.id) === connectedPolygonId && uniqueLayerIds.includes((_b = i.properties._dynamic) === null || _b === void 0 ? void 0 : _b.type); });
|
|
1609
1659
|
if (selectedPolygon) {
|
|
1610
1660
|
if (this.defaultOptions.polygonsOptions.handleDisabledPolygons) {
|
|
1611
1661
|
for (const f of featuresWithPolygon) {
|
|
1612
1662
|
const polygon = this.state.allFeatures.features.find((i) => {
|
|
1613
1663
|
var _a, _b, _c;
|
|
1614
1664
|
return ((_a = i.properties._dynamic) === null || _a === void 0 ? void 0 : _a.id) === ((_b = f.properties._dynamic) === null || _b === void 0 ? void 0 : _b.polygon_id) &&
|
|
1615
|
-
((_c = i.properties._dynamic) === null || _c === void 0 ? void 0 : _c.type)
|
|
1665
|
+
uniqueLayerIds.includes((_c = i.properties._dynamic) === null || _c === void 0 ? void 0 : _c.type);
|
|
1616
1666
|
});
|
|
1617
1667
|
if (polygon) {
|
|
1618
1668
|
this.map.setFeatureState({
|
|
@@ -2190,12 +2240,16 @@ export class Map {
|
|
|
2190
2240
|
)
|
|
2191
2241
|
: [];*/
|
|
2192
2242
|
const featuresWithPolygon = this.state.allFeatures.features.filter((f) => { var _a; return ((_a = f.properties._dynamic) === null || _a === void 0 ? void 0 : _a.polygon_id) && f.geometry.type === 'Point'; });
|
|
2243
|
+
const uniqueLayerIds = [
|
|
2244
|
+
...new Set(this.defaultOptions.polygonLayers.map((layer) => `${layer.layerId}-custom`).filter(Boolean)),
|
|
2245
|
+
'polygons-custom',
|
|
2246
|
+
];
|
|
2193
2247
|
if (activeFeatures.length > 0) {
|
|
2194
2248
|
for (const f of featuresWithPolygon) {
|
|
2195
2249
|
const polygon = this.state.allFeatures.features.find((i) => {
|
|
2196
2250
|
var _a, _b, _c;
|
|
2197
2251
|
return ((_a = i.properties._dynamic) === null || _a === void 0 ? void 0 : _a.id) === ((_b = f.properties._dynamic) === null || _b === void 0 ? void 0 : _b.polygon_id) &&
|
|
2198
|
-
((_c = i.properties._dynamic) === null || _c === void 0 ? void 0 : _c.type)
|
|
2252
|
+
uniqueLayerIds.includes((_c = i.properties._dynamic) === null || _c === void 0 ? void 0 : _c.type);
|
|
2199
2253
|
});
|
|
2200
2254
|
if (polygon) {
|
|
2201
2255
|
this.map.setFeatureState({
|
|
@@ -2222,7 +2276,7 @@ export class Map {
|
|
|
2222
2276
|
const polygon = this.state.allFeatures.features.find((i) => {
|
|
2223
2277
|
var _a, _b, _c;
|
|
2224
2278
|
return ((_a = i.properties._dynamic) === null || _a === void 0 ? void 0 : _a.id) === ((_b = f.properties._dynamic) === null || _b === void 0 ? void 0 : _b.polygon_id) &&
|
|
2225
|
-
((_c = i.properties._dynamic) === null || _c === void 0 ? void 0 : _c.type)
|
|
2279
|
+
uniqueLayerIds.includes((_c = i.properties._dynamic) === null || _c === void 0 ? void 0 : _c.type);
|
|
2226
2280
|
});
|
|
2227
2281
|
if (polygon) {
|
|
2228
2282
|
if (((_a = filterByAmenity([f], amenityId)) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
@@ -2352,11 +2406,15 @@ export class Map {
|
|
|
2352
2406
|
onDisablePolygons() {
|
|
2353
2407
|
if (this.defaultOptions.polygonsOptions.handleDisabledPolygons) {
|
|
2354
2408
|
const featuresWithPolygon = this.state.allFeatures.features.filter((f) => { var _a; return ((_a = f.properties._dynamic) === null || _a === void 0 ? void 0 : _a.polygon_id) && f.geometry.type === 'Point'; });
|
|
2409
|
+
const uniqueLayerIds = [
|
|
2410
|
+
...new Set(this.defaultOptions.polygonLayers.map((layer) => `${layer.layerId}-custom`).filter(Boolean)),
|
|
2411
|
+
'polygons-custom',
|
|
2412
|
+
];
|
|
2355
2413
|
for (const f of featuresWithPolygon) {
|
|
2356
2414
|
const polygon = this.state.allFeatures.features.find((i) => {
|
|
2357
2415
|
var _a, _b, _c;
|
|
2358
2416
|
return ((_a = i.properties._dynamic) === null || _a === void 0 ? void 0 : _a.id) === ((_b = f.properties._dynamic) === null || _b === void 0 ? void 0 : _b.polygon_id) &&
|
|
2359
|
-
((_c = i.properties._dynamic) === null || _c === void 0 ? void 0 : _c.type)
|
|
2417
|
+
uniqueLayerIds.includes((_c = i.properties._dynamic) === null || _c === void 0 ? void 0 : _c.type);
|
|
2360
2418
|
});
|
|
2361
2419
|
if (polygon) {
|
|
2362
2420
|
this.map.setFeatureState({
|
package/lib/controllers/geo.js
CHANGED
|
@@ -213,7 +213,7 @@ export const getFeatures = ({ initPolygons, polygonLayers, autoLabelLines, hidde
|
|
|
213
213
|
? connectedPolygon.properties._dynamic
|
|
214
214
|
: {};
|
|
215
215
|
connectedPolygon.properties._dynamic.id = (_g = connectedPolygon.properties.id) === null || _g === void 0 ? void 0 : _g.replace(/\{|\}/g, '');
|
|
216
|
-
connectedPolygon.properties._dynamic.type =
|
|
216
|
+
connectedPolygon.properties._dynamic.type = `${polygonLayer.layerId ? polygonLayer.layerId : 'polygons'}-custom`;
|
|
217
217
|
connectedPolygon.properties._dynamic.poi_id = feature.properties.id;
|
|
218
218
|
connectedPolygon.properties._dynamic.amenity = feature.properties.amenity;
|
|
219
219
|
connectedPolygon.properties = Object.assign(Object.assign({}, connectedPolygon.properties), { dynamic_minZoom: polygonLayer.minZoom, dynamic_maxZoom: polygonLayer.maxZoom, dynamic_selectedHeight: polygonLayer.selectedPolygonHeight, dynamic_hoverHeight: polygonLayer.hoverPolygonHeight, dynamic_activeHeight: polygonLayer.hoverPolygonHeight, dynamic_disabledHeight: polygonLayer.disabledPolygonHeight, dynamic_defaultHeight: polygonLayer.defaultPolygonHeight, dynamic_base: polygonLayer.base, dynamic_selectedColor: polygonLayer.selectedPolygonColor, dynamic_hoverColor: polygonLayer.hoverPolygonColor, dynamic_activeColor: polygonLayer.hoverPolygonColor, dynamic_disabledColor: polygonLayer.disabledPolygonColor, dynamic_defaultColor: polygonLayer.defaultPolygonColor });
|
|
@@ -242,8 +242,8 @@ export const getFeatures = ({ initPolygons, polygonLayers, autoLabelLines, hidde
|
|
|
242
242
|
connectedLabelLine.properties.metadata = feature.properties.metadata;
|
|
243
243
|
connectedLabelLine.properties.id = connectedLabelLine.id;
|
|
244
244
|
connectedLabelLine.properties._dynamic.id = connectedLabelLine.id;
|
|
245
|
-
connectedLabelLine.properties.type =
|
|
246
|
-
connectedLabelLine.properties._dynamic.type =
|
|
245
|
+
connectedLabelLine.properties.type = `${polygonLayer.layerId ? polygonLayer.layerId : 'polygons'}-label`;
|
|
246
|
+
connectedLabelLine.properties._dynamic.type = `${polygonLayer.layerId ? polygonLayer.layerId : 'polygons'}-label`;
|
|
247
247
|
connectedLabelLine.properties._dynamic.poi_id = feature.properties.id;
|
|
248
248
|
connectedLabelLine.properties._dynamic.amenity = feature.properties.amenity;
|
|
249
249
|
connectedLabelLine.properties._dynamic.polygon_id = connectedPolygon.properties._dynamic.id;
|
|
@@ -273,8 +273,8 @@ export const getFeatures = ({ initPolygons, polygonLayers, autoLabelLines, hidde
|
|
|
273
273
|
};
|
|
274
274
|
labelLineFeature.properties.id = `${connectedPolygon.id}9999`;
|
|
275
275
|
labelLineFeature.id = `${connectedPolygon.id}9999`;
|
|
276
|
-
labelLineFeature.properties.type =
|
|
277
|
-
labelLineFeature.properties._dynamic.type =
|
|
276
|
+
labelLineFeature.properties.type = `${polygonLayer.layerId ? polygonLayer.layerId : 'polygons'}-label`;
|
|
277
|
+
labelLineFeature.properties._dynamic.type = `${polygonLayer.layerId ? polygonLayer.layerId : 'polygons'}-label`;
|
|
278
278
|
labelLineFeature.properties._dynamic.length = Math.ceil(length(labelLineFeature) * 1000);
|
|
279
279
|
labelLineFeature.properties = Object.assign(Object.assign({}, labelLineFeature.properties), { dynamic_iconMinZoom: polygonLayer.iconMinZoom, dynamic_iconMaxZoom: polygonLayer.iconMaxZoom, dynamic_labelMinZoom: polygonLayer.labelMinZoom, dynamic_labelMaxZoom: polygonLayer.labelMaxZoom, dynamic_symbolPlacement: polygonLayer.symbolPlacement, dynamic_disabledOpacity: polygonLayer.iconImageDefaultVisible || polygonLayer.iconImageDefaultVisible === undefined
|
|
280
280
|
? 1
|
|
@@ -335,8 +335,8 @@ export const getFeatures = ({ initPolygons, polygonLayers, autoLabelLines, hidde
|
|
|
335
335
|
// labelBorder.properties = { ...labelBorder.properties, ...feature.properties };
|
|
336
336
|
labelBorder.properties.id = `${connectedPolygon.id}9999`;
|
|
337
337
|
labelBorder.id = `${connectedPolygon.id}9999`;
|
|
338
|
-
labelBorder.properties.type =
|
|
339
|
-
labelBorder.properties._dynamic.type =
|
|
338
|
+
labelBorder.properties.type = `${polygonLayer.layerId ? polygonLayer.layerId : 'polygons'}-label`;
|
|
339
|
+
labelBorder.properties._dynamic.type = `${polygonLayer.layerId ? polygonLayer.layerId : 'polygons'}-label`;
|
|
340
340
|
connectedPolygon.properties._dynamic.label_id = labelBorder.properties.id;
|
|
341
341
|
labelBorder.properties = Object.assign(Object.assign({}, labelBorder.properties), { dynamic_iconMinZoom: polygonLayer.iconMinZoom, dynamic_iconMaxZoom: polygonLayer.iconMaxZoom, dynamic_labelMinZoom: polygonLayer.labelMinZoom, dynamic_labelMaxZoom: polygonLayer.labelMaxZoom, dynamic_symbolPlacement: polygonLayer.symbolPlacement, dynamic_disabledOpacity: polygonLayer.iconImageDefaultVisible || polygonLayer.iconImageDefaultVisible === undefined ? 1 : 0, dynamic_selectedTextColor: polygonLayer.selectedLabelColor, dynamic_hoverTextColor: polygonLayer.hoverLabelColor, dynamic_activeTextColor: polygonLayer.hoverLabelColor, dynamic_disabledTextColor: polygonLayer.disabledLabelColor, dynamic_defaultTextColor: polygonLayer.defaultLabelColor });
|
|
342
342
|
featuresToAdd.push(labelBorder);
|
|
@@ -461,7 +461,7 @@ export const getFeaturesBundle = ({ initPolygons, polygonLayers, autoLabelLines,
|
|
|
461
461
|
? connectedPolygon.properties._dynamic
|
|
462
462
|
: {};
|
|
463
463
|
connectedPolygon.properties._dynamic.id = (_g = connectedPolygon.properties.id) === null || _g === void 0 ? void 0 : _g.replace(/\{|\}/g, '');
|
|
464
|
-
connectedPolygon.properties._dynamic.type =
|
|
464
|
+
connectedPolygon.properties._dynamic.type = `${polygonLayer.layerId ? polygonLayer.layerId : 'polygons'}-custom`;
|
|
465
465
|
connectedPolygon.properties._dynamic.poi_id = feature.properties.id;
|
|
466
466
|
connectedPolygon.properties._dynamic.amenity = feature.properties.amenity;
|
|
467
467
|
connectedPolygon.properties = Object.assign(Object.assign({}, connectedPolygon.properties), { dynamic_minZoom: polygonLayer.minZoom, dynamic_maxZoom: polygonLayer.maxZoom, dynamic_selectedHeight: polygonLayer.selectedPolygonHeight, dynamic_hoverHeight: polygonLayer.hoverPolygonHeight, dynamic_activeHeight: polygonLayer.hoverPolygonHeight, dynamic_disabledHeight: polygonLayer.disabledPolygonHeight, dynamic_defaultHeight: polygonLayer.defaultPolygonHeight, dynamic_base: polygonLayer.base, dynamic_selectedColor: polygonLayer.selectedPolygonColor, dynamic_hoverColor: polygonLayer.hoverPolygonColor, dynamic_activeColor: polygonLayer.hoverPolygonColor, dynamic_disabledColor: polygonLayer.disabledPolygonColor, dynamic_defaultColor: polygonLayer.defaultPolygonColor });
|
|
@@ -490,8 +490,8 @@ export const getFeaturesBundle = ({ initPolygons, polygonLayers, autoLabelLines,
|
|
|
490
490
|
connectedLabelLine.properties.metadata = feature.properties.metadata;
|
|
491
491
|
connectedLabelLine.properties.id = connectedLabelLine.id;
|
|
492
492
|
connectedLabelLine.properties._dynamic.id = connectedLabelLine.id;
|
|
493
|
-
connectedLabelLine.properties.type =
|
|
494
|
-
connectedLabelLine.properties._dynamic.type =
|
|
493
|
+
connectedLabelLine.properties.type = `${polygonLayer.layerId ? polygonLayer.layerId : 'polygons'}-label`;
|
|
494
|
+
connectedLabelLine.properties._dynamic.type = `${polygonLayer.layerId ? polygonLayer.layerId : 'polygons'}-label`;
|
|
495
495
|
connectedLabelLine.properties._dynamic.poi_id = feature.properties.id;
|
|
496
496
|
connectedLabelLine.properties._dynamic.amenity = feature.properties.amenity;
|
|
497
497
|
connectedLabelLine.properties._dynamic.polygon_id = connectedPolygon.properties._dynamic.id;
|
|
@@ -521,8 +521,8 @@ export const getFeaturesBundle = ({ initPolygons, polygonLayers, autoLabelLines,
|
|
|
521
521
|
};
|
|
522
522
|
labelLineFeature.properties.id = `${connectedPolygon.id}9999`;
|
|
523
523
|
labelLineFeature.id = `${connectedPolygon.id}9999`;
|
|
524
|
-
labelLineFeature.properties.type =
|
|
525
|
-
labelLineFeature.properties._dynamic.type =
|
|
524
|
+
labelLineFeature.properties.type = `${polygonLayer.layerId ? polygonLayer.layerId : 'polygons'}-label`;
|
|
525
|
+
labelLineFeature.properties._dynamic.type = `${polygonLayer.layerId ? polygonLayer.layerId : 'polygons'}-label`;
|
|
526
526
|
labelLineFeature.properties._dynamic.length = Math.ceil(length(labelLineFeature) * 1000);
|
|
527
527
|
labelLineFeature.properties = Object.assign(Object.assign({}, labelLineFeature.properties), { dynamic_iconMinZoom: polygonLayer.iconMinZoom, dynamic_iconMaxZoom: polygonLayer.iconMaxZoom, dynamic_labelMinZoom: polygonLayer.labelMinZoom, dynamic_labelMaxZoom: polygonLayer.labelMaxZoom, dynamic_symbolPlacement: polygonLayer.symbolPlacement, dynamic_disabledOpacity: polygonLayer.iconImageDefaultVisible || polygonLayer.iconImageDefaultVisible === undefined
|
|
528
528
|
? 1
|
|
@@ -583,8 +583,8 @@ export const getFeaturesBundle = ({ initPolygons, polygonLayers, autoLabelLines,
|
|
|
583
583
|
// labelBorder.properties = { ...labelBorder.properties, ...feature.properties };
|
|
584
584
|
labelBorder.properties.id = `${connectedPolygon.id}9999`;
|
|
585
585
|
labelBorder.id = `${connectedPolygon.id}9999`;
|
|
586
|
-
labelBorder.properties.type =
|
|
587
|
-
labelBorder.properties._dynamic.type =
|
|
586
|
+
labelBorder.properties.type = `${polygonLayer.layerId ? polygonLayer.layerId : 'polygons'}-label`;
|
|
587
|
+
labelBorder.properties._dynamic.type = `${polygonLayer.layerId ? polygonLayer.layerId : 'polygons'}-label`;
|
|
588
588
|
connectedPolygon.properties._dynamic.label_id = labelBorder.properties.id;
|
|
589
589
|
labelBorder.properties = Object.assign(Object.assign({}, labelBorder.properties), { dynamic_iconMinZoom: polygonLayer.iconMinZoom, dynamic_iconMaxZoom: polygonLayer.iconMaxZoom, dynamic_labelMinZoom: polygonLayer.labelMinZoom, dynamic_labelMaxZoom: polygonLayer.labelMaxZoom, dynamic_symbolPlacement: polygonLayer.symbolPlacement, dynamic_disabledOpacity: polygonLayer.iconImageDefaultVisible || polygonLayer.iconImageDefaultVisible === undefined ? 1 : 0, dynamic_selectedTextColor: polygonLayer.selectedLabelColor, dynamic_hoverTextColor: polygonLayer.hoverLabelColor, dynamic_activeTextColor: polygonLayer.hoverLabelColor, dynamic_disabledTextColor: polygonLayer.disabledLabelColor, dynamic_defaultTextColor: polygonLayer.defaultLabelColor });
|
|
590
590
|
featuresToAdd.push(labelBorder);
|