| Message |
Dim connectionFactory As ESRI.ArcGIS.GISClient.IAGSServerConnectionFactory
connectionFactory = New ESRI.ArcGIS.GISClient.AGSServerConnectionFactoryow
Dim connectionProps As IPropertySet
connectionProps = New PropertySet
connectionProps.SetProperty("URL", "http://cmaps.gov.tr/maps/services")
Dim gisServer As ESRI.ArcGIS.GISClient.IAGSServerConnection
gisServer = connectionFactory.Open(connectionProps, 0)
'//get an enum of all server object names from the server (GIS services, i.e.)
Dim soNames As ESRI.ArcGIS.GISClient.IAGSEnumServerObjectName = gisServer.ServerObjectNames
Dim soName As ESRI.ArcGIS.GISClient.IAGSServerObjectName
' //loop thru all services, find a map service called "I3_Imagery_Prime_World_2D" (high res imagery for the world)
'Dim pEnumSOName As IAGSEnumServerObjectName
soName = soNames.Next()
Do Until soName Is Nothing
' MessageBox.Show(soName.Name)
If soName.Name = "ALTYAPI" Then Exit Do
soName = soNames.Next()
Loop
If Not soName Is Nothing Then
Dim msLayerFactory As ILayerFactory
msLayerFactory = New MapServerLayerFactory
If msLayerFactory.CanCreate(soName) = True Then
Dim enumLyrs As IEnumLayer = msLayerFactory.Create(soName)
'MESSAGEOX.SHOW(msLayerFactory.PublicName())
Dim mapServerLayer As IMapServerLayer
mapServerLayer = CType(enumLyrs.Next, IMapServerLayer)
If Not mapServerLayer Is Nothing Then
axMapControl1.AddLayer(CType(mapServerLayer, ILayer))
End If
End If
I have an appplication in arcgis engine.
How can I add group layer in arcgis server to my application as a layer?
In my code when I run the program the error "Could not connect to the Map Server" is given and shows the line below;
Dim enumLyrs As IEnumLayer = msLayerFactory.Create(soName)
I am waiting for your solutions...
|