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


C# GraphicsOverlay类代码示例

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


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


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