[core] Move generic setProperty() parts to the base Layer class

This commit is contained in:
Mikhail Pozdnyakov
2020-03-18 16:46:24 +02:00
parent 99dbb3eed5
commit 280b806777
24 changed files with 100 additions and 124 deletions

View File

@@ -283,12 +283,9 @@ Value HeatmapLayer::serialize() const {
return result;
}
optional<Error> HeatmapLayer::setProperty(const std::string& name, const Convertible& value) {
optional<Error> HeatmapLayer::setPropertyInternal(const std::string& name, const Convertible& value) {
const auto it = layerProperties.find(name.c_str());
if (it == layerProperties.end()) {
if (name == "visibility") return setVisibility(value);
return Error{"layer doesn't support this property"};
}
if (it == layerProperties.end()) return Error{"layer doesn't support this property"};
auto property = static_cast<Property>(it->second);