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

Replace LocationLayerPlugin with LocationComponent #1438

Merged
merged 1 commit into from
Oct 24, 2018

Conversation

danesfeder
Copy link
Contributor

@danesfeder danesfeder commented Oct 18, 2018

Closes #1431

This PR replaces the LocationLayerPlugin with MapboxMap#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.

  • TODO:
    • Update tests
    • Update javadoc
    • Run through test app

@danesfeder danesfeder added refactor backwards incompatible Requires a SEMVER major version change. labels Oct 18, 2018
@danesfeder danesfeder added this to the 0.22.0 milestone Oct 18, 2018
@danesfeder danesfeder self-assigned this Oct 18, 2018
@danesfeder danesfeder force-pushed the dan-location-component branch 2 times, most recently from ef59dc9 to d72fe3e Compare October 22, 2018 15:50
@danesfeder
Copy link
Contributor Author

@Guardiola31337 javadoc is updated here and this is ready for 👀

Copy link
Contributor

@LukasPaczos LukasPaczos left a 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();
Copy link
Contributor

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();
Copy link
Contributor

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();
Copy link
Contributor

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();
Copy link
Contributor

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();
Copy link
Contributor

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();
Copy link
Contributor

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();
Copy link
Contributor

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);
Copy link
Contributor

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();
Copy link
Contributor

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();
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

@danesfeder
Copy link
Contributor Author

Thanks for the great feedback @LukasPaczos! Should be all addressed now.

@Guardiola31337 this is ready for final 👀 when you have a chance

Copy link
Contributor

@Guardiola31337 Guardiola31337 left a 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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

@danesfeder danesfeder merged commit 27382cc into master Oct 24, 2018
@danesfeder danesfeder deleted the dan-location-component branch October 24, 2018 18:08
@danesfeder danesfeder mentioned this pull request Oct 24, 2018
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards incompatible Requires a SEMVER major version change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants