Select to view content in your preferred language

dynamic layers and map projection

631
2
08-12-2010 12:23 PM
TerryGiles
Frequent Contributor
Based on the SL samples and my own experimenting, it appears dynamic layers can be projected on the fly to match that of the map it is displayed in.  One thing I've noticed though is that if the dynamic layer's projection doesn't match, it gets a white background when projected to match the map covering all layers underneath.  Is this correct and if so is it by design, a known limitation, or something I can work around? 

For now it's not a big issue as almost all of our map services match the old ArcGIS online schema of Geographic WGS 84, but when those are turned off and only the Web Mercator versions are available it looks like I'll have to modify all of our services to match...

Thanks,
Terry
0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor

One thing I've noticed though is that if the dynamic layer's projection doesn't match, it gets a white background when projected to match the map covering all layers underneath. Is this correct and if so is it by design, a known limitation, or something I can work around?



It's not by design. It should work the same way.

I didn't reproduce your issue.

For example, I changed the tiled layer of the DynamicAndTiled sample :

 
<Grid x:Name="LayoutRoot" >
<esri:Map x:Name="MyMap">
<esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" 
Url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" 
InitializationFailed="Layer_InitializationFailed" />
<esri:ArcGISDynamicMapServiceLayer ID="DynamicLayer" Opacity="0.6" Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapSe..."
InitializationFailed="Layer_InitializationFailed" />
</esri:Map>
</Grid>


and I got a good result (see attachment).

Note that I was able to get a white background by using an ImageFormat which doesn't support the transparency (as JPG).
 
<esri:ArcGISDynamicMapServiceLayer ID="DynamicLayer" Opacity="0.6" ImageFormat="JPG"
Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapSe..."
InitializationFailed="Layer_InitializationFailed" />

But I guess it's not your case since you would get the same result whatever the spatial reference.

Could you give more info on how to reproduce your issue?

Thanks
0 Kudos
TerryGiles
Frequent Contributor
Hello Dominique,

Thanks for the reply.  I tried again today, it works just fine..weird.  I was not setting the image format for the dynamic layer in my XAML as the default is png24 which should support transparency.

below is what I had in my XAML, guess my computer just needed a rest..


        <esri:Map x:Name="map" Grid.ColumnSpan="4" Grid.Row="1">
            <esri:Map.Extent>
                <esri:Envelope XMin="-130" YMin="10" XMax="-70" YMax="60" >
                    <esri:Envelope.SpatialReference>
                        <esri:SpatialReference WKID="4326"/>
                    </esri:Envelope.SpatialReference>
                </esri:Envelope>
            </esri:Map.Extent>
            <esri:Map.Layers>
                <!-- imagery service in 4326 -->
                <esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/I3_Imagery_Prime_World_2D/MapServer"/>
    <!-- local dynamic service in 4269 -->
                <esri:ArcGISDynamicMapServiceLayer Url="http://myserver/ArcGIS/rest/services/test_service/MapServer/" />
                
            </esri:Map.Layers>
        </esri:Map>
0 Kudos