kvision icon indicating copy to clipboard operation
kvision copied to clipboard

New map module based on MapLibre

Open aSemy opened this issue 3 years ago • 3 comments

This is a very speculative issue,

https://maplibre.org/

I like the look of MapLibre for a couple of reasons:

  • TypeScript native (Leaflet is entirely JS and it doesn't look like they'll be using TypeScript any time soon)
  • Native vector tile support https://maplibre.org/maplibre-gl-js-docs/example/third-party/ (Leaflet requires 3rd party plugins)
  • Leaflet has an ugly display bug (for 7 years!) where white lines appear between tiles https://github.com/Leaflet/Leaflet/issues/3575
  • it uses TypeScript, which is much more easy to integrate with Kotlin

Generally it looks like MapLibre is less popular (it's much newer, having been recently split from MapBox, after a license change), but it supports more modern features.

Implementing MapLibre bindings is made much more difficult because Dukat fails to generate anything https://github.com/Kotlin/dukat/issues/477. By comparison, Dukat did generate most of the Leaflet bindings, which provided a good basis. However... those aren't perfect because Leaflet is not TypeScript native (unlike MapLibre), so the TypeScript the Leaflet bindings were generated from might not be accurate (but they seem to work okay). So it's a mixed bag. Anyway, defining new bindings is a lot of work, regardless of Dukat support.

There is some interest in creating Kotlin bindings for MapBox/MapLibre https://github.com/Kotlin/dukat/issues/477. Additional it looks like there's some movement to migrate the MapLibre's Java code to Kotlin https://github.com/maplibre/maplibre-gl-native/pull/420 - so maybe MapLibre devs could help with the bindings? Or even include them themselves? I might make an issue.

I'm not likely to pick this up any time soon - Leaflet is good enough. But if there's a lot of support, or someone wants to collaborate, I could give it a go.

aSemy avatar Sep 16 '22 21:09 aSemy

You don't need to replace something that works - there is no problem adding another module.

rjaros avatar Sep 17 '22 04:09 rjaros

Good point! I assumed that having two kvision-map modules would be awkward, so one would replace the other.

Do you know if the the current kvision-map module well used?

aSemy avatar Sep 18 '22 10:09 aSemy

I'm using the module in one of my apps, but it's very simple usage (just to show a location of the entity). Maven central stats show about 1K downloads a month, even though it's not included by default in any template or example app.

rjaros avatar Sep 18 '22 10:09 rjaros