Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'd like to use a basemap containing world map data as a backdrop to some point and outline data that I'm hosting in ArcGIS server in the ESRI Flex API, but I would like the map control to share a WKID with my data, so I don't need to reproject it on every operation. However, the Map control seems to want a) the layers to be displayed with the first being on the bottom, and b) the first layer to be the layer that defines the WKID. Is there a good way to work around these contraints?

share|improve this question
    
did this work for you? I get an error on flex 2.2 viewer when using this code –  Brad Nesom Aug 4 '11 at 16:26
add comment

2 Answers

up vote 1 down vote accepted

According to the docs, you can't set SpatialReference directly. Instead, set the extent property on the Map object.

<esri:Map id="map" units="{Units.FEET}">
    <esri:extent>
        <esri:Extent xmin="661140" ymin="-1420246" xmax="3015668" ymax="1594451">
            <esri:SpatialReference wkid="26777"/>
            <!-- NAD_1927_StatePlane_Kansas_North_FIPS_1501 -->
        </esri:Extent>
    </esri:extent>
    <esri:ArcGISDynamicMapServiceLayer url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer"/>
    <esri:ArcGISDynamicMapServiceLayer url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Petroleum/KGS_OilGasFields_Kansas/MapServer"/>
</esri:Map>
share|improve this answer
add comment

An alternative way to workaround the (a) and (b) constraints you mention is to re-order the layers once the first layer is loaded (and has set the map spatial reference).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.