geoblocks / ol-maplibre-layer

Use a MapBox map as an OpenLayers layer
https://geoblocks.github.io/ol-maplibre-layer/demo.html
BSD 3-Clause "New" or "Revised" License
35 stars 5 forks source link

Load/destroy the maplibre map only when visible/hidden and allow map.getFeaturesAtPixel #154

Closed oterral closed 1 month ago

oterral commented 5 months ago

Hi @fredj ,

Inspired by this project we have developed our own MaplibreLayer in mobility-toolbox-js ,for the v3 we have switched to a complete renderer class instead of the use of the render function, it allows us to use the map.getFeaturesAtPixel function.

So the difference between ol-maplibre-layer and mobility-toolbox-js:

Since I don't like duplicated code, we would be happy to propose a PR for those improvements. Are you interested in ?

Here is a demo

oterral commented 3 months ago

Maybe @ger-benjamin

ger-benjamin commented 3 months ago

Hello @oterral ,

Sorry, we don't really have/take time to manage a community. We easily miss messages. But PRs are welcome :-)

What do you propose exactly ? Adding the features described above, in the aim to use this project and not anymore the matching code in mobility-toolbox ? As long as it's generically usable, yes that would be 100% in the spirit of geoblocks.

oterral commented 3 months ago

Adding the features described above, in the aim to use this project and not anymore the matching code in mobility-toolbox ? As long as it's generically usable, yes that would be 100% in the spirit of geoblocks.

Yes that's exactly the spirit. We use the maplibre layer very often and sometimes we don't want to have to import mobility-toolbox-js in all our project if it's not needed. Since it's very generic, geoblocks seemed to be a good place.

I will prepare a PR