Skip to content

feat: implement continuous mode#115

Open
Murmele wants to merge 68 commits intomaplibre:mainfrom
Murmele:rust_compilation_bug
Open

feat: implement continuous mode#115
Murmele wants to merge 68 commits intomaplibre:mainfrom
Murmele:rust_compilation_bug

Conversation

@Murmele
Copy link
Collaborator

@Murmele Murmele commented Dec 9, 2025

This PR is far away from being finished, but maybe someone can have a look on it and provide feedback.
Implement continuous mode with map and renderer observer.

Not working

Testing

Currently I am testing it in my project with Slint: https://gitlab.com/Murmele/slintmaplibretest

Launch Checklist

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality.
  • Document any changes to public APIs.
  • Post benchmark scores.
  • Add an entry to CHANGELOG.md under the ## main section.

Reason: previously the wrong callback was used
Reason: otherwise the static_assertion checks are wrong
Reason: the MapObserver Instance got deleted after the MapRenderer_new_with_observer call, because the variable which has the pointer to the MapObserver gets deleted and then also the references pointing on it are invalid
Reason: unintentionally added. It does nothing
Reason: Otherwise we have a livetime problem if the function is not static. For Closures move must be used to capture all variables by value!
Reason: because it is important to set it
Reason: Using opaque objects is better so no unsafe conversion is required
Reason: less error prone and less unsafe code
@Murmele Murmele mentioned this pull request Dec 9, 2025
11 tasks
@nyurik nyurik changed the title Implement continuous mode feat: implement continuous mode Dec 11, 2025
@Murmele Murmele force-pushed the rust_compilation_bug branch from 0539d03 to 6993e5c Compare January 7, 2026 17:50
@Murmele Murmele force-pushed the rust_compilation_bug branch from 0d2e4ae to 6b267f7 Compare January 7, 2026 18:12
@Murmele Murmele marked this pull request as ready for review January 7, 2026 18:19
@nyurik
Copy link
Member

nyurik commented Jan 7, 2026

hi @Murmele thx for all the hard work on this!!! Please join us in https://slack.openstreetmap.us/ on slack - this way you can chat directly with all of us and we can collaborate better. Let me know if you need any help.

@nyurik
Copy link
Member

nyurik commented Jan 7, 2026

@mwilsnd for some reason I cannot add you to the reviewers, but your feedback would be great!

@Murmele
Copy link
Collaborator Author

Murmele commented Jan 7, 2026

hi @Murmele thx for all the hard work on this!!! Please join us in https://slack.openstreetmap.us/ on slack - this way you can chat directly with all of us and we can collaborate better. Let me know if you need any help.

Thanks for the invitation! Is there a channel related to maplibre or just the general?

@nyurik
Copy link
Member

nyurik commented Jan 7, 2026

#maplibre-native and #maplibre are probably the most relevant

const size_t pixelCount = mSize.width * mSize.height;
constexpr size_t bytes_per_pixel = 4; // rgba
// TODO: why *2?
return sizeof(uint32_t) * 2 + pixelCount * bytes_per_pixel;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at how the allocation size is determined in native here, this should just be 4 * width * height. Are you seeing a bounds check or alignment failure unless you allocate extra space?

@mwilsnd
Copy link
Collaborator

mwilsnd commented Jan 7, 2026

Currently setSize does not work. I have seen in the vulkan/headless_backend That the size is only used the first time the texture got created.

@mwilsnd shouldn't the texture recreated once the size changes?

If you try to resize the frontend two or more times before calling readStillImage, do you get a properly sized output? Looks like the OpenGL backend should also work, but the vulkan implementation linked does look like it needs to be updated to handle size changes.

@Murmele
Copy link
Collaborator Author

Murmele commented Jan 8, 2026

Currently setSize does not work. I have seen in the vulkan/headless_backend That the size is only used the first time the texture got created.
@mwilsnd shouldn't the texture recreated once the size changes?

If you try to resize the frontend two or more times before calling readStillImage, do you get a properly sized output? Looks like the OpenGL backend should also work, but the vulkan implementation linked does look like it needs to be updated to handle size changes.

Yes maybe this is missing: maplibre/maplibre-native#4030

@Murmele
Copy link
Collaborator Author

Murmele commented Feb 17, 2026

I will check it out next weeks to get it build again

@nyurik
Copy link
Member

nyurik commented Feb 17, 2026

thanks!!! I have been using github's copilot quiet successfully - the only problem with it is that it doesn't work across forks :( I'll see if i can just create an extra issue and assign it - maybe it will self-heal

@nyurik
Copy link
Member

nyurik commented Feb 17, 2026

I created #129 - will see what copilot does :)

@nyurik
Copy link
Member

nyurik commented Feb 17, 2026

horray, this PR passes once again. What the status of it? I would looooove to have this as part of mln-rs :)

@Murmele
Copy link
Collaborator Author

Murmele commented Feb 18, 2026

horray, this PR passes once again. What the status of it? I would looooove to have this as part of mln-rs :)

The PR passes, but in my testapplication it does not compile anymore because of missing libraries in the almagan (was it the mln texture?). I hope I get it this week up :)

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.

4 participants