[core] Return enum layer property values as string
The output of Layer::getProperty is a mapbox::base::Value which is equivalent to JSON. When setting the value of an enum property via JSON its value would be a string, so it would be natural to return a string too. Also, the numbers generated depend on the enum definition. They are not part of the style spec.
This commit is contained in:
@@ -1006,6 +1006,6 @@ TEST(Map, UniversalStyleGetter) {
|
||||
StyleProperty lineCap = lineLayer->getProperty("line-cap");
|
||||
ASSERT_TRUE(lineCap.value);
|
||||
EXPECT_EQ(StyleProperty::Kind::Constant, lineCap.kind);
|
||||
ASSERT_TRUE(lineCap.value.getInt());
|
||||
EXPECT_EQ(mbgl::underlying_type(mbgl::style::LineCapType::Butt), *lineCap.value.getInt());
|
||||
}
|
||||
ASSERT_TRUE(lineCap.value.getString());
|
||||
EXPECT_EQ(std::string("butt"), *lineCap.value.getString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user