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

want to add the feature "loadImage" #722

Open
codingmiao opened this issue Sep 4, 2020 · 1 comment
Open

want to add the feature "loadImage" #722

codingmiao opened this issue Sep 4, 2020 · 1 comment

Comments

@codingmiao
Copy link

When I want to add a Symbol layer, but the icon I need is not in the Sprite, I often use function "loadImage" to add it, which is more convenient than modifying the Sprite:

    const icon = {
        url: 'http://xxx.com/test.png',
        id: 'myicon'
    }
    //load icon
    map.loadImage(icon.url, function (error, image) {
        map.addImage(icon.id, image);
    })
    //....
    //add layer to map
    const layer = {
        "id": 'marklayer_' + icon.id,
        "type": "symbol",
        "source": "sourceName",
        "source-layer": "sourceLayerName",
        "layout": {
            "icon-allow-overlap": true,
            "icon-image": icon.id,
        }
    }
    map.addLayer(layer)

But there's no way to "loadImage" in Maputnik,I am keen to add this feature,thanks~

@orangemug
Copy link
Collaborator

Hi @codingmiao, we have discussed this, and have some ideas to add this. We'll update this ticket when we make some progress.

If you have the time please also tell us what you use Maputnik for over in #164

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

No branches or pull requests

2 participants