您的位置:首页 > 其它

SuperMap iClient for Silverlight开发系列之自定义面风格

2011-02-12 15:22 393 查看
SuperMap.Web程序集中提供了点、线、面风格,还提供了默认的风格和预定义的五种点的样式等,如果已经提供的Feature风格不能满足用户的需求,那么也可以自己进行扩展来实现,可以从Style继承,也可以从Style的子类MarkerStyle、LineStyle、FillStyle继承,实现父类的ControlTemplate。

下面就自定义一个面的风格:


在C#代码中直接用就可以了:

feature = new Feature();
feature.Geometry = new GeoRegion
{
Parts = new ObservableCollection<Point2DCollection>
{
new Point2DCollection()
{
new Point2D(0,0),
new Point2D(10000000,0),
new Point2D(10000000,10000000),
new Point2D(0,10000000),
new Point2D(0,0)
},
new Point2DCollection()
{
new Point2D(-10000000,0),
new Point2D(0,-10000000),
new Point2D(-10000000,-10000000),
new Point2D(-10000000,0)
}
}
};
feature.Style = myCustomFillStyle;


效果(黑色的面就是想要的效果):

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐