Click or drag to resize

MapPoint Class

Represents a location defined by x and y (and optionally z) coordinates.
Inheritance Hierarchy

Namespace:  Esri.ArcGISRuntime.Geometry
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.11.0
public class MapPoint : Geometry

The MapPoint type exposes the following members.

Public methodCode exampleMapPoint(Double, Double)
Initializes a new instance of the MapPoint class.
Public methodCode exampleMapPoint(Double, Double, SpatialReference)
Initializes a new instance of the MapPoint class.
Public methodCode exampleMapPoint(Double, Double, Double)
Initializes a new instance of the MapPoint class with an x, y, z and a null spatial reference.
Public methodCode exampleMapPoint(Double, Double, Double, SpatialReference)
Initializes a new instance of the MapPoint class with an x, y, z and spatial reference.
Public propertyDimension
Gets the number of dimensions for the geometry.
(Overrides GeometryDimension.)
Public propertyExtent
Gets the minimum enclosing envelope of the instance
(Overrides GeometryExtent.)
Public propertyGeometryType
Gets the geometry type.
(Overrides GeometryGeometryType.)
Public propertyHasCurves
Gets a value indicating whether the geometry has any curves.
(Inherited from Geometry.)
Public propertyHasM
Gets a value indicating if the geometry has M
(Overrides GeometryHasM.)
Public propertyHasZ
Gets a value indicating if the geometry has Z coordinate.
(Overrides GeometryHasZ.)
Public propertyIsEmpty
Gets a value indicating whether or not the geometry is empty.
(Overrides GeometryIsEmpty.)
Public propertyM
Gets the optional coordinate to define a measure value for the point.
Public propertyCode exampleSpatialReference
Gets the spatial reference of this geometry.
(Inherited from Geometry.)
Public propertyCode exampleX
Gets the X coordinate.
Public propertyCode exampleY
Gets the Y coordinate for the map point.
Public propertyCode exampleZ
Gets the Z coordinate.
Public methodStatic memberCreateWithM(Double, Double, Double)
Creates a new 2D map point with an M (measure) value. The spatial reference will be null.
Public methodStatic memberCreateWithM(Double, Double, Double, SpatialReference)
Creates a new 2D map point with an M (measure) value and a spatial reference.
Public methodStatic memberCreateWithM(Double, Double, Double, Double)
Creates a new 3D map point with an x, y, z, and m (measure) coordinate.
Public methodStatic memberCreateWithM(Double, Double, Double, Double, SpatialReference)
Creates a new 3D map point with an x, y, z, m (measure) and a spatial reference.
Public methodEquals
Checks if two geometries are approximately same, within some tolerance.
(Inherited from Geometry.)
Public methodIsEqual
Compares two MapPoint for equality. This will check for a matching SpatialReference and coordinates for a match.
(Overrides GeometryIsEqual(Geometry).)
Public methodToJson
Converts this geometry into an ArcGIS JSON representation.
(Inherited from Geometry.)
Public methodToString
Returns a String that represents the current Object.
(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, or a moving vehicle. 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. Map points can optionally have a z-value (commonly used to describe elevation or altitude) and an m-value (commonly used for measurement relative to the geometry).

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 and longitude formatted string directly to a map point. The coordinate formatter can also return a latitude and 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 map point object.



Example Name: FeatureLayerRenderingModeMap

Render features statically or dynamically by setting the feature layer rendering mode.

Code example screen shot.

// 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:
// 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
        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()

            // Setup the control references and execute initialization. 

        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(""));
            ServiceFeatureTable polylineServiceFeatureTable = new ServiceFeatureTable(new Uri(""));
            ServiceFeatureTable polygonServiceFeatureTable = new ServiceFeatureTable(new Uri(""));

            // 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;

                // Add the dynamic layer to the bottom map view
                FeatureLayer dynamicLayer = (FeatureLayer)layer.Clone();
                dynamicLayer.RenderingMode = FeatureRenderingMode.Dynamic;

            // Set the view point of both MapViews.

        private async void OnZoomClick(object sender, System.Windows.RoutedEventArgs e)
                // 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");
            <RowDefinition Height="auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="*" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        <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" />
See Also
Additional Examples
Hyperlink to ExampleDescription
AddAnIntegratedMeshLayerView an integrated mesh layer from a scene service.
AddFeaturesAdd features to a feature layer.
AddGraphicsRendererA renderer allows you to change the style of all graphics in a graphics overlay by referencing a single symbol style.
AddGraphicsWithSymbolsUse a symbol style to display a graphic on a graphics overlay.
AnalyzeViewshedCalculate a viewshed using a geoprocessing service, in this case showing what parts of a landscape are visible from points on mountainous terrain.
Animate3DGraphicAn `OrbitGeoElementCameraController` follows a graphic while the graphic's position and rotation are animated.
AnimateImageOverlayAnimate a series of images with an image overlay.
BufferCreate a buffer around a map point and display the results as a `Graphic`
BufferListGenerate multiple individual buffers or a single unioned buffer around multiple points.
ChangeViewpointSet the map view to a new viewpoint.
ChooseCameraControllerControl the behavior of the camera in a scene.
ClipGeometryClip a geometry with another geometry.
ClosestFacilityFind a route to the closest facility from a location.
ClosestFacilityStaticFind routes from several locations to the respective closest facility.
ConvexHullCreate 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.
ConvexHullListGenerate convex hull polygon(s) from multiple input geometries.
CreateFeatureCollectionLayerCreate a Feature Collection Layer from a Feature Collection Table, and add it to a map.
CreateGeometriesCreate simple geometry types.
CutGeometryCut a geometry along a polyline.
DeleteFeaturesDelete features from an online feature service.
DensifyAndGeneralizeA 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.
DictionaryRendererGraphicsOverlayThis sample demonstrates applying a dictionary renderer to graphics, in order to display military symbology without the need for a feature table.
DisplayGridDisplay 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.
DisplayKmlNetworkLinksDisplay a file with a KML network link, including displaying any network link control messages at launch.
DisplayLayerViewStateDetermine if a layer is currently being viewed.
DisplayUtilityAssociationsCreate graphics for utility associations in a utility network.
DisplayWfsDisplay a layer from a WFS service, requesting only features for the current extent.
DistanceMeasurementMeasure distances between two points in 3D.
EditAndSyncFeaturesSynchronize offline edits with a feature service.
EditBranchVersioningCreate, query and edit a specific server version using service geodatabase.
EditFeatureAttachmentsAdd, delete, and download attachments for features from a service.
EditFeatureLinkedAnnotationEdit feature attributes which are linked to annotation through an expression.
EditKmlGroundOverlayEdit the values of a KML ground overlay.
FeatureLayerDefinitionExpressionLimit the features displayed on a map with a definition expression.
FeatureLayerDictionaryRendererConvert features into graphics to show them with mil2525d symbols.
FeatureLayerExtrusionExtrude features based on their attributes.
FeatureLayerQueryFind features in a feature table which match an SQL query.
FeatureLayerRenderingModeMapRender features statically or dynamically by setting the feature layer rendering mode.
FeatureLayerRenderingModeSceneRender features in a scene statically or dynamically by setting the feature layer rendering mode.
FeatureLayerSelectionSelect features in a feature layer.
FeatureLayerUrlShow features from an online feature service.
FindAddressFind the location for an address.
FindPlaceFind places of interest near a location or within a specific area.
FindRouteDisplay directions for a route between two points.
FindServiceAreaFind the service area within a network from a given point.
FormatCoordinatesFormat coordinates in a variety of common notations.
GeodatabaseTransactionsUse transactions to manage how changes are committed to a geodatabase.
GeodesicOperationsCalculate a geodesic path between two points and measure its distance.
GetElevationAtPointGet the elevation for a given point on a surface in a scene.
IdentifyGraphicsDisplay an alert message when a graphic is clicked.
IdentifyKmlFeaturesShow a callout with formatted content for a KML feature.
IdentifyLayersIdentify 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.
IdentifyRasterCellGet the cell value of a local raster at the tapped location and display the result in a callout.
LineOfSightGeoElementShow a line of sight between two moving objects.
LineOfSightLocationPerform a line of sight analysis between two points in real time.
ListKmlContentsList the contents of a KML file.
ListTransformationsGet a list of suitable transformations for projecting a geometry between two spatial references with different horizontal datums.
MapImageLayerTablesFind features in a spatial table related to features in a non-spatial table.
MapImageSublayerQueryFind features in a sublayer based on attributes and location.
MobileMapSearchAndRouteDisplay maps and use locators to enable search and routing offline using a Mobile Map Package.
NavigateRouteUse a routing service to navigate between points.
NavigateRouteReroutingNavigate between two points and dynamically recalculate an alternate route when the original route is unavailable.
NearestVertexFind the closest vertex and coordinate of a geometry to a point.
OfflineGeocodeGeocode addresses to locations and reverse geocode locations to addresses offline.
OfflineRoutingSolve a route on-the-fly using offline data.
PerformValveIsolationTraceRun a filtered trace to locate operable features that will isolate an area from the flow of network resources.
ProjectProject a point from one spatial reference to another.
ProjectWithSpecificTransformationProject a point from one coordinate system to another using a specific transformation step.
RasterLayerImageServiceRasterCreate a raster layer from a raster image service.
RenderPictureMarkersUse pictures for markers.
RenderSimpleMarkersShow a simple marker symbol on a map.
ReverseGeocodeUse an online service to find the address for a tapped point.
RouteAroundBarriersFind a route that reaches all stops without crossing any barriers.
SceneLayerSelectionIdentify features in a scene to select.
SceneLayerUrlDisplay an ArcGIS scene layer from a URL.
ScenePropertiesExpressionsUpdate the orientation of a graphic using expressions based on its attributes.
SceneSymbolsShow various kinds of 3D symbols in a scene.
SelectEncFeaturesSelect features in an ENC layer.
ServiceFeatureTableManualCacheDisplay a feature layer from a service using the **manual cache** feature request mode.
SetMinMaxScaleRestrict zooming between specific scale ranges.
ShowCalloutShow a callout with the latitude and longitude of user-tapped points.
ShowLabelsOnLayerDisplay custom labels on a feature layer.
ShowLocationHistoryDisplay your location history on the map.
ShowPopupShow predefined popups from a web map.
SimpleRenderersDisplay common symbols for all graphics in a graphics overlay with a renderer.
SketchOnMapUse the Sketch Editor to edit or sketch a new point, line, or polygon geometry on to a map.
SpatialOperationsFind the union, intersection, or difference of two geometries.
SpatialRelationshipsDetermine spatial relationships between two geometries.
SurfacePlacementsPosition graphics relative to a surface using different surface placement modes.
SymbolizeShapefileDisplay a shapefile with custom symbology.
SymbolsFromMobileStyleCombine multiple symbols from a mobile style file into a single symbol.
TerrainExaggerationVertically exaggerate terrain in a scene.
TraceUtilityNetworkDiscover connected features in a utility network using connected, subnetwork, upstream, and downstream traces.
UpdateAttributesUpdate feature attributes in an online feature service.
UpdateGeometriesUpdate a feature's location in an online feature service.
UseDistanceCompositeSymChange a graphic's symbol based on the camera's proximity to it.
ViewshedCameraAnalyze the viewshed for a camera. A viewshed shows the visible and obstructed areas from an observer's vantage point.
ViewshedGeoElementAnalyze the viewshed for an object (GeoElement) in a scene.
ViewshedLocationPerform a viewshed analysis from a defined vantage point.