add symbol* properties/keys

This commit is contained in:
Konstantin Käfer
2014-07-23 15:37:01 +02:00
parent 6e44e03241
commit 270c24a9a8
8 changed files with 146 additions and 13 deletions

View File

@@ -23,16 +23,25 @@ const std::map<PropertyKey, PropertyValue> PropertyFallbackValue::properties = {
{ PropertyKey::LineDashLand, defaultStyleProperties<LineProperties>().dash_array[0] },
{ PropertyKey::LineDashGap, defaultStyleProperties<LineProperties>().dash_array[1] },
{ PropertyKey::IconOpacity, defaultStyleProperties<IconProperties>().opacity },
{ PropertyKey::IconRotate, defaultStyleProperties<IconProperties>().rotate },
{ PropertyKey::IconRotateAnchor, defaultStyleProperties<IconProperties>().rotate_anchor },
{ PropertyKey::TextOpacity, defaultStyleProperties<TextProperties>().opacity },
{ PropertyKey::TextSize, defaultStyleProperties<TextProperties>().size },
{ PropertyKey::TextColor, defaultStyleProperties<TextProperties>().color },
{ PropertyKey::TextHaloColor, defaultStyleProperties<TextProperties>().halo_color },
{ PropertyKey::TextHaloWidth, defaultStyleProperties<TextProperties>().halo_width },
{ PropertyKey::TextHaloBlur, defaultStyleProperties<TextProperties>().halo_blur },
{ PropertyKey::IconOpacity, defaultStyleProperties<SymbolProperties>().icon.opacity },
{ PropertyKey::IconRotate, defaultStyleProperties<SymbolProperties>().icon.rotate },
{ PropertyKey::IconSize, defaultStyleProperties<SymbolProperties>().icon.size },
{ PropertyKey::IconColor, defaultStyleProperties<SymbolProperties>().icon.color },
{ PropertyKey::IconHaloColor, defaultStyleProperties<SymbolProperties>().icon.halo_color },
{ PropertyKey::IconHaloWidth, defaultStyleProperties<SymbolProperties>().icon.halo_width },
{ PropertyKey::IconHaloBlur, defaultStyleProperties<SymbolProperties>().icon.halo_blur },
{ PropertyKey::IconTranslateX, defaultStyleProperties<SymbolProperties>().icon.translate[0] },
{ PropertyKey::IconTranslateY, defaultStyleProperties<SymbolProperties>().icon.translate[1] },
{ PropertyKey::IconTranslateAnchor, defaultStyleProperties<SymbolProperties>().icon.translate_anchor },
{ PropertyKey::TextOpacity, defaultStyleProperties<SymbolProperties>().text.opacity },
{ PropertyKey::TextSize, defaultStyleProperties<SymbolProperties>().text.size },
{ PropertyKey::TextColor, defaultStyleProperties<SymbolProperties>().text.color },
{ PropertyKey::TextHaloColor, defaultStyleProperties<SymbolProperties>().text.halo_color },
{ PropertyKey::TextHaloWidth, defaultStyleProperties<SymbolProperties>().text.halo_width },
{ PropertyKey::TextHaloBlur, defaultStyleProperties<SymbolProperties>().text.halo_blur },
{ PropertyKey::TextTranslateX, defaultStyleProperties<SymbolProperties>().text.translate[0] },
{ PropertyKey::TextTranslateY, defaultStyleProperties<SymbolProperties>().text.translate[1] },
{ PropertyKey::TextTranslateAnchor, defaultStyleProperties<SymbolProperties>().text.translate_anchor },
{ PropertyKey::CompositeOpacity, defaultStyleProperties<CompositeProperties>().opacity },

View File

@@ -196,7 +196,6 @@ void StyleLayer::applyStyleProperties<IconProperties>(const float z, const times
IconProperties &icon = properties.get<IconProperties>();
applyStyleProperty(PropertyKey::IconOpacity, icon.opacity, z, now);
applyStyleProperty(PropertyKey::IconRotate, icon.rotate, z, now);
applyStyleProperty(PropertyKey::IconRotateAnchor, icon.rotate_anchor, z, now);
}
template <>

View File

@@ -592,7 +592,6 @@ void StyleParser::parseStyle(JSVal value, ClassProperties &klass) {
parseOptionalProperty<Function<float>>("icon-opacity", Key::IconOpacity, klass, value);
parseOptionalProperty<PropertyTransition>("transition-icon-opacity", Key::IconOpacity, klass, value);
parseOptionalProperty<Function<float>>("icon-rotate", Key::IconRotate, klass, value);
parseOptionalProperty<RotateAnchorType>("icon-rotate-anchor", Key::IconRotateAnchor, klass, value);
parseOptionalProperty<Function<float>>("text-opacity", Key::TextOpacity, klass, value);
parseOptionalProperty<PropertyTransition>("transition-text-opacity", Key::TextOpacity, klass, value);

View File

@@ -6,6 +6,7 @@ template<> const FillProperties &defaultStyleProperties() { static const FillPro
template<> const LineProperties &defaultStyleProperties() { static const LineProperties p; return p; }
template<> const IconProperties &defaultStyleProperties() { static const IconProperties p; return p; }
template<> const TextProperties &defaultStyleProperties() { static const TextProperties p; return p; }
template<> const SymbolProperties &defaultStyleProperties() { static const SymbolProperties p; return p; }
template<> const CompositeProperties &defaultStyleProperties() { static const CompositeProperties p; return p; }
template<> const RasterProperties &defaultStyleProperties() { static const RasterProperties p; return p; }
template<> const BackgroundProperties &defaultStyleProperties() { static const BackgroundProperties p; return p; }