-
Notifications
You must be signed in to change notification settings - Fork 535
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
Stacking multiple tilejson sources #288
Comments
Suspect I'm coming up against a generic Mapbox GL JS issue, unrelated to this project. e.g. mapbox/mapbox-gl-js#4000 |
Hey @alpha-beta-soup that is quite specific and indeed I don't think there is a way to achieve that at the moment. I will keep this issue open and if you could follow up on the mapbox-gl-js issue and keep this issue updated, that would be nice 👍 |
Aww what a shame :( So the only workaround I found is to define it in the style property |
In the same motion, it would be very valuable to be able to define a |
@cyrilchapon I think maybe you're getting styles and sources mixed up. The style itself has links for the sources, and those sources are what you want to enter in as the You could also download the style and parse it dynamically, creating React components where you need. I didn't test this, so consider it pseudo code, but for example:
If you're going the dynamic route, you would also need to make sure that the main style you're using has all the fonts and icons you need. Also, I think mapbox calls all the sources "composite" by default, so you might need to rename them to avoid duplicate source ids. |
I will close this issue as it is not clear to me what the issue with @cyrilchapon I raised an issue for style to be optional as I think it is a valid point, I came across this use case where I wanted to create a map including only 1 geoJSON layer without any remote tile server involved. cf: #531 |
I have a base layer style being used like so:
I then add various sources and layers for both image tiles (
<Layer type={"raster"}/>
) and GeoJSON data, both from custom APIs. This all works great. However I would now like to show coastlines and other basemap-like labels on top of these non-Mapbox layers, separately from the most fundamental base style. From my understanding, it is not possible to declare this kind of stacking in the rootstyle
. So I thought that I would be able to define two more styles in Mapbox Studio, and use the URLs to them as references, and then place coastlines and labels on top. Then users could use a checkbox to turn coastlines and labels off/on as they wish.I tried:
This is fine, except for these additional Mapbox styles. I didn't expect this approach to work, and it doesn't, but I'm not sure if what I'm attempting to achieve is actually possible at all. It seems as if that root
style
in theReacMapboxGl
component is the only way to include remote Mapbox styles? If it isn't, is there an example of stacking multiple Mapbox sources in a particular order?The text was updated successfully, but these errors were encountered: