Select to view content in your preferred language

Dynamic map service

870
4
03-09-2011 01:26 PM
JonPedder
Deactivated User
I have code that displays an ESRI tiles map service correct but when I try to display a dynamic map which is published locally it won't display. I've tested that the map does indeed display when I use a simple statement as follows.
<esri:Map>
  <esri:ArcGISDynamicMapServiceLayer url="http://sarserver/MapSAR_Server/rest/services/ANF/MapServer"/>
</esri:Map>

However when I try the following I get a blank screen, might this be as I'm attempting to display multiple dynamic services?

<esri:Map
    id="myMap"
    level="14"
   
    load="myMap_loadHandler(event)"
    width="100%" height="100%">
        
    <esri:ArcGISDynamicMapServiceLayer url="http://sarserver/MapSAR_Server/rest/services/ANF/MapServer"/>
       
    <esri:ArcGISDynamicMapServiceLayer
     id="assignmentsLayer"
     visible="{toggleAssignments.selected}"
     alpha=".7"
     url="http://sarserver/MapSAR_Server/rest/services/MapSAR_Assignments_Server/MapServer"
     />
</esri:Map>

Thanks in advance

Jon
Tags (2)
0 Kudos
4 Replies
Drew
by
Frequent Contributor
I have code that displays an ESRI tiles map service correct but when I try to display a dynamic map which is published locally it won't display. I've tested that the map does indeed display when I use a simple statement as follows.
<esri:Map>
  <esri:ArcGISDynamicMapServiceLayer url="http://sarserver/MapSAR_Server/rest/services/ANF/MapServer"/>
</esri:Map>

However when I try the following I get a blank screen, might this be as I'm attempting to display multiple dynamic services?

<esri:Map
    id="myMap"
    level="14"
   
    load="myMap_loadHandler(event)"
    width="100%" height="100%">
        
    <esri:ArcGISDynamicMapServiceLayer url="http://sarserver/MapSAR_Server/rest/services/ANF/MapServer"/>
       
    <esri:ArcGISDynamicMapServiceLayer
     id="assignmentsLayer"
     visible="{toggleAssignments.selected}"
     alpha=".7"
     url="http://sarserver/MapSAR_Server/rest/services/MapSAR_Assignments_Server/MapServer"
     />
</esri:Map>

Thanks in advance

Jon


First I would check if the service is viewable in the rest services JavaScript viewer. You can do so at the below URL:
http://sarserver/MapSAR_Server/rest/services

Second, I would check if the layers are visible at level="14". Do you have min or max scale levels set in the mxd (or msd). Try removing level="14" and see what comes up.

Finally, I would check to see whats coming back from the server using FireBug or Fiddler.

Drew
0 Kudos
JonPedder
Deactivated User
Thanks for the tip, unfortunately it didn't work.

Interestingly I can see the map in java via rest and also see it if using a very simple test mxml doc. If I switch to a tiled map hosted by arcgis it display fine, when I switch to dynamic is when I see nothing.

here's the code that works with tiled
   <esri:Map
    id="myMap"
    level="14"
   
    load="myMap_loadHandler(event)"
    width="100%" height="100%">
   
    <!-- based on CA topo service coordinate system
    <esri:extent>
    <esri:Extent id="mainExtent" xmax="499889.034" ymax="3791242.816" xmin="472558.580" ymin="3776222.919">
    <esri:SpatialReference wkid="26911"/>
    </esri:Extent>
    </esri:extent>
    -->
   
    <esri:ArcGISTiledMapServiceLayer
     url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"
     />
   
   
    <esri:ArcGISDynamicMapServiceLayer
     id="assignmentsLayer"
     visible="{toggleAssignments.selected}"
     alpha=".7"
     url="http://sarserver/MapSAR_Server/rest/services/MapSAR_Assignments_Server/MapServer"
     />

Here's the code that fails

<esri:Map
    id="myMap"
    load="myMap_loadHandler(event)"
    width="100%" height="100%">
   
    <esri:extent>
     <esri:Extent xmax="410209.212" ymax="3787665.306" xmin="400982.892" ymin="3781910.607">
      <esri:SpatialReference wkid="26911"/>
     </esri:Extent>
    </esri:extent>
   
    <esri:ArcGISDynamicMapServiceLayer
     url="http://sarserver/MapSAR_Server/rest/services/ANF/MapServer"
     />

        
    <esri:ArcGISDynamicMapServiceLayer
     id="assignmentsLayer"
     visible="{toggleAssignments.selected}"
     alpha=".7"
     url="http://sarserver/MapSAR_Server/rest/services/MapSAR_Assignments_Server/MapServer"
     />
0 Kudos
Drew
by
Frequent Contributor
Sounds like a data problem...
Have you checked your MXD to ensure the datasources are valid ?
Are you using SDE, FGDB, PGDB ?

Drew
0 Kudos
JonPedder
Deactivated User
Found it, it was this line that prevented the dynamicmapservice display properly.

load="myMap_loadHandler(event)"

remove that and voila!

Jon
0 Kudos