Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data-driven icon-image: 3 icon limit per layer? #2459

Closed
ashleyclough opened this issue Apr 18, 2016 · 1 comment
Closed

data-driven icon-image: 3 icon limit per layer? #2459

ashleyclough opened this issue Apr 18, 2016 · 1 comment

Comments

@ashleyclough
Copy link

I'm trying to render data-driven icon-images within a layer using svg icons.

See: http://parallel.co.uk/leeds/gp.html#11.07/51.4496/-0.2064

All 10 icons are available and are referenced in the data but only 3 are rendered within a single layer. Code below shows filtering of 5 values but only 3 are rendered with icon-images though all 5 are rendered with text. Those rendered appear to be the top 3 in the ordering of the value in the tileset data: parallel.c4a449da, not the order within the filter statement.

mapbox-gl-js version: 0.17.0

map.addLayer(
    {
        "id": "stack icon",
        "type": "symbol",
        "source": "gp_registered_patients",
        "source-layer": "gp_registered_patients",
        "filter": ["in", "stack", "two","three","five","nine","one"],
        "minzoom": 11,
        "interactive": true,
        "layout": {

            "icon-offset": [14,-154],
            "icon-image": "stack_icon_lime_"+"{stack}",
            "icon-allow-overlap": true,
            "icon-ignore-placement": true,
            "icon-padding": 0,
            "icon-size": 0.38,

            "text-size": 10,
            "text-font": ["Meta Offc Pro Medium","Arial Unicode MS Regular"],
            "text-allow-overlap": true,
            "text-offset": [1,0],
            "text-anchor": "left",
            "text-field": "{stack}",
            "text-rotate": 270

        },
        "paint": {
            "text-color": "#333"
        }
    });

Expected Behaviour: All data-driven icon-images will render.

Actual Behaviour: Only 3 of the data-driven con-images render.

@lucaswoj
Copy link
Contributor

If you check the console, you will see a warning messages that says:

SpriteAtlas out of space.

This indicates that there are too many sprites loaded into memory and Mapbox GL JS is unable to display them all. The feature that would allow larger SpriteAtlases is being tracked in #141.

(Hint: The author of #2164 found a workaround for his purposes.)

Closing in favor of #141

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants