Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,22 @@ private void showTrackingListDialog() {
locationLayerPlugin.setCameraMode(CameraMode.TRACKING_GPS_NORTH);
}
listPopup.dismiss();

if (locationLayerPlugin.getCameraMode() != CameraMode.NONE) {
locationLayerPlugin.zoomWhileTracking(15, 750, new MapboxMap.CancelableCallback() {
@Override
public void onCancel() {
// No impl
}

@Override
public void onFinish() {
locationLayerPlugin.tiltWhileTracking(45);
}
});
} else {
mapboxMap.easeCamera(CameraUpdateFactory.tiltTo(0));
}
});
listPopup.show();
}
Expand Down
3 changes: 3 additions & 0 deletions plugin-locationlayer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Mapbox welcomes participation and contributions from everyone.

### master
- Additional methods to tilt and zoom in/out the camera while camera tracking is engaged [#583](https://github.com/mapbox/mapbox-plugins-android/pull/583)

### 0.6.0 - July 9, 2018
- Animate accuracy ring when new value is provided [#577](https://github.com/mapbox/mapbox-plugins-android/pull/577)
- Allow pre-loaded MapboxMap images / maki icons in LocationLayerOptions [#574](https://github.com/mapbox/mapbox-plugins-android/pull/574)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.mapbox.mapboxsdk.plugins.locationlayer;

import android.animation.ValueAnimator;

import java.util.List;

class CameraCompassBearingAnimator extends PluginFloatAnimator<PluginAnimator.OnCameraAnimationsValuesChangeListener> {
CameraCompassBearingAnimator(Float previous, Float target,
List<OnCameraAnimationsValuesChangeListener> updateListeners) {
super(previous, target, updateListeners);
}

@Override
int provideAnimatorType() {
return ANIMATOR_CAMERA_COMPASS_BEARING;
}

@Override
public void onAnimationUpdate(ValueAnimator animation) {
for (OnCameraAnimationsValuesChangeListener listener : updateListeners) {
listener.onNewCompassBearingValue((Float) animation.getAnimatedValue());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.mapbox.mapboxsdk.plugins.locationlayer;

import android.animation.ValueAnimator;

import java.util.List;

class CameraGpsBearingAnimator extends PluginFloatAnimator<PluginAnimator.OnCameraAnimationsValuesChangeListener> {
CameraGpsBearingAnimator(Float previous, Float target, List<OnCameraAnimationsValuesChangeListener> updateListeners) {
super(previous, target, updateListeners);
}

@Override
int provideAnimatorType() {
return ANIMATOR_CAMERA_GPS_BEARING;
}

@Override
public void onAnimationUpdate(ValueAnimator animation) {
for (OnCameraAnimationsValuesChangeListener listener : updateListeners) {
listener.onNewGpsBearingValue((Float) animation.getAnimatedValue());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.mapbox.mapboxsdk.plugins.locationlayer;

import android.animation.ValueAnimator;

import com.mapbox.mapboxsdk.geometry.LatLng;

import java.util.List;

class CameraLatLngAnimator extends PluginLatLngAnimator<PluginAnimator.OnCameraAnimationsValuesChangeListener> {
CameraLatLngAnimator(LatLng previous, LatLng target, List<OnCameraAnimationsValuesChangeListener> updateListeners) {
super(previous, target, updateListeners);
}

@Override
int provideAnimatorType() {
return ANIMATOR_CAMERA_LATLNG;
}

@Override
public void onAnimationUpdate(ValueAnimator animation) {
for (OnCameraAnimationsValuesChangeListener listener : updateListeners) {
listener.onNewLatLngValue((LatLng) animation.getAnimatedValue());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.mapbox.mapboxsdk.plugins.locationlayer;

import android.animation.TypeEvaluator;

import com.mapbox.mapboxsdk.geometry.LatLng;

class LatLngEvaluator implements TypeEvaluator<LatLng> {

private final LatLng latLng = new LatLng();

@Override
public LatLng evaluate(float fraction, LatLng startValue, LatLng endValue) {
latLng.setLatitude(startValue.getLatitude()
+ ((endValue.getLatitude() - startValue.getLatitude()) * fraction));
latLng.setLongitude(startValue.getLongitude()
+ ((endValue.getLongitude() - startValue.getLongitude()) * fraction));
return latLng;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.mapbox.mapboxsdk.plugins.locationlayer;

import android.animation.ValueAnimator;

import java.util.List;

class LayerAccuracyAnimator extends PluginFloatAnimator<PluginAnimator.OnLayerAnimationsValuesChangeListener> {

LayerAccuracyAnimator(Float previous, Float target, List<OnLayerAnimationsValuesChangeListener> updateListeners) {
super(previous, target, updateListeners);
}

@Override
int provideAnimatorType() {
return ANIMATOR_LAYER_ACCURACY;
}

@Override
public void onAnimationUpdate(ValueAnimator animation) {
for (OnLayerAnimationsValuesChangeListener listener : updateListeners) {
listener.onNewAccuracyRadiusValue((Float) animation.getAnimatedValue());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.mapbox.mapboxsdk.plugins.locationlayer;

import android.animation.ValueAnimator;

import java.util.List;

class LayerCompassBearingAnimator extends PluginFloatAnimator<PluginAnimator.OnLayerAnimationsValuesChangeListener> {
LayerCompassBearingAnimator(Float previous,
Float target, List<OnLayerAnimationsValuesChangeListener> updateListeners) {
super(previous, target, updateListeners);
}

@Override
int provideAnimatorType() {
return ANIMATOR_LAYER_COMPASS_BEARING;
}

@Override
public void onAnimationUpdate(ValueAnimator animation) {
for (OnLayerAnimationsValuesChangeListener listener : updateListeners) {
listener.onNewCompassBearingValue((Float) animation.getAnimatedValue());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.mapbox.mapboxsdk.plugins.locationlayer;

import android.animation.ValueAnimator;

import java.util.List;

class LayerGpsBearingAnimator extends PluginFloatAnimator<PluginAnimator.OnLayerAnimationsValuesChangeListener> {
LayerGpsBearingAnimator(Float previous, Float target, List<OnLayerAnimationsValuesChangeListener> updateListeners) {
super(previous, target, updateListeners);
}

@Override
int provideAnimatorType() {
return ANIMATOR_LAYER_GPS_BEARING;
}

@Override
public void onAnimationUpdate(ValueAnimator animation) {
for (OnLayerAnimationsValuesChangeListener listener : updateListeners) {
listener.onNewGpsBearingValue((Float) animation.getAnimatedValue());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.mapbox.mapboxsdk.plugins.locationlayer;

import android.animation.ValueAnimator;

import com.mapbox.mapboxsdk.geometry.LatLng;

import java.util.List;

class LayerLatLngAnimator extends PluginLatLngAnimator<PluginAnimator.OnLayerAnimationsValuesChangeListener> {
LayerLatLngAnimator(LatLng previous, LatLng target, List<OnLayerAnimationsValuesChangeListener> updateListeners) {
super(previous, target, updateListeners);
}

@Override
int provideAnimatorType() {
return ANIMATOR_LAYER_LATLNG;
}

@Override
public void onAnimationUpdate(ValueAnimator animation) {
for (OnLayerAnimationsValuesChangeListener listener : updateListeners) {
listener.onNewLatLngValue((LatLng) animation.getAnimatedValue());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.iconSize;
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.visibility;

final class LocationLayer implements LocationLayerAnimator.OnLayerAnimationsValuesChangeListener {
final class LocationLayer implements PluginAnimator.OnLayerAnimationsValuesChangeListener {

@RenderMode.Mode
private int renderMode;
Expand Down
Loading