Redraws the map with new spatial reference properties.
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim instance As MapView
Dim newSpatialReference As SpatialReference
Dim value As ESRI.ArcGIS.ADF.Web.CartoImage
value = instance.Draw(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 Basic | Copy 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
Requirements
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family
See Also