Map service GetMapName method

Gets the name of the map (data frame) as indicated by the index value provided.

GetMapName(int Index)

Parameter

Description

Index

The index value of the map (data frame) from which to return the name. The index is 0-based.

Return Value

A string referencing the name of the map associated with the index value provided.

Remarks

This method is often used in conjunction with the GetMapCount method to iterate the maps in a map service, searching for a specific map name.

Examples

C#

MapService_MapServer mapservice = new MapService_MapServer();

mapservice.Url = "http://localhost:6080/arcgis/services/MapService/MapServer";

int mapcount = mapservice.GetMapCount();

for (int i = 0; i < mapcount; i++)

{

      string mapname = mapservice.GetMapName(i);

}

VB.NET

Dim mapservice As MapService_MapServer = New MapService_MapServer()

mapservice.Url = "http://localhost:6080/arcgis/services/MapService/MapServer"

 

Dim mapcount As Integer = mapservice.GetMapCount()

Dim i As Integer

For i = 0 To mapcount - 1 Step i + 1

      Dim mapname As String = mapservice.GetMapName(i)

Next

Java

String serviceURL = "http://localhost:6080/arcgis/services/MapService/MapServer";

MapServerBindingStub mapService = new MapServerBindingStub(serviceURL);

 

int mapCount = mapService.getMapCount();

for (int i = 0; i < mapCount; i++)

{

      String mapName = mapService.getMapName(i);

      System.out.println("Map Name: " + mapName);

}

2/28/2020