diff --git a/src/mbgl/style/style_parser.cpp b/src/mbgl/style/style_parser.cpp index a0410dc0a..bcaa6a1e3 100644 --- a/src/mbgl/style/style_parser.cpp +++ b/src/mbgl/style/style_parser.cpp @@ -286,7 +286,7 @@ std::tuple> StyleParser::parseProperty(JSVal value, c float first = value[rapidjson::SizeType(0)].GetDouble(); float second = value[rapidjson::SizeType(1)].GetDouble(); - return std::tuple> { false, {{ first, second }} }; + return std::tuple> { true, {{ first, second }} }; } else { Log::Warning(Event::ParseStyle, "value must be array of two numbers"); return std::tuple> { false, {{ 0.0f, 0.0f }} }; @@ -367,7 +367,7 @@ std::tuple>> StyleParser::parseStops(JSVal template std::tuple> StyleParser::parseFunction(JSVal value, const char *property_name) { if (!value.IsObject()) { - return std::tuple> { true, ConstantFunction(std::get<1>(parseProperty(value, property_name))) }; + return parseProperty(value, property_name); } if (!value.HasMember("stops")) { diff --git a/test/fixtures/style_parser/line-translate.info.json b/test/fixtures/style_parser/line-translate.info.json new file mode 100644 index 000000000..3d9a908eb --- /dev/null +++ b/test/fixtures/style_parser/line-translate.info.json @@ -0,0 +1,7 @@ +{ + "default": { + "log": [ + [1, "WARNING", "ParseStyle", "value must be array of two numbers"] + ] + } +} diff --git a/test/fixtures/style_parser/line-translate.style.json b/test/fixtures/style_parser/line-translate.style.json new file mode 100644 index 000000000..3c079f352 --- /dev/null +++ b/test/fixtures/style_parser/line-translate.style.json @@ -0,0 +1,18 @@ +{ + "version": 6, + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5", + "maxzoom": 14 + } + }, + "layers": [{ + "id": "line_translate_example", + "type": "line", + "source": "mapbox", + "paint": { + "line-translate": null + } + }] +}