Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Image Source Support #469

Merged
merged 7 commits into from
Dec 19, 2020

Conversation

cuberob
Copy link
Contributor

@cuberob cuberob commented Nov 30, 2020

My previous PR for adding basic image source support got merged, and while functional, I think it was lacking some consistency. This PR is a continuation of that work, it:

  • Is more explicit about the parameters, instead of using the generic name it's now either imageSourceId or imageLayerId.
  • Adds addLayerBelow functionality. In my use case I had to insert layers below the markers, this can be done using this functions and e.g. adding the source below the country-label layer.
  • Does some sanity checks on iOS before adding sources/layers
  • Updated the PlaceSource sample to more clearly demonstrate the difference between the ImageSource and ImageLayer and to add a demo of the addLayerBelow functionality.
  • Fixed some coding style consistency issues where double quotes where used instead of flutter preferred single quotes

note: it's built on top of the UnsatisfiedLinkError branch as without those changes I could not get the sample project to run anymore.

addLayerBelow demo:

mapboxdemo

andrea689 and others added 7 commits October 27, 2020 10:08
Add const keyword to LatLngQuad so that is can be
instantiated as a constant in consuming projects.
Rename the parameters in the controller to make it more explicit
which id you are passing along (source or layer).

Improve the PlaceSource example by using static source & layer
ids which should help to make it more obvious what you are dealing
with (source vs layer).
Instead of having parameters called name when communicating
with the native world. Use imageLayerId & imageSourceId to make
it more explicit what we are dealing with.
Support adding layers below other layers for more fine-grained
control as to where your image source ends up.
@cuberob cuberob marked this pull request as ready for review November 30, 2020 09:59
Copy link
Collaborator

@tobrun tobrun left a comment

Choose a reason for hiding this comment

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

Thank you for improving and continue to contribute!

@tobrun tobrun merged commit 04fba8b into flutter-mapbox-gl:master Dec 19, 2020
@cuberob cuberob deleted the improved-image-source branch December 21, 2020 13:09
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.

None yet

3 participants