Gets or sets the SpatialReference of the Geometry.
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim instance As Geometry
Dim value As SpatialReference
instance.SpatialReference = value
value = instance.SpatialReference
|
Example
The following example adds a point to the map in an acetate layer, using a
different coordinate system for the point than for the map as a whole. After
setting the coordinate system for the map (to Robinson), we create the point and
set its coordinate system (to WGS84 geographic). Then we add the point to an
acetate geometry element and the element to an acetate layer, and add the acetate
layer to the map.
C# | Copy Code |
---|
// Set the map to a new projection (Robinson) mapView.SpatialReference = new ESRI.ArcGIS.ADF.IMS.SpatialReference.SpatialReference(54030); // Create a point and set its projection (WGS84) ESRI.ArcGIS.ADF.IMS.Geometry.Point pt = new ESRI.ArcGIS.ADF.IMS.Geometry.Point(75.0, 45.0); pt.SpatialReference = new ESRI.ArcGIS.ADF.IMS.SpatialReference.SpatialReference(4326); // Set up an acetate element and layer for the point ESRI.ArcGIS.ADF.IMS.Display.Symbol.SimpleMarkerSymbol symbol = new ESRI.ArcGIS.ADF.IMS.Display.Symbol.SimpleMarkerSymbol( System.Drawing.Color.Blue, 15, ESRI.ArcGIS.ADF.IMS.Display.Symbol.MarkerSymbolType.Circle); ESRI.ArcGIS.ADF.IMS.Display.AcetateElement.GeometryElement acetatePt = new ESRI.ArcGIS.ADF.IMS.Display.AcetateElement.GeometryElement( ESRI.ArcGIS.ADF.IMS.Display.AcetateElement.AcetateUnits.Database, pt, symbol); ESRI.ArcGIS.ADF.IMS.Carto.Layer.AcetateLayer acetateLayer = new ESRI.ArcGIS.ADF.IMS.Carto.Layer.AcetateLayer("mapGraphics"); // Add the acetate layer to the map acetateLayer.AcetateElements.Add(acetatePt); mapView.Layers.Add(acetateLayer); |
Visual Basic | Copy Code |
---|
mapView.SpatialReference =
New ESRI.ArcGIS.ADF.IMS.SpatialReference.SpatialReference(54030)
Dim pt As New ESRI.ArcGIS.ADF.IMS.Geometry.Point(75.0, 45.0)
pt.SpatialReference = _
New ESRI.ArcGIS.ADF.IMS.SpatialReference.SpatialReference(4326)
Dim symbol As New _
ESRI.ArcGIS.ADF.IMS.Display.Symbol.SimpleMarkerSymbol( _
System.Drawing.Color.Blue, 15,
ESRI.ArcGIS.ADF.IMS.Display.Symbol.MarkerSymbolType.Circle)
Dim acetatePt As New _
ESRI.ArcGIS.ADF.IMS.Display.AcetateElement.GeometryElement(
ESRI.ArcGIS.ADF.IMS.Display.AcetateElement.AcetateUnits.Database, pt, symbol)
Dim acetateLayer As New ESRI.ArcGIS.ADF.IMS.Carto.Layer.AcetateLayer("mapGraphics")
acetateLayer.AcetateElements.Add(acetatePt)
mapView.Layers.Add(acetateLayer)
|
Remarks
See Also