@teeechina/teee-map 0.0.9 → 0.0.11

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/teee-map.mjs CHANGED
@@ -37218,29 +37218,69 @@ var d = u, f = async () => {
37218
37218
  ];
37219
37219
  return [
37220
37220
  {
37221
- id: `${e}_trackcircuit`,
37221
+ id: `${e}_trackcircuit_bad`,
37222
37222
  type: "line",
37223
37223
  source: e,
37224
37224
  layout: { "line-join": "round" },
37225
37225
  paint: {
37226
- "line-color": "grey",
37227
- "line-width": 3
37226
+ "line-color": [
37227
+ "case",
37228
+ [
37229
+ "==",
37230
+ ["feature-state", "state"],
37231
+ 1
37232
+ ],
37233
+ "#ff0000",
37234
+ [
37235
+ "==",
37236
+ ["feature-state", "state"],
37237
+ 2
37238
+ ],
37239
+ "#ffffff",
37240
+ [
37241
+ "==",
37242
+ ["feature-state", "state"],
37243
+ 3
37244
+ ],
37245
+ "#808080",
37246
+ "#000000"
37247
+ ],
37248
+ "line-width": t,
37249
+ "line-dasharray": [4, 4],
37250
+ "line-opacity": [
37251
+ "case",
37252
+ [
37253
+ "==",
37254
+ ["feature-state", "substate"],
37255
+ 0
37256
+ ],
37257
+ 1,
37258
+ 0
37259
+ ]
37228
37260
  }
37229
37261
  },
37230
37262
  {
37231
- id: `${e}_trackcircuit_red`,
37263
+ id: `${e}_trackcircuit_grey`,
37232
37264
  type: "line",
37233
37265
  source: e,
37234
37266
  layout: { "line-join": "round" },
37235
37267
  paint: {
37236
- "line-color": "red",
37268
+ "line-color": "grey",
37237
37269
  "line-width": t,
37238
37270
  "line-opacity": [
37239
37271
  "case",
37240
37272
  [
37241
- "==",
37242
- ["feature-state", "state"],
37243
- "1"
37273
+ "all",
37274
+ [
37275
+ "==",
37276
+ ["feature-state", "state"],
37277
+ 3
37278
+ ],
37279
+ [
37280
+ "!=",
37281
+ ["feature-state", "substate"],
37282
+ 0
37283
+ ]
37244
37284
  ],
37245
37285
  1,
37246
37286
  0
@@ -37248,19 +37288,27 @@ var d = u, f = async () => {
37248
37288
  }
37249
37289
  },
37250
37290
  {
37251
- id: `${e}_trackcircuit_white`,
37291
+ id: `${e}_trackcircuit_red`,
37252
37292
  type: "line",
37253
37293
  source: e,
37254
37294
  layout: { "line-join": "round" },
37255
37295
  paint: {
37256
- "line-color": "white",
37296
+ "line-color": "red",
37257
37297
  "line-width": t,
37258
37298
  "line-opacity": [
37259
37299
  "case",
37260
37300
  [
37261
- "==",
37262
- ["feature-state", "state"],
37263
- 2
37301
+ "all",
37302
+ [
37303
+ "==",
37304
+ ["feature-state", "state"],
37305
+ 1
37306
+ ],
37307
+ [
37308
+ "!=",
37309
+ ["feature-state", "substate"],
37310
+ 0
37311
+ ]
37264
37312
  ],
37265
37313
  1,
37266
37314
  0
@@ -37268,22 +37316,27 @@ var d = u, f = async () => {
37268
37316
  }
37269
37317
  },
37270
37318
  {
37271
- id: `${e}_trackcircuit_grey`,
37319
+ id: `${e}_trackcircuit_white`,
37272
37320
  type: "line",
37273
37321
  source: e,
37274
- layout: {
37275
- "line-join": "round",
37276
- visibility: "none"
37277
- },
37322
+ layout: { "line-join": "round" },
37278
37323
  paint: {
37279
- "line-color": "grey",
37324
+ "line-color": "white",
37280
37325
  "line-width": t,
37281
37326
  "line-opacity": [
37282
37327
  "case",
37283
37328
  [
37284
- "==",
37285
- ["feature-state", "state"],
37286
- 3
37329
+ "all",
37330
+ [
37331
+ "==",
37332
+ ["feature-state", "state"],
37333
+ 2
37334
+ ],
37335
+ [
37336
+ "!=",
37337
+ ["feature-state", "substate"],
37338
+ 0
37339
+ ]
37287
37340
  ],
37288
37341
  1,
37289
37342
  0
@@ -37423,7 +37476,7 @@ var d = u, f = async () => {
37423
37476
  [
37424
37477
  "==",
37425
37478
  ["feature-state", "state"],
37426
- "1"
37479
+ 1
37427
37480
  ],
37428
37481
  1,
37429
37482
  0
@@ -37456,125 +37509,54 @@ var d = u, f = async () => {
37456
37509
  "icon-anchor": "left"
37457
37510
  }
37458
37511
  }),
37459
- switch: (e) => [
37460
- {
37461
- id: `${e}_switch_hitarea`,
37462
- type: "circle",
37463
- source: e,
37464
- paint: {
37465
- "circle-radius": [
37466
- "interpolate",
37467
- ["linear"],
37468
- ["zoom"],
37469
- 5,
37470
- 11
37471
- ],
37472
- "circle-color": "red",
37473
- "circle-opacity": 0
37474
- }
37475
- },
37476
- {
37477
- id: `${e}_switch_text`,
37478
- type: "symbol",
37479
- source: e,
37480
- layout: {
37481
- "text-field": ["get", "name"],
37482
- "text-size": [
37483
- "interpolate",
37484
- ["linear"],
37485
- ["zoom"],
37486
- 15,
37487
- 11,
37488
- 22,
37489
- 15
37490
- ],
37491
- "text-font": ["Open Sans Regular"],
37492
- "text-anchor": "top",
37493
- "text-offset": [0, .5],
37494
- "symbol-placement": "point",
37495
- "text-allow-overlap": !0
37496
- },
37497
- paint: { "text-color": [
37498
- "match",
37499
- ["feature-state", "state"],
37500
- "2",
37501
- "lightgreen",
37502
- "3",
37503
- "darkorange",
37504
- "4",
37505
- "red",
37506
- "white"
37507
- ] }
37508
- },
37509
- {
37510
- id: `${e}_switch_lock`,
37511
- type: "circle",
37512
- source: e,
37513
- paint: {
37514
- "circle-radius": [
37515
- "interpolate",
37516
- ["linear"],
37517
- ["zoom"],
37518
- 5,
37519
- 8
37520
- ],
37521
- "circle-stroke-width": 1.7,
37522
- "circle-stroke-color": [
37523
- "match",
37524
- ["feature-state", "state"],
37525
- "2",
37526
- "green",
37527
- "3",
37528
- "darkorange",
37529
- "4",
37530
- "red",
37531
- "white"
37532
- ],
37533
- "circle-color": "transparent",
37534
- "circle-stroke-opacity": [
37535
- "case",
37536
- [
37537
- "==",
37538
- ["feature-state", "subState2"],
37539
- "1"
37540
- ],
37541
- 1,
37542
- 0
37543
- ]
37544
- }
37545
- },
37546
- {
37547
- id: `${e}_switch_danfen`,
37548
- type: "symbol",
37549
- source: e,
37550
- layout: {
37551
- "icon-image": "icon-red-box",
37552
- "icon-allow-overlap": !0,
37553
- "icon-offset": [0, 15],
37554
- "icon-size": [
37555
- "interpolate",
37556
- ["linear"],
37557
- ["zoom"],
37558
- 5,
37559
- .2,
37560
- 10,
37561
- .5,
37562
- 18,
37563
- 1
37564
- ]
37565
- },
37566
- paint: { "icon-opacity": [
37567
- "case",
37568
- [
37569
- "==",
37570
- ["feature-state", "subState3"],
37571
- "1"
37572
- ],
37573
- 1,
37574
- 0
37575
- ] }
37512
+ switch: (e) => [{
37513
+ id: `${e}_switch_hitarea`,
37514
+ type: "circle",
37515
+ source: e,
37516
+ paint: {
37517
+ "circle-radius": [
37518
+ "interpolate",
37519
+ ["linear"],
37520
+ ["zoom"],
37521
+ 5,
37522
+ 11
37523
+ ],
37524
+ "circle-color": "red",
37525
+ "circle-opacity": 0
37576
37526
  }
37577
- ],
37527
+ }, {
37528
+ id: `${e}_switch_text`,
37529
+ type: "symbol",
37530
+ source: e,
37531
+ layout: {
37532
+ "text-field": ["get", "name"],
37533
+ "text-size": [
37534
+ "interpolate",
37535
+ ["linear"],
37536
+ ["zoom"],
37537
+ 15,
37538
+ 11,
37539
+ 22,
37540
+ 15
37541
+ ],
37542
+ "text-font": ["Open Sans Regular"],
37543
+ "text-anchor": "top",
37544
+ "text-offset": [0, .5],
37545
+ "symbol-placement": "point",
37546
+ "text-allow-overlap": !0
37547
+ },
37548
+ paint: { "text-color": [
37549
+ "match",
37550
+ ["feature-state", "state"],
37551
+ "2",
37552
+ "lightgreen",
37553
+ "3",
37554
+ "darkorange",
37555
+ "4",
37556
+ "red",
37557
+ "white"
37558
+ ] }
37559
+ }],
37578
37560
  switch_loc: (e) => [
37579
37561
  {
37580
37562
  id: `${e}_switchloc`,
@@ -38584,7 +38566,8 @@ function Ve(e, t) {
38584
38566
  };
38585
38567
  t == 1 && e == 0 || (t == 2 || t == 3) && e == 0 || (t == 2 || t == 3 || t == 11) && e == 1 || t == 6 && e == 0 || (t == 7 || t == 11) && e == 0 ? i.state = "red" : (t == 4 || t == 5 || t == 12) && e == 0 && (i.state = "blue"), this.updateFeatureState(r, i);
38586
38568
  } else t === "track_circuit" && this.updateFeatureState(r, {
38587
- state: "",
38569
+ state: 3,
38570
+ substate: 1,
38588
38571
  visiable: !0
38589
38572
  });
38590
38573
  }
@@ -46711,6 +46694,16 @@ var fi = 20037508.34, pi = (e, t) => [e / fi * 180, Math.atan(Math.exp(t / fi *
46711
46694
  }, n);
46712
46695
  }
46713
46696
  }
46697
+ getFeatureState(e) {
46698
+ if (this.stashFeatures.get(e)) return this.stashFeatures.get(e);
46699
+ }
46700
+ locateGeojsonFeature(e) {
46701
+ let t = d(gi(e));
46702
+ this.map.fitBounds([[t[0], t[1]], [t[2], t[3]]], {
46703
+ padding: 50,
46704
+ maxZoom: 18
46705
+ });
46706
+ }
46714
46707
  };
46715
46708
  //#endregion
46716
- export { vi as TeeeMap, vi as default };
46709
+ export { vi as TeeeMap, vi as default, gi as transformGeoJsonFrom3857 };