ESRI.ArcGIS.ADF.IMS
LayoutView Class
Members  Example  See Also 
ESRI.ArcGIS.ADF.IMS.Carto Namespace : LayoutView Class




Handles working with and viewing layouts in an ArcMap Server service.

Object Model






Syntax

Visual Basic (Declaration) 
<SerializableAttribute()>
Public Class LayoutView 
   Inherits View
Visual Basic (Usage)Copy Code
Dim instance As LayoutView
C# 
[SerializableAttribute()]
public class LayoutView : View 

Example

The following example creates a LayoutView, and sets the output type to PDF. It then displays some information about one of its data frames, and sets the projection and extent of the data frame. Finally, it generates an output PDF file for the layout.
C#Copy Code
LayoutView layoutView = mapService.CreateLayoutView(); 

  

// Set output type to PDF 

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 geographic coordinates 

Envelope worldEnv = new Envelope(-130, 25, -100, 50); 

worldEnv.SpatialReference = new SpatialReference(4326); 

worldFrame.Extent = worldEnv; 

  

// Generate a layout file 

ESRI.ArcGIS.ADF.Web.CartoImage image = layoutView.Draw(); 

lblLayoutView.Text = "Layout is available at: " + image.Url; 

    
Visual BasicCopy Code
Dim layoutView As LayoutView = mapService.CreateLayoutView()



' Set output type to PDF

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 geographic coordinates

Envelope worldEnv = New Envelope(-130, 25, -100, 50)

worldEnv.SpatialReference = New SpatialReference(4326)

worldFrame.Extent = worldEnv



' Generate a layout file

ESRI.ArcGIS.ADF.Web.CartoImage image = layoutView.Draw()

lblLayoutView.Text = "Layout is available at: " + image.Url

Inheritance Hierarchy

System.Object
   ESRI.ArcGIS.ADF.IMS.Carto.View
      ESRI.ArcGIS.ADF.IMS.Carto.LayoutView

See Also

© 2010 All Rights Reserved.