@dartcom/ui-kit 3.5.3 → 3.6.1
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 +2 -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 +1897 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +9 -9
- 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,21 +44179,1223 @@ const LeafletLayer = () => {
|
|
|
43527
44179
|
return null;
|
|
43528
44180
|
};
|
|
43529
44181
|
|
|
43530
|
-
|
|
43531
|
-
|
|
43532
|
-
|
|
43533
|
-
|
|
43534
|
-
|
|
43535
|
-
|
|
43536
|
-
|
|
44182
|
+
const getBuiltupAreaLayers = (source) => {
|
|
44183
|
+
const layers = [];
|
|
44184
|
+
const data = {
|
|
44185
|
+
source,
|
|
44186
|
+
layer: '"MapAdminBuiltupArea"',
|
|
44187
|
+
};
|
|
44188
|
+
const layer = {
|
|
44189
|
+
id: uuid(),
|
|
44190
|
+
data,
|
|
44191
|
+
draw: {
|
|
44192
|
+
polygons: {
|
|
44193
|
+
color: '#CFC8C8',
|
|
44194
|
+
},
|
|
44195
|
+
},
|
|
44196
|
+
};
|
|
44197
|
+
layers.push(layer);
|
|
44198
|
+
return layers;
|
|
44199
|
+
};
|
|
43537
44200
|
|
|
43538
|
-
|
|
43539
|
-
|
|
43540
|
-
|
|
43541
|
-
|
|
43542
|
-
|
|
43543
|
-
|
|
43544
|
-
|
|
44201
|
+
const getPointAddressLayers = (source) => {
|
|
44202
|
+
const layer = {
|
|
44203
|
+
id: uuid(),
|
|
44204
|
+
data: {
|
|
44205
|
+
source,
|
|
44206
|
+
layer: '"PointAddress"',
|
|
44207
|
+
minzoom: 15,
|
|
44208
|
+
},
|
|
44209
|
+
draw: {
|
|
44210
|
+
text: {
|
|
44211
|
+
interactive: true,
|
|
44212
|
+
text_source: 'address',
|
|
44213
|
+
font: {
|
|
44214
|
+
fill: 'black',
|
|
44215
|
+
size: '12px',
|
|
44216
|
+
},
|
|
44217
|
+
},
|
|
44218
|
+
},
|
|
44219
|
+
};
|
|
44220
|
+
return [layer];
|
|
44221
|
+
};
|
|
44222
|
+
|
|
44223
|
+
const text_source = `function() {
|
|
44224
|
+
const { poi_name, cat_id } = feature;
|
|
44225
|
+
|
|
44226
|
+
switch (+cat_id) {
|
|
44227
|
+
case 4100: {
|
|
44228
|
+
const text = poi_name.replaceAll(/(Метро-|Станция-|МЦД-)/g, "");
|
|
44229
|
+
|
|
44230
|
+
return text;
|
|
44231
|
+
}
|
|
44232
|
+
|
|
44233
|
+
default: {
|
|
44234
|
+
return poi_name;
|
|
44235
|
+
}
|
|
44236
|
+
}
|
|
44237
|
+
}`;
|
|
44238
|
+
const catIds = [
|
|
44239
|
+
3578, 4013, 4100, 5400, 5511, 5512, 5540, 5541, 5800, 5813, 5999, 6000, 7011,
|
|
44240
|
+
7389, 7832, 7929, 7990, 8060, 8410, 9517, 9530, 9565, 9583, 9718, 9992,
|
|
44241
|
+
];
|
|
44242
|
+
|
|
44243
|
+
const getDefaultPOI = (cat_id) => {
|
|
44244
|
+
const defaultPOI = {};
|
|
44245
|
+
switch (cat_id) {
|
|
44246
|
+
case 4100: {
|
|
44247
|
+
defaultPOI[`_${cat_id}-metro`] = {
|
|
44248
|
+
filter: `function() {
|
|
44249
|
+
const { poi_name, cat_id } = feature;
|
|
44250
|
+
|
|
44251
|
+
const isMetro = poi_name.startsWith('Метро-');
|
|
44252
|
+
const isStation = poi_name.startsWith('Станция-');
|
|
44253
|
+
|
|
44254
|
+
const isCatId = +cat_id === ${cat_id};
|
|
44255
|
+
|
|
44256
|
+
const isFilter = isCatId && (isMetro || isStation);
|
|
44257
|
+
|
|
44258
|
+
return isFilter;
|
|
44259
|
+
}`,
|
|
44260
|
+
draw: {
|
|
44261
|
+
points: getPOITypeLayer(`POI_${cat_id}(metro)`),
|
|
44262
|
+
},
|
|
44263
|
+
};
|
|
44264
|
+
defaultPOI[`_${cat_id}-diameter`] = {
|
|
44265
|
+
filter: `function() {
|
|
44266
|
+
const { cat_id, poi_name } = feature;
|
|
44267
|
+
|
|
44268
|
+
const isDiameter = poi_name.startsWith('МЦД-');
|
|
44269
|
+
|
|
44270
|
+
const isCatId = +cat_id === ${cat_id};
|
|
44271
|
+
|
|
44272
|
+
const isFilter = isCatId && isDiameter;
|
|
44273
|
+
|
|
44274
|
+
return isFilter;
|
|
44275
|
+
}`,
|
|
44276
|
+
draw: {
|
|
44277
|
+
points: getPOITypeLayer(`POI_${cat_id}(diameter)`),
|
|
44278
|
+
},
|
|
44279
|
+
};
|
|
44280
|
+
break;
|
|
44281
|
+
}
|
|
44282
|
+
case 9530: {
|
|
44283
|
+
defaultPOI[`_${cat_id}-mail`] = {
|
|
44284
|
+
filter: `function() {
|
|
44285
|
+
const { cat_id, poi_name = '' } = feature;
|
|
44286
|
+
|
|
44287
|
+
const isCatId = +cat_id === ${cat_id};
|
|
44288
|
+
|
|
44289
|
+
const isMail = poi_name.startsWith('Почта');
|
|
44290
|
+
|
|
44291
|
+
const isFilter = isCatId && isMail;
|
|
44292
|
+
|
|
44293
|
+
return isFilter;
|
|
44294
|
+
}`,
|
|
44295
|
+
draw: {
|
|
44296
|
+
points: getPOITypeLayer(`POI_${cat_id}(Mail)`),
|
|
44297
|
+
},
|
|
44298
|
+
};
|
|
44299
|
+
defaultPOI[`_${cat_id}-delivery`] = {
|
|
44300
|
+
filter: `function() {
|
|
44301
|
+
const { cat_id, poi_name = '' } = feature;
|
|
44302
|
+
|
|
44303
|
+
const isCatId = +cat_id === ${cat_id};
|
|
44304
|
+
|
|
44305
|
+
const isMail = poi_name.startsWith('Почта');
|
|
44306
|
+
|
|
44307
|
+
const isFilter = isCatId && !isMail;
|
|
44308
|
+
|
|
44309
|
+
return isFilter;
|
|
44310
|
+
}`,
|
|
44311
|
+
draw: {
|
|
44312
|
+
points: getPOITypeLayer(`POI_${cat_id}(Delivery)`),
|
|
44313
|
+
},
|
|
44314
|
+
};
|
|
44315
|
+
break;
|
|
44316
|
+
}
|
|
44317
|
+
case 9992: {
|
|
44318
|
+
const subcat = {
|
|
44319
|
+
mosque: 1,
|
|
44320
|
+
church: 2,
|
|
44321
|
+
temple: 3,
|
|
44322
|
+
davidStar: 4,
|
|
44323
|
+
mortar: 6,
|
|
44324
|
+
};
|
|
44325
|
+
Object.entries(subcat).forEach(([subcat_name, subcat_id]) => {
|
|
44326
|
+
defaultPOI[`_${cat_id}-${subcat_name}`] = {
|
|
44327
|
+
filter: `function() {
|
|
44328
|
+
const { cat_id, subcat_id } = feature;
|
|
44329
|
+
|
|
44330
|
+
const isCatId = +cat_id === ${cat_id};
|
|
44331
|
+
const isSubcatId = +subcat_id === ${subcat_id};
|
|
44332
|
+
|
|
44333
|
+
const isFilter = isCatId && isSubcatId;
|
|
44334
|
+
|
|
44335
|
+
return isFilter;
|
|
44336
|
+
}`,
|
|
44337
|
+
draw: {
|
|
44338
|
+
points: getPOITypeLayer(`POI_${cat_id}(${subcat_name})`),
|
|
44339
|
+
},
|
|
44340
|
+
};
|
|
44341
|
+
});
|
|
44342
|
+
break;
|
|
44343
|
+
}
|
|
44344
|
+
default: {
|
|
44345
|
+
defaultPOI[`_${cat_id}`] = {
|
|
44346
|
+
filter: `function {
|
|
44347
|
+
const { cat_id } = feature;
|
|
44348
|
+
|
|
44349
|
+
const isFilter = +cat_id === ${cat_id};
|
|
44350
|
+
|
|
44351
|
+
return isFilter;
|
|
44352
|
+
}`,
|
|
44353
|
+
draw: {
|
|
44354
|
+
points: getPOITypeLayer(`POI_${cat_id}`),
|
|
44355
|
+
},
|
|
44356
|
+
};
|
|
44357
|
+
}
|
|
44358
|
+
}
|
|
44359
|
+
return defaultPOI;
|
|
44360
|
+
};
|
|
44361
|
+
const getPOITypeLayer = (texture) => {
|
|
44362
|
+
const typeLayer = {
|
|
44363
|
+
texture,
|
|
44364
|
+
sprite: 'base',
|
|
44365
|
+
size: '20px',
|
|
44366
|
+
placement: 'midpoint',
|
|
44367
|
+
};
|
|
44368
|
+
return typeLayer;
|
|
44369
|
+
};
|
|
44370
|
+
const sublayers = catIds.reduce((acc, catId) => ({
|
|
44371
|
+
...acc,
|
|
44372
|
+
...getDefaultPOI(catId),
|
|
44373
|
+
}), {});
|
|
44374
|
+
const getPOILayers = (source) => {
|
|
44375
|
+
const layers = [];
|
|
44376
|
+
const layer = {
|
|
44377
|
+
id: uuid(),
|
|
44378
|
+
data: {
|
|
44379
|
+
source,
|
|
44380
|
+
layer: '"POI"',
|
|
44381
|
+
},
|
|
44382
|
+
draw: {
|
|
44383
|
+
points: {
|
|
44384
|
+
text: {
|
|
44385
|
+
text_source,
|
|
44386
|
+
font: {
|
|
44387
|
+
fill: '#464544',
|
|
44388
|
+
size: '12px',
|
|
44389
|
+
},
|
|
44390
|
+
},
|
|
44391
|
+
},
|
|
44392
|
+
},
|
|
44393
|
+
sublayers,
|
|
44394
|
+
};
|
|
44395
|
+
layers.push(layer);
|
|
44396
|
+
return layers;
|
|
44397
|
+
};
|
|
44398
|
+
|
|
44399
|
+
const getCityPOILayers = (source) => {
|
|
44400
|
+
const layer = {
|
|
44401
|
+
id: uuid(),
|
|
44402
|
+
data: {
|
|
44403
|
+
source,
|
|
44404
|
+
layer: '"CityPOI"',
|
|
44405
|
+
},
|
|
44406
|
+
filter: `function () {
|
|
44407
|
+
const { capital_order8, capital_order2, capital_order1, poi_name, priority } = feature;
|
|
44408
|
+
|
|
44409
|
+
if ($zoom >= 9 && $zoom < 13) {
|
|
44410
|
+
return priority < 8;
|
|
44411
|
+
}
|
|
44412
|
+
|
|
44413
|
+
if ($zoom <= 11) {
|
|
44414
|
+
return capital_order8 === 'Y';
|
|
44415
|
+
}
|
|
44416
|
+
|
|
44417
|
+
if ($zoom >= 15) {
|
|
44418
|
+
return capital_order2 !== 'Y';
|
|
44419
|
+
}
|
|
44420
|
+
|
|
44421
|
+
return true;
|
|
44422
|
+
}
|
|
44423
|
+
`,
|
|
44424
|
+
draw: {
|
|
44425
|
+
text: {
|
|
44426
|
+
text_source: 'poi_name',
|
|
44427
|
+
priority: `function () {
|
|
44428
|
+
const { priority } = feature;
|
|
44429
|
+
|
|
44430
|
+
if ($zoom <= 15) {
|
|
44431
|
+
return priority;
|
|
44432
|
+
}
|
|
44433
|
+
|
|
44434
|
+
return 1;
|
|
44435
|
+
}
|
|
44436
|
+
`,
|
|
44437
|
+
font: {
|
|
44438
|
+
fill: 'black',
|
|
44439
|
+
size: `function() {
|
|
44440
|
+
const { capital_order8 } = feature;
|
|
44441
|
+
|
|
44442
|
+
if (capital_order8 === 'Y') {
|
|
44443
|
+
return '16px';
|
|
44444
|
+
}
|
|
44445
|
+
|
|
44446
|
+
return '12px';
|
|
44447
|
+
}`,
|
|
44448
|
+
weight: `function() {
|
|
44449
|
+
const { capital_order2 } = feature;
|
|
44450
|
+
|
|
44451
|
+
if (capital_order2 === 'Y') {
|
|
44452
|
+
return 'bold';
|
|
44453
|
+
}
|
|
44454
|
+
|
|
44455
|
+
return 'normal';
|
|
44456
|
+
}`,
|
|
44457
|
+
stroke: {
|
|
44458
|
+
color: 'white',
|
|
44459
|
+
width: '2px',
|
|
44460
|
+
},
|
|
44461
|
+
},
|
|
44462
|
+
},
|
|
44463
|
+
},
|
|
44464
|
+
};
|
|
44465
|
+
return [layer];
|
|
44466
|
+
};
|
|
44467
|
+
|
|
44468
|
+
const getOneWayLayers = (source) => {
|
|
44469
|
+
const layer = {
|
|
44470
|
+
id: uuid(),
|
|
44471
|
+
data: {
|
|
44472
|
+
source,
|
|
44473
|
+
layer: '"OneWay"',
|
|
44474
|
+
},
|
|
44475
|
+
draw: {
|
|
44476
|
+
points: {
|
|
44477
|
+
texture: 'arrow',
|
|
44478
|
+
sprite: 'base',
|
|
44479
|
+
angle: `function() {
|
|
44480
|
+
const { bearing } = feature;
|
|
44481
|
+
|
|
44482
|
+
return bearing;
|
|
44483
|
+
}
|
|
44484
|
+
`,
|
|
44485
|
+
},
|
|
44486
|
+
},
|
|
44487
|
+
};
|
|
44488
|
+
return [layer];
|
|
44489
|
+
};
|
|
44490
|
+
|
|
44491
|
+
var ConditionTypes;
|
|
44492
|
+
(function (ConditionTypes) {
|
|
44493
|
+
ConditionTypes["traffic_signal"] = "traffic_signal";
|
|
44494
|
+
ConditionTypes["pedestrian_crossing"] = "pedestrian_crossing";
|
|
44495
|
+
ConditionTypes["physical"] = "physical";
|
|
44496
|
+
ConditionTypes["gate"] = "gate";
|
|
44497
|
+
})(ConditionTypes || (ConditionTypes = {}));
|
|
44498
|
+
|
|
44499
|
+
const getConditionLayers = (source) => {
|
|
44500
|
+
const sublayers = {};
|
|
44501
|
+
const layer = {
|
|
44502
|
+
id: uuid(),
|
|
44503
|
+
data: {
|
|
44504
|
+
source,
|
|
44505
|
+
layer: '"Conditions"',
|
|
44506
|
+
},
|
|
44507
|
+
};
|
|
44508
|
+
Object.values(ConditionTypes).forEach((conditionType) => {
|
|
44509
|
+
sublayers[`_${conditionType}`] = {
|
|
44510
|
+
filter: `function() {
|
|
44511
|
+
const { type } = feature;
|
|
44512
|
+
|
|
44513
|
+
const isShow = type === '${conditionType}';
|
|
44514
|
+
|
|
44515
|
+
return isShow;
|
|
44516
|
+
}`,
|
|
44517
|
+
draw: {
|
|
44518
|
+
points: {
|
|
44519
|
+
texture: conditionType,
|
|
44520
|
+
sprite: 'base',
|
|
44521
|
+
placement: 'midpoint',
|
|
44522
|
+
},
|
|
44523
|
+
},
|
|
44524
|
+
};
|
|
44525
|
+
});
|
|
44526
|
+
layer.sublayers = sublayers;
|
|
44527
|
+
return [layer];
|
|
44528
|
+
};
|
|
44529
|
+
|
|
44530
|
+
const getRailroadLayers = (source) => {
|
|
44531
|
+
const layer = '"MapRailroadLink"';
|
|
44532
|
+
const layers = [];
|
|
44533
|
+
const data = {
|
|
44534
|
+
source,
|
|
44535
|
+
layer,
|
|
44536
|
+
};
|
|
44537
|
+
const frontLayer = {
|
|
44538
|
+
id: uuid(),
|
|
44539
|
+
data: {
|
|
44540
|
+
source,
|
|
44541
|
+
layer,
|
|
44542
|
+
},
|
|
44543
|
+
draw: {
|
|
44544
|
+
lines: {
|
|
44545
|
+
width: 5,
|
|
44546
|
+
dash: [2, 1],
|
|
44547
|
+
color: '#5C5F5F',
|
|
44548
|
+
cap: 'round',
|
|
44549
|
+
join: 'round',
|
|
44550
|
+
},
|
|
44551
|
+
},
|
|
44552
|
+
};
|
|
44553
|
+
const backLayer = {
|
|
44554
|
+
id: uuid(),
|
|
44555
|
+
data,
|
|
44556
|
+
draw: {
|
|
44557
|
+
lines: {
|
|
44558
|
+
width: 6,
|
|
44559
|
+
color: '#A3A8A',
|
|
44560
|
+
cap: 'round',
|
|
44561
|
+
join: 'round',
|
|
44562
|
+
},
|
|
44563
|
+
},
|
|
44564
|
+
};
|
|
44565
|
+
layers.push(backLayer, frontLayer);
|
|
44566
|
+
return layers;
|
|
44567
|
+
};
|
|
44568
|
+
|
|
44569
|
+
const getWaterAreaLayers = (source) => {
|
|
44570
|
+
const layers = [];
|
|
44571
|
+
const layer = {
|
|
44572
|
+
id: uuid(),
|
|
44573
|
+
data: {
|
|
44574
|
+
source,
|
|
44575
|
+
layer: '"MapWaterArea"',
|
|
44576
|
+
},
|
|
44577
|
+
draw: {
|
|
44578
|
+
polygons: {
|
|
44579
|
+
color: '#7DBEE4',
|
|
44580
|
+
},
|
|
44581
|
+
lines: {
|
|
44582
|
+
color: '#7DBEE4',
|
|
44583
|
+
width: 20,
|
|
44584
|
+
cap: 'round',
|
|
44585
|
+
join: 'round',
|
|
44586
|
+
},
|
|
44587
|
+
},
|
|
44588
|
+
};
|
|
44589
|
+
const waterAreaLabelLayer = {
|
|
44590
|
+
id: uuid(),
|
|
44591
|
+
data: {
|
|
44592
|
+
source,
|
|
44593
|
+
layer: '"MapWaterAreaLabel"',
|
|
44594
|
+
},
|
|
44595
|
+
filter: `function() {
|
|
44596
|
+
const { display_class } = feature;
|
|
44597
|
+
|
|
44598
|
+
if ($zoom >= 14) {
|
|
44599
|
+
return true;
|
|
44600
|
+
} else {
|
|
44601
|
+
return display_class <= 4;
|
|
44602
|
+
}
|
|
44603
|
+
}`,
|
|
44604
|
+
draw: {
|
|
44605
|
+
text: {
|
|
44606
|
+
text_source: 'name',
|
|
44607
|
+
font: {
|
|
44608
|
+
fill: '#0A80C4',
|
|
44609
|
+
size: '14px',
|
|
44610
|
+
stroke: { color: 'white', width: '3px' },
|
|
44611
|
+
},
|
|
44612
|
+
},
|
|
44613
|
+
},
|
|
44614
|
+
};
|
|
44615
|
+
const waterLakeLabelLayer = {
|
|
44616
|
+
id: uuid(),
|
|
44617
|
+
data: {
|
|
44618
|
+
source,
|
|
44619
|
+
layer: '"MapWaterLakeLabel"',
|
|
44620
|
+
},
|
|
44621
|
+
filter: `function() {
|
|
44622
|
+
const { display_class } = feature;
|
|
44623
|
+
|
|
44624
|
+
if ($zoom >= 14) {
|
|
44625
|
+
return true;
|
|
44626
|
+
} else {
|
|
44627
|
+
return display_class <= 4;
|
|
44628
|
+
}
|
|
44629
|
+
}`,
|
|
44630
|
+
draw: {
|
|
44631
|
+
text: {
|
|
44632
|
+
text_source: 'name',
|
|
44633
|
+
font: {
|
|
44634
|
+
fill: '#0A80C4',
|
|
44635
|
+
size: '14px',
|
|
44636
|
+
stroke: { color: 'white', width: '3px' },
|
|
44637
|
+
},
|
|
44638
|
+
},
|
|
44639
|
+
},
|
|
44640
|
+
};
|
|
44641
|
+
layers.push(layer, waterAreaLabelLayer, waterLakeLabelLayer);
|
|
44642
|
+
return layers;
|
|
44643
|
+
};
|
|
44644
|
+
|
|
44645
|
+
const getWaterLinkLayers = (source) => {
|
|
44646
|
+
const sublayers = {};
|
|
44647
|
+
const layer = {
|
|
44648
|
+
id: uuid(),
|
|
44649
|
+
data: {
|
|
44650
|
+
source,
|
|
44651
|
+
layer: '"MapWaterLink"',
|
|
44652
|
+
},
|
|
44653
|
+
};
|
|
44654
|
+
sublayers.geometry = {
|
|
44655
|
+
draw: {
|
|
44656
|
+
lines: {
|
|
44657
|
+
color: '#7DBEE4',
|
|
44658
|
+
width: 5,
|
|
44659
|
+
cap: 'round',
|
|
44660
|
+
join: 'round',
|
|
44661
|
+
},
|
|
44662
|
+
},
|
|
44663
|
+
};
|
|
44664
|
+
sublayers.text = {
|
|
44665
|
+
filter: `function() {
|
|
44666
|
+
return $zoom >= 10;
|
|
44667
|
+
}`,
|
|
44668
|
+
draw: {
|
|
44669
|
+
text: {
|
|
44670
|
+
text_source: 'name',
|
|
44671
|
+
font: {
|
|
44672
|
+
fill: '#0A80C4',
|
|
44673
|
+
size: '14px',
|
|
44674
|
+
stroke: { color: 'white', width: '3px' },
|
|
44675
|
+
},
|
|
44676
|
+
},
|
|
44677
|
+
},
|
|
44678
|
+
};
|
|
44679
|
+
layer.sublayers = sublayers;
|
|
44680
|
+
return [layer];
|
|
44681
|
+
};
|
|
44682
|
+
|
|
44683
|
+
const getOceanAreaLayers = (source) => {
|
|
44684
|
+
const geometryLayer = {
|
|
44685
|
+
id: uuid(),
|
|
44686
|
+
data: {
|
|
44687
|
+
source,
|
|
44688
|
+
layer: '"MapOceanArea"',
|
|
44689
|
+
},
|
|
44690
|
+
draw: {
|
|
44691
|
+
polygons: {
|
|
44692
|
+
color: '#7DBEE4',
|
|
44693
|
+
},
|
|
44694
|
+
},
|
|
44695
|
+
};
|
|
44696
|
+
const textLayer = {
|
|
44697
|
+
id: uuid(),
|
|
44698
|
+
data: {
|
|
44699
|
+
source,
|
|
44700
|
+
layer: '"MapOceanAreaLabel"',
|
|
44701
|
+
},
|
|
44702
|
+
draw: {
|
|
44703
|
+
text: {
|
|
44704
|
+
text_source: 'name',
|
|
44705
|
+
font: {
|
|
44706
|
+
fill: '#0A80C4',
|
|
44707
|
+
size: '18px',
|
|
44708
|
+
stroke: { color: 'white', width: '3px' },
|
|
44709
|
+
},
|
|
44710
|
+
},
|
|
44711
|
+
},
|
|
44712
|
+
};
|
|
44713
|
+
return [geometryLayer, textLayer];
|
|
44714
|
+
};
|
|
44715
|
+
|
|
44716
|
+
const getLanduseAreaLayers = (source) => {
|
|
44717
|
+
const layers = [];
|
|
44718
|
+
switch (source) {
|
|
44719
|
+
case exports.TangramSourceNames.NATURE_TILE: {
|
|
44720
|
+
const geometryLayer = {
|
|
44721
|
+
id: uuid(),
|
|
44722
|
+
data: {
|
|
44723
|
+
source,
|
|
44724
|
+
layer: '"MapNatureForest"',
|
|
44725
|
+
},
|
|
44726
|
+
draw: {
|
|
44727
|
+
polygons: {
|
|
44728
|
+
interactive: true,
|
|
44729
|
+
color: `function() {
|
|
44730
|
+
const { feature_type } = feature;
|
|
44731
|
+
|
|
44732
|
+
switch (feature_type) {
|
|
44733
|
+
case '900202': {
|
|
44734
|
+
return '#96BE7D';
|
|
44735
|
+
}
|
|
44736
|
+
|
|
44737
|
+
default : {
|
|
44738
|
+
return null;
|
|
44739
|
+
}
|
|
44740
|
+
}
|
|
44741
|
+
}`,
|
|
44742
|
+
},
|
|
44743
|
+
},
|
|
44744
|
+
};
|
|
44745
|
+
layers.push(geometryLayer);
|
|
44746
|
+
break;
|
|
44747
|
+
}
|
|
44748
|
+
default: {
|
|
44749
|
+
const geometryLayer = {
|
|
44750
|
+
id: uuid(),
|
|
44751
|
+
data: {
|
|
44752
|
+
source,
|
|
44753
|
+
layer: '"MapLanduseArea"',
|
|
44754
|
+
},
|
|
44755
|
+
draw: {
|
|
44756
|
+
polygons: {
|
|
44757
|
+
interactive: true,
|
|
44758
|
+
color: `function() {
|
|
44759
|
+
const { feature_type } = feature;
|
|
44760
|
+
|
|
44761
|
+
switch (feature_type) {
|
|
44762
|
+
case '509998': {
|
|
44763
|
+
return '#ECD175';
|
|
44764
|
+
}
|
|
44765
|
+
|
|
44766
|
+
case '600102':
|
|
44767
|
+
case '900140': {
|
|
44768
|
+
return '#3E9A8C';
|
|
44769
|
+
}
|
|
44770
|
+
|
|
44771
|
+
case '900202':
|
|
44772
|
+
case '900130':
|
|
44773
|
+
case '900150':
|
|
44774
|
+
case '900103': {
|
|
44775
|
+
return '#96BE7D';
|
|
44776
|
+
}
|
|
44777
|
+
|
|
44778
|
+
case '9997010': {
|
|
44779
|
+
return null;
|
|
44780
|
+
}
|
|
44781
|
+
}
|
|
44782
|
+
}`,
|
|
44783
|
+
order: `function() {
|
|
44784
|
+
const { feature_type } = feature;
|
|
44785
|
+
|
|
44786
|
+
switch(feature_type) {
|
|
44787
|
+
case '900150':
|
|
44788
|
+
case '900130':
|
|
44789
|
+
case '509998': {
|
|
44790
|
+
return 300;
|
|
44791
|
+
}
|
|
44792
|
+
|
|
44793
|
+
default: {
|
|
44794
|
+
return 299;
|
|
44795
|
+
}
|
|
44796
|
+
}
|
|
44797
|
+
}`,
|
|
44798
|
+
},
|
|
44799
|
+
},
|
|
44800
|
+
};
|
|
44801
|
+
const labelLayer = {
|
|
44802
|
+
id: uuid(),
|
|
44803
|
+
data: {
|
|
44804
|
+
source,
|
|
44805
|
+
layer: '"MapLanduseAreaLabel"',
|
|
44806
|
+
},
|
|
44807
|
+
filter: `function() {
|
|
44808
|
+
return $zoom >= 15;
|
|
44809
|
+
}`,
|
|
44810
|
+
draw: {
|
|
44811
|
+
text: {
|
|
44812
|
+
text_source: 'name',
|
|
44813
|
+
font: {
|
|
44814
|
+
size: '13px',
|
|
44815
|
+
fill: `function() {
|
|
44816
|
+
const { feature_type } = feature;
|
|
44817
|
+
|
|
44818
|
+
switch(feature_type) {
|
|
44819
|
+
case '509998': {
|
|
44820
|
+
return '#CD7F32';
|
|
44821
|
+
}
|
|
44822
|
+
|
|
44823
|
+
default: {
|
|
44824
|
+
return '#00541F';
|
|
44825
|
+
}
|
|
44826
|
+
}
|
|
44827
|
+
}`,
|
|
44828
|
+
stroke: { color: 'white', width: '3px' },
|
|
44829
|
+
},
|
|
44830
|
+
},
|
|
44831
|
+
},
|
|
44832
|
+
};
|
|
44833
|
+
layers.push(geometryLayer, labelLayer);
|
|
44834
|
+
}
|
|
44835
|
+
}
|
|
44836
|
+
return layers;
|
|
44837
|
+
};
|
|
44838
|
+
|
|
44839
|
+
const getBuildingLayers = (source) => {
|
|
44840
|
+
const layers = [];
|
|
44841
|
+
const data = {
|
|
44842
|
+
source,
|
|
44843
|
+
layer: '"MapBuildingECArea"',
|
|
44844
|
+
minzoom: 15,
|
|
44845
|
+
};
|
|
44846
|
+
const layer = {
|
|
44847
|
+
id: uuid(),
|
|
44848
|
+
data,
|
|
44849
|
+
extruded: {
|
|
44850
|
+
draw: {
|
|
44851
|
+
polygons: {
|
|
44852
|
+
interactive: true,
|
|
44853
|
+
style: 'buildings',
|
|
44854
|
+
extrude: `function() {
|
|
44855
|
+
return $zoom >= 17;
|
|
44856
|
+
}`,
|
|
44857
|
+
},
|
|
44858
|
+
},
|
|
44859
|
+
},
|
|
44860
|
+
draw: {
|
|
44861
|
+
polygons: {
|
|
44862
|
+
color: '#DDB07B',
|
|
44863
|
+
height: { property: 'height' },
|
|
44864
|
+
},
|
|
44865
|
+
lines: {
|
|
44866
|
+
color: '#DB933F',
|
|
44867
|
+
width: '2px',
|
|
44868
|
+
cap: 'round',
|
|
44869
|
+
join: 'round',
|
|
44870
|
+
},
|
|
44871
|
+
},
|
|
44872
|
+
};
|
|
44873
|
+
layers.push(layer);
|
|
44874
|
+
return layers;
|
|
44875
|
+
};
|
|
44876
|
+
|
|
44877
|
+
const getFacilityAreaLayers = (source) => {
|
|
44878
|
+
const layers = [];
|
|
44879
|
+
const geometryLayer = {
|
|
44880
|
+
id: uuid(),
|
|
44881
|
+
data: {
|
|
44882
|
+
source,
|
|
44883
|
+
layer: '"MapFacilityArea"',
|
|
44884
|
+
},
|
|
44885
|
+
draw: {
|
|
44886
|
+
polygons: {
|
|
44887
|
+
color: `function() {
|
|
44888
|
+
const { feature_type } = feature;
|
|
44889
|
+
|
|
44890
|
+
switch (feature_type) {
|
|
44891
|
+
case '2000408': {
|
|
44892
|
+
return '#DBBAC4';
|
|
44893
|
+
}
|
|
44894
|
+
|
|
44895
|
+
case '1900403': {
|
|
44896
|
+
return '#B6C3C7';
|
|
44897
|
+
}
|
|
44898
|
+
|
|
44899
|
+
case '1907403': {
|
|
44900
|
+
return '#A3B9C0';
|
|
44901
|
+
}
|
|
44902
|
+
|
|
44903
|
+
case '2000123': {
|
|
44904
|
+
return '#E4BA7D';
|
|
44905
|
+
}
|
|
44906
|
+
|
|
44907
|
+
case '2000124': {
|
|
44908
|
+
return '#BFE6E3';
|
|
44909
|
+
}
|
|
44910
|
+
|
|
44911
|
+
case '2000200': {
|
|
44912
|
+
return '#A0A9A8';
|
|
44913
|
+
}
|
|
44914
|
+
|
|
44915
|
+
case '2000403': {
|
|
44916
|
+
return '#AF7136';
|
|
44917
|
+
}
|
|
44918
|
+
|
|
44919
|
+
case '2000420': {
|
|
44920
|
+
return '#89AC76';
|
|
44921
|
+
}
|
|
44922
|
+
|
|
44923
|
+
case '2000457': {
|
|
44924
|
+
return '#9494C0';
|
|
44925
|
+
}
|
|
44926
|
+
|
|
44927
|
+
default: {
|
|
44928
|
+
return '#E1D4D4';
|
|
44929
|
+
}
|
|
44930
|
+
}
|
|
44931
|
+
}`,
|
|
44932
|
+
order: `function() {
|
|
44933
|
+
const { feature_type } = feature;
|
|
44934
|
+
|
|
44935
|
+
switch (feature_type) {
|
|
44936
|
+
case '1907403': {
|
|
44937
|
+
return 301;
|
|
44938
|
+
}
|
|
44939
|
+
|
|
44940
|
+
default: {
|
|
44941
|
+
return 300;
|
|
44942
|
+
}
|
|
44943
|
+
}
|
|
44944
|
+
}`,
|
|
44945
|
+
},
|
|
44946
|
+
lines: {
|
|
44947
|
+
color: '#857F7F',
|
|
44948
|
+
width: '2px',
|
|
44949
|
+
cap: 'round',
|
|
44950
|
+
join: 'round',
|
|
44951
|
+
},
|
|
44952
|
+
},
|
|
44953
|
+
};
|
|
44954
|
+
const labelLayer = {
|
|
44955
|
+
id: uuid(),
|
|
44956
|
+
data: {
|
|
44957
|
+
source,
|
|
44958
|
+
layer: '"MapFacilityAreaLabel"',
|
|
44959
|
+
},
|
|
44960
|
+
draw: {
|
|
44961
|
+
text: {
|
|
44962
|
+
text_source: 'name',
|
|
44963
|
+
font: {
|
|
44964
|
+
fill: `function() {
|
|
44965
|
+
const { feature_type } = feature;
|
|
44966
|
+
|
|
44967
|
+
switch(feature_type) {
|
|
44968
|
+
case '1900403':
|
|
44969
|
+
case '1907403': {
|
|
44970
|
+
return '#256D7B';
|
|
44971
|
+
}
|
|
44972
|
+
|
|
44973
|
+
case '2000420':
|
|
44974
|
+
case '2000460':
|
|
44975
|
+
case '2000123': {
|
|
44976
|
+
return '#00541F';
|
|
44977
|
+
}
|
|
44978
|
+
|
|
44979
|
+
case '2000408': {
|
|
44980
|
+
return '#5E2129';
|
|
44981
|
+
}
|
|
44982
|
+
|
|
44983
|
+
case '2000124': {
|
|
44984
|
+
return '#3E5F8A';
|
|
44985
|
+
}
|
|
44986
|
+
|
|
44987
|
+
case '2000200': {
|
|
44988
|
+
return '#464451';
|
|
44989
|
+
}
|
|
44990
|
+
|
|
44991
|
+
case '2000403': {
|
|
44992
|
+
return '#B03F35';
|
|
44993
|
+
}
|
|
44994
|
+
|
|
44995
|
+
case '2000457': {
|
|
44996
|
+
return '#6A5ACD';
|
|
44997
|
+
}
|
|
44998
|
+
|
|
44999
|
+
case '1700215':
|
|
45000
|
+
case '900159':
|
|
45001
|
+
case '900158': {
|
|
45002
|
+
return '#474A51';
|
|
45003
|
+
}
|
|
45004
|
+
|
|
45005
|
+
default: {
|
|
45006
|
+
return black;
|
|
45007
|
+
}
|
|
45008
|
+
}
|
|
45009
|
+
}`,
|
|
45010
|
+
size: '12px',
|
|
45011
|
+
stroke: {
|
|
45012
|
+
color: 'white',
|
|
45013
|
+
width: '3px',
|
|
45014
|
+
},
|
|
45015
|
+
},
|
|
45016
|
+
},
|
|
45017
|
+
},
|
|
45018
|
+
};
|
|
45019
|
+
layers.push(geometryLayer, labelLayer);
|
|
45020
|
+
return layers;
|
|
45021
|
+
};
|
|
45022
|
+
|
|
45023
|
+
const adminAreaLayerName = '"MapAdminArea"';
|
|
45024
|
+
|
|
45025
|
+
const getAdminAreaLayers = (source) => {
|
|
45026
|
+
const layers = [];
|
|
45027
|
+
const data = {
|
|
45028
|
+
source,
|
|
45029
|
+
layer: adminAreaLayerName,
|
|
45030
|
+
};
|
|
45031
|
+
const layer = {
|
|
45032
|
+
id: uuid(),
|
|
45033
|
+
data,
|
|
45034
|
+
draw: {
|
|
45035
|
+
polygons: {
|
|
45036
|
+
color: '#D3D2CF',
|
|
45037
|
+
},
|
|
45038
|
+
},
|
|
45039
|
+
};
|
|
45040
|
+
const borderRegionLayer = {
|
|
45041
|
+
id: uuid(),
|
|
45042
|
+
data,
|
|
45043
|
+
filter: `function() {
|
|
45044
|
+
const { type } = feature;
|
|
45045
|
+
|
|
45046
|
+
const isFilter = type === 'R';
|
|
45047
|
+
|
|
45048
|
+
return isFilter;
|
|
45049
|
+
}`,
|
|
45050
|
+
draw: {
|
|
45051
|
+
lines: {
|
|
45052
|
+
color: '#696969',
|
|
45053
|
+
width: '1px',
|
|
45054
|
+
cap: 'round',
|
|
45055
|
+
join: 'round',
|
|
45056
|
+
},
|
|
45057
|
+
},
|
|
45058
|
+
};
|
|
45059
|
+
const borderDistrictLayer = {
|
|
45060
|
+
id: uuid(),
|
|
45061
|
+
data,
|
|
45062
|
+
filter: `function() {
|
|
45063
|
+
const { type } = feature;
|
|
45064
|
+
|
|
45065
|
+
const isFilter = type === 'D' && $zoom >= 12;
|
|
45066
|
+
|
|
45067
|
+
return isFilter;
|
|
45068
|
+
}`,
|
|
45069
|
+
draw: {
|
|
45070
|
+
lines: {
|
|
45071
|
+
color: '#696969',
|
|
45072
|
+
dash: [4, 7],
|
|
45073
|
+
width: '1px',
|
|
45074
|
+
cap: 'round',
|
|
45075
|
+
join: 'round',
|
|
45076
|
+
},
|
|
45077
|
+
},
|
|
45078
|
+
};
|
|
45079
|
+
layers.push(layer, borderRegionLayer, borderDistrictLayer);
|
|
45080
|
+
return layers;
|
|
45081
|
+
};
|
|
45082
|
+
|
|
45083
|
+
const getNatureFieldLayers = (source) => {
|
|
45084
|
+
const layer = {
|
|
45085
|
+
id: uuid(),
|
|
45086
|
+
data: {
|
|
45087
|
+
source,
|
|
45088
|
+
layer: '"MapNatureField"',
|
|
45089
|
+
},
|
|
45090
|
+
draw: {
|
|
45091
|
+
polygons: {
|
|
45092
|
+
interactive: true,
|
|
45093
|
+
color: '#EBEEC7',
|
|
45094
|
+
},
|
|
45095
|
+
},
|
|
45096
|
+
};
|
|
45097
|
+
return [layer];
|
|
45098
|
+
};
|
|
45099
|
+
|
|
45100
|
+
const linkLayerName = '"Link"';
|
|
45101
|
+
const zLvlOrders = [
|
|
45102
|
+
'2.0',
|
|
45103
|
+
'1.5',
|
|
45104
|
+
'1.0',
|
|
45105
|
+
'0.7',
|
|
45106
|
+
'0.5',
|
|
45107
|
+
'0.3',
|
|
45108
|
+
'0.0',
|
|
45109
|
+
'-0.3',
|
|
45110
|
+
'-0.5',
|
|
45111
|
+
'-0.1',
|
|
45112
|
+
];
|
|
45113
|
+
const functionInterval = [[1, 2], [3, 4], [5]];
|
|
45114
|
+
const colorFunction = `function() {
|
|
45115
|
+
const { functional_class, tunnel, tollway } = feature;
|
|
45116
|
+
|
|
45117
|
+
const alpha = tunnel ? 0.89 : 1;
|
|
45118
|
+
|
|
45119
|
+
const getRGB = (hex, alpha) => {
|
|
45120
|
+
const r = +(parseInt(hex.slice(1, 3), 16) / 255).toFixed(2);
|
|
45121
|
+
const g = +(parseInt(hex.slice(3, 5), 16) / 255).toFixed(2);
|
|
45122
|
+
const b = +(parseInt(hex.slice(5, 7), 16) / 255).toFixed(2);
|
|
45123
|
+
|
|
45124
|
+
return [r, g, b, alpha];
|
|
45125
|
+
}
|
|
45126
|
+
|
|
45127
|
+
if (tollway) {
|
|
45128
|
+
return '#D72740';
|
|
45129
|
+
}
|
|
45130
|
+
|
|
45131
|
+
switch (functional_class) {
|
|
45132
|
+
case 1:
|
|
45133
|
+
case 2: {
|
|
45134
|
+
const color = getRGB('#D1747F', alpha);
|
|
45135
|
+
|
|
45136
|
+
return color;
|
|
45137
|
+
}
|
|
45138
|
+
|
|
45139
|
+
case 3:
|
|
45140
|
+
case 4: {
|
|
45141
|
+
const color = getRGB('#B1A7AA', alpha);
|
|
45142
|
+
|
|
45143
|
+
return color;
|
|
45144
|
+
}
|
|
45145
|
+
|
|
45146
|
+
case 5: {
|
|
45147
|
+
const color = getRGB('#D5CEC3', alpha);
|
|
45148
|
+
|
|
45149
|
+
return color;
|
|
45150
|
+
}
|
|
45151
|
+
}
|
|
45152
|
+
}`;
|
|
45153
|
+
const widthFunction = `function() {
|
|
45154
|
+
const { functional_class, road_number } = feature;
|
|
45155
|
+
|
|
45156
|
+
const getScale = () => {
|
|
45157
|
+
if ($zoom <= 15 && $zoom >= 14) { return 7; }
|
|
45158
|
+
|
|
45159
|
+
if ($zoom <= 13 && $zoom >= 12) { return 9; }
|
|
45160
|
+
|
|
45161
|
+
if ($zoom <= 5) { return 400; }
|
|
45162
|
+
|
|
45163
|
+
if ($zoom <= 7) { return 200; }
|
|
45164
|
+
|
|
45165
|
+
if ($zoom < 12) { return 50; }
|
|
45166
|
+
|
|
45167
|
+
return 1;
|
|
45168
|
+
}
|
|
45169
|
+
|
|
45170
|
+
const scale = getScale();
|
|
45171
|
+
|
|
45172
|
+
switch(functional_class) {
|
|
45173
|
+
case 1:
|
|
45174
|
+
case 2: {
|
|
45175
|
+
return 8 * scale;
|
|
45176
|
+
}
|
|
45177
|
+
|
|
45178
|
+
case 3:
|
|
45179
|
+
case 4: {
|
|
45180
|
+
return 7 * scale;
|
|
45181
|
+
}
|
|
45182
|
+
|
|
45183
|
+
case 5: {
|
|
45184
|
+
if (Boolean(road_number)) {
|
|
45185
|
+
return 7 * scale;
|
|
45186
|
+
}
|
|
45187
|
+
|
|
45188
|
+
return 6;
|
|
45189
|
+
}
|
|
45190
|
+
}
|
|
45191
|
+
}`;
|
|
45192
|
+
const outlineColorFunction = `function() {
|
|
45193
|
+
const { functional_class, access_id, tollway } = feature;
|
|
45194
|
+
|
|
45195
|
+
if (tollway) {
|
|
45196
|
+
return '#B9263B';
|
|
45197
|
+
}
|
|
45198
|
+
|
|
45199
|
+
switch(functional_class) {
|
|
45200
|
+
case 5: {
|
|
45201
|
+
return '#989898';
|
|
45202
|
+
}
|
|
45203
|
+
|
|
45204
|
+
case 3:
|
|
45205
|
+
case 4: {
|
|
45206
|
+
return '#8F6E78';
|
|
45207
|
+
}
|
|
45208
|
+
|
|
45209
|
+
case 1:
|
|
45210
|
+
case 2: {
|
|
45211
|
+
return '#9A414B';
|
|
45212
|
+
}
|
|
45213
|
+
}
|
|
45214
|
+
}`;
|
|
45215
|
+
const outlineWidthFunction = `function() {
|
|
45216
|
+
const { functional_class, access_id } = feature;
|
|
45217
|
+
|
|
45218
|
+
switch(functional_class) {
|
|
45219
|
+
case 5: {
|
|
45220
|
+
switch (access_id) {
|
|
45221
|
+
case 32: {
|
|
45222
|
+
return 0;
|
|
45223
|
+
}
|
|
45224
|
+
|
|
45225
|
+
default: {
|
|
45226
|
+
return 1;
|
|
45227
|
+
}
|
|
45228
|
+
}
|
|
45229
|
+
}
|
|
45230
|
+
|
|
45231
|
+
default: {
|
|
45232
|
+
return 1;
|
|
45233
|
+
}
|
|
45234
|
+
}
|
|
45235
|
+
}`;
|
|
45236
|
+
|
|
45237
|
+
const getLinkLayers = (source) => {
|
|
45238
|
+
const layers = [];
|
|
45239
|
+
const data = {
|
|
45240
|
+
source,
|
|
45241
|
+
layer: linkLayerName,
|
|
45242
|
+
};
|
|
45243
|
+
const roadNumberLayer = {
|
|
45244
|
+
id: uuid(),
|
|
45245
|
+
data,
|
|
45246
|
+
draw: {
|
|
45247
|
+
text: {
|
|
45248
|
+
text_source: 'road_number',
|
|
45249
|
+
font: {
|
|
45250
|
+
fill: '#181bff',
|
|
45251
|
+
size: '16px',
|
|
45252
|
+
weight: 'bold',
|
|
45253
|
+
underline: true,
|
|
45254
|
+
background: {
|
|
45255
|
+
color: 'black',
|
|
45256
|
+
},
|
|
45257
|
+
},
|
|
45258
|
+
},
|
|
45259
|
+
},
|
|
45260
|
+
};
|
|
45261
|
+
layers.push(roadNumberLayer);
|
|
45262
|
+
zLvlOrders.forEach((zLvl) => {
|
|
45263
|
+
const filter = `function() {
|
|
45264
|
+
const { z_lvl = '0.0' } = feature;
|
|
45265
|
+
|
|
45266
|
+
const isFilter = z_lvl === '${zLvl}';
|
|
45267
|
+
|
|
45268
|
+
return isFilter;
|
|
45269
|
+
}`;
|
|
45270
|
+
const text = {
|
|
45271
|
+
text_source: 'street_name',
|
|
45272
|
+
font: {
|
|
45273
|
+
fill: 'black',
|
|
45274
|
+
size: '14px',
|
|
45275
|
+
stroke: { color: 'white', width: '3px' },
|
|
45276
|
+
},
|
|
45277
|
+
};
|
|
45278
|
+
const getBaseLayerDraw = () => ({
|
|
45279
|
+
text,
|
|
45280
|
+
lines: {
|
|
45281
|
+
color: colorFunction,
|
|
45282
|
+
width: widthFunction,
|
|
45283
|
+
cap: 'round',
|
|
45284
|
+
join: 'round',
|
|
45285
|
+
},
|
|
45286
|
+
});
|
|
45287
|
+
const getBorderLayerDraw = () => ({
|
|
45288
|
+
lines: {
|
|
45289
|
+
color: colorFunction,
|
|
45290
|
+
width: widthFunction,
|
|
45291
|
+
cap: 'round',
|
|
45292
|
+
join: 'round',
|
|
45293
|
+
outline: {
|
|
45294
|
+
color: outlineColorFunction,
|
|
45295
|
+
width: outlineWidthFunction,
|
|
45296
|
+
},
|
|
45297
|
+
},
|
|
45298
|
+
});
|
|
45299
|
+
switch (zLvl) {
|
|
45300
|
+
case '0.0': {
|
|
45301
|
+
functionInterval.forEach((functionClasses) => {
|
|
45302
|
+
functionClasses.forEach((functionClass) => {
|
|
45303
|
+
const baseLayer = {
|
|
45304
|
+
id: uuid(),
|
|
45305
|
+
data,
|
|
45306
|
+
filter: `function() {
|
|
45307
|
+
const { functional_class, z_lvl = '0.0' } = feature;
|
|
45308
|
+
|
|
45309
|
+
const isFilter = z_lvl === '${zLvl}' && functional_class === ${functionClass};
|
|
45310
|
+
|
|
45311
|
+
return isFilter;
|
|
45312
|
+
}`,
|
|
45313
|
+
draw: getBaseLayerDraw(),
|
|
45314
|
+
sublayers: {
|
|
45315
|
+
construction: {
|
|
45316
|
+
filter: `function() {
|
|
45317
|
+
return global.links.getIsConstruction(feature);
|
|
45318
|
+
}`,
|
|
45319
|
+
draw: {
|
|
45320
|
+
lines: {
|
|
45321
|
+
width: 3,
|
|
45322
|
+
color: '#9AA096',
|
|
45323
|
+
dash: [2, 1],
|
|
45324
|
+
},
|
|
45325
|
+
},
|
|
45326
|
+
},
|
|
45327
|
+
functionalClassAccessId32: {
|
|
45328
|
+
filter: `function() {
|
|
45329
|
+
return global.links.getIsFunctionalClass(feature);
|
|
45330
|
+
}`,
|
|
45331
|
+
draw: {
|
|
45332
|
+
lines: {
|
|
45333
|
+
width: 2,
|
|
45334
|
+
color: '#9AA096',
|
|
45335
|
+
dash: [2, 1],
|
|
45336
|
+
},
|
|
45337
|
+
},
|
|
45338
|
+
},
|
|
45339
|
+
lowMobility: {
|
|
45340
|
+
filter: `function() {
|
|
45341
|
+
return global.links.getIsLowMobility(feature);
|
|
45342
|
+
}`,
|
|
45343
|
+
draw: {
|
|
45344
|
+
lines: {
|
|
45345
|
+
width: 4,
|
|
45346
|
+
},
|
|
45347
|
+
},
|
|
45348
|
+
},
|
|
45349
|
+
},
|
|
45350
|
+
};
|
|
45351
|
+
const borderLayer = {
|
|
45352
|
+
id: uuid(),
|
|
45353
|
+
data,
|
|
45354
|
+
filter: `function() {
|
|
45355
|
+
const { functional_class, z_lvl = '0.0' } = feature;
|
|
45356
|
+
|
|
45357
|
+
const isFilter = z_lvl === '${zLvl}' && functional_class === ${functionClass} && !global.links.getIsConstruction(feature) && !global.links.getIsFunctionalClass(feature);
|
|
45358
|
+
|
|
45359
|
+
return isFilter;
|
|
45360
|
+
}`,
|
|
45361
|
+
draw: getBorderLayerDraw(),
|
|
45362
|
+
sublayers: {
|
|
45363
|
+
lowMobility: {
|
|
45364
|
+
filter: `function() {
|
|
45365
|
+
return global.links.getIsLowMobility(feature);
|
|
45366
|
+
}`,
|
|
45367
|
+
draw: {
|
|
45368
|
+
lines: {
|
|
45369
|
+
width: 4,
|
|
45370
|
+
},
|
|
45371
|
+
},
|
|
45372
|
+
},
|
|
45373
|
+
},
|
|
45374
|
+
};
|
|
45375
|
+
layers.push(baseLayer, borderLayer);
|
|
45376
|
+
});
|
|
45377
|
+
});
|
|
45378
|
+
break;
|
|
45379
|
+
}
|
|
45380
|
+
default: {
|
|
45381
|
+
const baseLayer = {
|
|
45382
|
+
id: uuid(),
|
|
45383
|
+
data,
|
|
45384
|
+
filter,
|
|
45385
|
+
draw: getBaseLayerDraw(),
|
|
45386
|
+
};
|
|
45387
|
+
const borderLayer = {
|
|
45388
|
+
id: uuid(),
|
|
45389
|
+
data,
|
|
45390
|
+
filter,
|
|
45391
|
+
draw: getBorderLayerDraw(),
|
|
45392
|
+
};
|
|
45393
|
+
layers.push(baseLayer, borderLayer);
|
|
45394
|
+
}
|
|
45395
|
+
}
|
|
45396
|
+
});
|
|
45397
|
+
return layers;
|
|
45398
|
+
};
|
|
43545
45399
|
|
|
43546
45400
|
// define() gets called for each chunk generated by the first Rollup pass.
|
|
43547
45401
|
// The order the chunks are called in is controlled by the imports in bundle.js:
|
|
@@ -43608,7 +45462,35 @@ exports.LeafletLayer = LeafletLayer;
|
|
|
43608
45462
|
exports.List = CustomList;
|
|
43609
45463
|
exports.NoData = NoData;
|
|
43610
45464
|
exports.Select = CustomSelect;
|
|
45465
|
+
exports._backendUrl = _backendUrl;
|
|
43611
45466
|
exports._testApiKeys = _testApiKeys;
|
|
45467
|
+
exports.catIds = catIds;
|
|
45468
|
+
exports.getAdminAreaLayers = getAdminAreaLayers;
|
|
45469
|
+
exports.getBuildingLayers = getBuildingLayers;
|
|
45470
|
+
exports.getBuiltupAreaLayers = getBuiltupAreaLayers;
|
|
45471
|
+
exports.getCityPOILayers = getCityPOILayers;
|
|
45472
|
+
exports.getConditionLayers = getConditionLayers;
|
|
45473
|
+
exports.getDefaultPOI = getDefaultPOI;
|
|
45474
|
+
exports.getFacilityAreaLayers = getFacilityAreaLayers;
|
|
45475
|
+
exports.getLanduseAreaLayers = getLanduseAreaLayers;
|
|
45476
|
+
exports.getLaneMarkingLineLayers = getLaneMarkingLineLayers;
|
|
45477
|
+
exports.getLaneMarkingPointLayers = getLaneMarkingPointLayers;
|
|
45478
|
+
exports.getLaneMarkingPolyLayers = getLaneMarkingPolyLayers;
|
|
45479
|
+
exports.getLinkLayers = getLinkLayers;
|
|
45480
|
+
exports.getNatureFieldLayers = getNatureFieldLayers;
|
|
45481
|
+
exports.getOceanAreaLayers = getOceanAreaLayers;
|
|
45482
|
+
exports.getOneWayLayers = getOneWayLayers;
|
|
45483
|
+
exports.getPOILayers = getPOILayers;
|
|
45484
|
+
exports.getPOITypeLayer = getPOITypeLayer;
|
|
45485
|
+
exports.getParkingLineLayers = getParkingLineLayers;
|
|
45486
|
+
exports.getPointAddressLayers = getPointAddressLayers;
|
|
45487
|
+
exports.getRailroadLayers = getRailroadLayers;
|
|
45488
|
+
exports.getRoadPolyLayers = getRoadPolyLayers;
|
|
45489
|
+
exports.getWaterAreaLayers = getWaterAreaLayers;
|
|
45490
|
+
exports.getWaterLinkLayers = getWaterLinkLayers;
|
|
45491
|
+
exports.sourceUrl = sourceUrl;
|
|
45492
|
+
exports.text_source = text_source;
|
|
45493
|
+
exports.tile_size = tile_size;
|
|
43612
45494
|
exports.useFormContext = useFormContext;
|
|
43613
45495
|
exports.useGetLeafletLayer = useGetLeafletLayer;
|
|
43614
45496
|
//# sourceMappingURL=index.cjs.map
|