Skip to content

Conversation

@srmncnk
Copy link
Contributor

@srmncnk srmncnk commented Sep 10, 2025

Overview

This PR introduces additional functionality to the flutter wrapper from the native library.

1. Performance Controls

  • setMaximumFps(int fps) - Controls rendering performance by limiting frame rate
  • forceOnlineMode() - Forces the map to use online mode in some cases on older Android devices where device is offline but you're serving offline data via local server

Why this matters: Essential for battery optimization on mobile devices and ensuring custom implemented offline data.

2. Enhanced Camera Control

  • animateCameraWithDuration(CameraUpdate cameraUpdate, int duration) - Smooth camera animations with precise timing control
  • queryCameraPosition() - Retrieves current camera state for programmatic map control

Why this matters: Enables smooth user experiences and allows developers to build sophisticated map interactions with predictable timing.

3. Advanced Style and Layer Control

  • editGeoJsonSource(String id, String data) - Updates GeoJSON data in real-time
  • editGeoJsonUrl(String id, String url) - Changes GeoJSON source URLs dynamically
  • setLayerFilter(String layerId, String filter) - Applies complex filters to map layers
  • getStyle() - Exports current map style as JSON

Why this matters: Very useful when you want to manipulate style and layers quickly and dynamically.

5. Custom Authentication

  • setCustomHeaders(Map<String, String> headers, List<String> filter) - Adds custom headers to map requests
  • getCustomHeaders() - Retrieves current custom headers

Why this matters: Essential for authenticating map tiles.

Impact

This is production ready and well tested, we ported our exposed functionality from previous repository from tobrun. As we're switching to maplibre, this is what we need.

@srmncnk
Copy link
Contributor Author

srmncnk commented Sep 10, 2025

Implements #596

@AlexanderThiele
Copy link
Collaborator

AlexanderThiele commented Sep 10, 2025

do you have time to review @gabbopalma ?

@AlexanderThiele
Copy link
Collaborator

@srmncnk can you take a look at the pipeline errors?

@gabbopalma
Copy link
Collaborator

do you have time to review @gabbopalma ?

sure, i will check tomorrow/next days

@gabbopalma gabbopalma added the enhancement New feature or request label Sep 11, 2025
@gabbopalma gabbopalma added this to the v0.23.0 milestone Sep 11, 2025
@gabbopalma
Copy link
Collaborator

Hello @srmncnk, I have added some comments for improvements to be made. The PR looks good, and thank you for your contribution!
Could you add some examples of the new methods exposed in the sample app?
Thanks

@srmncnk
Copy link
Contributor Author

srmncnk commented Sep 12, 2025

@gabbopalma Thanks for the quick review! Agreed and implemented, please have a look.

@AlexanderThiele
Copy link
Collaborator

@gabbopalma Thanks for the quick review! Agreed and implemented, please have a look.

the pipeline is still failing, could you check the errors?

@srmncnk
Copy link
Contributor Author

srmncnk commented Sep 12, 2025

@gabbopalma @AlexanderThiele Looks good to me now. Will add examples to sample app in the evening.

@gabbopalma
Copy link
Collaborator

perfect, thanks for the improvements. I will review again when examples are added. Thank you!

@srmncnk
Copy link
Contributor Author

srmncnk commented Sep 12, 2025

I added easeCamera, queryCameraPosition and setMaximumFps to AnimateCameraPage example.
I also added a new example called LayerManipulationPage with a simple animation using editGeojsonSource, setting a geojson of earthquakes via editGeojsonUrl and toggling showcase using setLayerFilter to show how manipulate layers when performance is critical.

I didn't bother with offline mode since it's hard to make an example of it with offline data. Same for authentication, it's a very specific usecase.

@gabbopalma gabbopalma self-requested a review September 14, 2025 12:41
Copy link
Collaborator

@gabbopalma gabbopalma left a comment

Choose a reason for hiding this comment

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

Hii, we have these minor issues to resolve. Could you also check why the pipelines are failing? Thank you

@gabbopalma gabbopalma changed the base branch from main to release-0.23.0 September 15, 2025 16:17
@gabbopalma gabbopalma deleted the branch maplibre:release-0.23.0 September 17, 2025 15:46
@gabbopalma gabbopalma closed this Sep 17, 2025
@gabbopalma gabbopalma reopened this Sep 17, 2025
@srmncnk srmncnk requested a review from gabbopalma September 19, 2025 11:27
@srmncnk
Copy link
Contributor Author

srmncnk commented Sep 19, 2025

@gabbopalma @AlexanderThiele Took me a bit, busy days. Did run the tests locally with melos, LGTM.

@gabbopalma
Copy link
Collaborator

gabbopalma commented Sep 19, 2025

Hi @srmncnk, the PR seems LGTM and is ready to being merged. We have one last reviewed change to apply (I can't do it), lost among the old applied suggestions.
Thank you for you efforts and your contribution!

This will be merged into release-0.23.0 branch, which will be released soon

@srmncnk
Copy link
Contributor Author

srmncnk commented Sep 19, 2025

@gabbopalma Sounds great, thank you very much! I applied your change, we're good to go.

@gabbopalma gabbopalma added the next version This feature will added in the next version label Sep 19, 2025
@gabbopalma gabbopalma merged commit 8805da0 into maplibre:release-0.23.0 Sep 19, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request next version This feature will added in the next version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants