Closed BoxSo closed 1 year ago
Sure, but it's a basemap not a layer:
const StaticMaps = require('staticmaps');
const options = {
width: 600,
height: 400,
tileUrl: 'http://openfiremap.org/hytiles/{z}/{x}/{y}.png',
};
const map = new StaticMaps(options);
This does not seem to work. All i get is a white image. Maybe i'm doing something wrong?
var StaticMaps = require('staticmaps');
const options = {
width: 600,
height: 400,
tileUrl: 'http://openfiremap.org/hytiles/{z}/{x}/{y}.png',
};
const map = new StaticMaps(options);
/ THIS WORKS const options = { width: 600, height: 400, zoomRange: { max: 20, } }; const map = new StaticMaps(options); /
const marker = {
img: `${__dirname}/marker.png`, // can also be a URL,
offsetX: 24,
offsetY: 48,
width: 48,
height: 48,
coord: [lon, lat],
};
map.addMarker(marker);
map.render()
.then(() => map.image.save('single-marker.png'))
.then(() => {
console.log('File saved!');
callback(true);
})
.catch((err) => {
console.log('Error generating map: ' + err.message);
callback(false);
});
Can I see a code snippet?
This is the resulting image
Ok, I checked the tiles and its indeed a layer and not a basemap: http://openfiremap.org/hytiles/11/1084/700.png
Sorry, I thought the hydrant icons are rendered onto the tile images. This is a new use case and will add a feature to support that kind of "layers".
Thanks Stephan! appreciate!
Regards
Jens
Is there any news regarding this feature?
Thanks!
Added a PR for the modifications I made to add 2 tile servers: https://github.com/StephanGeorg/staticmaps/pull/68
Closed with #68
Let's say i want to add another layer from a tile-Server (http://openfiremap.org/hytiles/z/x/y.png). Would this be possible somehow?
Regards
BoxSon