Image scaling on map issue

Hi guys.

I’am currently facing an issue, that I really need help with.

In my application I want to show Images over maps (OSM, etc). This images represent some sort of heatmaps, which will dynamically be updated.

Additionally, I´d like to draw Polygons on top of the map.

To draw these glyphs on the right position on top of the map I use wgs84 coordinates (lat, lon) and transform them to pseudo-mercator, which is needed when using tile_maps.

What I have tried so far:

*drawing a rectangular polygon
*drawing the same rectangular poylgon , but as an image with x, y, height and width.

In the following screenshot you see the results:

The bigger (green) one is the polygon. The white one is an Image:
The problem is, that the Image appears to be smaler, although the polygon and the Image (units is set to “data”) have the same coordinates.
Has anybody an idea what is happening here. Is there some sort of hidden scaling-mechanism when using Image glyphs?

I really would appreciate it if someone could help me with this issue.


I have not seen this. It’s possible it’s a bug, or it may be a usage issue somewhere. For something like this the only way to really offer help is with a complete, minimal script that reproduces what you see.

Hi Bryan.

Thanks for your answer. You are right it was an usage issue. I spent quite some time on the issue, but yesterday I found the problem.

For the Image the width and height is needed, in mercator. What I did is, that i calculated the width and height in wgs84. And that was wrong. When I calculated the width and height in meractor it fits perfectly.

I appreciate your reply. Next time i definitly try to be more specific (code snippet) if I havbe another problem.

Thank you.

I’m glad you got it sorted out, if there is something we can add or make more clear in the docs or examples please open a GitHub issue to propose it.