private void service_ProcessCompleted(object sender, ServiceAreaEventArgs e)
 {
     foreach (ServerGeometry p in e.Result.AreaRegions)
     {
         //显示服务区域
         FillStyle fillStyle = new FillStyle();
         fillStyle.Fill = new SolidColorBrush(Color.FromArgb(120, 179, 235, 246));
         Feature area = new Feature();
         area.Geometry = p.ToGeometry();
         area.Style = fillStyle;
         featuresLayer.AddFeature(area);
     }
 }
 //public FeatureElement(Feature f, IRenderer renderer, bool _ignoreMouseEvent)
 //{
 //    this.ClipBox = Rectangle2D.Empty;
 //    this.pathIsInvalid = true;
 //    if (f == null)
 //    {
 //        throw new ArgumentNullException("f");
 //    }
 //    this.feature = new WeakReference(f);
 //    if (renderer != null && (f.GetValue(Clusterer.ClusterProperty) == null))
 //    {
 //        this.GeoStyle = renderer.GetStyle(f) ?? generateDefaultSyle(f);
 //    }//renderer的优先级高于Feature自我的
 //    else
 //    {
 //        this.GeoStyle = f.Style ?? generateDefaultSyle(f);
 //    }
 //    f.SetBoundedStyle(this.GeoStyle);
 //    if (this.GeoStyle != null)
 //    {
 //        base.Template = this.GeoStyle.ControlTemplate;
 //    }
 //    this.ignoreMouseEvents = _ignoreMouseEvent;
 //    this.Geometry = f.Geometry;
 //}
 //internal static FeatureElement DrawShape(Feature feature, IRenderer renderer)
 //{
 //    SuperMap.Web.Core.Geometry geometry = feature.Geometry;
 //    FeatureElement element = new FeatureElement(feature, renderer);
 //    if (geometry is GeoPoint && element.GeoStyle is MarkerStyle)
 //    {
 //        MarkerStyle style = (MarkerStyle)(element.GeoStyle);
 //        element.RenderTransform = new TranslateTransform { X = -style.OffsetX, Y = -style.OffsetY };
 //    }
 //    else if (geometry is GeoLine && element.GeoStyle is LineStyle)
 //    {
 //        element.SetPath();
 //    }
 //    else if (geometry is GeoRegion && element.GeoStyle is FillStyle)
 //    {
 //        element.SetPath();
 //    }
 //    else
 //    {
 //        throw new ArgumentException(ExceptionStrings.InvalidSupportGeometry);
 //    }
 //    return element;
 //}
 private static Style generateDefaultSyle(Feature f)
 {
     if (f.Geometry is GeoPoint)
     {
         Style pmstyle = null;
         if (f.Layer.Map.Theme == null)
         {
             pmstyle = new PredefinedMarkerStyle() { Color = new SolidColorBrush(Colors.Red), Size = 10 };
         }
         else
         {
             pmstyle = new PredefinedMarkerStyle() { Color = f.Layer.Map.Theme.Color, Size = f.Layer.Map.Theme.Size };
         }
         return pmstyle;
     }
     else if (f.Geometry is GeoLine)
     {
         Style plstyle = null;
         if (f.Layer.Map.Theme == null)
         {
             plstyle = new PredefinedLineStyle() { Stroke = new SolidColorBrush(Color.FromArgb(99, 255, 0, 0)), StrokeThickness = 2 };
         }
         else
         {
             plstyle = new PredefinedLineStyle() { Stroke = f.Layer.Map.Theme.Stroke, StrokeThickness = f.Layer.Map.Theme.StrokeThickness };
         }
         return plstyle;
     }
     else
     {
         Style pfstyle = null;
         if (f.Layer.Map.Theme == null)
         {
             pfstyle = new FillStyle() { Fill = new SolidColorBrush(Color.FromArgb(99, 255, 0, 0)) };
         }
         else
         {
             pfstyle = new FillStyle() { Fill = f.Layer.Map.Theme.Fill, Stroke = f.Layer.Map.Theme.Stroke };
         }
         return pfstyle;
     }
 }