[core] Replace StyleLayerType with RTTI

This commit is contained in:
John Firebaugh
2015-12-07 14:56:32 -08:00
parent 8bfc5de1dc
commit e04c5f6506
18 changed files with 59 additions and 127 deletions

View File

@@ -30,7 +30,6 @@ void ShapeAnnotationImpl::updateStyle(Style& style) {
type = ProjectedFeatureType::LineString;
std::unique_ptr<LineLayer> layer = std::make_unique<LineLayer>();
layer->type = StyleLayerType::Line;
layer->layout.join = JoinType::Round;
const LineAnnotationProperties& properties = shape.properties.get<LineAnnotationProperties>();
@@ -48,7 +47,6 @@ void ShapeAnnotationImpl::updateStyle(Style& style) {
type = ProjectedFeatureType::Polygon;
std::unique_ptr<FillLayer> layer = std::make_unique<FillLayer>();
layer->type = StyleLayerType::Fill;
const FillAnnotationProperties& properties = shape.properties.get<FillAnnotationProperties>();
layer->paint.opacity = properties.opacity;
@@ -67,7 +65,7 @@ void ShapeAnnotationImpl::updateStyle(Style& style) {
std::unique_ptr<StyleLayer> layer = sourceLayer->clone();
type = layer->type == StyleLayerType::Line
type = layer->is<LineLayer>()
? ProjectedFeatureType::LineString
: ProjectedFeatureType::Polygon;