Closed MrAmericanMike closed 11 months ago
const options = {
width: 1024,
height: 1024,
tileSubdomains: ['a', 'b', 'c', 'd'],
tileUrl: 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}@2x.png',
tileSize: 512,
};
See https://github.com/CartoDB/basemap-styles#1-web-raster-basemaps
Thanks. Totally missed the subdomains been now tileSubdomains.
I guess the documentation here also would need to be updated to reflect those changes: https://github.com/CartoDB/basemap-styles#1-web-raster-basemaps
I wasn't familiar with the "scale" option. I guess I will have to look into that closer, as I can see it affects the zoom at the same time.
The code above never worked:
subdomains: "abcd",
was always expecting an array{r}
was never supported. I can't find what the changes were between 1.9 and 1.12 for this to break. (It's not a mayor version change, so technically it should still work)
import StaticMaps from "staticmaps"; const MAP_OPTIONS = { width: 600, height: 300, subdomains: "abcd", tileUrl: "https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png", }; const MAP = new StaticMaps(MAP_OPTIONS); await MAP.render([-115.172977, 36.100822], 14); await MAP.image.save("test.jpg", { quality: 70 });
I have this test here. https://replit.com/@MrAmericanMike/StaticMaps-1#index.js
Took it from some old code I used. I never had issues with it. I guess if it worked was only by chance? But it never gave me problems in that 1.9.1 version.
So I have this very basic example that works when using Staticmaps 1.9.1
However when upgrading to 1.12.0 it breaks.
It saves a file, but it's all black.
I can't find what the changes were between 1.9 and 1.12 for this to break. (It's not a mayor version change, so technically it should still work)