Switch to ESRI World_Street_Map via local CORS proxy
Carto Voyager was returning 'API Key required' content for the
user (likely rate-limited or IP-blocked by Carto). Switched to
ESRI World_Street_Map which has CORS-friendly tiles with plenty
of place names and street labels.
URL format is different from Carto: {z}/{y}/{x}.jpg (y before x,
jpg not png). Updated the build to match. The local /esri/
proxy in default.conf handles the upstream CORS-incompatibility
by adding permissive CORS headers and a proper User-Agent.
This commit is contained in:
1 parent
e0c6b685ad
commit
4500fe3214
2 files changed
+22
-7
No files matched your search
Vendored
+4
-3
@@ -284,7 +284,7 @@ function init(canvas) {
|
||||
// mosaic centre always corresponds to UV (0.5, 0.5).
|
||||
// Tile source: Carto basemaps Voyager style (with place names).
|
||||
// Free, CORS-enabled, OSM-derived. URL format {z}/{x}/{y}.png.
|
||||
var GROUND_TILE_URL = '/carto/voyager/';
|
||||
var GROUND_TILE_URL = '/esri/streets/';
|
||||
var GROUND_TILE_Z = 11;
|
||||
var GROUND_TILE_SIZE = 256;
|
||||
// Fetch direction: which way the tile corridor is oriented.
|
||||
@@ -318,8 +318,9 @@ function fetchTileImage(tileX, tileY) {
|
||||
img.crossOrigin = 'anonymous';
|
||||
img.onload = function() { resolve(img); };
|
||||
img.onerror = function() { reject(new Error('tile fetch failed')); };
|
||||
// Carto/OSM-style format: {z}/{x}/{y}.png via local proxy
|
||||
img.src = GROUND_TILE_URL + GROUND_TILE_Z + '/' + tileX + '/' + tileY + '.png';
|
||||
// ESRI World_Street_Map format: {z}/{y}/{x}.jpg via local
|
||||
// proxy. (y before x, jpg not png)
|
||||
img.src = GROUND_TILE_URL + GROUND_TILE_Z + '/' + tileY + '/' + tileX + '.jpg';
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user