示例#1
0
        public EarthquakeWidget()
        {
            InitializeComponent();

            Caption = "New Earthquake Widget";

            // Retrieve the symbols used to show earthquake epicenters, defined in the Widget.xaml resources.
            _sym = (client.Symbols.SimpleMarkerSymbol) this.TryFindResource("EpicenterSymbol");

            // Set up XmlDataProvider here, so we can later change the source property if required.
            _xmlData = this.TryFindResource("atomProvider") as XmlDataProvider;

            // Hook to the data change event on this.
            _xmlData.DataChanged += _xmlData_DataChanged;
        }
        public EarthquakeWidget()
        {
            InitializeComponent();

             Caption = "New Earthquake Widget";

             // Retrieve the symbols used to show earthquake epicenters, defined in the Widget.xaml resources.
             _sym = (client.Symbols.SimpleMarkerSymbol)this.TryFindResource("EpicenterSymbol");

             // Set up XmlDataProvider here, so we can later change the source property if required.
             _xmlData = this.TryFindResource("atomProvider") as XmlDataProvider;

             // Hook to the data change event on this.
             _xmlData.DataChanged += _xmlData_DataChanged;
        }
示例#3
0
        public void DrawPoint(double latitude, double longitude)
        {
            IsDirty = true;
            ESRI.ArcGIS.Client.Symbols.SimpleMarkerSymbol marker = new ESRI.ArcGIS.Client.Symbols.SimpleMarkerSymbol();
            marker.Style = ESRI.ArcGIS.Client.Symbols.SimpleMarkerSymbol.SimpleMarkerStyle.Circle;
            marker.Color = System.Windows.Media.Brushes.OrangeRed;
            // marker.Size =

            ESRI.ArcGIS.Client.Graphic g = new ESRI.ArcGIS.Client.Graphic();
            g.Symbol = marker;

            var pt = MapUtil.ProjectPoint(new System.Windows.Point(longitude, latitude));

            ESRI.ArcGIS.Client.Geometry.MapPoint geometry = new ESRI.ArcGIS.Client.Geometry.MapPoint(pt.X, pt.Y);
            g.Geometry = geometry;

            _l1.Graphics.Add(g);
        }
示例#4
0
 public static ESRI.ArcGIS.Client.GraphicsLayer CreateSearchLyr(ESRI.ArcGIS.Client.Geometry.Geometry mp)
 {
     ESRI.ArcGIS.Client.GraphicsLayer gl = new GraphicsLayer();
     ESRI.ArcGIS.Client.GraphicCollection listGc = new GraphicCollection();
     ESRI.ArcGIS.Client.Graphic gp = new Graphic()
     {
         Geometry = mp
     };
     listGc.Add(gp);
     gl.ID = "SearchLyr";
     gl.Graphics = listGc;
     ESRI.ArcGIS.Client.Symbols.SimpleMarkerSymbol skb = new ESRI.ArcGIS.Client.Symbols.SimpleMarkerSymbol();
     skb.Color = Brushes.Red;
     skb.Size = 15;
     var render = new SimpleRenderer();
     render.Symbol = skb;
     gl.Renderer = render as IRenderer;
     return gl;
 }