• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# GraphicsOverlay类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中GraphicsOverlay的典型用法代码示例。如果您正苦于以下问题:C# GraphicsOverlay类的具体用法?C# GraphicsOverlay怎么用?C# GraphicsOverlay使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GraphicsOverlay类属于命名空间,在下文中一共展示了GraphicsOverlay类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreatePolylines

		public CreatePolylines()
		{
			InitializeComponent();

			_graphicsOverlay = MyMapView.GraphicsOverlays["graphicsOverlay"];
			MyMapView.SpatialReferenceChanged += MyMapView_SpatialReferenceChanged;
		}
开发者ID:MagicWang,项目名称:arcgis-runtime-samples-dotnet,代码行数:7,代码来源:CreatePolylines.xaml.cs


示例2: AddModelMarkerSymbol

		private async Task AddModelMarkerSymbol()
		{
			// Instantiate a new ModelMarkerSymbol
			ModelMarkerSymbol modelMarkerSymbol = new ModelMarkerSymbol();

			// Set the SourceUri property
			modelMarkerSymbol.SourceUri = Path.Combine(AssemblyDirectory, @"Samples\Scene\PT-Boat-Model\PTBoat.obj");

			// Increase the scale to achieve the desired visual size
			modelMarkerSymbol.Scale = 50;

			// Create a new MapPoint for the location
			MapPoint mapPoint = new MapPoint(-155, 19, -100);

			// Create a new Graphic to display the model symbol
			Graphic graphic = new Graphic(mapPoint);

			// Set the Graphic Symbol property
			graphic.Symbol = modelMarkerSymbol;

			// Create a GraphicsOverlay to contain the symbolized Graphic
			GraphicsOverlay graphicsoverlay = new GraphicsOverlay()
			{
				RenderingMode = GraphicsRenderingMode.Dynamic,
				SceneProperties = new LayerSceneProperties() { SurfacePlacement = SurfacePlacement.Relative }
			};
			// Add the Graphic to the GraphicsOverlay
			graphicsoverlay.Graphics.Add(graphic);

			// Add the GraphicsOverlay to the MapView's GraphicsOverlays collection
			MySceneView.GraphicsOverlays.Add(graphicsoverlay);

			// Set the Viewpoint
			await MySceneView.SetViewAsync(new Camera(mapPoint.Y - 0.5, mapPoint.X + 0.5, 25000, 315, 70));
		}
开发者ID:MagicWang,项目名称:arcgis-runtime-samples-dotnet,代码行数:35,代码来源:ModelMarkerSymbolSample.xaml.cs


示例3: LineFillSymbols

		/// <summary>Construct Line and Fill Symbols sample control</summary>
		public LineFillSymbols()
		{
			InitializeComponent();

			_graphicsOverlay = MyMapView.GraphicsOverlays["graphicsOverlay"];
			MyMapView.SpatialReferenceChanged += MyMapView_SpatialReferenceChanged;
		}
开发者ID:MagicWang,项目名称:arcgis-runtime-samples-dotnet,代码行数:8,代码来源:LineFillSymbols.xaml.cs


示例4: LoadLocation

		private async void LoadLocation()
		{
			Windows.Devices.Geolocation.Geoposition l = null;
			try
			{
				var loc = new Windows.Devices.Geolocation.Geolocator();
				l = position = await loc.GetGeopositionAsync();

			}
			catch { return; }
			foreach (var coll in new GraphicsOverlayCollection[] { 
				sceneView.GraphicsOverlays , mapView.GraphicsOverlays
			})
			{
				GraphicsOverlay overlay = new GraphicsOverlay();
				coll.Add(overlay);
				Graphic g = new Graphic()
				{
					Symbol = new SimpleMarkerSymbol()
					{
						Color = Color.FromArgb(255, 0, 122, 194),
						Size = 20,
						Outline = new SimpleLineSymbol()
						{
							Width = 2,
							Color = Colors.White
						}
					},

				};
				g.Geometry = new MapPoint(l.Coordinate.Point.Position.Longitude, l.Coordinate.Point.Position.Latitude, SpatialReferences.Wgs84);
				overlay.Graphics.Add(g);
				break;
			}
		}
开发者ID:Esri,项目名称:arcgis-runtime-demos-dotnet,代码行数:35,代码来源:MainPage.xaml.cs


示例5: CreatePictureMarkerSymbolFromResources

        private async Task CreatePictureMarkerSymbolFromResources(GraphicsOverlay overlay)
        {
            Assembly currentAssembly = null;
#if WINDOWS_UWP
            // Get current assembly that contains the image
            currentAssembly = GetType().GetTypeInfo().Assembly;
#else
            // Get current assembly that contains the image
            currentAssembly = Assembly.GetExecutingAssembly();
#endif


            // Get image as a stream from the resources
            // Picture is defined as EmbeddedResource and DoNotCopy
            var resourceStream = currentAssembly.GetManifestResourceStream(
                "ArcGISRuntimeXamarin.Resources.PictureMarkerSymbols.pin_star_blue.png");

            // Create new symbol using asynchronous factory method from stream
            PictureMarkerSymbol pinSymbol = await PictureMarkerSymbol.CreateAsync(resourceStream);

            // Create location for the pint
            MapPoint pinPoint = new MapPoint(-226773, 6550477, SpatialReferences.WebMercator);

            // Create graphic with the location and symbol
            Graphic pinGraphic = new Graphic(pinPoint, pinSymbol);

            // Add graphic to the graphics overlay
            overlay.Graphics.Add(pinGraphic);
        }
开发者ID:Esri,项目名称:arcgis-runtime-samples-xamarin,代码行数:29,代码来源:RenderPictureMarkers.xaml.cs


示例6: MyMapView_Loaded

        private async void MyMapView_Loaded(object sender, RoutedEventArgs e)
        {
            // ArcGIS Online への参照を取得
            var portal = await ArcGISPortal.CreateAsync(new Uri(PORTAL_URL));

            // ID を基にアイテムを取得
            var item = await ArcGISPortalItem.CreateAsync(portal, "Web マップ ID");

            // アイテムを Web マップとして取得
            var webmap = await WebMap.FromPortalItemAsync(item);

            // Web マップを格納するために WebMapViewModel を作成
            var vm = await WebMapViewModel.LoadAsync(webmap, portal);

            // MapView コントロールの Map プロパティに、WebMap を割り当て
            MyMapView.Map = vm.Map;


            // グラフィックス オーバーレイが存在しない場合は、新規に追加
            if (MyMapView.GraphicsOverlays.Count == 0)
            {
                geocodeResultGraphicsOverlay = new GraphicsOverlay()
                {
                    Renderer = createGeocoordingSymbol(),
                };
                MyMapView.GraphicsOverlays.Add(geocodeResultGraphicsOverlay);
            }

            isMapReady = true;
        }
开发者ID:EsriJapan,项目名称:arcgis-dev-resources,代码行数:30,代码来源:MainWindow.xaml.cs


示例7: LineFillSymbols

		/// <summary>Construct Line and Fill Symbols sample control</summary>
		public LineFillSymbols()
		{
			InitializeComponent();

			_graphicsOverlay = MyMapView.GraphicsOverlays["graphicsOverlay"];
			MyMapView.ExtentChanged += MyMapView_ExtentChanged;
		}
开发者ID:MagicWang,项目名称:arcgis-runtime-samples-dotnet,代码行数:8,代码来源:LineFillSymbols.xaml.cs


示例8: GeodesicBuffer

        /// <summary>Construct Geodesic Buffer sample control</summary>
        public GeodesicBuffer()
        {
            InitializeComponent();

			_graphicsOverlay = MyMapView.GraphicsOverlays["graphicsOverlay"];
            SetupSymbols();
        }
开发者ID:jordanparfitt,项目名称:arcgis-runtime-samples-dotnet,代码行数:8,代码来源:GeodesicBuffer.xaml.cs


示例9: ProjectCoordinate

		/// <summary>Construct Project sample control</summary>
		public ProjectCoordinate()
		{
			InitializeComponent();

			_graphicsOverlay = MyMapView.GraphicsOverlays["graphicsOverlay"];
			MyMapView.SpatialReferenceChanged += MyMapView_SpatialReferenceChanged;
		}
开发者ID:jordanparfitt,项目名称:arcgis-runtime-samples-dotnet,代码行数:8,代码来源:ProjectCoordinate.xaml.cs


示例10: OfflineGeocoding

		/// <summary>Construct Offline Geocoding sample control</summary>
		public OfflineGeocoding()
		{
			InitializeComponent();

			_graphicsOverlay = MyMapView.GraphicsOverlays["graphicsOverlay"];
			SetupRendererSymbols();
		}
开发者ID:MagicWang,项目名称:arcgis-runtime-samples-dotnet,代码行数:8,代码来源:OfflineGeocoding.xaml.cs


示例11: CreateOverlay

        private void CreateOverlay()
        {
            // Create polygon builder and add polygon corners into it
            PolygonBuilder builder = new PolygonBuilder(SpatialReferences.WebMercator);
            builder.AddPoint(new MapPoint(-20e5, 20e5));
            builder.AddPoint(new MapPoint(20e5, 20e5));
            builder.AddPoint(new MapPoint(20e5, -20e5));
            builder.AddPoint(new MapPoint(-20e5, -20e5));

            // Get geometry from the builder
            Polygon polygonGeometry = builder.ToGeometry();

            // Create symbol for the polygon
            SimpleFillSymbol polygonSymbol = new SimpleFillSymbol(
                SimpleFillSymbolStyle.Solid,
                System.Drawing.Color.Yellow,
                null);

            // Create new graphic
            Graphic polygonGraphic = new Graphic(polygonGeometry, polygonSymbol);

            // Create overlay to where graphics are shown
            _polygonOverlay = new GraphicsOverlay();
            _polygonOverlay.Graphics.Add(polygonGraphic);

            // Add created overlay to the MapView
            _myMapView.GraphicsOverlays.Add(_polygonOverlay);
        }
开发者ID:Esri,项目名称:arcgis-runtime-samples-xamarin,代码行数:28,代码来源:IdentifyGraphics.cs


示例12: AreaSample

		public AreaSample()
		{
			InitializeComponent();

			_graphicsOverlay = MyMapView.GraphicsOverlays["AreaOverlay"];
			MyMapView.SpatialReferenceChanged += MyMapView_SpatialReferenceChanged;
		}
开发者ID:MagicWang,项目名称:arcgis-runtime-samples-dotnet,代码行数:7,代码来源:AreaSample.xaml.cs


示例13: AttributeQuery

        public AttributeQuery()
        {
            this.InitializeComponent();

			_graphicsOverlay = MyMapView.GraphicsOverlays["graphicsOverlay"];
            InitializeComboBox();
        }
开发者ID:MagicWang,项目名称:arcgis-runtime-samples-dotnet,代码行数:7,代码来源:AttributeQuery.xaml.cs


示例14: CreatePolylines

        /// <summary>Construct Create Polylines sample control</summary>
        public CreatePolylines()
        {
            InitializeComponent();

			_graphicsOverlay = MyMapView.GraphicsOverlays["graphicsOverlay"];
			MyMapView.NavigationCompleted += MyMapView_NavigationCompleted;
		}
开发者ID:jordanparfitt,项目名称:arcgis-runtime-samples-dotnet,代码行数:8,代码来源:CreatePolylines.xaml.cs


示例15: Initialize

        private void Initialize()
        {
            // Create new Map with basemap
            Map myMap = new Map(Basemap.CreateImagery());

            // Create initial map location and reuse the location for graphic
            MapPoint centralLocation = new MapPoint(-226773, 6550477, SpatialReferences.WebMercator);
            Viewpoint initialViewpoint = new Viewpoint(centralLocation, 7500);

            // Set initial viewpoint
            myMap.InitialViewpoint = initialViewpoint;

            // Provide used Map to the MapView
            _myMapView.Map = myMap;

            // Create overlay to where graphics are shown
            GraphicsOverlay overlay = new GraphicsOverlay();

            // Add created overlay to the MapView
            _myMapView.GraphicsOverlays.Add(overlay);

            // Create a simple marker symbol
            SimpleMarkerSymbol simpleSymbol = new SimpleMarkerSymbol()
            {
                Color = Color.Red,
                Size = 10,
                Style = SimpleMarkerSymbolStyle.Circle
            };

            // Add a new graphic with a central point that was created earlier
            Graphic graphicWithSymbol = new Graphic(centralLocation, simpleSymbol);
            overlay.Graphics.Add(graphicWithSymbol);
        }
开发者ID:Esri,项目名称:arcgis-runtime-samples-dotnet,代码行数:33,代码来源:RenderSimpleMarkers.cs


示例16: ComputeClassStatistics

		/// <summary>Construct compute class statistics sample control</summary>
		public ComputeClassStatistics()
		{
			InitializeComponent();

			_graphicsOverlay = MyMapView.GraphicsOverlays["graphicsOverlay"];
			MyMapView.LayerLoaded += MyMapView_LayerLoaded;
		}
开发者ID:MagicWang,项目名称:arcgis-runtime-samples-dotnet,代码行数:8,代码来源:ComputeClassStatistics.xaml.cs


示例17: ProjectCoordinate

		/// <summary>Construct Project sample control</summary>
		public ProjectCoordinate()
		{
			InitializeComponent();
		
			_graphicsOverlay = MyMapView.GraphicsOverlays["graphicsOverlay"]; 
			MyMapView.ExtentChanged += MyMapView_ExtentChanged;
		}
开发者ID:MagicWang,项目名称:arcgis-runtime-samples-dotnet,代码行数:8,代码来源:ProjectCoordinate.xaml.cs


示例18: GetSamples

        /// <summary>Construct Get Image Samples sample control</summary>
        public GetSamples()
        {
            InitializeComponent();
			_graphicsOverlay = MyMapView.GraphicsOverlays["graphicsOverlay"];
			_mapTip = MyMapView.Overlays.Items.First() as FrameworkElement;
            MyMapView.LayerLoaded += MyMapView_LayerLoaded;
        }
开发者ID:jordanparfitt,项目名称:arcgis-runtime-samples-dotnet,代码行数:8,代码来源:GetSamples.xaml.cs


示例19: Mensuration

        /// <summary>Construct Mensuration sample control</summary>
        public Mensuration()
        {
            InitializeComponent();

			_pointSymbol = LayoutRoot.Resources["PointSymbol"] as Symbols.Symbol;
			_lineSymbol = LayoutRoot.Resources["LineSymbol"] as Symbols.Symbol;
			_polygonSymbol = LayoutRoot.Resources["PolygonSymbol"] as Symbols.Symbol;

			_graphicsOverlay = MyMapView.GraphicsOverlays["graphicsOverlay"];

            comboLinearUnit.ItemsSource = typeof(LinearUnits).GetTypeInfo().DeclaredProperties
				.Select(p => p.GetValue(null, null))
                .Except(new LinearUnit[] { LinearUnits.NauticalMiles } ).ToList();
            comboLinearUnit.SelectedItem = LinearUnits.Meters;

            comboAngularUnit.ItemsSource = new AngularUnit[] { AngularUnits.Degrees, AngularUnits.Radians };
            comboAngularUnit.SelectedItem = AngularUnits.Degrees;

            comboAreaUnit.ItemsSource = typeof(AreaUnits).GetTypeInfo().DeclaredProperties
				.Select(p => p.GetValue(null, null)).ToList();
            comboAreaUnit.SelectedItem = AreaUnits.SquareMeters;

			var imageLayer = MyMapView.Map.Layers["ImageLayer"] as ArcGISTiledMapServiceLayer;
            _mensurationTask = new MensurationTask(new Uri(imageLayer.ServiceUri));
        }
开发者ID:MagicWang,项目名称:arcgis-runtime-samples-dotnet,代码行数:26,代码来源:Mensuration.xaml.cs


示例20: mapView1_SpatialReferenceChanged

		void mapView1_SpatialReferenceChanged(object sender, EventArgs e)
		{
			resultsOverlay = mapView1.GraphicsOverlays["ResultsGraphicsOverlay"] as GraphicsOverlay;
			statesOverlay = mapView1.GraphicsOverlays["StatesGraphicsOverlay"] as GraphicsOverlay;

			var x = LoadParcels();	
		}
开发者ID:jordanparfitt,项目名称:arcgis-runtime-samples-dotnet,代码行数:7,代码来源:CutPolygons.xaml.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# GraphicsPath类代码示例发布时间:2022-05-24
下一篇:
C# GraphicsMode类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap