[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:
Ander Conselvan de Oliveira
2019-09-27 15:39:21 +03:00
parent d90b2bb6dc
commit bb9b1ab624
2 changed files with 4 additions and 4 deletions

View File

@@ -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());
}