@caoguo/maplibre 0.0.6 → 0.0.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.
Files changed (64) hide show
  1. package/dist/chunk-DENQSIV2.js +81 -0
  2. package/dist/chunk-DENQSIV2.js.map +1 -0
  3. package/dist/chunk-G7VY42ZG.js +210 -0
  4. package/dist/chunk-G7VY42ZG.js.map +1 -0
  5. package/dist/chunk-MLLIAWVI.js +214 -0
  6. package/dist/chunk-MLLIAWVI.js.map +1 -0
  7. package/dist/chunk-OLS4DD3F.js +27 -0
  8. package/dist/chunk-OLS4DD3F.js.map +1 -0
  9. package/dist/chunk-OUEPE6JT.js +26 -0
  10. package/dist/chunk-OUEPE6JT.js.map +1 -0
  11. package/dist/chunk-SKXL3DKL.js +125 -0
  12. package/dist/chunk-SKXL3DKL.js.map +1 -0
  13. package/dist/chunk-Y3JNDOHU.js +56 -0
  14. package/dist/chunk-Y3JNDOHU.js.map +1 -0
  15. package/dist/controls/index.cjs +227 -0
  16. package/dist/controls/index.cjs.map +1 -0
  17. package/dist/controls/index.d.cts +171 -0
  18. package/dist/controls/index.d.ts +171 -0
  19. package/dist/controls/index.js +4 -0
  20. package/dist/controls/index.js.map +1 -0
  21. package/dist/crs/index.cjs +137 -0
  22. package/dist/crs/index.cjs.map +1 -0
  23. package/dist/crs/index.d.cts +80 -0
  24. package/dist/crs/index.d.ts +80 -0
  25. package/dist/crs/index.js +3 -0
  26. package/dist/crs/index.js.map +1 -0
  27. package/dist/index.cjs +48 -13
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +11 -499
  30. package/dist/index.d.ts +11 -499
  31. package/dist/index.js +14 -643
  32. package/dist/index.js.map +1 -1
  33. package/dist/lod/index.cjs +60 -0
  34. package/dist/lod/index.cjs.map +1 -0
  35. package/dist/lod/index.d.cts +62 -0
  36. package/dist/lod/index.d.ts +62 -0
  37. package/dist/lod/index.js +3 -0
  38. package/dist/lod/index.js.map +1 -0
  39. package/dist/shaders/index.cjs +215 -0
  40. package/dist/shaders/index.cjs.map +1 -0
  41. package/dist/shaders/index.d.cts +131 -0
  42. package/dist/shaders/index.d.ts +131 -0
  43. package/dist/shaders/index.js +3 -0
  44. package/dist/shaders/index.js.map +1 -0
  45. package/dist/sourceUtils.cjs +30 -0
  46. package/dist/sourceUtils.cjs.map +1 -0
  47. package/dist/sourceUtils.d.cts +60 -0
  48. package/dist/sourceUtils.d.ts +60 -0
  49. package/dist/sourceUtils.js +3 -0
  50. package/dist/sourceUtils.js.map +1 -0
  51. package/dist/styles.cjs +47 -12
  52. package/dist/styles.cjs.map +1 -1
  53. package/dist/styles.d.cts +13 -4
  54. package/dist/styles.d.ts +13 -4
  55. package/dist/styles.js +1 -1
  56. package/dist/terrain.cjs +31 -0
  57. package/dist/terrain.cjs.map +1 -0
  58. package/dist/terrain.d.cts +28 -0
  59. package/dist/terrain.d.ts +28 -0
  60. package/dist/terrain.js +3 -0
  61. package/dist/terrain.js.map +1 -0
  62. package/package.json +31 -1
  63. package/dist/chunk-DNEF4DHG.js +0 -48
  64. package/dist/chunk-DNEF4DHG.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/dist/index.cjs CHANGED
@@ -16,20 +16,18 @@ var WUHAN_ZOOM = 11;
16
16
  function caoguoStyle(theme$1 = "caoguo-dark") {
17
17
  return theme.buildStyle(theme$1);
18
18
  }
19
- function osmRasterStyle() {
19
+ function geoqRasterStyle() {
20
20
  return {
21
21
  version: 8,
22
22
  glyphs: "https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf",
23
23
  sources: {
24
- "osm-raster": {
24
+ "geoq-raster": {
25
25
  type: "raster",
26
26
  tiles: [
27
- "https://a.tile.openstreetmap.org/{z}/{x}/{y}.png",
28
- "https://b.tile.openstreetmap.org/{z}/{x}/{y}.png",
29
- "https://c.tile.openstreetmap.org/{z}/{x}/{y}.png"
27
+ "https://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}"
30
28
  ],
31
29
  tileSize: 256,
32
- attribution: "\xA9 OpenStreetMap contributors"
30
+ attribution: "\xA9 GeoQ \u667A\u56FE"
33
31
  }
34
32
  },
35
33
  layers: [
@@ -39,19 +37,54 @@ function osmRasterStyle() {
39
37
  paint: { "background-color": "#0a0f1e" }
40
38
  },
41
39
  {
42
- id: "osm-raster",
40
+ id: "geoq-raster",
43
41
  type: "raster",
44
- source: "osm-raster",
42
+ source: "geoq-raster",
45
43
  paint: {
46
- "raster-opacity": 0.85,
47
- "raster-saturation": -0.6,
48
- "raster-brightness-max": 0.7,
49
- "raster-contrast": 0.1
44
+ "raster-opacity": 0.9,
45
+ "raster-saturation": -0.2,
46
+ "raster-contrast": 0.05
50
47
  }
51
48
  }
52
49
  ]
53
50
  };
54
51
  }
52
+ var osmRasterStyle = geoqRasterStyle;
53
+ function buildGraticule(step = 10) {
54
+ const features = [];
55
+ for (let lon = -180; lon <= 180; lon += step) {
56
+ features.push({
57
+ type: "Feature",
58
+ properties: { kind: "meridian" },
59
+ geometry: { type: "LineString", coordinates: [[lon, -85], [lon, 85]] }
60
+ });
61
+ }
62
+ for (let lat = -80; lat <= 80; lat += step) {
63
+ features.push({
64
+ type: "Feature",
65
+ properties: { kind: "parallel" },
66
+ geometry: { type: "LineString", coordinates: [[-180, lat], [180, lat]] }
67
+ });
68
+ }
69
+ return { type: "FeatureCollection", features };
70
+ }
71
+ function localBasemapStyle() {
72
+ return {
73
+ version: 8,
74
+ sources: {
75
+ graticule: { type: "geojson", data: buildGraticule() }
76
+ },
77
+ layers: [
78
+ { id: "bg", type: "background", paint: { "background-color": "#0a0f1e" } },
79
+ {
80
+ id: "graticule",
81
+ type: "line",
82
+ source: "graticule",
83
+ paint: { "line-color": "#1e293b", "line-width": 0.6, "line-opacity": 0.6 }
84
+ }
85
+ ]
86
+ };
87
+ }
55
88
 
56
89
  // src/crs/gcj02.ts
57
90
  var PI = Math.PI;
@@ -1199,7 +1232,7 @@ var Map2 = class {
1199
1232
  if (!isWebGLAvailable()) {
1200
1233
  throw new WebGLUnavailableError();
1201
1234
  }
1202
- let style = osmRasterStyle();
1235
+ let style = localBasemapStyle();
1203
1236
  if (options.style) {
1204
1237
  style = options.style;
1205
1238
  } else if (options.tianditu) {
@@ -1434,11 +1467,13 @@ exports.createTransformer = createTransformer;
1434
1467
  exports.default = src_default;
1435
1468
  exports.fromWgs84 = fromWgs84;
1436
1469
  exports.gcj02ToWgs84 = gcj02ToWgs84;
1470
+ exports.geoqRasterStyle = geoqRasterStyle;
1437
1471
  exports.getGlobalConfig = getGlobalConfig;
1438
1472
  exports.glowPasses = glowPasses;
1439
1473
  exports.installServiceWorker = installServiceWorker;
1440
1474
  exports.isInChina = isInChina;
1441
1475
  exports.isWebGLAvailable = isWebGLAvailable;
1476
+ exports.localBasemapStyle = localBasemapStyle;
1442
1477
  exports.offlineGeoJSONSource = offlineGeoJSONSource;
1443
1478
  exports.offlineSourceTiles = offlineSourceTiles;
1444
1479
  exports.offlineTileUrl = offlineTileUrl;