Icon is flipped horizontally when icon-anchor is *-left or *-right and icon loaded via addImage()
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
I load an image using `addImage` and `loadImage`. When using `icon-anchor: center` it displays normally:

However when I use `icon-anchor: left` (or `right`, `bottom-left` etc) it:
- flips the image along the vertical axis
- positions the image to the left of its anchor
- horizontally compresses the image

In these examples, the location of the feature is the bottom left corner of the cream-colored rectangle (ignoring the rounded corner).
This does not occur when using an image from a pre-generated sprite sheet (eg, `parking-11`):

My layer definition here is:
```
{
"id": "cad-logo",
"type": "symbol",
"source": "cad",
"minzoom": 13,
"filter": [
"==",
[
"get",
"layer"
],
"_LOGO"
],
"layout": {
"icon-image": "landnow-logo",
"icon-anchor": "left",
"icon-size": 0.2
}
}
```
There is no mention of flipping behaviour in the documentation, and the fact that it doesn't happen with a pre-generated stylesheet suggests that this is a bug, not intended.
Using v3.0.1. Also present in v2.13.0.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The reported entry points are addImage(), loadImage(), and the symbol layer's icon-anchor and icon-image properties; no source file or test is named. Start by reproducing the issue with a dynamically loaded image and compare it with the pre-generated sprite case. Done means left, right, and corner anchors preserve orientation, dimensions, and placement consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- computer-graphics, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100