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

Support "nested" styles #4000

Closed
lucaswoj opened this issue Jan 17, 2017 · 7 comments
Closed

Support "nested" styles #4000

lucaswoj opened this issue Jan 17, 2017 · 7 comments
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) feature 🍏

Comments

@lucaswoj
Copy link
Contributor

migrated from mapbox/DEPRECATED-mapbox-gl#25 by @lucaswoj

...

Users don't expect setStyle to overwrite everything, and consider the current behavior a bug. This is a bummer, and something that we could document around, saying "setStyle will wipe out the current state of the map". I'm fine with the documentation approach, but it needs a workaround, because "switching the map style" is a common usecase that is a hard expectation - it's easy to do in Leaflet and all similar tile-based libraries. -- @tmcw, 2016

Injecting custom layers into Mapbox core styles is a common use case and confusing to our users, especially when the user wants to swap out the core style and keep the custom layers.

Have we considered supporting "nested styles"? These would help our users build a solid mental model of their stylesheet, encapsulate core style implementation details, allow new kinds of style modularity, and fit nicely into Studio.

map.setStyle({
    version: 9,
    layers: [{
        type: 'style',
        layout: { url: 'mapbox://styles/mapbox/streets-v9-bottom' }
    }, ..., {
        type: 'style',
        layout: { url: 'mapbox://styles/mapbox/streets-v9-top' }
    }]
});
@1ec5 1ec5 added the cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) label Jan 17, 2017
@mb12
Copy link

mb12 commented Jan 18, 2017

An alternative option would be to add a separate API to add points, lines and polygons. These could be internally persisted by GL JS automatically via an implicit source. GL native already supports this for feature parity with Mapkit.

@jaapster
Copy link

jaapster commented Sep 8, 2017

@lucaswoj Could these style-layers be added dynamically? That would be very helpful.

In our product we have a base "meta-layer", typically something like "streets-v9", containing multiple "mapbox layers" and on top of that we load our own dynamically generated "meta-layers" (containing tile sources and "mapbox layers") and GeoJSON layers for rendering of selection, drawing etc.

This combined with inline base64 encoded icons would be awesome ...

@miguelleitevieira
Copy link

Hi all, exist some developments on this feature?

@santinogue
Copy link

Hi, any updates on this???

@stevage
Copy link
Contributor

stevage commented Jul 12, 2019

Is this essentially a duplicate of #4225?

@kkaefer
Copy link
Contributor

kkaefer commented Mar 8, 2024

We support style imports now.

@kkaefer kkaefer closed this as completed Mar 8, 2024
@JamesChevalier
Copy link

Your link goes to an internal repository. Is this the feature you’re referring to?
https://docs.mapbox.com/style-spec/reference/imports/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) feature 🍏
Projects
None yet
Development

No branches or pull requests

9 participants