mapcachetools 2.2.2 → 2.2.4
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/bin/mapcache_download.js +5 -1
- package/package.json +1 -1
package/bin/mapcache_download.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
1
3
|
/*
|
|
2
4
|
Enhanced Map Tile Downloader with Terrain Support and Single Extension
|
|
3
5
|
- Downloads map tiles (satellite or terrain RGB) for a given geographic bounding box and zoom range.
|
|
@@ -30,7 +32,7 @@ const MAX_LATITUDE = 85.0511287798;
|
|
|
30
32
|
const R_MINOR = 6356752.314245179; // Not used, but kept for completeness.
|
|
31
33
|
|
|
32
34
|
// Default values
|
|
33
|
-
const DEFAULT_PROVIDER = 0; // 0: OSM, 1: Mapbox Satellite, 2: Mapbox Terrain RGB
|
|
35
|
+
const DEFAULT_PROVIDER = 0; // 0: OSM, 1: Mapbox Satellite, 2: Mapbox Terrain RGB, 3: Stadiamaps
|
|
34
36
|
const DEFAULT_CONCURRENCY = 5; // Safe default to avoid rate limits
|
|
35
37
|
const DEFAULT_RETRIES = 3;
|
|
36
38
|
const DEFAULT_ZOUT = 0;
|
|
@@ -147,6 +149,8 @@ function getTileUrlAndFilename(i, j, zoom) {
|
|
|
147
149
|
// Mapbox Terrain RGB
|
|
148
150
|
url = `https://api.mapbox.com/v4/mapbox.terrain-rgb/${zoom}/${i}/${j}.png?access_token=${TOKEN}`;
|
|
149
151
|
typePrefix = "terrain";
|
|
152
|
+
} else if (map_provider == 3) {
|
|
153
|
+
url = `https://tiles.stadiamaps.com/tiles/alidade_satellite/${zoom}/${i}/${j}.jpg?api_key=${TOKEN}`;
|
|
150
154
|
} else {
|
|
151
155
|
// OpenStreetMap
|
|
152
156
|
url = `https://tile.openstreetmap.org/${zoom}/${i}/${j}.png`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mapcachetools",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"description": "A Node.js tool to download and cache map tiles (OSM, Mapbox Satellite, Mapbox Terrain RGB) as PNG images for offline use in mapping applications. Use at your own risk and comply with provider terms.",
|
|
5
5
|
"main": "bin/mapcache_download.js",
|
|
6
6
|
"bin": {
|