Cherry pick release v4.2.0 (#6944)
* [android] - MyLocationView should facing above when location and compass bearing tracking are enabled. (#6829) * [android] - use current animated rotation value for calculating animated marker rotation difference (#6826) fix unit tests, input limiting is not handled by animateRotationBy instead of MarkerView. Changed test to validate if method was called with correct value. * [android] - only calculated offset margins for InfoWindow if View is found in current viewport, added example to the test app to test for regressions (#6877) * upgraded okhttp dependency to latest version (#6880) * Cancelable callback invocation (#6891) * [android] - allow onCancel to be invoked from camera cancel callbacks * set to null after finish * [android] - using bearing clockwise versus counterclockwise (#6917) * [android] - using bearing clockwise versus counterclockwise * fixup brackets * [android] - convert bearing values from core to Android SDK equivalent.
This commit is contained in:
@@ -172,6 +172,24 @@ public class MarkerViewActivity extends AppCompatActivity {
|
||||
.icon(IconFactory.getInstance(mapView.getContext())
|
||||
.fromResource(R.drawable.ic_arsenal))
|
||||
);
|
||||
|
||||
// allow more open infowindows at the same time
|
||||
mapboxMap.setAllowConcurrentMultipleOpenInfoWindows(true);
|
||||
|
||||
// add offscreen markers
|
||||
Marker markerRightOffScreen = mapboxMap.addMarker(new MarkerOptions()
|
||||
.setPosition(new LatLng(38.892846, -76.909399))
|
||||
.title("InfoWindow")
|
||||
.snippet("Offscreen, to the right of the Map."));
|
||||
|
||||
Marker markerRightBottomOffScreen = mapboxMap.addMarker(new MarkerOptions()
|
||||
.setPosition(new LatLng(38.791645, -77.039006))
|
||||
.title("InfoWindow")
|
||||
.snippet("Offscreen, to the bottom of the Map"));
|
||||
|
||||
// open infowindow offscreen markers
|
||||
mapboxMap.selectMarker(markerRightOffScreen);
|
||||
mapboxMap.selectMarker(markerRightBottomOffScreen);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -87,7 +87,17 @@ public class CameraPositionActivity extends AppCompatActivity implements OnMapRe
|
||||
.tilt(tilt)
|
||||
.build();
|
||||
|
||||
mapboxMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition), 5000);
|
||||
mapboxMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition), 5000, new MapboxMap.CancelableCallback() {
|
||||
@Override
|
||||
public void onCancel() {
|
||||
Log.v(MapboxConstants.TAG, "OnCancel called");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
Log.v(MapboxConstants.TAG, "OnFinish called");
|
||||
}
|
||||
});
|
||||
Log.v(MapboxConstants.TAG, cameraPosition.toString());
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user