Meshtastic-Android icon indicating copy to clipboard operation
Meshtastic-Android copied to clipboard

WIP: feat: maplibre

Open mdecourcy opened this issue 1 month ago • 10 comments

MapLibre has near feature parity with Google Maps and actually has some advantages:

MapLibre Exclusive Features:

  1. Heatmap mode - Density visualization
  2. Role legend - Shows node role colors
  3. Offline tile caching - Ambient cache management
  4. Clustering toggle - Can be disabled
  5. Clustering actions - radial overlay of nodes for cluster of size <= 8
  6. Role-based filtering - Filter by device roles

Google Maps Exclusive Features

  1. Richer info windows - Full NodeChip display with details
  2. Track point info windows - Position details on track points

Things that I'm shelving for later (in no particular order):

  1. heatmap will need some touch up
  2. Reposition node type legend
  3. Consider moving location button above zoom in/out buttons
  4. Gut osmdroid
  5. Gut gmaps after successful fdroid userbase testing
  6. raster maps
  7. unsure if precision bits are working as intended. Doesn't smell right
  8. Node trackpoints enhancements to get parity w/ gmaps
  9. Lifecycle management improvements
  10. Better label hiding logic

Will address the missing features in separate PRs. This PR is already way too big, sorry guys

image image image image image image image image

mdecourcy avatar Nov 22 '25 03:11 mdecourcy

Codecov Report

:x: Patch coverage is 0% with 2219 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 0.51%. Comparing base (f9575a2) to head (7231f7d). :warning: Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
.../meshtastic/feature/map/maplibre/ui/MapLibrePOC.kt 0.00% 745 Missing :warning:
.../feature/map/maplibre/core/MapLibreLayerManager.kt 0.00% 296 Missing :warning:
...g/meshtastic/feature/map/maplibre/ui/MapLibreUI.kt 0.00% 194 Missing :warning:
...c/feature/map/maplibre/utils/MapLibreLayerUtils.kt 0.00% 175 Missing :warning:
...ture/map/maplibre/core/MapLibreDataTransformers.kt 0.00% 116 Missing :warning:
...stic/feature/map/maplibre/utils/MapLibreHelpers.kt 0.00% 108 Missing :warning:
.../feature/map/maplibre/core/MapLibreStyleBuilder.kt 0.00% 106 Missing :warning:
.../feature/map/maplibre/ui/MapLibreControlButtons.kt 0.00% 104 Missing :warning:
...tastic/feature/map/maplibre/ui/MapClickHandlers.kt 0.00% 85 Missing :warning:
...tastic/feature/map/maplibre/ui/MapLibreOverlays.kt 0.00% 82 Missing :warning:
... and 8 more
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #3785      +/-   ##
========================================
- Coverage   0.56%   0.51%   -0.06%     
========================================
  Files        381     398      +17     
  Lines      21733   23919    +2186     
  Branches    2684    3069     +385     
========================================
  Hits         122     122              
- Misses     21591   23777    +2186     
  Partials      20      20              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Nov 22 '25 18:11 codecov[bot]

Is there a way to know/restrict the min zoomlevel for tilesets? I'd like to prevent this if we can. I was using the satellite Map Style in the below instance.

image

jamesarich avatar Nov 30 '25 16:11 jamesarich

Cluster tap behavior is a bit unexpected:

  • Google Maps version - at higher zoom levels, tapping a cluster will zoom to a bounding box containing the items in that cluster. Allowing the user to drill down. Only at the lowest zoom levels, and/or if nodes are broadcasting the same level of precision will a dialog/list of the nodes be shown.
  • maplibre version - at all zoom levels, tapping a cluster will display a dialog/list/web of the nodes contained within

jamesarich avatar Nov 30 '25 16:11 jamesarich

The introduction of an indication of role is a good idea and I'm open to exploring how to expose it, however for the sake of identifiable consistincy we should be coloring the pins as the nodeColor.

Also a bit conflicted about showing the nodeid as the identifier/label on the pin, in other places the node is identified by color and shortname (the node chip).

jamesarich avatar Nov 30 '25 16:11 jamesarich

Also as brought up in conversation - we'll need to better understand the demo tileserver usage or if we need to roll our own, etc.

jamesarich avatar Nov 30 '25 16:11 jamesarich

Heatmap.. did not seem functional (or I do not have enough heat 🥶 )...

jamesarich avatar Nov 30 '25 17:11 jamesarich

Cluster tap behavior is a bit unexpected:

* Google Maps version - at higher zoom levels, tapping a cluster will zoom to a bounding box containing the items in that cluster. Allowing the user to drill down. Only at the lowest zoom levels, and/or if nodes are broadcasting the same level of precision will a dialog/list of the nodes be shown.

* maplibre version - at all zoom levels, tapping a cluster will display a dialog/list/web of the nodes contained within

Due to the smaller location dots, it would be nice if clustering would stay off when selected as such and between page changes.

b8b8 avatar Nov 30 '25 17:11 b8b8

The introduction of an indication of role is a good idea and I'm open to exploring how to expose it, however for the sake of identifiable consistincy we should be coloring the pins as the nodeColor.

Also a bit conflicted about showing the nodeid as the identifier/label on the pin, in other places the node is identified by color and shortname (the node chip).

yes, short name would be better. I do like colour coded roles but it is inconsistent withe previous layout so makes sense to use the proper node derived colour.

b8b8 avatar Nov 30 '25 17:11 b8b8

Heatmap.. did not seem functional (or I do not have enough heat 🥶 )...

Heat map works for me but i personally dont think its needed. If it stays though, that's fine.

b8b8 avatar Nov 30 '25 17:11 b8b8

Is there a way to know/restrict the min zoomlevel for tilesets? I'd like to prevent this if we can. I was using the satellite Map Style in the below instance. image

Yes there is, I can do this pretty easily. Will add to todo list.

Cluster tap behavior is a bit unexpected:

* Google Maps version - at higher zoom levels, tapping a cluster will zoom to a bounding box containing the items in that cluster. Allowing the user to drill down. Only at the lowest zoom levels, and/or if nodes are broadcasting the same level of precision will a dialog/list of the nodes be shown.

* maplibre version - at all zoom levels, tapping a cluster will display a dialog/list/web of the nodes contained within

Will do this as well

The introduction of an indication of role is a good idea and I'm open to exploring how to expose it, however for the sake of identifiable consistincy we should be coloring the pins as the nodeColor.

I agree that role colors diverge from present UI, however on a node map I do feel like the ability to differentiate role types at a quick glance is very useful. I could add a toggle to cycle between nodeColor and role colors?

Also a bit conflicted about showing the nodeid as the identifier/label on the pin, in other places the node is identified by color and shortname (the node chip).

As discussed in discord, this is only for emojis and is unfortunately a constraint of MapLibre. I have found a blog post with a potential solution that I can try to implement. If after a few iterations on this and potentially other solutions, I could fall back to node long name instead of hex ID. Would that suffice?

Regarding heatmap - very much a WIP that I can remove. It's definitely broken as it lies

mdecourcy avatar Dec 01 '25 16:12 mdecourcy