Search code examples
c#asp.netarcgisesriarcgis-server

arcGIS newbie: accessing map from a ADF application


I'm an arcGIS newbie and I'm trying to visualize a map I've created with arcMap.

The map (test.mxd) has a single layer with some data (some colored squares) and I published it with a service using the arcGIS Server Manager choosing "Publish resource"

So now I have a simple map service running.

Using the ADF sample for .NET applications I'm trying to display the map, thus if I write

<esri:MapResourceItems>
                <esri:MapResourceItem Definition="&lt;Definition DataSourceDefinition=&quot;http://server.arcgisonline.com/arcgis/services&quot; DataSourceType=&quot;ArcGIS Server Internet&quot; Identity=&quot;To set, right-click project and 'Add ArcGIS Identity'&quot; ResourceDefinition=&quot;(default)@ESRI_Imagery_World_2D&quot; /&gt;"
                    DisplaySettings="visible=True:transparency=0:mime=True:imgFormat=PNG8:height=100:width=100:dpi=96:color=:transbg=False:displayInToc=True:dynamicTiling="
                    LayerDefinitions="" Name="MapResourceItem0" /> 

            </ResourceItems>

where DataSourceDefinition and ResourceDefinition are online, I can visualize the map.

If I use my code:

<esri:MapResourceItem Definition="&lt;Definition DataSourceDefinition=&quot;localhost/arcgis/services/test/&quot; DataSourceType=&quot;ArcGIS Server Local&quot; Identity=&quot;To set, right-click project and 'Add ArcGIS Identity'&quot; ResourceDefinition=&quot;Layers@test&quot; /&gt;"
        DisplaySettings="visible=True:transparency=0:mime=True:imgFormat=PNG8:height=100:width=100:dpi=96:color=:transbg=False:displayInToc=True:dynamicTiling="
                    LayerDefinitions="" Name="MapResourceItem0" />

(I've written DataSourceDefinition and ResourceDefinition by myself just guessing them), this won't work and the map div is empty. I can see the pan dragging cursor, but the data is totally empty.

Maybe the map got loaded but I can't see anything because I have a single layer and not a raster map behind?

This should be a simple problem, but I'm totally new to arcGIS and can't find something explaining how to do this


Solution

  • Figured out: I needed to use the service manager to add a WMS querable service