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 Maps API #1452

Merged
merged 2 commits into from Aug 19, 2021
Merged

feat(geo): add Maps API #1452

merged 2 commits into from Aug 19, 2021

Conversation

raphkim
Copy link
Contributor

@raphkim raphkim commented Aug 16, 2021

  • Added two APIs to Geo interface and implemented them:
    • getAvailableMaps()
    • getDefaultMap()

Dependent on #1451

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

@raphkim raphkim requested review from a team, drochetti and rjuliano August 16, 2021 21:54
onError: Consumer<GeoException>
) {
try {
onResult.accept(pluginConfiguration.maps!!.items)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can pluginConfiguration.maps be null?

You may be able to do something like:

pluginConfiguration.maps?.let { onResult.accept(it.items) }

Copy link
Contributor Author

@raphkim raphkim Aug 19, 2021

Choose a reason for hiding this comment

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

Yep! I imagine some people may choose not to use the maps API in Geo and not configure it to begin with.

In such case, maps configuration will be null, and the NPE will be caught to trigger an error callback.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using let will simply return null rather than triggering an error as it should, which is why I simply used !! instead.

onError: Consumer<GeoException>
) {
try {
onResult.accept(pluginConfiguration.maps!!.default)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same as above

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.

A couple minor comments for your review. Other than that, it looks good 🚢

@raphkim raphkim merged commit 274950f into geo Aug 19, 2021
@raphkim raphkim deleted the geo-maps branch August 19, 2021 19:50
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