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
Serve Mapbox-GL style files #64
Comments
@jimbok8 right now, I've been thinking toward providing a way to have a default mapbox style that you could publish for each tileset (e.g., to use in our map preview endpoint), but I wasn't thinking of that in terms of publishing styles more broadly - e.g., those that use > 1 tileset on I think if we enabled publishing styles more broadly (e.g., consuming >=1 hosted service plus external services), we'd want it to do a few updates to the style file to make it match the endpoint URLs of the server - so that it is fully self contained. e.g., using something like To do this, we could create a new flag to pass in a styles directory, and in there you would have one or more json files of mapbox GL styles. These could be updated per above then published at For now, I'd recommend using a static fileserver to serve your styles (e.g., nginx, caddy, etc). |
@brendan-ward, I have a semi-related question that I didn't think was quite appropriate to open an issue for: I'm using your server on an embedded system alongside another webserver that serves my app along with a generic So, when the app is about to display a map (with mapbox-gl), it needs to fill in the missing tile source info in the style. The app queries your server for I'd like to be able to utilize multiple Is there a way to use multiple |
@schwiet each source in your style is a distinct tile service ( You can have one source per tile service, and then one or more layers per source - but that means authoring your own more specific If you are hosting on OpenMapTiles, they may be combining multiple spatial datasets into one You should leverage multiple sources and layers to produce the functionality that it seems like you are trying to get at (by supplementing Depending on your use case, you could then remove one or more layers against the You can also programmatically add sources and layers after your map has loaded the underlying style (i.e., you are using the style to define the basemap). This is most commonly what I do with tile services hosted in |
@brendan-ward thank you for that quick reply (especially since this seems to be a more general style question). I think this answers my question. For reference, the use case I am imagining is aimed at allowing users to have a couple different regions of map tiles on the server and the app handling displaying all of what is available. Like I said, it's an embedded platform with limited resource, so if a particular user will be using the device in Dallas and Houston, the easiest way I could imagine giving them what they needed, without including the state of Texas or larger, what to let them throw an Thanks again for taking the time to clear that up for me. |
@schwiet are you generating localized tiles, or are your users generating them? For something like what you are describing, it is possible to create a tileset for each locality to finer levels of detail, then merge them later. E.g., Or - because vector tiles are intended to be lightweight and shard things spatially anyway - it seems like all your data could be merged into a single tileset, and the localized data will only be fetched for the tiles in the extent of the given user, and not the other locality. Just don't include the locality data at coarser zoom levels, and resource usage should be fine. |
Closing, because using a reverse proxy or a companion static file server should be sufficient to serve style files and assets. We may revisit this in the future, but for now it is not part of the roadmap. |
is it possible to serve other files; i.e. like a standard http server?
In particular I am trying to use mapbox-gl.js which uses a .json file to store the style and also the mbtiles source location.
How can I serve the .json file from http://localhost?
Thanks.
The text was updated successfully, but these errors were encountered: