Select to view content in your preferred language

How do you add a map service?

3749
20
08-19-2010 08:03 AM
JoshuaCoates
Deactivated User
I am extremely new to ArcGIS Server as well as Flex Builder and am trying to see if someone can help me step by step on how to add a map service that I have created in flex builder. I have a map service and web app on ArcGIS Server where I am interning and the web app works great. However, I am trying to turn it up a notch and learn how to use Flex to make it look even better. The map (mxd/msd) is not a tiled (cached) map....so I am trying to figure out what steps I need to take in order to publish the service I currently have as a .NET into Flex?! The server type is ASP.NET and I have published the service from the MSD of my map. ..... I am not sure how to figure out what my Web application root and Web application URL are (for the project properties in Flex)? I assume that the web application URL is the URL where my web app is. I have very little knowledge of computer and mxml code, and little knowledge of technical computer terms but have been told that even I am capable of using Flex. I just want to get my service to run in Flex. Can someone walk me through this in "Layman's terms" please? All the tutorials and demos I have watched through ESRI and Adobe are completely over my head and I don't even know where or how to begin. Any help would be greatly appreciated!


Josh C.
Tags (2)
0 Kudos
20 Replies
DasaPaddock
Esri Regular Contributor
Can you give more detail about the errors? Are you getting 404 response codes? Are you able to load these urls in your browser? You may need to check that your web server is properly configured.
0 Kudos
JoshuaCoates
Deactivated User
00:00:03.486 0.152 502 (5898) GET 304 text/html http://publicgis/Floodplain/index.html
00:00:03.646 0.021 407 (26337) GET (Cache) application/x-javascript http://publicgis/Floodplain/swfobject.js
00:00:03.674 1.446 550 (2009) GET 304 image/gif http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif
00:00:03.702 0.100 552 (670254) GET 304 application/x-shockwave-flash http://publicgis/Floodplain/index.swf
00:00:03.822 0.052 464 (670095) GET (Cache) application/x-shockwave-flash (NS_ERROR_FAILURE) http://publicgis/Floodplain/index.swf
00:00:03.896 0.014 429 (209) GET (Cache) text/x-cross-domain-policy http://fpdownload.adobe.com/pub/swz/crossdomain.xml
00:00:04.413 0.007 421 (141) GET (Cache) text/x-cross-domain-policy http://fpdownload.adobe.com/crossdomain.xml
00:00:05.487 0.034 504 (3696) GET 304 text/xml http://publicgis/Floodplain/config.xml
00:00:05.713 0.039 543 (112969) GET 304 application/x-shockwave-flash http://publicgis/Floodplain/widgets/WidgetContainer/WidgetContainerWidget.swf
00:00:05.734 0.104 430 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/w_link.png
00:00:05.772 0.165 431 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/w_close.png
00:00:05.793 0.217 432 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/Red_glow.swf
00:00:05.817 0.253 433 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/i_pushpin.png
00:00:05.840 0.277 412 326 GET 301 Redirect to: http://publicgis/floodplain/?f=json http://publicgis/floodplain?f=json
00:00:05.865 0.302 507 (659674) GET 304 application/x-shockwave-flash http://publicgis/Floodplain/blackgold.swf
00:00:06.119 0.147 413 357 GET 403 text/html (NS_ERROR_FAILURE) http://publicgis/floodplain/?f=json
00:00:06.387 0.082 434 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/w_collapse.png
00:00:06.389 0.141 428 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/w_up.png
00:00:06.391 0.200 430 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/w_down.png
00:00:06.393 0.258 439 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/w_collapse_down.png
00:00:06.395 0.318 430 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/w_left.png
00:00:06.397 0.378 431 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/w_right.png
00:00:06.399 0.437 534 (132164) GET 304 application/x-shockwave-flash http://publicgis/Floodplain/widgets/MapSwitcher/MapSwitcherWidget.swf
00:00:07.157 0.069 447 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/widgets/MapSwitcher/MapSwitcherWidget.xml
00:00:07.191 0.135 545 (118920) GET 304 application/x-shockwave-flash http://publicgis/Floodplain/widgets/HeaderController/HeaderControllerWidget.swf
00:00:07.743 0.084 451 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/widgets/HeaderController/HeaderController.xml
00:00:07.779 0.194 535 (106923) GET 304 application/x-shockwave-flash http://publicgis/Floodplain/widgets/OverviewMap/OverviewMapWidget.swf
00:00:08.392 0.110 447 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/widgets/OverviewMap/OverviewMapWidget.xml
00:00:08.428 0.229 433 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/i_expand2.png
00:00:09.028 0.116 428 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/logo.png
00:00:09.067 0.242 434 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/i_bookmark.png
00:00:09.106 0.972 434 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/i_bookmark.png
00:00:09.185 0.213 432 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/i_target.png
00:00:09.226 0.308 432 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/i_police.png
00:00:09.268 0.354 432 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/i_search.png
00:00:09.311 0.400 429 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/i_rss.png
00:00:09.355 0.489 431 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/i_draw2.png
00:00:09.400 0.589 431 1774 GET 404 text/html (NS_ERROR_FAILURE) http://publicgis/Floodplain/assets/images/i_print.png
0 Kudos
JoshuaCoates
Deactivated User
Not sure if I posted that correctly....
0 Kudos
DasaPaddock
Esri Regular Contributor
Looks like you're getting 404's for anything under the assets folder. Can you double check that they exist on the file system and that you can load those urls in your browser.
0 Kudos
JoshuaCoates
Deactivated User
What do I do to check the file system? I am not familiar with the term. I have looked in the src main source folder and the images are there....and i have looked in the output folder and the images are there. But I dont see URL's to test them in a web browser. When I open the Assets folder, there is a folder called images, and within it are several images.

I have put the URL where the map service is sitting as the mapservice URL. Under "flex build path" the main source folder is src, the output folder is a folder i created sitting on my web server "\\publicgis\wwwroot\Floodplain", and the output folder URL is "http://publicgis/Floodplain". When I run the project....the web browser opens....the flex interface opens with widgets and scale and header...however no map. It is just a black screen?! Any ideas? Thank you for all your help btw dpaddock! I really appreciate your support through all of this.


Josh C.
0 Kudos
JoshuaCoates
Deactivated User
YAY!!!!!! I got it:) I just had to match up the initial extent values from the service to the xml config file. Ok...now one last ? Can you point me towards information on how to get my layers in into the xml config so that they display in the web application and can be toggled through?! Thanks again!


Josh C.
0 Kudos
DasaPaddock
Esri Regular Contributor
Glad to hear you got it working. For more information on how to add your own services, see the Configuration Files -> Main Configuration file page at:
http://help.arcgis.com/en/webapps/flexviewer/help/index.html
You'll need to add operationallayers.
0 Kudos
JoshuaCoates
Deactivated User
Ok so the map service I have now, which is made from a MSD that I created in ArcMap....has 3 layers. On Layer is the basemap, and the other two are floodplain data from two different time periods. From what I have read....it sounds like I have to make completely new maps, with one layer per map, and create a service for each individual layer map that I create? I am really starting to not like Flex so much. I did not realize there was going to be so much difficulty in using it. I just want the layers of the service I currently have the web app running from to show up in the UI so that they can be turned on and off. I created a operation layer and just used the same URL as the mapservice URL....and it shows up on the UI in the top right hand corner if u click "more", however, things still show on the map when u zoom in even if that particular layer really is not turned on. The xml looks like this:

<operationallayers>
         <layer label="Layers" type="dynamic" visible="true"
                   url="http://publicgis/PublicGISserver/rest/services/Bartow_Floodplain/MapServer"/>
</operationallayers>

In order for this to work properly do I have to do what I mentioned above?
0 Kudos
DasaPaddock
Esri Regular Contributor
You don't have to create separate map services. Instead you can control which layers are visible in three different client layers. For example, in the basemaps mapservice set visiblelayers="0" and in two separate operational layers, set visiblelayers="1" and visiblelayers="2".
0 Kudos
JoshuaCoates
Deactivated User
How can I specify which layer in my msd I want to be "1" and which one I want to be "2"? Can you show me an example of xml for everything I need in the <operationallayers> section? In basemaps><mapservice label.......I just put visablelayers="0" right after alpha="1"...is this the right way to do it? Where can I find example codes for xml....the code gallery for beta has hardly any examples.
0 Kudos