Skip to content

Incorrect documentation for tileUrl with null value #95

@reilem

Description

@reilem

The docs for tileUrl state:

(optional) Tile server URL for the map base layer or null for empty base layer. {x},{y},{z} or {quadkey} supported.

However this "or null" is no longer true since version 1.11.0.

This code:

import StaticMaps from 'staticmaps';

async function main() {
    const map = new StaticMaps({
        width: 600,
        height: 600,
        tileUrl: null,
        reverseY: true,
    });

    await map.render([0, 0], 2);

    await map.image.save("map.png");
}

main();

On version 1.10.0 and before used to render an empty image where every pixel had rgba value (0,0,0,0). This was useful for creating a blank image with annotations rendered which could then be overlayed on top of other maps. However, since version 1.11.0 this now creates this image:

map

Is it still possible to create empty layers? Or has this been removed? If this feature has been removed then maybe it would be nice to add this to the release notes as a breaking change and also to update the docs. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions