-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature Request: Support for Multiple Sources in Map Styles Using ol-maplibre-layer #1
Comments
Hello, I added the feature to handle multiple layers in vector tiles (using ol-maplibre-layer). Online test: https://ignf-ma-carte.github.io/mcutils/mcutils/charte.html?map=FfyxzB @+ |
It's good news that it works. NB1: only works for local files (no remote files) Do you have more details about this issue? We have tested this library with an online style and did not encounter this problem. Here is a link to a test style that mixes several sources: And another link to visualize the rendering on MapLibre: NB2: the layer is no longer an ol layer and does not benefit from the selection/hover popup I understand, we are in a particular case reserved for experts. It might be possible to manage both types. This choice is then recorded in the Metadata property of the style: {
"version": 8,
"name": "SPASS",
"metadata": {
"mapbox:autocomposite": false,
"mapbox:type": "template",
"maputnik:renderer": "mbgljs", // or "ol"
"openmaptiles:version": "3.x",
"openmaptiles:mapbox:owner": "openmaptiles",
"openmaptiles:mapbox:source:url": "mapbox://openmaptiles.4qljc88t"
}
} If this information is not present, you could use the rendering mode with ol-mapbox to maintain the initial behavior of the viewer and thus retain the selection/hover and popup functionalities. NB3: an error message in the console when rendering on printing (to report) Indeed, the printing functionality can be problematic. This is why implementing both rendering modes could be a solution, with proper documentation. |
Not a real issue: the caller has to know the layer type to use and switch between ol or Maplibre layer.
We have to add a hack to query the Maplibre map on click (but not implemented yet).
Not a real issue, the printing works but an error is fired on first attempt to render the map (but it finally renders). |
Hello, Thank you again for your responsiveness. I noticed that the feature is implemented in the main branch of mcutils and that version 3.4.5 of the mcviewer uses this version of mcutils. However, this version of the viewer is not yet in production, is that right? Have a nice day. |
Not yet! |
Thank you for the information. I will test it and provide detailed feedback. |
Hello, I tested version 3.4 on the qualification site, but I don't have the impression that styles with multiple sources work. I tried with a remote file and a local file. Here are two different styles : Topo 4 couleurs Monde Satellite Hybride France |
It works for me:
NB1: only with a local file PS: I'll try to fix 2 and a bug on writing/loading. |
Just push a new commit to fix NB2 (IGNF-Ma-carte/mceditor@b621329). |
that's right, it works when you reload the map! That's great!! Good job. 🚀🚀 |
v4.3.6 is online in qlf: https://qlf-macarte.ign.fr/edition/carte/ |
Hello,
We commonly use Maputnik to create Maplibre styles (maplibre-style-spec) that combine multiple sources.
We have noticed that MaCarte uses the ol-mapbox-style library. After testing, we discovered that it can only load a single source. As stated in the documentation: "The style function will render all layers from the glStyle object that use the source of the first layer" (ol-mapbox-style - applyStyle).
However, we tested the ol-maplibre-layer library (ol-maplibre-layer). We were able to create multiple layers by loading Maplibre styles containing multiple sources into a map.
MapLibre is an open-source library, unlike Mapbox. Therefore, it might be more appropriate to use it for rendering style files, which aligns more with the open-source logic promoted by IGN.
Thank you for your work.
The text was updated successfully, but these errors were encountered: