Select to view content in your preferred language

Accessing map service through API

841
4
08-21-2012 04:03 AM
NadeemQazi
Regular Contributor
Hi there

I have built an application using flex API under flush builder 4.6. This application uses the map service published on the server.  I run the application and it works fine on my labtop and i can see the url address in the browser:http://149.157.138.198/testflushproject-debug/testflushproject.html

The ARCGIS server, Internet information server all lies on the same laptop. Now i use this url on the other laptop which is connected to this network. however when i enter this url  the page is opened showing me the user interface but the map is not shown on the other laptop. I can see the other  things like cross hair and other userinterface control however the map is not visible any idea......

<esri:Map id="mymap" x="-2" y="14" crosshairVisible="true" level="3" load="OnMapLoad()">
 
  <esri:ArcGISDynamicMapServiceLayer url="http://localhost/ArcGIS_Server/rest/services/davesite/MapServer"/>
 
  <esri:GraphicsLayer id="graphicsLayer"/>
</esri:Map>

<s:RichEditableText id="lbl_mapscale" x="172" y="22" text="1:{mymap.scale.toFixed(0)} (level {mymap.level})"/>
<s:Label x="54" y="22" text="Current map scale"/>
<s:HGroup x="494" y="10" width="200" height="200">
 
  <s:RichEditableText id="mousecoords"
       editable="false"
       text="Move the mouse over the map to see its current coordinates..."/>
 
</s:HGroup>
Tags (2)
0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Nadeem,

   You can nor mix localhost (the url of your ArcGISDynamicMapService) and then use the IP address to access the application with out using a crossdomain.xml. The easy fix in your case is to quit using different urls. If you are going to use the IP address then use it every where.
<esri:ArcGISDynamicMapServiceLayer url="http://149.157.138.198/ArcGIS_Server/rest/services/davesite/MapServer"/>
0 Kudos
NadeemQazi
Regular Contributor
Nadeem,

   You can nor mix localhost (the url of your ArcGISDynamicMapService) and then use the IP address to access the application with out using a crossdomain.xml. The easy fix in your case is to quit using different urls. If you are going to use the IP address then use it every where.
<esri:ArcGISDynamicMapServiceLayer url="http://149.157.138.198/ArcGIS_Server/rest/services/davesite/MapServer"/>


thanx robert, in case i wish to use to use the crossdomain.xml to solve this problem than what should be the entry in the crossdomain.xml and where will should i placed that file.
regards
nadeem
0 Kudos
NadeemQazi
Regular Contributor
thanx robert, in case i wish to use to use the crossdomain.xml to solve this problem than what should be the entry in the crossdomain.xml and where will should i placed that file.
regards
nadeem


Actually when i tried to used with the ipaddress in the url than the map did not show at all even on local laptop. i think there is some configuration need to be done at  ARCGIS server to allow the map to be seen remotely. but I am not sure how to do this. I used following code.
<esri:ArcGISDynamicMapServiceLayer url="http://http://149.157.138.198/ArcGIS_Server/rest/services/aiportMoneve_Activeonlu/MapServer"/>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nadeem,

   You do realize that you have http twice in the url right?..

Here is a link to the documentation on using crossdomain.xml
http://resources.arcgis.com/en/help/flex-api/concepts/017p/017p0000001w000000.htm
0 Kudos