@dartcom/ui-kit 3.5.3 → 3.6.0
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/components/layers/leaflet/constants.d.ts +11 -0
- package/dist/components/layers/leaflet/constants.d.ts.map +1 -0
- package/dist/components/layers/leaflet/hooks/useGetLeafletLayer.d.ts +22 -1
- package/dist/components/layers/leaflet/hooks/useGetLeafletLayer.d.ts.map +1 -1
- package/dist/components/layers/leaflet/index.d.ts +1 -0
- package/dist/components/layers/leaflet/index.d.ts.map +1 -1
- package/dist/components/layers/leaflet/layers/POI/constants.d.ts +3 -0
- package/dist/components/layers/leaflet/layers/POI/constants.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/POI/index.d.ts +3 -0
- package/dist/components/layers/leaflet/layers/POI/index.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/POI/utils.d.ts +7 -0
- package/dist/components/layers/leaflet/layers/POI/utils.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/admin-area/constants.d.ts +2 -0
- package/dist/components/layers/leaflet/layers/admin-area/constants.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/admin-area/index.d.ts +2 -0
- package/dist/components/layers/leaflet/layers/admin-area/index.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/admin-area/utils.d.ts +3 -0
- package/dist/components/layers/leaflet/layers/admin-area/utils.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/building/index.d.ts +2 -0
- package/dist/components/layers/leaflet/layers/building/index.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/building/utils.d.ts +3 -0
- package/dist/components/layers/leaflet/layers/building/utils.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/builtup-area/index.d.ts +2 -0
- package/dist/components/layers/leaflet/layers/builtup-area/index.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/builtup-area/utils.d.ts +3 -0
- package/dist/components/layers/leaflet/layers/builtup-area/utils.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/city-POI/index.d.ts +2 -0
- package/dist/components/layers/leaflet/layers/city-POI/index.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/city-POI/utils.d.ts +3 -0
- package/dist/components/layers/leaflet/layers/city-POI/utils.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/condition/index.d.ts +2 -0
- package/dist/components/layers/leaflet/layers/condition/index.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/condition/types.d.ts +7 -0
- package/dist/components/layers/leaflet/layers/condition/types.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/condition/utils.d.ts +3 -0
- package/dist/components/layers/leaflet/layers/condition/utils.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/facility-area/index.d.ts +2 -0
- package/dist/components/layers/leaflet/layers/facility-area/index.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/facility-area/utils.d.ts +3 -0
- package/dist/components/layers/leaflet/layers/facility-area/utils.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/index.d.ts +17 -0
- package/dist/components/layers/leaflet/layers/index.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/landuse-area/index.d.ts +2 -0
- package/dist/components/layers/leaflet/layers/landuse-area/index.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/landuse-area/utils.d.ts +3 -0
- package/dist/components/layers/leaflet/layers/landuse-area/utils.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/link/constants.d.ts +8 -0
- package/dist/components/layers/leaflet/layers/link/constants.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/link/index.d.ts +2 -0
- package/dist/components/layers/leaflet/layers/link/index.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/link/utils.d.ts +3 -0
- package/dist/components/layers/leaflet/layers/link/utils.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/nature-field/index.d.ts +2 -0
- package/dist/components/layers/leaflet/layers/nature-field/index.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/nature-field/utils.d.ts +3 -0
- package/dist/components/layers/leaflet/layers/nature-field/utils.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/ocean-area/index.d.ts +2 -0
- package/dist/components/layers/leaflet/layers/ocean-area/index.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/ocean-area/utils.d.ts +3 -0
- package/dist/components/layers/leaflet/layers/ocean-area/utils.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/one-way/index.d.ts +2 -0
- package/dist/components/layers/leaflet/layers/one-way/index.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/one-way/utils.d.ts +3 -0
- package/dist/components/layers/leaflet/layers/one-way/utils.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/point-address/index.d.ts +2 -0
- package/dist/components/layers/leaflet/layers/point-address/index.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/point-address/utils.d.ts +3 -0
- package/dist/components/layers/leaflet/layers/point-address/utils.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/railroad/index.d.ts +2 -0
- package/dist/components/layers/leaflet/layers/railroad/index.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/railroad/utils.d.ts +3 -0
- package/dist/components/layers/leaflet/layers/railroad/utils.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/water-area/index.d.ts +2 -0
- package/dist/components/layers/leaflet/layers/water-area/index.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/water-area/utils.d.ts +3 -0
- package/dist/components/layers/leaflet/layers/water-area/utils.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/water-link/index.d.ts +2 -0
- package/dist/components/layers/leaflet/layers/water-link/index.d.ts.map +1 -0
- package/dist/components/layers/leaflet/layers/water-link/utils.d.ts +3 -0
- package/dist/components/layers/leaflet/layers/water-link/utils.d.ts.map +1 -0
- package/dist/components/layers/leaflet/types.d.ts +109 -4
- package/dist/components/layers/leaflet/types.d.ts.map +1 -1
- package/dist/components/layers/leaflet/utils.d.ts +7 -0
- package/dist/components/layers/leaflet/utils.d.ts.map +1 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/url.d.ts +2 -0
- package/dist/constants/url.d.ts.map +1 -0
- package/dist/index.cjs +661 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +13 -13
- package/dist/index.esm.js.map +1 -1
- package/dist/services/api/api.service.d.ts.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -43373,6 +43373,8 @@ const {
|
|
|
43373
43373
|
mergeConfig
|
|
43374
43374
|
} = axios;
|
|
43375
43375
|
|
|
43376
|
+
const _backendUrl = 'https://dalganmap.ru/api';
|
|
43377
|
+
|
|
43376
43378
|
class ApiService {
|
|
43377
43379
|
client;
|
|
43378
43380
|
constructor(baseURL) {
|
|
@@ -43408,7 +43410,7 @@ class ApiService {
|
|
|
43408
43410
|
return response.data;
|
|
43409
43411
|
}
|
|
43410
43412
|
}
|
|
43411
|
-
const apiService = new ApiService(
|
|
43413
|
+
const apiService = new ApiService(_backendUrl);
|
|
43412
43414
|
|
|
43413
43415
|
class GlobalConfig {
|
|
43414
43416
|
static _instance = null;
|
|
@@ -43473,6 +43475,411 @@ const _testApiKeys = {
|
|
|
43473
43475
|
invalid: 'abcdefghijklmnopqrstuvwxyz0123456789',
|
|
43474
43476
|
};
|
|
43475
43477
|
|
|
43478
|
+
/**
|
|
43479
|
+
A function that returns a universally unique identifier (uuid).
|
|
43480
|
+
example: 1b83fd69-abe7-468c-bea1-306a8aa1c81d
|
|
43481
|
+
@returns `string` : 32 character uuid (see example)
|
|
43482
|
+
*/
|
|
43483
|
+
|
|
43484
|
+
var uuid_1;
|
|
43485
|
+
var hasRequiredUuid;
|
|
43486
|
+
|
|
43487
|
+
function requireUuid () {
|
|
43488
|
+
if (hasRequiredUuid) return uuid_1;
|
|
43489
|
+
hasRequiredUuid = 1;
|
|
43490
|
+
function uuid() {
|
|
43491
|
+
const hashTable = [
|
|
43492
|
+
"a",
|
|
43493
|
+
"b",
|
|
43494
|
+
"c",
|
|
43495
|
+
"d",
|
|
43496
|
+
"e",
|
|
43497
|
+
"f",
|
|
43498
|
+
"0",
|
|
43499
|
+
"1",
|
|
43500
|
+
"2",
|
|
43501
|
+
"3",
|
|
43502
|
+
"4",
|
|
43503
|
+
"5",
|
|
43504
|
+
"6",
|
|
43505
|
+
"7",
|
|
43506
|
+
"8",
|
|
43507
|
+
"9",
|
|
43508
|
+
];
|
|
43509
|
+
let uuid = [];
|
|
43510
|
+
for (let i = 0; i < 36; i++) {
|
|
43511
|
+
if (i === 8 || i === 13 || i === 18 || i === 23) {
|
|
43512
|
+
uuid[i] = "-";
|
|
43513
|
+
} else {
|
|
43514
|
+
uuid[i] = hashTable[Math.ceil(Math.random() * hashTable.length - 1)];
|
|
43515
|
+
}
|
|
43516
|
+
}
|
|
43517
|
+
return uuid.join("");
|
|
43518
|
+
}
|
|
43519
|
+
|
|
43520
|
+
uuid_1 = uuid;
|
|
43521
|
+
return uuid_1;
|
|
43522
|
+
}
|
|
43523
|
+
|
|
43524
|
+
var uuidExports = requireUuid();
|
|
43525
|
+
var uuid = /*@__PURE__*/getDefaultExportFromCjs(uuidExports);
|
|
43526
|
+
|
|
43527
|
+
exports.API_METHODS = void 0;
|
|
43528
|
+
(function (API_METHODS) {
|
|
43529
|
+
API_METHODS["GET"] = "GET";
|
|
43530
|
+
API_METHODS["DELETE"] = "DELETE";
|
|
43531
|
+
API_METHODS["PUT"] = "PUT";
|
|
43532
|
+
API_METHODS["POST"] = "POST";
|
|
43533
|
+
})(exports.API_METHODS || (exports.API_METHODS = {}));
|
|
43534
|
+
|
|
43535
|
+
exports.PanelsNames = void 0;
|
|
43536
|
+
(function (PanelsNames) {
|
|
43537
|
+
PanelsNames["TOP_RIGHT"] = "top-right";
|
|
43538
|
+
PanelsNames["BOTTOM_RIGHT"] = "bottom-right";
|
|
43539
|
+
PanelsNames["BOTTOM_LEFT"] = "bottom-left";
|
|
43540
|
+
PanelsNames["TOP_LEFT"] = "top-left";
|
|
43541
|
+
})(exports.PanelsNames || (exports.PanelsNames = {}));
|
|
43542
|
+
|
|
43543
|
+
exports.TangramSourceNames = void 0;
|
|
43544
|
+
(function (TangramSourceNames) {
|
|
43545
|
+
TangramSourceNames["TILE"] = "tile";
|
|
43546
|
+
TangramSourceNames["NATURE_TILE"] = "nature_tile";
|
|
43547
|
+
TangramSourceNames["MSK"] = "msk";
|
|
43548
|
+
})(exports.TangramSourceNames || (exports.TangramSourceNames = {}));
|
|
43549
|
+
|
|
43550
|
+
const tile_size = 256;
|
|
43551
|
+
const sourceUrl = {
|
|
43552
|
+
[exports.TangramSourceNames.TILE]: `${_backendUrl}/tiles/get_tile/{z}/{x}/{y}.mvt`,
|
|
43553
|
+
[exports.TangramSourceNames.NATURE_TILE]: `${_backendUrl}/tiles/get_nature_tile/{z}/{x}/{y}.mvt`,
|
|
43554
|
+
[exports.TangramSourceNames.MSK]: 'http://89.108.118.23:3070/tiles/get_tile/{z}/{x}/{y}.mvt',
|
|
43555
|
+
};
|
|
43556
|
+
const getRoadPolyLayers = (source) => {
|
|
43557
|
+
const layers = [];
|
|
43558
|
+
const data = {
|
|
43559
|
+
source,
|
|
43560
|
+
layer: '"RoadPoly"',
|
|
43561
|
+
};
|
|
43562
|
+
const roadLayer = {
|
|
43563
|
+
id: uuid(),
|
|
43564
|
+
data,
|
|
43565
|
+
filter: `function() {
|
|
43566
|
+
const { type } = feature;
|
|
43567
|
+
|
|
43568
|
+
const isFilter = type === 'Road';
|
|
43569
|
+
|
|
43570
|
+
return isFilter;
|
|
43571
|
+
}`,
|
|
43572
|
+
draw: {
|
|
43573
|
+
polygons: {
|
|
43574
|
+
color: '#B3BDCF',
|
|
43575
|
+
},
|
|
43576
|
+
},
|
|
43577
|
+
};
|
|
43578
|
+
const tramLayer = {
|
|
43579
|
+
id: uuid(),
|
|
43580
|
+
data,
|
|
43581
|
+
filter: `function() {
|
|
43582
|
+
const { type } = feature;
|
|
43583
|
+
|
|
43584
|
+
const isFilter = type === 'Tram';
|
|
43585
|
+
|
|
43586
|
+
return isFilter;
|
|
43587
|
+
}`,
|
|
43588
|
+
draw: {
|
|
43589
|
+
polygons: {
|
|
43590
|
+
color: '#ADA8A8',
|
|
43591
|
+
},
|
|
43592
|
+
},
|
|
43593
|
+
};
|
|
43594
|
+
const curbLayer = {
|
|
43595
|
+
id: uuid(),
|
|
43596
|
+
data,
|
|
43597
|
+
filter: `function() {
|
|
43598
|
+
const { type } = feature;
|
|
43599
|
+
|
|
43600
|
+
const isFilter = type === 'Curb';
|
|
43601
|
+
|
|
43602
|
+
return isFilter;
|
|
43603
|
+
}`,
|
|
43604
|
+
draw: {
|
|
43605
|
+
polygons: {
|
|
43606
|
+
color: '#D2D9E6',
|
|
43607
|
+
},
|
|
43608
|
+
},
|
|
43609
|
+
};
|
|
43610
|
+
const bridgeLayer = {
|
|
43611
|
+
id: uuid(),
|
|
43612
|
+
data,
|
|
43613
|
+
filter: `function() {
|
|
43614
|
+
const { type } = feature;
|
|
43615
|
+
|
|
43616
|
+
const isFilter = type === 'Bridge';
|
|
43617
|
+
|
|
43618
|
+
return isFilter;
|
|
43619
|
+
}`,
|
|
43620
|
+
draw: {
|
|
43621
|
+
polygons: {
|
|
43622
|
+
color: '#E1DFDD',
|
|
43623
|
+
},
|
|
43624
|
+
},
|
|
43625
|
+
};
|
|
43626
|
+
layers.push(roadLayer, tramLayer, curbLayer, bridgeLayer);
|
|
43627
|
+
return layers;
|
|
43628
|
+
};
|
|
43629
|
+
const getLaneMarkingPolyLayers = (source) => {
|
|
43630
|
+
const layers = [];
|
|
43631
|
+
const data = {
|
|
43632
|
+
source,
|
|
43633
|
+
layer: '"LaneMarkingPoly"',
|
|
43634
|
+
};
|
|
43635
|
+
const layer__1_26 = {
|
|
43636
|
+
id: uuid(),
|
|
43637
|
+
data,
|
|
43638
|
+
filter: `function() {
|
|
43639
|
+
const { poly_number } = feature;
|
|
43640
|
+
|
|
43641
|
+
const isFilter = poly_number === '1.26';
|
|
43642
|
+
|
|
43643
|
+
return isFilter;
|
|
43644
|
+
}`,
|
|
43645
|
+
draw: {
|
|
43646
|
+
styles: {
|
|
43647
|
+
'diagonal-grid': {
|
|
43648
|
+
color: 'yellow',
|
|
43649
|
+
},
|
|
43650
|
+
},
|
|
43651
|
+
},
|
|
43652
|
+
};
|
|
43653
|
+
layers.push(layer__1_26);
|
|
43654
|
+
return layers;
|
|
43655
|
+
};
|
|
43656
|
+
const getLaneMarkingLineLayers = (source) => {
|
|
43657
|
+
const layers = [];
|
|
43658
|
+
const data = {
|
|
43659
|
+
source,
|
|
43660
|
+
layer: '"LaneMarkingLine"',
|
|
43661
|
+
};
|
|
43662
|
+
const layer = {
|
|
43663
|
+
id: uuid(),
|
|
43664
|
+
data,
|
|
43665
|
+
sublayers: {
|
|
43666
|
+
'1.1': {
|
|
43667
|
+
filter: `function () {
|
|
43668
|
+
const { lane_number } = feature;
|
|
43669
|
+
|
|
43670
|
+
const isFilter = lane_number === '1.1';
|
|
43671
|
+
|
|
43672
|
+
return isFilter;
|
|
43673
|
+
}`,
|
|
43674
|
+
draw: {
|
|
43675
|
+
lines: {
|
|
43676
|
+
color: 'white',
|
|
43677
|
+
width: 1,
|
|
43678
|
+
},
|
|
43679
|
+
},
|
|
43680
|
+
},
|
|
43681
|
+
'1.6': {
|
|
43682
|
+
filter: `function () {
|
|
43683
|
+
const { lane_number } = feature;
|
|
43684
|
+
|
|
43685
|
+
const isFilter = lane_number === '1.6';
|
|
43686
|
+
|
|
43687
|
+
return isFilter;
|
|
43688
|
+
}`,
|
|
43689
|
+
draw: {
|
|
43690
|
+
lines: {
|
|
43691
|
+
color: 'white',
|
|
43692
|
+
width: 1,
|
|
43693
|
+
dash: [5, 5],
|
|
43694
|
+
},
|
|
43695
|
+
},
|
|
43696
|
+
},
|
|
43697
|
+
'1.7': {
|
|
43698
|
+
filter: `function () {
|
|
43699
|
+
const { lane_number } = feature;
|
|
43700
|
+
|
|
43701
|
+
const isFilter = lane_number === '1.7';
|
|
43702
|
+
|
|
43703
|
+
return isFilter;
|
|
43704
|
+
}`,
|
|
43705
|
+
draw: {
|
|
43706
|
+
lines: {
|
|
43707
|
+
color: 'white',
|
|
43708
|
+
width: 0.5,
|
|
43709
|
+
dash: [4, 10],
|
|
43710
|
+
},
|
|
43711
|
+
},
|
|
43712
|
+
},
|
|
43713
|
+
'1.7-blue': {
|
|
43714
|
+
filter: `function () {
|
|
43715
|
+
const { lane_number } = feature;
|
|
43716
|
+
|
|
43717
|
+
const isFilter = lane_number === '1.7blue';
|
|
43718
|
+
|
|
43719
|
+
return isFilter;
|
|
43720
|
+
}`,
|
|
43721
|
+
draw: {
|
|
43722
|
+
lines: {
|
|
43723
|
+
color: 'blue',
|
|
43724
|
+
width: 0.5,
|
|
43725
|
+
dash: [4, 10],
|
|
43726
|
+
},
|
|
43727
|
+
},
|
|
43728
|
+
},
|
|
43729
|
+
'1.14.3': {
|
|
43730
|
+
filter: `function () {
|
|
43731
|
+
const { lane_number } = feature;
|
|
43732
|
+
|
|
43733
|
+
const isFilter = lane_number === '1.14.3';
|
|
43734
|
+
|
|
43735
|
+
return isFilter;
|
|
43736
|
+
}`,
|
|
43737
|
+
draw: {
|
|
43738
|
+
lines: {
|
|
43739
|
+
color: 'white',
|
|
43740
|
+
width: 0.5,
|
|
43741
|
+
dash: [4, 10],
|
|
43742
|
+
},
|
|
43743
|
+
},
|
|
43744
|
+
},
|
|
43745
|
+
'1.12': {
|
|
43746
|
+
filter: `function () {
|
|
43747
|
+
const { lane_number } = feature;
|
|
43748
|
+
|
|
43749
|
+
const isFilter = lane_number === '1.12';
|
|
43750
|
+
|
|
43751
|
+
return isFilter;
|
|
43752
|
+
}`,
|
|
43753
|
+
draw: {
|
|
43754
|
+
lines: {
|
|
43755
|
+
color: 'white',
|
|
43756
|
+
width: 2,
|
|
43757
|
+
},
|
|
43758
|
+
},
|
|
43759
|
+
},
|
|
43760
|
+
},
|
|
43761
|
+
};
|
|
43762
|
+
layers.push(layer);
|
|
43763
|
+
return layers;
|
|
43764
|
+
};
|
|
43765
|
+
const getLaneMarkingPointLayers = (source) => {
|
|
43766
|
+
const layers = [];
|
|
43767
|
+
const data = {
|
|
43768
|
+
source,
|
|
43769
|
+
layer: '"LaneMarkingPoint"',
|
|
43770
|
+
};
|
|
43771
|
+
const layer = {
|
|
43772
|
+
id: uuid(),
|
|
43773
|
+
data,
|
|
43774
|
+
draw: {
|
|
43775
|
+
points: {
|
|
43776
|
+
texture: 'lane-marking',
|
|
43777
|
+
sprite: 'base',
|
|
43778
|
+
angle: `function() {
|
|
43779
|
+
const { angle } = feature;
|
|
43780
|
+
|
|
43781
|
+
return angle;
|
|
43782
|
+
}
|
|
43783
|
+
`,
|
|
43784
|
+
placement: 'midpoint',
|
|
43785
|
+
},
|
|
43786
|
+
},
|
|
43787
|
+
};
|
|
43788
|
+
layers.push(layer);
|
|
43789
|
+
return layers;
|
|
43790
|
+
};
|
|
43791
|
+
const getParkingLineLayers = (source) => {
|
|
43792
|
+
const layers = [];
|
|
43793
|
+
const data = {
|
|
43794
|
+
source,
|
|
43795
|
+
layer: '"ParkingLine"',
|
|
43796
|
+
};
|
|
43797
|
+
const layer = {
|
|
43798
|
+
id: uuid(),
|
|
43799
|
+
data,
|
|
43800
|
+
draw: {
|
|
43801
|
+
lines: {
|
|
43802
|
+
color: 'white',
|
|
43803
|
+
width: 1,
|
|
43804
|
+
},
|
|
43805
|
+
},
|
|
43806
|
+
};
|
|
43807
|
+
layers.push(layer);
|
|
43808
|
+
return layers;
|
|
43809
|
+
};
|
|
43810
|
+
|
|
43811
|
+
const getLayerName = ({ id, data: { source, layer }, }) => {
|
|
43812
|
+
const layerName = `${id}-${source}-${layer}`;
|
|
43813
|
+
return layerName;
|
|
43814
|
+
};
|
|
43815
|
+
const setLayerOrder = ({ layer, order, }) => {
|
|
43816
|
+
const cloneLayer = structuredClone(layer);
|
|
43817
|
+
const { draw, sublayers } = cloneLayer;
|
|
43818
|
+
if (draw) {
|
|
43819
|
+
const { points, lines, polygons, text, styles } = draw;
|
|
43820
|
+
if (points) {
|
|
43821
|
+
draw.points = {
|
|
43822
|
+
...structuredClone(points),
|
|
43823
|
+
order,
|
|
43824
|
+
};
|
|
43825
|
+
}
|
|
43826
|
+
if (lines) {
|
|
43827
|
+
draw.lines = {
|
|
43828
|
+
...structuredClone(lines),
|
|
43829
|
+
order,
|
|
43830
|
+
};
|
|
43831
|
+
}
|
|
43832
|
+
if (polygons) {
|
|
43833
|
+
draw.polygons = {
|
|
43834
|
+
...structuredClone(polygons),
|
|
43835
|
+
order,
|
|
43836
|
+
};
|
|
43837
|
+
}
|
|
43838
|
+
if (text) {
|
|
43839
|
+
draw.text = {
|
|
43840
|
+
...structuredClone(text),
|
|
43841
|
+
order,
|
|
43842
|
+
};
|
|
43843
|
+
}
|
|
43844
|
+
if (styles) {
|
|
43845
|
+
draw.styles = Object.entries(styles).reduce((accum, [name, style]) => ({
|
|
43846
|
+
...accum,
|
|
43847
|
+
[name]: {
|
|
43848
|
+
...structuredClone(style),
|
|
43849
|
+
order,
|
|
43850
|
+
},
|
|
43851
|
+
}), {});
|
|
43852
|
+
}
|
|
43853
|
+
cloneLayer.draw = structuredClone(draw);
|
|
43854
|
+
}
|
|
43855
|
+
if (sublayers) {
|
|
43856
|
+
Object.entries(sublayers).forEach(([name, sublayer]) => {
|
|
43857
|
+
if (sublayer) {
|
|
43858
|
+
const { draw } = sublayer;
|
|
43859
|
+
if (draw) {
|
|
43860
|
+
const { points, lines, polygons } = draw;
|
|
43861
|
+
if (points) {
|
|
43862
|
+
points.order = order;
|
|
43863
|
+
draw.points = points;
|
|
43864
|
+
}
|
|
43865
|
+
if (lines) {
|
|
43866
|
+
lines.order = order;
|
|
43867
|
+
draw.lines = lines;
|
|
43868
|
+
}
|
|
43869
|
+
if (polygons) {
|
|
43870
|
+
polygons.order = order;
|
|
43871
|
+
draw.polygons = polygons;
|
|
43872
|
+
}
|
|
43873
|
+
sublayer.draw = structuredClone(draw);
|
|
43874
|
+
}
|
|
43875
|
+
sublayers[name] = structuredClone(sublayer);
|
|
43876
|
+
}
|
|
43877
|
+
});
|
|
43878
|
+
cloneLayer.sublayers = structuredClone(sublayers);
|
|
43879
|
+
}
|
|
43880
|
+
return cloneLayer;
|
|
43881
|
+
};
|
|
43882
|
+
|
|
43476
43883
|
const useGetLeafletLayer = () => {
|
|
43477
43884
|
const { instance: { isValidApiKey }, } = GlobalConfig;
|
|
43478
43885
|
const [layer, setLayer] = React__namespace.useState(null);
|
|
@@ -43490,6 +43897,141 @@ const useGetLeafletLayer = () => {
|
|
|
43490
43897
|
}
|
|
43491
43898
|
});
|
|
43492
43899
|
};
|
|
43900
|
+
const addSource = React__namespace.useCallback((sourceConfig) => {
|
|
43901
|
+
if (!scene) {
|
|
43902
|
+
console.warn('Scene не инициализирована');
|
|
43903
|
+
return;
|
|
43904
|
+
}
|
|
43905
|
+
if (!config) {
|
|
43906
|
+
console.warn('Config не инициализирована');
|
|
43907
|
+
return;
|
|
43908
|
+
}
|
|
43909
|
+
const { name } = sourceConfig;
|
|
43910
|
+
config.sources[name] = structuredClone(sourceConfig);
|
|
43911
|
+
scene.updateConfig({ rebuild: true });
|
|
43912
|
+
return getSources();
|
|
43913
|
+
}, [scene, config]);
|
|
43914
|
+
const getSource = React__namespace.useCallback((sourceName) => {
|
|
43915
|
+
if (!config) {
|
|
43916
|
+
console.warn('Config не инициализирована');
|
|
43917
|
+
return;
|
|
43918
|
+
}
|
|
43919
|
+
return structuredClone(config.sources[sourceName]);
|
|
43920
|
+
}, [config]);
|
|
43921
|
+
const updateSource = React__namespace.useCallback((sourceName, newUrl) => {
|
|
43922
|
+
if (!scene) {
|
|
43923
|
+
console.warn('Scene не инициализирована');
|
|
43924
|
+
return;
|
|
43925
|
+
}
|
|
43926
|
+
if (!config) {
|
|
43927
|
+
console.warn('Config не инициализирована');
|
|
43928
|
+
return;
|
|
43929
|
+
}
|
|
43930
|
+
config.sources[sourceName].url = newUrl;
|
|
43931
|
+
scene.updateConfig({ rebuild: true });
|
|
43932
|
+
return getSources();
|
|
43933
|
+
}, [config, scene]);
|
|
43934
|
+
const addLayer = React__namespace.useCallback((layer) => {
|
|
43935
|
+
if (!scene) {
|
|
43936
|
+
console.warn('Scene не инициализирован');
|
|
43937
|
+
return;
|
|
43938
|
+
}
|
|
43939
|
+
if (!config) {
|
|
43940
|
+
console.warn('Config не инициализирован');
|
|
43941
|
+
return;
|
|
43942
|
+
}
|
|
43943
|
+
const order = getLayers().length + 1;
|
|
43944
|
+
const layerWithOrder = setLayerOrder({
|
|
43945
|
+
layer,
|
|
43946
|
+
order,
|
|
43947
|
+
});
|
|
43948
|
+
const layerName = getLayerName(layerWithOrder);
|
|
43949
|
+
const { sublayers = {}, draw } = layerWithOrder;
|
|
43950
|
+
if (draw) {
|
|
43951
|
+
const { styles = {} } = draw;
|
|
43952
|
+
if (styles) {
|
|
43953
|
+
layerWithOrder.draw = {
|
|
43954
|
+
...structuredClone(draw),
|
|
43955
|
+
...structuredClone(styles),
|
|
43956
|
+
};
|
|
43957
|
+
}
|
|
43958
|
+
}
|
|
43959
|
+
config.layers[layerName] = {
|
|
43960
|
+
...structuredClone(layerWithOrder),
|
|
43961
|
+
...structuredClone(sublayers),
|
|
43962
|
+
};
|
|
43963
|
+
scene.updateConfig({ rebuild: true });
|
|
43964
|
+
return getLayers();
|
|
43965
|
+
}, [config, scene]);
|
|
43966
|
+
const removeLayer = React__namespace.useCallback((layer) => {
|
|
43967
|
+
if (!scene) {
|
|
43968
|
+
console.warn('Scene не инициализирован');
|
|
43969
|
+
return;
|
|
43970
|
+
}
|
|
43971
|
+
if (!config) {
|
|
43972
|
+
console.warn('Config не инициализирован');
|
|
43973
|
+
return;
|
|
43974
|
+
}
|
|
43975
|
+
const layerName = getLayerName(layer);
|
|
43976
|
+
if (config.layers[layerName]) {
|
|
43977
|
+
delete config.layers[layerName];
|
|
43978
|
+
}
|
|
43979
|
+
scene.updateConfig({ rebuild: true });
|
|
43980
|
+
return getLayers();
|
|
43981
|
+
}, [config, scene]);
|
|
43982
|
+
const addStyle = React__namespace.useCallback(({ name, style }) => {
|
|
43983
|
+
if (!scene) {
|
|
43984
|
+
console.warn('Scene не инициализирована');
|
|
43985
|
+
return;
|
|
43986
|
+
}
|
|
43987
|
+
if (!config) {
|
|
43988
|
+
console.warn('Config не инициализирована');
|
|
43989
|
+
return;
|
|
43990
|
+
}
|
|
43991
|
+
config.styles[name] = structuredClone(style);
|
|
43992
|
+
scene.updateConfig({ rebuild: true });
|
|
43993
|
+
}, [config, scene]);
|
|
43994
|
+
const getLayerVisibility = React__namespace.useCallback((layer) => {
|
|
43995
|
+
if (!config) {
|
|
43996
|
+
console.warn('Config не инициализирована');
|
|
43997
|
+
return;
|
|
43998
|
+
}
|
|
43999
|
+
const layerName = getLayerName(layer);
|
|
44000
|
+
const { visible: layerVisibility } = config.layers[layerName];
|
|
44001
|
+
return layerVisibility;
|
|
44002
|
+
}, [config]);
|
|
44003
|
+
const toggleLayerVisibility = React__namespace.useCallback(({ layer, visible }) => {
|
|
44004
|
+
if (!scene) {
|
|
44005
|
+
console.warn('Scene не инициализирована');
|
|
44006
|
+
return;
|
|
44007
|
+
}
|
|
44008
|
+
if (!config) {
|
|
44009
|
+
console.warn('Config не инициализирована');
|
|
44010
|
+
return;
|
|
44011
|
+
}
|
|
44012
|
+
const layerName = getLayerName(layer);
|
|
44013
|
+
config.layers[layerName].visible = visible;
|
|
44014
|
+
scene.updateConfig();
|
|
44015
|
+
return getLayerVisibility(layer);
|
|
44016
|
+
}, [config, scene]);
|
|
44017
|
+
const getLayers = React__namespace.useCallback(() => {
|
|
44018
|
+
if (!config)
|
|
44019
|
+
return [];
|
|
44020
|
+
const { layers } = config;
|
|
44021
|
+
return Object.keys(layers);
|
|
44022
|
+
}, [config]);
|
|
44023
|
+
const removeLayers = React__namespace.useCallback(() => {
|
|
44024
|
+
if (!config)
|
|
44025
|
+
return [];
|
|
44026
|
+
const { layers } = config;
|
|
44027
|
+
Object.values(layers).forEach(removeLayer);
|
|
44028
|
+
}, [config]);
|
|
44029
|
+
const getSources = React__namespace.useCallback(() => {
|
|
44030
|
+
if (!config)
|
|
44031
|
+
return [];
|
|
44032
|
+
const { sources } = config;
|
|
44033
|
+
return Object.keys(sources);
|
|
44034
|
+
}, [config]);
|
|
43493
44035
|
React__namespace.useEffect(() => {
|
|
43494
44036
|
if (isValidApiKey) {
|
|
43495
44037
|
getLeafletLayer();
|
|
@@ -43509,10 +44051,120 @@ const useGetLeafletLayer = () => {
|
|
|
43509
44051
|
});
|
|
43510
44052
|
}
|
|
43511
44053
|
}, [scene]);
|
|
44054
|
+
React__namespace.useEffect(() => {
|
|
44055
|
+
addStyle({
|
|
44056
|
+
name: 'space-tile',
|
|
44057
|
+
style: {
|
|
44058
|
+
shaders: {
|
|
44059
|
+
defines: {
|
|
44060
|
+
TILE_SCALE: 0.0002445,
|
|
44061
|
+
'NORMALIZED_SHORT(x)': '(x * 32767.)',
|
|
44062
|
+
},
|
|
44063
|
+
blocks: {
|
|
44064
|
+
global: `
|
|
44065
|
+
varying vec3 v_pos;
|
|
44066
|
+
vec2 getTileCoords() {
|
|
44067
|
+
return fract(v_pos.xy);
|
|
44068
|
+
}
|
|
44069
|
+
`,
|
|
44070
|
+
position: `
|
|
44071
|
+
v_pos = modelPosition().xyz;
|
|
44072
|
+
`,
|
|
44073
|
+
},
|
|
44074
|
+
},
|
|
44075
|
+
},
|
|
44076
|
+
});
|
|
44077
|
+
addStyle({
|
|
44078
|
+
name: 'tools-aastep',
|
|
44079
|
+
style: {
|
|
44080
|
+
shaders: {
|
|
44081
|
+
extensions: 'OES_standard_derivatives',
|
|
44082
|
+
blocks: {
|
|
44083
|
+
global: `
|
|
44084
|
+
float aastep(float threshold, float value) {
|
|
44085
|
+
#ifdef TANGRAM_FRAGMENT_SHADER
|
|
44086
|
+
#ifdef TANGRAM_EXTENSION_OES_standard_derivatives
|
|
44087
|
+
float afwidth = length(vec2(dFdx(value), dFdy(value))) * 0.70710678118654757;
|
|
44088
|
+
return smoothstep(threshold-afwidth, threshold+afwidth, value);
|
|
44089
|
+
#else
|
|
44090
|
+
return step(threshold, value);
|
|
44091
|
+
#endif
|
|
44092
|
+
#else
|
|
44093
|
+
return step(threshold, value);
|
|
44094
|
+
#endif
|
|
44095
|
+
}
|
|
44096
|
+
`,
|
|
44097
|
+
},
|
|
44098
|
+
},
|
|
44099
|
+
},
|
|
44100
|
+
});
|
|
44101
|
+
addStyle({
|
|
44102
|
+
name: 'pattern-diagonal-grid',
|
|
44103
|
+
style: {
|
|
44104
|
+
mix: ['space-tile', 'tools-aastep'],
|
|
44105
|
+
shaders: {
|
|
44106
|
+
blocks: {
|
|
44107
|
+
global: `
|
|
44108
|
+
float DiagonalGrid(float scale, float lineWidth) {
|
|
44109
|
+
vec2 st = getTileCoords() * scale;
|
|
44110
|
+
|
|
44111
|
+
float d1 = mod(st.x + st.y, 1.0);
|
|
44112
|
+
float line1 = aastep(lineWidth, d1) * aastep(1.0 - lineWidth, d1);
|
|
44113
|
+
|
|
44114
|
+
float d2 = mod(st.x - st.y, 1.0);
|
|
44115
|
+
float line2 = aastep(lineWidth, d2) * aastep(1.0 - lineWidth, d2);
|
|
44116
|
+
|
|
44117
|
+
return max(line1, line2);
|
|
44118
|
+
}
|
|
44119
|
+
`,
|
|
44120
|
+
},
|
|
44121
|
+
},
|
|
44122
|
+
},
|
|
44123
|
+
});
|
|
44124
|
+
addStyle({
|
|
44125
|
+
name: 'diagonal-grid',
|
|
44126
|
+
style: {
|
|
44127
|
+
mix: 'pattern-diagonal-grid',
|
|
44128
|
+
blend: 'screen',
|
|
44129
|
+
base: 'polygons',
|
|
44130
|
+
shaders: {
|
|
44131
|
+
blocks: {
|
|
44132
|
+
color: `
|
|
44133
|
+
float grid = DiagonalGrid(12.0, 0.08);
|
|
44134
|
+
|
|
44135
|
+
color.a = grid;
|
|
44136
|
+
`,
|
|
44137
|
+
},
|
|
44138
|
+
},
|
|
44139
|
+
},
|
|
44140
|
+
});
|
|
44141
|
+
}, [addStyle]);
|
|
44142
|
+
React__namespace.useEffect(() => {
|
|
44143
|
+
Object.values(exports.TangramSourceNames).forEach((name) => {
|
|
44144
|
+
const url = sourceUrl[name];
|
|
44145
|
+
addSource({
|
|
44146
|
+
tile_size,
|
|
44147
|
+
name,
|
|
44148
|
+
url,
|
|
44149
|
+
type: 'MVT',
|
|
44150
|
+
});
|
|
44151
|
+
});
|
|
44152
|
+
}, [addSource]);
|
|
43512
44153
|
return {
|
|
43513
44154
|
layer,
|
|
43514
44155
|
scene,
|
|
43515
44156
|
config,
|
|
44157
|
+
addSource,
|
|
44158
|
+
getSource,
|
|
44159
|
+
updateSource,
|
|
44160
|
+
addLayer,
|
|
44161
|
+
removeLayer,
|
|
44162
|
+
addStyle,
|
|
44163
|
+
getLayerVisibility,
|
|
44164
|
+
toggleLayerVisibility,
|
|
44165
|
+
getSources,
|
|
44166
|
+
getLayers,
|
|
44167
|
+
removeLayers,
|
|
43516
44168
|
};
|
|
43517
44169
|
};
|
|
43518
44170
|
|
|
@@ -43527,22 +44179,6 @@ const LeafletLayer = () => {
|
|
|
43527
44179
|
return null;
|
|
43528
44180
|
};
|
|
43529
44181
|
|
|
43530
|
-
exports.API_METHODS = void 0;
|
|
43531
|
-
(function (API_METHODS) {
|
|
43532
|
-
API_METHODS["GET"] = "GET";
|
|
43533
|
-
API_METHODS["DELETE"] = "DELETE";
|
|
43534
|
-
API_METHODS["PUT"] = "PUT";
|
|
43535
|
-
API_METHODS["POST"] = "POST";
|
|
43536
|
-
})(exports.API_METHODS || (exports.API_METHODS = {}));
|
|
43537
|
-
|
|
43538
|
-
exports.PanelsNames = void 0;
|
|
43539
|
-
(function (PanelsNames) {
|
|
43540
|
-
PanelsNames["TOP_RIGHT"] = "top-right";
|
|
43541
|
-
PanelsNames["BOTTOM_RIGHT"] = "bottom-right";
|
|
43542
|
-
PanelsNames["BOTTOM_LEFT"] = "bottom-left";
|
|
43543
|
-
PanelsNames["TOP_LEFT"] = "top-left";
|
|
43544
|
-
})(exports.PanelsNames || (exports.PanelsNames = {}));
|
|
43545
|
-
|
|
43546
44182
|
// define() gets called for each chunk generated by the first Rollup pass.
|
|
43547
44183
|
// The order the chunks are called in is controlled by the imports in bundle.js:
|
|
43548
44184
|
//
|
|
@@ -43608,7 +44244,15 @@ exports.LeafletLayer = LeafletLayer;
|
|
|
43608
44244
|
exports.List = CustomList;
|
|
43609
44245
|
exports.NoData = NoData;
|
|
43610
44246
|
exports.Select = CustomSelect;
|
|
44247
|
+
exports._backendUrl = _backendUrl;
|
|
43611
44248
|
exports._testApiKeys = _testApiKeys;
|
|
44249
|
+
exports.getLaneMarkingLineLayers = getLaneMarkingLineLayers;
|
|
44250
|
+
exports.getLaneMarkingPointLayers = getLaneMarkingPointLayers;
|
|
44251
|
+
exports.getLaneMarkingPolyLayers = getLaneMarkingPolyLayers;
|
|
44252
|
+
exports.getParkingLineLayers = getParkingLineLayers;
|
|
44253
|
+
exports.getRoadPolyLayers = getRoadPolyLayers;
|
|
44254
|
+
exports.sourceUrl = sourceUrl;
|
|
44255
|
+
exports.tile_size = tile_size;
|
|
43612
44256
|
exports.useFormContext = useFormContext;
|
|
43613
44257
|
exports.useGetLeafletLayer = useGetLeafletLayer;
|
|
43614
44258
|
//# sourceMappingURL=index.cjs.map
|