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
feat(geo): add Maps API #1452
Conversation
aws-geo-location/src/main/java/com/amplifyframework/geo/location/AWSLocationGeoPlugin.kt
Outdated
Show resolved
Hide resolved
onError: Consumer<GeoException> | ||
) { | ||
try { | ||
onResult.accept(pluginConfiguration.maps!!.items) |
There was a problem hiding this comment.
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) }
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this 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 🚢
* 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
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.