예제 #1
0
        public static String LabelStyle(LabelStyle style)
        {
            FeatureTypeStyleType rawStyle = new FeatureTypeStyleType();

            if (!String.IsNullOrEmpty(style.Name))
            {
                rawStyle.Name = style.Name;
            }

            if (style.Description != null)
            {
                rawStyle.Description          = new DescriptionType();
                rawStyle.Description.Title    = style.Description.Title;
                rawStyle.Description.Abstract = style.Description.Abstract;
            }

            return(FeatureTypeStyleSerializer.Serialize(rawStyle));
        }
예제 #2
0
        public void SerializeDegeneratePointSymbolizer()
        {
            FeatureTypeStyleType featureStyleType = new FeatureTypeStyleType();
            RuleType             rule             = new RuleType();

            featureStyleType.Items    = new Object[1];
            featureStyleType.Items[0] = rule;
            PointSymbolizerType pointSymbolizer = new PointSymbolizerType();

            rule.Items    = new SymbolizerType[1];
            rule.Items[0] = pointSymbolizer;

            String xml = FeatureTypeStyleSerializer.Serialize(featureStyleType);

            StringAssert.Contains("<Rule>", xml);
            StringAssert.Contains("</Rule>", xml);
            StringAssert.Contains("<PointSymbolizer", xml);
        }