Select to view content in your preferred language

Can't bring this map service into my map???

2179
6
06-21-2010 04:12 PM
sofoo
by
Frequent Contributor
Hello,

I have the following code for a web map using the Flex API.  I can get other map services to overlay on top of the basemap, but I can't add this parcel layer from CIRGIS.  Can anyone help me out?  (There is some extra code in the beginning that you can disregard.  I've simplified the code to narrow the possibilities):

--------------------

<?xml version="1.0" encoding="utf-8"?>
<mx:Application   xmlns:mx="http://www.adobe.com/2006/mxml"  xmlns:esri="http://www.esri.com/2008/ags"    pageTitle="DrawToolbar"    styleName="plain">   
<mx:Script>       


<![CDATA[           

import com.esri.ags.geometry.MapPoint;    
import mx.events.ItemClickEvent; 
import mx.controls.Alert;
import com.esri.ags.events.MapMouseEvent;
import com.esri.ags.Graphic;
import com.esri.ags.events.DrawEvent;
import com.esri.ags.events.GraphicEvent;
                       
]]>   
</mx:Script>  

<esri:Map id="myMap" >
<esri:extent>           
   <esri:Extent xmin="-119.65" ymin="34.43" xmax="-119.7" ymax="34.45">         
  <esri:SpatialReference wkid="4326"/>           
</esri:Extent>       
</esri:extent>       

  

<esri:ArcGISTiledMapServiceLayer id="tiledStreetMap" url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
      
<esri:ArcGISTiledMapServiceLayer id="parcels" url="http://www.cirgis.org/ArcGIS/rest/services/County_ParcelsWGS84/MapServer"/>       

</esri:Map>   

<mx:TraceTarget includeCategory="true" includeLevel="true"/>   
<!-- The output from TraceTarget is available when running Debug within Flex Builder -->
</mx:Application>
Tags (2)
0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus
sofoo,

   The issue is that the CIRGIS parcel map service is not a tiled map service like you are try to use it as. If you enter
http://www.cirgis.org/ArcGIS/rest/services/County_ParcelsWGS84/MapServer
to your browsers address bar you will notice the service directory page list the Single Fused Map Cache = false. For a tiled map service it would be Single Fused Map Cache = true and there would be a list of Levels of Detail.

Use ArcGISDynamicMapServiceLayer instead.
0 Kudos
DasaPaddock
Esri Regular Contributor
I noticed that there's an error in the policy file at: http://www.cirgis.org/crossdomain.xml
It's not well formed XML. It has an extra "-" character in it. This will be a problem if you're not using a proxy or deploying your app to http://www.cirgis.org.
0 Kudos
sofoo
by
Frequent Contributor
Robert - I tried that and it didn't work either.

Dasa - I noticed that this layer is available in ArcGIS Online (http://www.arcgis.com/home/item.html?id=7a3f1dfe41f448e9821132c160e3646f).  Do you know how ESRI was able to link to this map service?  Also, what do you mean by "proxy"?  I don't understand what that is.

Thanks for the responses!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Sofoo,

   Funny this code works fine for me.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
    xmlns:esri="http://www.esri.com/2008/ags" 
    pageTitle="DrawToolbar"
    styleName="plain">
 <mx:Script>
  <![CDATA[
  
   import com.esri.ags.geometry.MapPoint;
   import mx.events.ItemClickEvent;
   import mx.controls.Alert;
   import com.esri.ags.events.MapMouseEvent;
   import com.esri.ags.Graphic;
   import com.esri.ags.events.DrawEvent;
   import com.esri.ags.events.GraphicEvent;
  
  ]]>
 </mx:Script>
 
 <esri:Map id="myMap" >
  <esri:extent>
   <esri:Extent xmin="-119.65" ymin="34.43" xmax="-119.7" ymax="34.45">
    <esri:SpatialReference wkid="4326"/>
   </esri:Extent>
  </esri:extent>
 
  <esri:ArcGISTiledMapServiceLayer id="tiledStreetMap" url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
 
  <esri:ArcGISDynamicMapServiceLayer id="parcels" url="http://www.cirgis.org/ArcGIS/rest/services/County_ParcelsWGS84/MapServer"/>
 
 </esri:Map>
 
 <mx:TraceTarget includeCategory="true" includeLevel="true"/>
 <!-- The output from TraceTarget is available when running Debug within Flex Builder -->
</mx:Application>


As far as the proxy look at this thread where Dasa answers that question.

http://forums.esri.com/thread.asp?c=158&f=2421&t=263931
0 Kudos
DasaPaddock
Esri Regular Contributor
Sofoo, ArcGIS.com is using the JS API which doesn't load the crossdomain.xml file. If you use a proxy, then you won't need to load the bad file at http://www.cirgis.org/crossdomain.xml

Robert,
Are you running from a webserver or from your Builder's bin-debug?

When I run this from my local webserver with Flash Player 10.1, I get this error in my console:

Error: [strict] Ignoring policy file at http://www.cirgis.org/crossdomain.xml due to incorrect syntax.  See http://www.adobe.com/go/strict_policy_files to fix this problem.
*** Security Sandbox Violation ***
Connection to http://www.cirgis.org/ArcGIS/rest/services/County_ParcelsWGS84/MapServer?f=json halted - not permitted from http://quicksilver.esri.com/ags/test_pad.swf

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:esri="http://www.esri.com/2008/ags">

    <esri:Map>
        <esri:ArcGISDynamicMapServiceLayer
                url="http://www.cirgis.org/ArcGIS/rest/services/County_ParcelsWGS84/MapServer"/>
    </esri:Map>

</mx:Application>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Dasa,

   I ran my test from my local machine in Flex Builder 3 using 3.4 SDK and requiring Flash Player 10.0. The output url folder is not configured to a virtual directory so it is running from the C drive. I know it still won't work for him if he deploys it to a web server unless my sets up the proxy, but my point was it is a ArcGISDynamicMapServiceLayer Sofoo should be using.
0 Kudos