core, android: add support for camera roll (#3011)
This commit is contained in:
@@ -510,6 +510,11 @@ TestMetadata parseTestMetadata(const TestPaths& paths) {
|
||||
}
|
||||
}
|
||||
|
||||
if (testValue.HasMember("maxPitch")) {
|
||||
assert(testValue["maxPitch"].IsNumber());
|
||||
metadata.maxPitch = testValue["maxPitch"].GetFloat();
|
||||
}
|
||||
|
||||
if (testValue.HasMember("pixelRatio")) {
|
||||
assert(testValue["pixelRatio"].IsNumber());
|
||||
metadata.pixelRatio = testValue["pixelRatio"].GetFloat();
|
||||
@@ -618,6 +623,8 @@ const std::string setCenterOp("setCenter");
|
||||
const std::string setZoomOp("setZoom");
|
||||
const std::string setBearingOp("setBearing");
|
||||
const std::string setPitchOp("setPitch");
|
||||
const std::string setRollOp("setRoll");
|
||||
const std::string setCenterAltitudeOp("setCenterElevation");
|
||||
const std::string setFilterOp("setFilter");
|
||||
const std::string setLayerZoomRangeOp("setLayerZoomRange");
|
||||
const std::string setLightOp("setLight");
|
||||
@@ -805,6 +812,24 @@ TestOperations parseTestOperations(TestMetadata& metadata) {
|
||||
ctx.getMap().jumpTo(mbgl::CameraOptions().withPitch(pitch));
|
||||
return true;
|
||||
});
|
||||
} else if (operationArray[0].GetString() == setRollOp) {
|
||||
// setRoll
|
||||
assert(operationArray.Size() >= 2u);
|
||||
assert(operationArray[1].IsNumber());
|
||||
double roll = operationArray[1].GetDouble();
|
||||
result.emplace_back([roll](TestContext& ctx) {
|
||||
ctx.getMap().jumpTo(mbgl::CameraOptions().withRoll(roll));
|
||||
return true;
|
||||
});
|
||||
} else if (operationArray[0].GetString() == setCenterAltitudeOp) {
|
||||
// setCenterAltitude
|
||||
assert(operationArray.Size() >= 2u);
|
||||
assert(operationArray[1].IsNumber());
|
||||
double centerAltitude = operationArray[1].GetDouble();
|
||||
result.emplace_back([centerAltitude](TestContext& ctx) {
|
||||
ctx.getMap().jumpTo(mbgl::CameraOptions().withCenterAltitude(centerAltitude));
|
||||
return true;
|
||||
});
|
||||
} else if (operationArray[0].GetString() == setFilterOp) {
|
||||
// setFilter
|
||||
assert(operationArray.Size() >= 3u);
|
||||
|
||||
Reference in New Issue
Block a user