Allow drawing empty base layer#61
Conversation
|
Thank's again for your PRs @OlivierKamers. Use case sounds reasonable to me. Would you please add a test for this. Thanks. |
|
@StephanGeorg I have added a test case which results in the expected image: However when running all tests locally, all other test cases seem to fail because the tile request returns a response with an empty buffer, even though the URL looks ok. I also have this when running them on the main branch so it shouldn't be an issue with this change. |
Seams to be something with your IP. All tests running smoothly from my local machine. |
|
Just posting here that I found the issue with the empty response body, which is actually documented here: sindresorhus/got#1349 |

We have a special use-case where it's useful to allow drawing annotations without having a base-layer.
Some of our map layers have thermal data meaning that the data is encoded in the RGB values of the tiles and has to be decoded to a visual coloring again. We draw the base layer using staticmaps, read the resulting image and apply the coloring to the pixels.
When adding drawings (lines, polygons, text, ...) this would mean that the drawings get this different coloring too. That's why we render them separately with a staticmaps instance without base layer and in the end add it as an overlay to the colored map layer (using sharp).