MapPoint Class |
Namespace: Esri.ArcGISRuntime.Geometry
The MapPoint type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | MapPoint(Double, Double) |
Initializes a new instance of the MapPoint class.
|
![]() ![]() | MapPoint(Double, Double, SpatialReference) |
Initializes a new instance of the MapPoint class.
|
![]() ![]() | MapPoint(Double, Double, Double) |
Initializes a new instance of the MapPoint class with an x, y, z and a
null spatial reference.
|
![]() ![]() | MapPoint(Double, Double, Double, SpatialReference) |
Initializes a new instance of the MapPoint class with an x, y, z and
spatial reference.
|
Name | Description | |
---|---|---|
![]() | Dimension | Gets the number of dimensions for the geometry. (Overrides GeometryDimension.) |
![]() | Extent |
Gets the minimum enclosing envelope of the instance
(Overrides GeometryExtent.) |
![]() | GeometryType |
Gets the geometry type.
(Overrides GeometryGeometryType.) |
![]() | HasCurves | Gets a value indicating whether the geometry has any curves. (Inherited from Geometry.) |
![]() | HasM |
Gets a value indicating if the geometry has M
(Overrides GeometryHasM.) |
![]() | HasZ |
Gets a value indicating if the geometry has Z coordinate.
(Overrides GeometryHasZ.) |
![]() | IsEmpty |
Gets a value indicating whether or not the geometry is empty.
(Overrides GeometryIsEmpty.) |
![]() | M |
Gets the optional coordinate to define a measure value for the point.
|
![]() ![]() | SpatialReference | Gets the spatial reference of this geometry. (Inherited from Geometry.) |
![]() ![]() | X |
Gets the X coordinate.
|
![]() ![]() | Y |
Gets the Y coordinate for the map point.
|
![]() ![]() | Z |
Gets the Z coordinate.
|
Name | Description | |
---|---|---|
![]() ![]() | CreateWithM(Double, Double, Double) |
Creates a new 2D map point with an M (measure) value. The spatial reference will be null.
|
![]() ![]() | CreateWithM(Double, Double, Double, SpatialReference) |
Creates a new 2D map point with an M (measure) value and a spatial reference.
|
![]() ![]() | CreateWithM(Double, Double, Double, Double) |
Creates a new 3D map point with an x, y, z, and m (measure) coordinate.
|
![]() ![]() | CreateWithM(Double, Double, Double, Double, SpatialReference) |
Creates a new 3D map point with an x, y, z, m (measure) and a spatial reference.
|
![]() | Equals | Checks if two geometries are approximately same, within some tolerance. (Inherited from Geometry.) |
![]() | IsEqual |
Compares two MapPoint for equality. This will check for a matching SpatialReference
and coordinates for a match.
(Overrides GeometryIsEqual(Geometry).) |
![]() | ToJson | Converts this geometry into an ArcGIS JSON representation. (Inherited from Geometry.) |
![]() | ToString | (Overrides ObjectToString.) |
Map point geometries represent discrete locations or entities, such as a geocoded house address, the location of a water meter in a water utility network, a moving vehicle, and so on. Larger geographic entities (such as cities) are often represented as map points on small-scale maps. Map points can be used as the geometry of features and graphics and are often used to construct more complex geometries. They are also used in a Viewpoint to define the center of the display.
Map points store a single set of x,y coordinates that define a location (longitude and latitude, for example), and a SpatialReference. Optionally, a z-value (commonly used to describe elevation) and an m-value (commonly used for measurement relative to the geometry) can also be defined.
For map points defined with a geographic spatial reference, the x-coordinate is the longitude (east or west), and the y-coordinate is the latitude (north or south). When geographic coordinates are represented in strings, they are generally written using the form "(latitude, longitude)", where the y-coordinate comes before the x-coordinate. Latitude values south of the equator and longitude values west of the prime meridian are expressed as negative numbers.
Use CoordinateFormatter to convert a latitude, longitude formatted string directly to a map point, and also return a latitude, longitude formatted string from an existing map point. Other coordinate notations, such as Military Grid Reference System (MGRS) and United States National Grid (USNG) are also supported.
Map points are based upon the parent Geometry Class. The Geometry Class is immutable which means that you can not change its shape once it is created. If you need to modify a map point once it has been created, use the MapPointBuilder Class instead. The ToGeometry Method will provide you with the MapPoint object.
WPF
Example Name: FeatureLayerRenderingModeMap
Render features statically or dynamically by setting the feature layer rendering mode.
// Copyright 2017 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific // language governing permissions and limitations under the License. using Esri.ArcGISRuntime.Data; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; using System; using System.Collections.Generic; using System.Threading.Tasks; using System.Windows; namespace ArcGISRuntime.WPF.Samples.FeatureLayerRenderingModeMap { [ArcGISRuntime.Samples.Shared.Attributes.Sample( name: "Feature layer rendering mode (map)", category: "Layers", description: "Render features statically or dynamically by setting the feature layer rendering mode.", instructions: "Click the button to trigger the same zoom animation on both static and dynamic maps.", tags: new[] { "dynamic", "feature layer", "features", "rendering", "static" })] public partial class FeatureLayerRenderingModeMap { // Viewpoint locations for map view to zoom in and out to. private Viewpoint _zoomOutPoint = new Viewpoint(new MapPoint(-118.37, 34.46, SpatialReferences.Wgs84), 650000, 0); private Viewpoint _zoomInPoint = new Viewpoint(new MapPoint(-118.45, 34.395, SpatialReferences.Wgs84), 50000, 90); public FeatureLayerRenderingModeMap() { InitializeComponent(); // Setup the control references and execute initialization. Initialize(); } private void Initialize() { // Set the initial viewpoint on the maps. MyStaticMapView.Map = new Map { InitialViewpoint = _zoomOutPoint }; MyDynamicMapView.Map = new Map { InitialViewpoint = _zoomOutPoint }; // Create service feature table using a point, polyline, and polygon service. ServiceFeatureTable pointServiceFeatureTable = new ServiceFeatureTable(new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/0")); ServiceFeatureTable polylineServiceFeatureTable = new ServiceFeatureTable(new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/8")); ServiceFeatureTable polygonServiceFeatureTable = new ServiceFeatureTable(new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/9")); // Create feature layers from service feature tables List<FeatureLayer> featureLayers = new List<FeatureLayer> { new FeatureLayer(polygonServiceFeatureTable), new FeatureLayer(polylineServiceFeatureTable), new FeatureLayer(pointServiceFeatureTable) }; // Add each layer to the map as a static layer and a dynamic layer foreach (FeatureLayer layer in featureLayers) { // Add the static layer to the top map view layer.RenderingMode = FeatureRenderingMode.Static; MyStaticMapView.Map.OperationalLayers.Add(layer); // Add the dynamic layer to the bottom map view FeatureLayer dynamicLayer = (FeatureLayer)layer.Clone(); dynamicLayer.RenderingMode = FeatureRenderingMode.Dynamic; MyDynamicMapView.Map.OperationalLayers.Add(dynamicLayer); } // Set the view point of both MapViews. MyStaticMapView.SetViewpoint(_zoomOutPoint); MyDynamicMapView.SetViewpoint(_zoomOutPoint); } private async void OnZoomClick(object sender, System.Windows.RoutedEventArgs e) { try { // Initiate task to zoom both map views in. Task t1 = MyStaticMapView.SetViewpointAsync(_zoomInPoint, TimeSpan.FromSeconds(5)); Task t2 = MyDynamicMapView.SetViewpointAsync(_zoomInPoint, TimeSpan.FromSeconds(5)); await Task.WhenAll(t1, t2); // Delay start of next set of zoom tasks. await Task.Delay(2000); // Initiate task to zoom both map views out. Task t3 = MyStaticMapView.SetViewpointAsync(_zoomOutPoint, TimeSpan.FromSeconds(5)); Task t4 = MyDynamicMapView.SetViewpointAsync(_zoomOutPoint, TimeSpan.FromSeconds(5)); await Task.WhenAll(t3, t4); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error"); } } } }
<UserControl x:Class="ArcGISRuntime.WPF.Samples.FeatureLayerRenderingModeMap.FeatureLayerRenderingModeMap" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="auto" /> <RowDefinition Height="*" /> <RowDefinition Height="auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Label Content="Static mode:" Grid.Row="0" Grid.ColumnSpan="2" Foreground="Blue" FontWeight="SemiBold" /> <esri:MapView x:Name="MyStaticMapView" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" /> <Label Content="Dynamic mode:" Grid.Row="2" Grid.Column="0" Foreground="Blue" FontWeight="SemiBold" /> <Button Content="Animated zoom" Grid.Row="2" Grid.Column="1" Click="OnZoomClick" /> <esri:MapView x:Name="MyDynamicMapView" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" /> </Grid> </UserControl>
Hyperlink to Example | Description |
---|---|
AddAnIntegratedMeshLayer | View an integrated mesh layer from a scene service. |
AddFeatures | Add features to a feature layer. |
AddGraphicsRenderer | A renderer allows you to change the style of all graphics in a graphics overlay by referencing a single symbol style. |
AddGraphicsWithSymbols | Use a symbol style to display a graphic on a graphics overlay. |
AnalyzeViewshed | Calculate a viewshed using a geoprocessing service, in this case showing what parts of a landscape are visible from points on mountainous terrain. |
Animate3DGraphic | An `OrbitGeoElementCameraController` follows a graphic while the graphic's position and rotation are animated. |
AnimateImageOverlay | Animate a series of images with an image overlay. |
Buffer | Create a buffer around a map point and display the results as a `Graphic` |
BufferList | Generate multiple individual buffers or a single unioned buffer around multiple points. |
ChangeViewpoint | Set the map view to a new viewpoint. |
ChooseCameraController | Control the behavior of the camera in a scene. |
ClipGeometry | Clip a geometry with another geometry. |
ClosestFacility | Find a route to the closest facility from a location. |
ClosestFacilityStatic | Find routes from several locations to the respective closest facility. |
ConvexHull | Create a convex hull for a given set of points. The convex hull is a polygon with shortest perimeter that encloses a set of points. As a visual analogy, consider a set of points as nails in a board. The convex hull of the points would be like a rubber band stretched around the outermost nails. |
ConvexHullList | Generate convex hull polygon(s) from multiple input geometries. |
CreateFeatureCollectionLayer | Create a Feature Collection Layer from a Feature Collection Table, and add it to a map. |
CreateGeometries | Create simple geometry types. |
CutGeometry | Cut a geometry along a polyline. |
DeleteFeatures | Delete features from an online feature service. |
DensifyAndGeneralize | A multipart geometry can be densified by adding interpolated points at regular intervals. Generalizing multipart geometry simplifies it while preserving its general shape. Densifying a multipart geometry adds more vertices at regular intervals. |
DictionaryRendererGraphicsOverlay | This sample demonstrates applying a dictionary renderer to graphics, in order to display military symbology without the need for a feature table. |
DisplayGrid | Display coordinate system grids including Latitude/Longitude, MGRS, UTM and USNG on a map view. Also, toggle label visibility and change the color of grid lines and grid labels. |
DisplayKmlNetworkLinks | Display a file with a KML network link, including displaying any network link control messages at launch. |
DisplayLayerViewState | Determine if a layer is currently being viewed. |
DisplayUtilityAssociations | Create graphics for utility associations in a utility network. |
DisplayWfs | Display a layer from a WFS service, requesting only features for the current extent. |
DistanceMeasurement | Measure distances between two points in 3D. |
EditAndSyncFeatures | Synchronize offline edits with a feature service. |
EditFeatureAttachments | Add, delete, and download attachments for features from a service. |
EditKmlGroundOverlay | Edit the values of a KML ground overlay. |
FeatureLayerDefinitionExpression | Limit the features displayed on a map with a definition expression. |
FeatureLayerDictionaryRenderer | Convert features into graphics to show them with mil2525d symbols. |
FeatureLayerExtrusion | Extrude features based on their attributes. |
FeatureLayerQuery | Find features in a feature table which match an SQL query. |
FeatureLayerRenderingModeMap | Render features statically or dynamically by setting the feature layer rendering mode. |
FeatureLayerRenderingModeScene | Render features in a scene statically or dynamically by setting the feature layer rendering mode. |
FeatureLayerSelection | Select features in a feature layer. |
FeatureLayerUrl | Show features from an online feature service. |
FindAddress | Find the location for an address. |
FindPlace | Find places of interest near a location or within a specific area. |
FindRoute | Display directions for a route between two points. |
FindServiceArea | Find the service area within a network from a given point. |
FormatCoordinates | Format coordinates in a variety of common notations. |
GeodatabaseTransactions | Use transactions to manage how changes are committed to a geodatabase. |
GeodesicOperations | Calculate a geodesic path between two points and measure its distance. |
GetElevationAtPoint | Get the elevation for a given point on a surface in a scene. |
IdentifyGraphics | Display an alert message when a graphic is clicked. |
IdentifyKmlFeatures | Show a callout with formatted content for a KML feature. |
IdentifyLayers | Identify features in all layers in a map. MapView supports identifying features across multiple layers. Because some layer types have sublayers, the sample recursively counts results for sublayers within each layer. |
IdentifyRasterCell | Get the cell value of a local raster at the tapped location and display the result in a callout. |
LineOfSightGeoElement | Show a line of sight between two moving objects. |
LineOfSightLocation | Perform a line of sight analysis between two points in real time. |
ListKmlContents | List the contents of a KML file. |
ListTransformations | Get a list of suitable transformations for projecting a geometry between two spatial references with different horizontal datums. |
MapImageLayerTables | Find features in a spatial table related to features in a non-spatial table. |
MapImageSublayerQuery | Find features in a sublayer based on attributes and location. |
MobileMapSearchAndRoute | Display maps and use locators to enable search and routing offline using a Mobile Map Package. |
NavigateRoute | Use a routing service to navigate between points. |
NavigateRouteRerouting | Navigate between two points and dynamically recalculate an alternate route when the original route is unavailable. |
NearestVertex | Find the closest vertex and coordinate of a geometry to a point. |
OfflineGeocode | Geocode addresses to locations and reverse geocode locations to addresses offline. |
OfflineRouting | Solve a route on-the-fly using offline data. |
PerformValveIsolationTrace | Run a filtered trace to locate operable features that will isolate an area from the flow of network resources. |
Project | Project a point from one spatial reference to another. |
ProjectWithSpecificTransformation | Project a point from one coordinate system to another using a specific transformation step. |
RasterLayerImageServiceRaster | Create a raster layer from a raster image service. |
RenderPictureMarkers | Use pictures for markers. |
RenderSimpleMarkers | Show a simple marker symbol on a map. |
ReverseGeocode | Use an online service to find the address for a tapped point. |
RouteAroundBarriers | Find a route that reaches all stops without crossing any barriers. |
SceneLayerSelection | Identify features in a scene to select. |
SceneLayerUrl | Display an ArcGIS scene layer from a URL. |
ScenePropertiesExpressions | Update the orientation of a graphic using expressions based on its attributes. |
SceneSymbols | Show various kinds of 3D symbols in a scene. |
SelectEncFeatures | Select features in an ENC layer. |
ServiceFeatureTableManualCache | Display a feature layer from a service using the **manual cache** feature request mode. |
SetMinMaxScale | Restrict zooming between specific scale ranges. |
ShowCallout | Show a callout with the latitude and longitude of user-tapped points. |
ShowLabelsOnLayer | Display custom labels on a feature layer. |
ShowLocationHistory | Display your location history on the map. |
ShowPopup | Show predefined popups from a web map. |
SimpleRenderers | Display common symbols for all graphics in a graphics overlay with a renderer. |
SketchOnMap | Use the Sketch Editor to edit or sketch a new point, line, or polygon geometry on to a map. |
SpatialOperations | Find the union, intersection, or difference of two geometries. |
SpatialRelationships | Determine spatial relationships between two geometries. |
SurfacePlacements | Position graphics relative to a surface using different surface placement modes. |
SymbolizeShapefile | Display a shapefile with custom symbology. |
SymbolsFromMobileStyle | Combine multiple symbols from a mobile style file into a single symbol. |
TerrainExaggeration | Vertically exaggerate terrain in a scene. |
TraceUtilityNetwork | Discover connected features in a utility network using connected, subnetwork, upstream, and downstream traces. |
UpdateAttributes | Update feature attributes in an online feature service. |
UpdateGeometries | Update a feature's location in an online feature service. |
UseDistanceCompositeSym | Change a graphic's symbol based on the camera's proximity to it. |
ViewshedCamera | Analyze the viewshed for a camera. A viewshed shows the visible and obstructed areas from an observer's vantage point. |
ViewshedGeoElement | Analyze the viewshed for an object (GeoElement) in a scene. |
ViewshedLocation | Perform a viewshed analysis from a defined vantage point. |