ESRI.ArcGIS.ADF.IMS
Draw(SpatialReference) Method
See Also  Example
ESRI.ArcGIS.ADF.IMS.Carto Namespace > MapView Class > Draw Method : Draw(SpatialReference) Method




newSpatialReference
Spatial reference to use when drawing the map.
Redraws the map with new spatial reference properties.

Syntax

Visual Basic (Declaration) 
Public Overloads Overrides Function Draw( _
   ByVal newSpatialReference As SpatialReference _
) As CartoImage
Visual Basic (Usage)Copy Code
Dim instance As MapView
Dim newSpatialReference As SpatialReference
Dim value As CartoImage
 
value = instance.Draw(newSpatialReference)
C# 
public override CartoImage Draw( 
   SpatialReference newSpatialReference
)

Parameters

newSpatialReference
Spatial reference to use when drawing the map.

Return Value

CartoImage object, whose Url property contains the URL location of the map image.

Example

The following example draws the map with a new spatial reference set to the Robinson projection. It sets the map extent using a geographic coordinate system (4326). It assumes a MapView exists named mapView, and an image control in the page named imgMap.
C#Copy Code
// Set the map extent to the area desired 

Envelope newExtent = new Envelope(-170, -70, 170, 70); 

// Define the spatial reference of the extent 

// (required if the envelope has a difference reference than the 

//   map's current reference, or the map's SpatialReference is null) 

newExtent.SpatialReference = new SpatialReference(4326); 

mapView.Extent = newExtent; 

  

// Define a new spatial reference for the map (Robinson is 54030) 

SpatialReference spatialRef = new SpatialReference(); 

// Draw the map with the new spatial reference 

CartoImage resultImage = mapView.Draw(54030); 

imgMap.ImageUrl = resultImage.Url; 

    
Visual BasicCopy Code
' Set the map extent To the area desired

Dim newExtent As New Envelope(-170, -70, 170, 70)

' Define the spatial reference of the extent

' (required If the envelope has a difference reference than the

' map's current reference, or the map's SpatialReference is null)

newExtent.SpatialReference = New SpatialReference(4326)

mapView.Extent = newExtent



' Define a New spatial reference For the map (Robinson Is 54030)

SpatialReference spatialRef = New SpatialReference()

' Draw the map With the New spatial reference

CartoImage resultImage = mapView.Draw(54030)

imgMap.ImageUrl = resultImage.Url

Remarks

See the SpatialReference property for discussion of changing the spatial reference of the map.

See Also

© 2010 All Rights Reserved.