ESRI.ArcGIS.ADF.IMS
CreateMapView(String) Method
See Also  Example
ESRI.ArcGIS.ADF.IMS.Carto Namespace > MapService Class > CreateMapView Method : CreateMapView(String) Method




dataFrameName
Name of the data frame in the ArcMap image service.
Creates a new MapView object that uses a specific data frame in the ArcIMS ArcMap service.

Syntax

Visual Basic (Declaration) 
Public Overloads Function CreateMapView( _
   ByVal dataFrameName As String _
) As MapView
Visual Basic (Usage)Copy Code
Dim instance As MapService
Dim dataFrameName As String
Dim value As MapView
 
value = instance.CreateMapView(dataFrameName)
C# 
public MapView CreateMapView( 
   string dataFrameName
)

Parameters

dataFrameName
Name of the data frame in the ArcMap image service.

Return Value

A new MapView tied to the ArcMap data frame specified.

Example

The following example creates a new server connection and MapService, and then creates a new MapView by specifying the data frame. It then prints the name of the data frame to a label.
C#Copy Code
// Create a connection to the server 

ESRI.ArcGIS.ADF.Connection.IMS.TCPConnection conn =  

    new ESRI.ArcGIS.ADF.Connection.IMS.TCPConnection("localhost", 5300); 

conn.ServiceName = "World"; 

  

// Create a MapService object that retrieves data frame information 

InitializationParameters connParams = new InitializationParameters(96, false, false, true, false, "#ALL#"); 

MapService mapService = new MapService(conn, connParams, true); 

  

// Create the MapView and print its data frame name 

MapView mapView = mapService.CreateMapView("World"); 

Label1.Text = "This MapView uses data frame " + mapView.DataFrameName; 

    
Visual BasicCopy Code
' Create a connection To the server

Dim conn As New ESRI.ArcGIS.ADF.Connection.IMS.TCPConnection("localhost", 5300)

conn.ServiceName = "World"



' Create a MapService Object that retrieves Data frame information

Dim connParams As New InitializationParameters(96, False, False, True, False, "#ALL#")

Dim mapService As New MapService(conn, connParams, True)



' Create the MapView And Print its Data frame name

Dim mapView As MapView = mapService.CreateMapView("World")

Label1.Text = "This MapView uses data frame " + mapView.DataFrameName

Remarks

Only use this method when the map service is an ArcMap image service, and you wish to generate a MapView associated with a data frame other than the default one.

To use this method, you must have set LoadDataFrames to either "#ALL#" or to the name of the data frame in the InitializationParameters used when initializing the MapService. If LoadDataFrames is set to false, then no data frame information is retrieved, and you cannot create a MapView for a non-default data frame.

If a list of data frames is needed, and the original document cannot be examined with ArcMap, then you can retrieve a DataFrameCollection, which has information on all data frames in the service, from a LayoutView by using MapService.CreateLayoutView.

See Also

© 2010 All Rights Reserved.