1ec5 left a comment (openstreetmap/openstreetmap-website#6234)

Thanks for opening this ticket and starting the conversation about a full 
migration to GL JS. OpenHistoricalMap’s fork of this project has been using 
maplibre-gl-leaflet for some time to avoid deviating too much from OSM, but 
this plugin’s limitations become apparent pretty quickly.

I agree that we should target a single map library if possible. In theory, a 
dual-library setup would enable us to keep supporting non-WebGL-capable 
environments, but I’d expect the code maintenance overhead to be substantial. 
We could make our own mapstraction library on top of both, but that would get 
us right back to square one with maplibre-gl-leaflet.

> How to use the just-introduced vector-based marker definitions with MapLibre 
> is also a point I'm unsure about, considering the CSS- and DOM-driven 
> coloring.

There are two ways to put a “pin” on a MapLibre map:

* [A DOM 
element](https://maplibre.org/maplibre-gl-js/docs/examples/add-custom-icons-with-markers/)
 using the [marker 
API](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-default-marker/). 
This would be pretty similar to what we’re already doing.
* [A symbol 
layer](https://maplibre.org/maplibre-gl-js/docs/examples/center-the-map-on-a-clicked-symbol/)
 using the runtime styling API. This is the traditional MapLibre approach with 
better performance and the ability to have the symbol underlap other layers, 
but interactivity is harder to implement. This is the same API we’d use to 
overlay an element’s geometry or a route line on the map, but it would probably 
be overkill for just a marker.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/6234#issuecomment-3114232604
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/issues/6234/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to