-
Notifications
You must be signed in to change notification settings - Fork 319
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
Replace LocationLayerPlugin with LocationComponent #1438
Conversation
ef59dc9
to
d72fe3e
Compare
@Guardiola31337 javadoc is updated here and this is ready for 👀 |
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.
Looks good! Minor changes requested. Going to leave the final 👍 to the navigation team.
if (locationLayerPlugin != null) { | ||
locationLayerPlugin.onStart(); | ||
if (mapboxMap != null) { | ||
mapboxMap.getLocationComponent().onStart(); |
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.
LocationComponent#onStart
is for the Maps SDK's internal use only and doesn't need to be called manually from the client's perspective :)
if (locationLayerPlugin != null) { | ||
locationLayerPlugin.onStop(); | ||
if (mapboxMap != null) { | ||
mapboxMap.getLocationComponent().onStop(); |
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.
if (locationLayerPlugin != null) { | ||
locationLayerPlugin.onStart(); | ||
if (mapboxMap != null) { | ||
mapboxMap.getLocationComponent().onStart(); |
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.
if (locationLayerPlugin != null) { | ||
locationLayerPlugin.onStop(); | ||
if (mapboxMap != null) { | ||
mapboxMap.getLocationComponent().onStop(); |
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.
if (locationLayer != null) { | ||
locationLayer.onStart(); | ||
if (mapboxMap != null) { | ||
mapboxMap.getLocationComponent().onStart(); |
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.
if (locationLayer != null) { | ||
locationLayer.onStart(); | ||
if (mapboxMap != null) { | ||
mapboxMap.getLocationComponent().onStart(); |
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.
if (locationLayer != null) { | ||
locationLayer.onStop(); | ||
if (mapboxMap != null) { | ||
mapboxMap.getLocationComponent().onStop(); |
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.
@@ -147,7 +147,7 @@ public void clearMarkers() { | |||
* @param location to update the icon and query the map | |||
*/ | |||
public void updateLocation(Location location) { | |||
locationLayer.forceLocationUpdate(location); | |||
mapboxMap.getLocationComponent().forceLocationUpdate(location); |
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.
For testing purposes, this should probably also use the injected LocationComponent
.
@@ -393,7 +383,7 @@ public void updateWaynameQueryMap(boolean isEnabled) { | |||
* accounting for the lifecycle. | |||
*/ | |||
public void onStart() { | |||
locationLayer.onStart(); | |||
locationComponent.onStart(); |
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.
@@ -403,7 +393,7 @@ public void onStart() { | |||
* accounting for the lifecycle. | |||
*/ | |||
public void onStop() { | |||
locationLayer.onStop(); | |||
locationComponent.onStop(); |
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.
d72fe3e
to
60e1b66
Compare
Thanks for the great feedback @LukasPaczos! Should be all addressed now. @Guardiola31337 this is ready for final 👀 when you have a chance |
60e1b66
to
20ee3fc
Compare
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.
Other than a couple of nits, this looks good to me 🚀
Thanks @LukasPaczos for implementing this as a component from the Maps SDK and @danesfeder for integrating it! This is awesome 🙇
* @param locationLayer for managing camera mode | ||
* @param mapboxMap for moving the camera | ||
* @param navigation for listening to location updates | ||
* @param locationComponent for managing camera mode | ||
* @since 0.6.0 |
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.
Should we mark this change in the @since
?
* @param mapboxMap for moving the camera | ||
* @param locationLayer for managing camera mode | ||
* @param mapboxMap for moving the camera | ||
* @param locationComponent for managing camera mode |
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.
20ee3fc
to
c9bd57a
Compare
c9bd57a
to
6c8a910
Compare
Closes #1431
This PR replaces the
LocationLayerPlugin
withMapboxMap#getLocationComponent
. We no longer need to pull in a separate dependency at this is now part of the Maps SDK. Noting (and also labeled) that this PR breaks SEMVER in a few places that we can note in the release notes.