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

feat(geo): add convenience method for setting map style #1497

Merged
merged 2 commits into from Sep 16, 2021
Merged

Conversation

raphkim
Copy link
Contributor

@raphkim raphkim commented Sep 15, 2021

Added setStyle convenience method that sets map style on maplibre map instance using correct thread types for different tasks.

Previously, user would have to:

  1. launch the map getter (MapView#getMapAsync()) from the main UI thread,
  2. fetch style from the worker thread (Geo#getMapStyleDescriptor()) from the worker thread,
  3. and then apply style on the map (MapboxMap#setStyle()) from the main UI thread

This resulted in making one simple step of loading a style on the map quite complicated. This PR adds a service executor to the plugin to enforce that network requests are made from a worker thread, and adds a convenience method that behaves like MapLibre's setStyle() method.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@raphkim raphkim requested a review from a team September 15, 2021 18:10
Copy link
Contributor

@rjuliano rjuliano left a comment

Choose a reason for hiding this comment

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

LGTM

@raphkim raphkim merged commit 6c158df into geo Sep 16, 2021
@raphkim raphkim deleted the geo-set-style branch September 16, 2021 22:05
raphkim added a commit that referenced this pull request Sep 21, 2021
* feat(geo): adds Geo category to Amplify (#1450)

* feat(geo): adds implementation of Geo category plugin (#1451)

* feat(geo): add Maps API (#1452)

* feat(geo): add MapLibre adapter for Geo plugin (#1456)

* feat(core): register geo category to Amplify and Hub (#1474)

* feat(geo): add getMapStyleDescriptor API to Geo (#1475)

* chore(geo): fix checkstyle errors

* feat(geo): add convenience method for setting map style (#1497)

* chore(geo): add alpha version to geo (#1499)

* fix(geo): Add JvmStatic to static methods
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

2 participants