当前位置: 首页>>代码示例>>C#>>正文


C# GraphicsLayer.Initialize方法代码示例

本文整理汇总了C#中GraphicsLayer.Initialize方法的典型用法代码示例。如果您正苦于以下问题:C# GraphicsLayer.Initialize方法的具体用法?C# GraphicsLayer.Initialize怎么用?C# GraphicsLayer.Initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GraphicsLayer的用法示例。


在下文中一共展示了GraphicsLayer.Initialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

 public void Start()
 {
     if (explosionLayer != null) return;
     explosionLayer = new GraphicsLayer { ID = Id };
     explosionLayer.Initialize();
     ((dsBaseLayer)Layer).ChildLayers.Insert(0, explosionLayer);
 }
开发者ID:TNOCS,项目名称:csTouch,代码行数:7,代码来源:ExplosionModel.cs

示例2: Start

 public void Start()
 {
     if (circleLayer != null) return;
     circleLayer = new GraphicsLayer { ID = Id, IsHitTestVisible = false };
     circleLayer.Initialize();
     ((dsBaseLayer)Layer).ChildLayers.Insert(0, circleLayer);
 }
开发者ID:TNOCS,项目名称:csTouch,代码行数:7,代码来源:CircleModel.cs

示例3: Start

 public void Start()
 {
     if (ZonesLayer != null) return;
     ZonesLayer = new GraphicsLayer { ID = Id };
     ZonesLayer.Initialize();
     ((dsBaseLayer)Layer).ChildLayers.Insert(0, ZonesLayer);
 }
开发者ID:TNOCS,项目名称:csTouch,代码行数:7,代码来源:ZoneModel.cs

示例4: Start

 /// <summary>
 /// Started only once in a service
 /// </summary>
 public void Start()
 {
     if (QueryLayer != null) return;
     QueryLayer = new GraphicsLayer { ID = Id };
     QueryLayer.Initialize();
     var dsBaseLayer = (dsBaseLayer)Layer;
     if (dsBaseLayer != null) dsBaseLayer.ChildLayers.Insert(0, QueryLayer);
 }
开发者ID:TNOCS,项目名称:csTouch,代码行数:11,代码来源:SqlQueryModel.cs

示例5: Start

 public void Start()
 {
     if (GridLayer != null) return;
     GridLayer = new GraphicsLayer { ID = Id, Opacity = 0.3 };
     GridLayer.MapTip = CreateMapTip();
     GridLayer.MaximumResolution = 12;
     GridLayer.Initialize();
     ((dsBaseLayer)Layer).ChildLayers.Insert(0, GridLayer);
 }
开发者ID:TNOCS,项目名称:csTouch,代码行数:9,代码来源:GridModel.cs

示例6: Start

 public void Start()
 {
     if (tracksLayer != null) return;
     tracksLayer                 = new GraphicsLayer {
         ID                      = Id,
         RenderingMode           = GraphicsLayerRenderingMode.Static,
         RendererTakesPrecedence = false
     };
     tracksLayer.Initialize();
     ((dsBaseLayer)Layer).ChildLayers.Insert(0, tracksLayer);
 }
开发者ID:TNOCS,项目名称:csTouch,代码行数:11,代码来源:TrackHistoryModel.cs

示例7: Initialize

        public override void Initialize()
        {
            if (LayerFile == null || !File.Exists(LayerFile)) return;
            var fileInfo = new FileInfo(LayerFile);
            if (fileInfo.Directory != null) ID = fileInfo.Directory.Name;

            Graphics = new GraphicsLayer();
            ChildLayers.Add(Graphics);
            Graphics.Initialize();

            ID = "Presenter Layer";
            base.Initialize();
            SpatialReference = new SpatialReference(4326);
            ChildLayers.Insert(0, el);
            UpdateLayer();
        }
开发者ID:TNOCS,项目名称:csTouch,代码行数:16,代码来源:PresenterLayer.cs

示例8: ucBagGeoCodingTool

 public ucBagGeoCodingTool()
 {
     InitializeComponent();
     Loaded += UcPlacemarkLoaded;
     var layer = AppState.ViewDef.MapToolsLayer;
     var l = layer.ChildLayers.FirstOrDefault(k => k.ID == "BagGeo") as GraphicsLayer;
     if (l != null)
     {
         gLayer = l;
     }
     else
     {
         gLayer = new GraphicsLayer { ID = "BagGeo" };
         layer.ChildLayers.Add(gLayer);
         gLayer.Initialize();
     }
 }
开发者ID:TNOCS,项目名称:csTouch,代码行数:17,代码来源:ucBagGeoCodingTool.xaml.cs

示例9: ucGeoCodingTool

 public ucGeoCodingTool()
 {
     InitializeComponent();
     Loaded += UcPlacemarkLoaded;
     _layer = AppState.ViewDef.MapToolsLayer;
     Layer l = _layer.ChildLayers.FirstOrDefault(k => k.ID == "Geo");
     if (l != null && l is GraphicsLayer)
     {
         gLayer = (GraphicsLayer)l;
     }
     else
     {
         gLayer = new GraphicsLayer { ID = "Geo" };
         _layer.ChildLayers.Add(gLayer);
         gLayer.Initialize();
     }
 }
开发者ID:TNOCS,项目名称:csTouch,代码行数:17,代码来源:ucGeoCodingTool.xaml.cs

示例10: Init

        public void Init(GroupLayer gl, MapPoint start, MapPoint finish, ResourceDictionary rd)
        {
            remoteClient.ComputeFieldOfViewAsImageCompleted += ClientOnComputeFieldOfViewCompleted;
            localClient .ComputeFieldOfViewAsImageCompleted += ClientOnComputeFieldOfViewCompleted;

            StartPoint = new csPoint
            {
                Mp = start
            };
            FinishPoint = new csPoint
            {
                Mp = finish
            };
            MLayer = new GraphicsLayer
            {
                ID = Guid.NewGuid().ToString()
            };

            ImageLayer = new ElementLayer();
            Image = new System.Windows.Controls.Image
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment = VerticalAlignment.Stretch,
                Stretch = Stretch.Fill,
                StretchDirection = StretchDirection.Both
            };
            ElementLayer.SetEnvelope(Image, AppState.ViewDef.MapControl.Extent);
            ImageLayer.Children.Add(Image);

            Start = new Graphic();
            Finish = new Graphic();
            Line = new Graphic();

            var ls = new LineSymbol
            {
                Color = Brushes.Black,
                Width = 4
            };
            Line.Symbol = ls;
            UpdateLine();

            MLayer.Graphics.Add(Line);

            Start.Geometry = start;
            Start.Symbol = rd["Start"] as Symbol;
            Start.Attributes["position"] = start;
            Start.Attributes["finish"] = Finish;
            Start.Attributes["start"] = Start;
            Start.Attributes["line"] = Line;
            Start.Attributes["state"] = "start";
            Start.Attributes["measure"] = this;
            Start.Attributes["menuenabled"] = true;
            MLayer.Graphics.Add(Start);

            Finish.Geometry = finish;
            Finish.Attributes["position"] = finish;
            Finish.Symbol = rd["Finish"] as Symbol;
            Finish.Attributes["finish"] = Finish;
            Finish.Attributes["start"] = Start;
            Finish.Attributes["line"] = Line;
            Finish.Attributes["measure"] = this;
            Finish.Attributes["state"] = "finish";
            Finish.Attributes["menuenabled"] = true;
            MLayer.Graphics.Add(Finish);
            Layer.ChildLayers.Add(ImageLayer);
            Layer.ChildLayers.Add(MLayer);
            MLayer.Initialize();

            AppStateSettings.Instance.ViewDef.MapManipulationDelta += ViewDef_MapManipulationDelta;

            if (AppState.Imb != null && AppState.Imb.Imb != null)
            {
                _3D = AppState.Imb.Imb.Publish(AppState.Imb.Imb.ClientHandle + ".3d");
                //AppState.Imb.Imb.Publish(_channel);
            }

            updateTimer.Interval = 50;
            updateTimer.Elapsed += UpdateTimerElapsed;
            updateTimer.Start();
        }
开发者ID:TNOCS,项目名称:csTouch,代码行数:80,代码来源:FieldOfView.cs

示例11: Init

        public void Init(GroupLayer gl, MapPoint start, MapPoint finish, ResourceDictionary rd)
        {
            Start = new csPoint() { Mp = start };
            Finish = new csPoint() { Mp = finish };
            MLayer = new GraphicsLayer() { ID = Guid.NewGuid().ToString() };
            _start = new Graphic();
            _finish = new Graphic();
            Line = new Graphic();

            LineSymbol ls = new LineSymbol() { Color = Brushes.Black, Width = 4 };
            Line.Symbol = ls;
            UpdateLine();

            MLayer.Graphics.Add(Line);

            _start.Geometry = start;
            _start.Attributes["position"] = start;

            _start.Symbol = rd["Start"] as Symbol;
            _start.Attributes["finish"] = _finish;
            _start.Attributes["start"] = _start;
            _start.Attributes["line"] = Line;
            _start.Attributes["state"] = "start";
            _start.Attributes["measure"] = this;
            _start.Attributes["menuenabled"] = true;
            MLayer.Graphics.Add(_start);

            _finish.Geometry = finish;
            _finish.Attributes["position"] = finish;
            _finish.Symbol = rd["Finish"] as Symbol;
            _finish.Attributes["finish"] = _finish;
            _finish.Attributes["start"] = _start;
            _finish.Attributes["line"] = Line;
            _finish.Attributes["measure"] = this;
            _finish.Attributes["state"] = "finish";
            MLayer.Graphics.Add(_finish);

            Layer.ChildLayers.Add(MLayer);
            MLayer.Initialize();

            AppStateSettings.Instance.ViewDef.MapManipulationDelta += ViewDef_MapManipulationDelta;

        }
开发者ID:TNOCS,项目名称:csTouch,代码行数:43,代码来源:Measure.cs

示例12: Add

        public void Add()
        {            
            GroupLayer gl = AppState.ViewDef.FindOrCreateGroupLayer(@"Wikipedia");

            GraphicsLayer lWiki = new GraphicsLayer() {ID = "Wiki Search: " + Keyword};
            gl.ChildLayers.Add(lWiki);
            lWiki.Initialize();
            WebClient wc = new WebClient();
            wc.DownloadStringCompleted += (e, s) =>
                                              {
                                                  if (s.Error == null)
                                                  {
                                                      Results.Clear();
                                                      XDocument xdoc = XDocument.Parse(s.Result);
                                                      foreach (var a in xdoc.Root.Elements("entry"))
                                                      {
                                                          WikiSearchResult wsr = new WikiSearchResult()
                                                                                     {
                                                                                         Title =
                                                                                             a.Element("title").Value,
                                                                                         Summary =
                                                                                             a.Element("summary").Value,
                                                                                         WikiUrl =
                                                                                             a.Element("wikipediaUrl").
                                                                                             Value,
                                                                                         ImageUrl =
                                                                                             a.Element("thumbnailImg").
                                                                                             Value
                                                                                     };
                                                          double lat = Convert.ToDouble(a.Element("lat").Value,
                                                                                        CultureInfo.InvariantCulture);
                                                          double lon = Convert.ToDouble(a.Element("lng").Value,
                                                                                        CultureInfo.InvariantCulture);

                                                          wsr.Position =
                                                              (MapPoint) _wm.FromGeographic(new MapPoint(lon, lat));

                                                          Results.Add(wsr);
                                                          if (wsr.ImageUrl!="")
                                                          {
                                                              Graphic g = new Graphic();
                                                              
                                                              g.Symbol = new PictureMarkerSymbol()
                                                                             {
                                                                                 Source =
                                                                                     new BitmapImage(
                                                                                     new Uri(wsr.ImageUrl)),
                                                                                 Width = 30,
                                                                                 OffsetX = 15,
                                                                                 OffsetY = 15
                                                                             };
                                                              g.Geometry = wsr.Position;
                                                              lWiki.Graphics.Add(g);
                                                          }
                                                      }
                                                  }
                                              };
            wc.DownloadStringAsync(new Uri(@"http://api.geonames.org/wikipediaSearch?q=" + Keyword + @"&maxRows=100&username=damylen"));

        }
开发者ID:TNOCS,项目名称:csTouch,代码行数:60,代码来源:WikiSearchContent.cs

示例13: Start

        public override void Start()
        {
            base.Start();

            var baseLayer = ((dsBaseLayer)Model.Layer);
            if (OperatingMode == FieldOfViewOperatingMode.Image)
            {
                if (ImageLayer != null) return;
                var displayName = Model.Id + " FoV img";
                ImageLayer = baseLayer.ChildLayers.OfType<ElementLayer>().FirstOrDefault(c => string.Equals(c.DisplayName, displayName, StringComparison.InvariantCultureIgnoreCase));
                if (ImageLayer == null)
                {
                    ImageLayer = new ElementLayer { ID = displayName, DisplayName = displayName };
                    ImageLayer.Initialize();
                    baseLayer.ChildLayers.Insert(0, ImageLayer);
                    AppState.ViewDef.UpdateLayers();
                }
            }
            else
            {
                if (GraphicsLayer != null) return;
                var displayName = Model.Id + " FoV";
                GraphicsLayer = baseLayer.ChildLayers.OfType<GraphicsLayer>().FirstOrDefault(c => string.Equals(c.DisplayName, displayName, StringComparison.InvariantCultureIgnoreCase));
                if (GraphicsLayer == null)
                {
                    GraphicsLayer = new GraphicsLayer { ID = displayName, DisplayName = displayName };
                    GraphicsLayer.Initialize();
                    baseLayer.ChildLayers.Insert(0, GraphicsLayer);
                    AppState.ViewDef.UpdateLayers();
                }
            }

            color = Model.Model.GetColor("Color", Colors.Blue);
            strokeWidth = Model.Model.GetInt("StrokeWidth", 2);
            precision = Model.Model.GetInt("Precision", 2);

            ManagePoiVisibility();
            //this.operatingMode = FieldOfViewOperatingMode.Polygon;

            switch (OperatingMode)
            {
                case FieldOfViewOperatingMode.Polygon:
                    if (GraphicsLayer == null) return;
                    remoteClient.ComputeFieldOfViewAsVectorCompleted += ClientOnComputeFieldOfViewAsVectorCompleted;
                    localClient.ComputeFieldOfViewAsVectorCompleted += ClientOnComputeFieldOfViewAsVectorCompleted;
                    break;
                default:
                    if (ImageLayer == null) return;
                    remoteClient.ComputeFieldOfViewAsImageCompleted += ClientOnComputeFieldOfViewAsImageCompleted;
                    localClient.ComputeFieldOfViewAsImageCompleted += ClientOnComputeFieldOfViewAsImageCompleted;

                    image = new Image
                    {
                        HorizontalAlignment = HorizontalAlignment.Stretch,
                        VerticalAlignment = VerticalAlignment.Stretch,
                        Stretch = Stretch.Fill,
                        StretchDirection = StretchDirection.Both
                    };

                    ElementLayer.SetEnvelope(image, AppStateSettings.Instance.ViewDef.MapControl.Extent);
                    ImageLayer.Children.Add(image);
                    break;
            }

            var posChanged = Observable.FromEventPattern<PositionEventArgs>(ev => Poi.PositionChanged += ev, ev => Poi.PositionChanged -= ev);
            posChanged.Throttle(TimeSpan.FromMilliseconds(150)).Subscribe(k => Calculate());

            var labelChanged = Observable.FromEventPattern<LabelChangedEventArgs>(ev => Poi.LabelChanged += ev, ev => Poi.LabelChanged -= ev);
            labelChanged.Throttle(TimeSpan.FromMilliseconds(150)).Subscribe(k => Calculate());
            Calculate();
        }
开发者ID:TNOCS,项目名称:csTouch,代码行数:71,代码来源:FoVPoi.cs

示例14: Init

        public void Init(GroupLayer gl, MapPoint start, MapPoint finish, ResourceDictionary rd)
        {
            Start = new EffectsPoint() { Mp = start };
            Finish = new EffectsPoint() { Mp = finish };
            MLayer = new GraphicsLayer() { ID = Guid.NewGuid().ToString() };
            ContoursLayer = new GraphicsLayer() { ID = Guid.NewGuid().ToString() };
            _start = new Graphic();
            _finish = new Graphic();
            Line = new Graphic();
            BaseEffectsModelShapes = new GraphicCollection();
            EffectsModelShapes = new GraphicCollection();

            
            
//            var testJson = new FileInfo(@"Plugins\USDomainPlugin\Effects\Data\testshape.json");
//            JObject geoJson = null;
//            using (var reader = testJson.OpenText())
//            {
//                var strJson = reader.ReadToEnd();
//                geoJson = JObject.Parse(strJson);
//                reader.Close();
//            }
//            var strWkt = @"POLYGON ((281.4968022018320000 0,281.3579005227060000 8.8420282352252900,280.9413325645150000 17.6753304560934000,280.2475094295410000 26.4911892597699000,279.2771158374510000 35.2809044579670000,278.0311094495650000 44.0358016629793000,276.5107199237550000 52.7472408482570000,274.7174477009240000 61.4066248750691000,272.6530625242520000 70.0054079768411000,270.3196016926710000 78.5351041927953000,267.7193680503000000 86.9872957425693000,264.8549277138150000 95.3536413335488000,261.7291075400000000 103.6258843927170000,258.3449923359800000 111.7958612148940000,254.7059218148940000 119.8555090193290000,250.8154872999950000 127.7968739066940000,246.6775281804520000 135.6121187086160000,242.2961281223330000 143.2935307220230000,237.6756110385240000 150.8335293206440000,232.8205368215440000 158.2246734361790000,227.7356968434850000 165.4596689017280000,222.4261092275060000 172.5313756502600000,216.8970138955490000 179.4328147609900000,211.1538673971700000 186.1571753467370000,205.2023375245860000 192.6978212754450000,199.0482977192440000 199.0482977192440000,192.6978212754450000 205.2023375245860000,186.1571753467370000 211.1538673971700000,179.4328147609900000 216.8970138955490000,172.5313756502600000 222.4261092275060000,165.4596689017280000 227.7356968434850000,158.2246734361790000 232.8205368215440000,150.8335293206440000 237.6756110385240000,143.2935307220230000 242.2961281223330000,135.6121187086160000 246.6775281804520000,127.7968739066940000 250.8154872999950000,119.8555090193290000 254.7059218148940000,111.7958612148940000 258.3449923359800000,103.6258843927170000 261.7291075400000000,95.3536413335487000 264.8549277138150000,86.9872957425692000 267.7193680503000000,78.5351041927953000 270.3196016926710000,70.0054079768411000 272.6530625242520000,61.4066248750690000 274.7174477009240000,52.7472408482570000 276.5107199237550000,44.0358016629793000 278.0311094495650000,35.2809044579670000 279.2771158374510000,26.4911892597699000 280.2475094295410000,17.6753304560934000 280.9413325645150000,8.8420282352253100 281.3579005227060000,0.0000000000000172 281.4968022018320000,-8.8420282352252800 281.3579005227060000,-17.6753304560934000 280.9413325645150000,-26.4911892597699000 280.2475094295410000,-35.2809044579670000 279.2771158374510000,-44.0358016629793000 278.0311094495650000,-52.7472408482571000 276.5107199237550000,-61.4066248750690000 274.7174477009240000,-70.0054079768410000 272.6530625242520000,-78.5351041927953000 270.3196016926710000,-86.9872957425692000 267.7193680503000000,-95.3536413335488000 264.8549277138150000,-103.6258843927170000 261.7291075400000000,-111.7958612148940000 258.3449923359800000,-119.8555090193300000 254.7059218148940000,-127.7968739066940000 250.8154872999950000,-135.6121187086170000 246.6775281804520000,-143.2935307220230000 242.2961281223330000,-150.8335293206440000 237.6756110385240000,-158.2246734361790000 232.8205368215440000,-165.4596689017280000 227.7356968434850000,-172.5313756502600000 222.4261092275060000,-179.4328147609900000 216.8970138955490000,-186.1571753467370000 211.1538673971700000,-192.6978212754450000 205.2023375245860000,-199.0482977192440000 199.0482977192440000,-205.2023375245860000 192.6978212754450000,-211.1538673971700000 186.1571753467370000,-216.8970138955490000 179.4328147609900000,-222.4261092275060000 172.5313756502600000,-227.7356968434850000 165.4596689017280000,-232.8205368215440000 158.2246734361790000,-237.6756110385240000 150.8335293206440000,-242.2961281223330000 143.2935307220230000,-246.6775281804520000 135.6121187086160000,-250.8154872999950000 127.7968739066940000,-254.7059218148940000 119.8555090193290000,-258.3449923359800000 111.7958612148940000,-261.7291075400000000 103.6258843927170000,-264.8549277138150000 95.3536413335488000,-267.7193680503000000 86.9872957425693000,-270.3196016926710000 78.5351041927953000,-272.6530625242520000 70.0054079768411000,-274.7174477009240000 61.4066248750690000,-276.5107199237550000 52.7472408482571000,-278.0311094495650000 44.0358016629793000,-279.2771158374510000 35.2809044579671000,-280.2475094295410000 26.4911892597699000,-280.9413325645150000 17.6753304560935000,-281.3579005227060000 8.8420282352252700,-281.4968022018320000 0.0000000000000345,-281.3579005227060000 -8.8420282352253200,-280.9413325645150000 -17.6753304560934000,-280.2475094295410000 -26.4911892597699000,-279.2771158374510000 -35.2809044579670000,-278.0311094495650000 -44.0358016629794000,-276.5107199237550000 -52.7472408482570000,-274.7174477009240000 -61.4066248750692000,-272.6530625242520000 -70.0054079768412000,-270.3196016926710000 -78.5351041927953000,-267.7193680503000000 -86.9872957425693000,-264.8549277138150000 -95.3536413335488000,-261.7291075400000000 -103.6258843927170000,-258.3449923359800000 -111.7958612148940000,-254.7059218148940000 -119.8555090193290000,-250.8154872999950000 -127.7968739066940000,-246.6775281804520000 -135.6121187086160000,-242.2961281223330000 -143.2935307220230000,-237.6756110385240000 -150.8335293206440000,-232.8205368215440000 -158.2246734361790000,-227.7356968434850000 -165.4596689017280000,-222.4261092275060000 -172.5313756502600000,-216.8970138955490000 -179.4328147609900000,-211.1538673971700000 -186.1571753467370000,-205.2023375245860000 -192.6978212754450000,-199.0482977192440000 -199.0482977192440000,-192.6978212754450000 -205.2023375245860000,-186.1571753467370000 -211.1538673971700000,-179.4328147609900000 -216.8970138955490000,-172.5313756502600000 -222.4261092275060000,-165.4596689017280000 -227.7356968434850000,-158.2246734361790000 -232.8205368215440000,-150.8335293206440000 -237.6756110385240000,-143.2935307220230000 -242.2961281223330000,-135.6121187086160000 -246.6775281804520000,-127.7968739066940000 -250.8154872999950000,-119.8555090193290000 -254.7059218148940000,-111.7958612148940000 -258.3449923359800000,-103.6258843927170000 -261.7291075400000000,-95.3536413335488000 -264.8549277138150000,-86.9872957425693000 -267.7193680503000000,-78.5351041927954000 -270.3196016926710000,-70.0054079768412000 -272.6530625242520000,-61.4066248750690000 -274.7174477009240000,-52.7472408482570000 -276.5107199237550000,-44.0358016629793000 -278.0311094495650000,-35.2809044579671000 -279.2771158374510000,-26.4911892597698000 -280.2475094295410000,-17.6753304560934000 -280.9413325645150000,-8.8420282352252900 -281.3579005227060000,-0.0000000000000517 -281.4968022018320000,8.8420282352251800 -281.3579005227060000,17.6753304560935000 -280.9413325645150000,26.4911892597699000 -280.2475094295410000,35.2809044579670000 -279.2771158374510000,44.0358016629792000 -278.0311094495650000,52.7472408482572000 -276.5107199237550000,61.4066248750692000 -274.7174477009240000,70.0054079768411000 -272.6530625242520000,78.5351041927953000 -270.3196016926710000,86.9872957425694000 -267.7193680503000000,95.3536413335489000 -264.8549277138150000,103.6258843927170000 -261.7291075400000000,111.7958612148940000 -258.3449923359800000,119.8555090193290000 -254.7059218148940000,127.7968739066940000 -250.8154872999950000,135.6121187086160000 -246.6775281804520000,143.2935307220230000 -242.2961281223330000,150.8335293206440000 -237.6756110385240000,158.2246734361790000 -232.8205368215440000,165.4596689017280000 -227.7356968434850000,172.5313756502600000 -222.4261092275060000,179.4328147609900000 -216.8970138955490000,186.1571753467370000 -211.1538673971700000,192.6978212754450000 -205.2023375245860000,199.0482977192440000 -199.0482977192440000,205.2023375245860000 -192.6978212754450000,211.1538673971700000 -186.1571753467370000,216.8970138955490000 -179.4328147609900000,222.4261092275060000 -172.5313756502600000,227.7356968434850000 -165.4596689017280000,232.8205368215440000 -158.2246734361790000,237.6756110385240000 -150.8335293206440000,242.2961281223330000 -143.2935307220230000,246.6775281804520000 -135.6121187086160000,250.8154872999950000 -127.7968739066940000,254.7059218148940000 -119.8555090193290000,258.3449923359800000 -111.7958612148940000,261.7291075400000000 -103.6258843927170000,264.8549277138150000 -95.3536413335488000,267.7193680503000000 -86.9872957425693000,270.3196016926710000 -78.5351041927954000,272.6530625242520000 -70.0054079768413000,274.7174477009240000 -61.4066248750690000,276.5107199237550000 -52.7472408482570000,278.0311094495650000 -44.0358016629794000,279.2771158374510000 -35.2809044579671000,280.2475094295410000 -26.4911892597698000,280.9413325645150000 -17.6753304560934000,281.3579005227060000 -8.8420282352253000,281.4968022018320000 -0.0000000000000689))";

//            BaseEffectsModelShapes.AddRange(geoJson.ToGraphic(new SpatialReference(28992)));
//            BaseEffectsModelShapes.AddRange(strWkt.ToGraphic(new SpatialReference(28992)));
//            BaseEffectsModelShapes.ForEach(shape =>
//            {
//                var clone = new Graphic();
//                clone.Geometry = ((Polygon) shape.Geometry).Clone();
//                clone.Symbol = new SimpleFillSymbol
//                {
//                    BorderBrush = new SolidColorBrush(Colors.Black),
//                    BorderThickness = 4,
//                    Fill = new SolidColorBrush(Colors.Red) { Opacity = 0.8f }
//                };
//                clone.Attributes.Add("base", shape);
//                EffectsModelShapes.Add(clone);
//            });
//            ContoursLayer.Graphics.AddRange(EffectsModelShapes);
//            ContoursLayer.Graphics.AddRange(BaseEffectsModelShapes);
            Layer.ChildLayers.Add(ContoursLayer);
            Layer.ChildLayers.Add(MLayer);

            LineSymbol ls = new LineSymbol() { Color = Brushes.Black, Width = 4 };
            Line.Symbol = ls;
            UpdateLine();

            MLayer.Graphics.Add(Line);
            _start.Geometry = start;
            _start.Attributes["position"] = start;

            _start.Symbol = rd["Start"] as Symbol;
            _start.Attributes["finish"] = _finish;
            _start.Attributes["start"] = _start;
            _start.Attributes["line"] = Line;
            _start.Attributes["state"] = "start";
            _start.Attributes["direction"] = this;
            _start.Attributes["menuenabled"] = true;

            MLayer.Graphics.Add(_start);

            _finish.Geometry = finish;
            _finish.Attributes["position"] = finish;
            _finish.Symbol = rd["Finish"] as Symbol;
            _finish.Attributes["finish"] = _finish;
            _finish.Attributes["start"] = _start;
            _finish.Attributes["line"] = Line;
            _finish.Attributes["direction"] = this;
            _finish.Attributes["state"] = "finish";
            MLayer.Graphics.Add(_finish);


            MLayer.Initialize();

            _start.SetZIndex(10);
            _finish.SetZIndex(10);
            Line.SetZIndex(10);

            SettingsViewModel = new EffectsModelSettingsViewModel();
            SettingsViewModel.PropertyChanged += SettingsViewModelOnPropertyChanged;
            SettingsViewModel.Initialize();

            AppStateSettings.Instance.ViewDef.MapManipulationDelta += ViewDef_MapManipulationDelta;

        }
开发者ID:TNOCS,项目名称:csTouch,代码行数:86,代码来源:DirectionTool.cs

示例15: Init

        public void Init(GroupLayer gl, MapPoint start, MapPoint finish, ResourceDictionary rd)
        {
            startPoint = new csPoint
            {
                Mp = start
            };
            finishPoint = new csPoint
            {
                Mp = finish
            };
            MLayer = new GraphicsLayer
            {
                ID = Guid.NewGuid().ToString()
            };
            _start = new Graphic();
            _finish = new Graphic();
            Line = new Graphic();

            var ls = new LineSymbol
            {
                Color = Brushes.Black,
                Width = 4
            };
            Line.Symbol = ls;
            UpdateLine();

            MLayer.Graphics.Add(Line);

            _start.Geometry = start;
            _start.Symbol = rd["Start"] as Symbol;
            _start.Attributes["position"] = start;
            _start.Attributes["finish"] = _finish;
            _start.Attributes["start"] = _start;
            _start.Attributes["line"] = Line;
            _start.Attributes["state"] = "start";
            _start.Attributes["measure"] = this;
            _start.Attributes["menuenabled"] = true;
            MLayer.Graphics.Add(_start);

            _finish.Geometry = finish;
            _finish.Attributes["position"] = finish;
            _finish.Symbol = rd["Finish"] as Symbol;
            _finish.Attributes["finish"] = _finish;
            _finish.Attributes["start"] = _start;
            _finish.Attributes["line"] = Line;
            _finish.Attributes["measure"] = this;
            _finish.Attributes["state"] = "finish";
            _finish.Attributes["menuenabled"] = true;
            MLayer.Graphics.Add(_finish);

            Layer.ChildLayers.Add(MLayer);
            MLayer.Initialize();

            AppStateSettings.Instance.ViewDef.MapManipulationDelta += ViewDef_MapManipulationDelta;

            if (AppState.Imb != null && AppState.Imb.Imb != null)
            {
                _3d = AppState.Imb.Imb.Publish(AppState.Imb.Imb.ClientHandle + ".3d");
                //AppState.Imb.Imb.Publish(_channel);
            }

            _updateTimer.Interval = 50;
            _updateTimer.Elapsed += UpdateTimerElapsed;
            _updateTimer.Start();
        }
开发者ID:TNOCS,项目名称:csTouch,代码行数:65,代码来源:Camera.cs


注:本文中的GraphicsLayer.Initialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。