Loading Map Service is blank

699
13
08-02-2011 06:40 AM
AndyWhitley
New Contributor
When I add my own map service to my flex project, the map is always blank.  I can preview my map using the java script link within rest services and preview the map in arccatalog.  Any suggestions?  I am using arcgisonline for my other default base maps.
Tags (2)
0 Kudos
13 Replies
PatrickWard1
New Contributor II
Do you have ArcGIS Server installed on a different server than the one hosting your Flex application? If so the remote server needs to have a cross-domain file in the root directory. For security reasons, the Web browser cannot access data that resides outside the exact Web domain where the SWF file originated. However, Adobe Flash Player can load data across domains if permission is granted from the server. This is accomplished by including a small crossdomain.xml file on the remote server that permits Flash to connect to services on that server.
http://server.arcgisonline.com/crossdomain.xml

If the above is not the issue then is your data in the same projected coordinate sytem used by the ArcGIS Online basemaps? The first thing you should do when designing the map is change the data frame coordinate system to the same one used by ArcGIS Online services, Google Maps, and Bing Maps, which is WGS 1984 Web Mercator (Auxiliary Sphere).
http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//009300001571...
0 Kudos
AndyWhitley
New Contributor
The flash build is on a different computer so I did add the cross domain file to the server and still no luck.  Let me double check the projection and retry.
0 Kudos
AndyWhitley
New Contributor
Patrick,

The projection was already correct for the .mxd.  I have included the code below for the map service.  I have tried it with the internal ip address in place of the name of the server which is "intrfce" and tried it with www. in front of the server name also.


<layer label="AVL"    type="dynamic" visible="false"
                   url="http://intrfce.com/arcgis/services/Unit_AVL/MapServer"/>
0 Kudos
AndyWhitley
New Contributor
I added /rest/ before services also, left that portion out by mistake, still no luck.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Andy,

   When you paste:

http://intrfce/arcgis/rest/services/Unit_AVL/MapServer
in a browser window does it bring up the Rest service directory page for that map service?
0 Kudos
AndyWhitley
New Contributor
Robert,

Thanks for all your help today.  Yes it does open up the services directory.

Andy
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Andy,

  So in the Service directory page what does it say the WKID (spatial reference) is? What does your main config inital extent look like?

Does it work if you use this url then?

http://intrfce/arcgis/rest/services/Unit_AVL/MapServer
0 Kudos
AndyWhitley
New Contributor
It displays the spatial reference is 3857, the link opens up the same as the last one, just my services directory page.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Andy,

   No, I mean when you use that url as the url for the layer in your config.xml

<layer label="AVL"    type="dynamic" visible="false"
                   url="http://intrfce/arcgis/rest/services/Unit_AVL/MapServer"/>   
0 Kudos