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

Setting a layout on addLayer is ignored #231

Open
tb4764 opened this issue May 10, 2021 · 0 comments
Open

Setting a layout on addLayer is ignored #231

tb4764 opened this issue May 10, 2021 · 0 comments

Comments

@tb4764
Copy link

tb4764 commented May 10, 2021

I'm trying to add a GeoJson source and a symbol layer with some layout properties. The source and layer are added, but the layout options are not implemented.

map.addSource('newSource', {
        'type': 'geojson',
        'data': {
              "type": "FeatureCollection",
              "features": [
                    {
                           "type": "Feature",
                           "geometry": { "type": "Point", "coordinates": [0, 0] },
                    }
              ]
        }
})
map.addLayer({
            'id': 'newLayer',
            'type': 'symbol',
            'source': 'newSource',
            'layout': {
                'icon-image': 'arrow',
                'icon-size': 10
            }
        })

When I track the map layers (map.getStyle().layers) in the console, the added layer only has the following:

id: "newLayer"
source: "newSource"
type: "symbol"

I tried this in a simple HTML file (without Vue & vue-maxpbox), and it works fine (ie, the layout properties are applied and visible in the console).
Any idea?

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

1 participant