@3clear/basegis 0.1.5 → 0.1.7

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.
@@ -73,6 +73,7 @@ const c = {
73
73
  enabled: !1,
74
74
  type: "wmts",
75
75
  provider: "custom",
76
+ crs: "EPSG:3857",
76
77
  visible: !1,
77
78
  engineSupport: ["cesium", "leaflet"],
78
79
  url: "https://example.com/geoserver/gwc/service/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=workspace:layer&STYLE=default&TILEMATRIXSET=EPSG:3857&FORMAT=image/png&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}"
@@ -130,42 +131,46 @@ const c = {
130
131
  terrainLabel: {
131
132
  tilePath: "cta_w",
132
133
  layerName: "cta"
134
+ },
135
+ terrainRgb: {
136
+ tilePath: "terrain-rgb_w",
137
+ layerName: "terrain-rgb"
133
138
  }
134
139
  }
135
140
  }
136
141
  }
137
142
  };
138
- function i(a) {
143
+ function i(r) {
139
144
  var e;
140
- return ((e = c.providers) == null ? void 0 : e[a]) || null;
145
+ return ((e = c.providers) == null ? void 0 : e[r]) || null;
141
146
  }
142
- function d(a = "tianditu") {
143
- var r;
144
- const e = ((r = i(a)) == null ? void 0 : r.tokenPool) || [];
147
+ function d(r = "tianditu") {
148
+ var a;
149
+ const e = ((a = i(r)) == null ? void 0 : a.tokenPool) || [];
145
150
  if (e.length === 0)
146
151
  return "";
147
152
  const t = Math.floor(Math.random() * e.length);
148
153
  return e[t];
149
154
  }
150
- function m(a = "tianditu") {
151
- var r;
152
- const e = ((r = i(a)) == null ? void 0 : r.subdomains) || ["0"], t = Math.floor(Math.random() * e.length);
155
+ function m(r = "tianditu") {
156
+ var a;
157
+ const e = ((a = i(r)) == null ? void 0 : a.subdomains) || ["0"], t = Math.floor(Math.random() * e.length);
153
158
  return e[t];
154
159
  }
155
- function l(a = "w") {
156
- return String(a || "w").toLowerCase() === "c" ? "c" : "w";
160
+ function l(r = "w") {
161
+ return String(r || "w").toLowerCase() === "c" ? "c" : "w";
157
162
  }
158
- function u(a = "", e = "w") {
159
- const t = String(a || "").replace(/_[cw]$/i, "");
163
+ function u(r = "", e = "w") {
164
+ const t = String(r || "").replace(/_[cw]$/i, "");
160
165
  return t ? `${t}_${l(e)}` : "";
161
166
  }
162
- function p(a = "vector", e = {}) {
167
+ function p(r = "vector", e = {}) {
163
168
  var s;
164
- const t = i("tianditu"), r = (s = t == null ? void 0 : t.resources) == null ? void 0 : s[a];
165
- if (!t || !r)
169
+ const t = i("tianditu"), a = (s = t == null ? void 0 : t.resources) == null ? void 0 : s[r];
170
+ if (!t || !a)
166
171
  return "";
167
- const n = l(e.projection || e.tileMatrixSet), o = u(r.tilePath, n);
168
- return o ? `${t.baseUrl}/${o}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&STYLE=default&FORMAT=tiles&LAYER=${r.layerName}&TILEMATRIXSET=${n}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk={tk}` : "";
172
+ const n = l(e.projection || e.tileMatrixSet), o = u(a.tilePath, n);
173
+ return o ? `${t.baseUrl}/${o}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&STYLE=default&FORMAT=tiles&LAYER=${a.layerName}&TILEMATRIXSET=${n}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk={tk}` : "";
169
174
  }
170
175
  export {
171
176
  p as a,
package/dist/layers.js CHANGED
@@ -1,55 +1,55 @@
1
- import { c, g as l, a as y } from "./basemap.config-Bs1PwVYt.js";
1
+ import { c, g as l, a as y } from "./basemap.config-CtXrS74D.js";
2
2
  function v(i = {}) {
3
3
  const {
4
- id: r = "tianditu-layer",
4
+ id: a = "tianditu-layer",
5
5
  name: t = "Tianditu Layer",
6
6
  visible: e = !0,
7
- provider: a = "tianditu",
7
+ provider: r = "tianditu",
8
8
  type: n = "wmts",
9
9
  ...s
10
10
  } = i;
11
11
  return {
12
12
  ...s,
13
- id: r,
13
+ id: a,
14
14
  name: t,
15
- provider: a,
15
+ provider: r,
16
16
  type: n,
17
17
  visible: e
18
18
  };
19
19
  }
20
- function b(i = "imagery") {
21
- const r = c("tianditu"), t = l("tianditu"), e = y(i);
22
- return !r || !t || !e ? null : {
23
- url: e.replace("{subdomain}", "{s}").replace("{tk}", encodeURIComponent(t)),
24
- subdomains: [...r.subdomains || ["0"]]
20
+ function b(i = "imagery", a = {}) {
21
+ const t = c("tianditu"), e = l("tianditu"), r = y(i, a);
22
+ return !t || !e || !r ? null : {
23
+ url: r.replace("{subdomain}", "{s}").replace("{tk}", encodeURIComponent(e)),
24
+ subdomains: [...t.subdomains || ["0"]]
25
25
  };
26
26
  }
27
27
  function L(i = {}) {
28
28
  const {
29
- id: r = "geoserver-pyramid-layer",
29
+ id: a = "geoserver-pyramid-layer",
30
30
  name: t = "GeoServer Pyramid Layer",
31
31
  url: e = "",
32
- visible: a = !0,
32
+ visible: r = !0,
33
33
  provider: n = "geoserver",
34
34
  type: s = "xyz",
35
35
  ...o
36
36
  } = i;
37
37
  return {
38
38
  ...o,
39
- id: r,
39
+ id: a,
40
40
  name: t,
41
41
  provider: n,
42
42
  type: s,
43
43
  url: e,
44
- visible: a
44
+ visible: r
45
45
  };
46
46
  }
47
47
  function f(i = {}) {
48
48
  const {
49
- id: r = "wms-layer",
49
+ id: a = "wms-layer",
50
50
  name: t = "WMS Layer",
51
51
  url: e = "",
52
- serviceUrl: a = "",
52
+ serviceUrl: r = "",
53
53
  layers: n = "",
54
54
  parameters: s = {},
55
55
  visible: o = !0,
@@ -59,12 +59,12 @@ function f(i = {}) {
59
59
  } = i;
60
60
  return {
61
61
  ...m,
62
- id: r,
62
+ id: a,
63
63
  name: t,
64
64
  provider: u,
65
65
  type: d,
66
- url: e || a,
67
- serviceUrl: a || e,
66
+ url: e || r,
67
+ serviceUrl: r || e,
68
68
  visible: o,
69
69
  layers: n,
70
70
  parameters: s
@@ -72,10 +72,10 @@ function f(i = {}) {
72
72
  }
73
73
  function T(i = {}) {
74
74
  const {
75
- id: r = "wmts-layer",
75
+ id: a = "wmts-layer",
76
76
  name: t = "WMTS Layer",
77
77
  url: e = "",
78
- layer: a = "",
78
+ layer: r = "",
79
79
  tileMatrixSet: n = "",
80
80
  visible: s = !0,
81
81
  provider: o = "custom",
@@ -84,13 +84,13 @@ function T(i = {}) {
84
84
  } = i;
85
85
  return {
86
86
  ...d,
87
- id: r,
87
+ id: a,
88
88
  name: t,
89
89
  provider: o,
90
90
  type: u,
91
91
  url: e,
92
92
  visible: s,
93
- layer: a,
93
+ layer: r,
94
94
  tileMatrixSet: n
95
95
  };
96
96
  }