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




Represents the generic functionality of an ArcIMS map service.

Object Model








Syntax

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

Example

The first example creates a new connection to the ArcIMS server and initializes a new MapService object based on the service. It then prints out a property of the map service.

The second example obtains the MapService from a Map web control on the page.

Visual BasicCopy Code
' Example 1 (VB)

' Set up a connection to the server

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

conn.ServiceName = "World"



Dim connParams As New InitializationParameters(96, True, False, False, False)

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



lblInfo.Text = "MapService MapUnits are " + mapService.Units.ToString()

C#Copy Code
// Example 1 (C#) 

// Set up a connection to the server 

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

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

conn.ServiceName = "World"; 

  

InitializationParameters connParams = new InitializationParameters(96, True, False, False, False); 

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

  

lblInfo.Text = "MapService MapUnits are " + mapService.Units.ToString(); 

    
Visual BasicCopy Code
' Example 2 (VB)

' Get the MapService via the Map control, and print a property

Dim mapFunct As MapFunctionality = CType(Map1.GetFunctionality(0), MapFunctionality)

Dim mapService As MapService = mapFunct.MapView.MapService

lblInfo.Text = "MapService MapUnits are " + mapService.Units.ToString()

C#Copy Code
// Example 2 (C#) 

// Get the MapService via the Map control, and print a property 

MapFunctionality mapFunct = (MapFunctionality)Map1.GetFunctionality(0); 

MapService mapService = mapFunct.MapView.MapService; 

lblInfo.Text = "MapService MapUnits are " + mapService.Units.ToString(); 

    

Remarks

The MapService represents the generic functionality of an ArcIMS map service. It is analogous to the SERVICEINFO response in ArcXML, in that it provides information about the spatial reference, map units, culture settings, and layout.

If using the ADF Map or MapResourceManager web controls, the MapService for an ArcIMS service may be retrieved from these controls.

Inheritance Hierarchy

System.Object
   ESRI.ArcGIS.ADF.IMS.Carto.MapService

See Also

© 2010 All Rights Reserved.