Represents a data frame in an ArcMap Server service.
Object Model
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim instance As DataFrame |
Example
The following example displays some properties of a data frame, and then changes the spatial reference and extent of the data frame. It generates a layout file that will display the modified data frame.
C# | Copy Code |
---|
LayoutView layoutView = mapService.CreateLayoutView();
layoutView.ImageDescriptor.ImageFormat = ESRI.ArcGIS.ADF.Web.ImageFormat.PDF;
DataFrame worldFrame = layoutView.DataFrames[1];
// Print some information about the data frame
lblDataFrameInfo.Text =
"Data frame information:<br>" +
"Data frame name: " + worldFrame.Name + "<br>" +
"First layer name: " + worldFrame.Layers[0].Name + "<br>" +
"Background color: " + worldFrame.BackColor.Name + "<br>" +
"Default extent: " + worldFrame.DefaultExtent.ToString() + "<br>" +
"Map units: " + worldFrame.MapUnits.ToString() + "<br>";
// Use the Robinson projection (ID of 54030) for one data frame
SpatialReference spatialRef = new SpatialReference(54030);
worldFrame.SpatialReference = spatialRef;
// Set the extent of the data frame with a geographic coordinates
Envelope worldEnv = new Envelope(-130, 25, -100, 50);
worldEnv.SpatialReference = new SpatialReference(4326);
worldFrame.Extent = worldEnv;
// Turn off a layer in a data frame
worldFrame.Layers[0].Visible = false;
// Generate a layout file
ESRI.ArcGIS.ADF.Web.CartoImage image = layoutView.Draw();
lblLayoutView.Text = "Layout is available at: " + image.Url; |
Visual Basic | Copy Code |
---|
Dim layoutView As LayoutView = mapService.CreateLayoutView()
layoutView.ImageDescriptor.ImageFormat = ESRI.ArcGIS.ADF.Web.ImageFormat.PDF
DataFrame worldFrame = layoutView.DataFrames(0)
' Print some information about the data frame
lblDataFrameInfo.Text = _
"Data frame information:<br>" + _
"Data frame name: " + worldFrame.Name + "<br>" + _
"First layer name: " + worldFrame.Layers(0).Name + "<br>" + _
"Background color: " + worldFrame.BackColor.Name + "<br>" + _
"Default extent: " + worldFrame.DefaultExtent.ToString() + "<br>" + _
"Map units: " + worldFrame.MapUnits.ToString() + "<br>"
' Use the Robinson projection (ID of 54030) For one Data frame
SpatialReference spatialRef = New SpatialReference(54030)
worldFrame.SpatialReference = spatialRef
' Set the extent of the Data frame With a geographic coordinates
Envelope worldEnv = New Envelope(-130, 25, -100, 50)
worldEnv.SpatialReference = New SpatialReference(4326)
worldFrame.Extent = worldEnv
' Turn off a layer In a Data frame
worldFrame.Layers(0).Visible = False
' Generate a layout file
ESRI.ArcGIS.ADF.Web.CartoImage image = layoutView.Draw()
lblLayoutView.Text = "Layout is available at: " + image.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