Skip to content

Conversation

JaffaKetchup
Copy link
Member

No description provided.

Refactoring of `MarkerLayer` internals
Added `TestMarker` widget to example app
@JaffaKetchup
Copy link
Member Author

JaffaKetchup commented Jul 23, 2025

Current status:

  • Improvement in UI thread with 12000 of new markers from 75ms to ~40ms
    • Not entirely sure why this occurs even on a single visible world
    • Haven't even implemented pre-build culling yet
  • No improvement in Raster thread
    • It's likely what I've written is not very efficient

When not counter-rotating, I'm struggling to make different worlds still line up properly:
image

When counter-rotating, I haven't yet drawn each marker across multiple worlds:
image

@monsieurtanuki If you've got spare time and you're interested, maybe this is interesting to you - all this coordinate maths and rotations is difficult for me. But no worries if not ofc :D

@monsieurtanuki
Copy link
Contributor

@JaffaKetchup I've just had a look at the code and it's too flutter-ish for me (e.g. MultiChildRenderObjectWidget), so I cannot help at that stage. I understand that it's still a WIP, but please make sure it's eventually readable enough to be maintainable.

If I remember well when I worked on osmdroid, I believe a simple way to deal with rotation would be to

  • rotate the whole big widget - according to the center of the map widget and the rotation
  • rotate the display of each marker in the opposite angle
  • I think there's already a Rotate widget

About culling, I lazily considered the map diagonals and said that everything beyond the circle whose diameter is that diagonal is to be ignored (modulo the size of the widget).

In osmdroid we displayed the markers directly on the canvas. Could be a way to improve performances, who knows?

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants