Select to view content in your preferred language

Switching Basemaps: World_Light_Gray_Base layer is not displaying

2464
2
01-28-2013 05:33 AM
stefanschlaefli
Regular Contributor
Hi

I'm working with the ESRI Silverlight API 2.3. I have a basemap switcher, that allows to use different basemap layers. It provides the following three ArcGISTiledMapServiceLayers:

-http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer
-http://server.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer
-http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer

On startup, the street_map layer is added to the map:

 <esri:Map x:Name="MyMap" Width="{Binding}" Margin="5" IsLogoVisible="False" WrapAround="True" ExtentChanged="MyMap_ExtentChanged" ExtentChanging="MyMap_ExtentChanging" Background="Transparent" BorderBrush="Crimson" BorderThickness="0"  >                           
     <esri:ArcGISTiledMapServiceLayer ID="BackgroundLayer" Opacity="0.85" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
</esri:Map>


the basemap switcher grabs the map's tiledmapservicelayer and assigns a new URL to it. it works fine with these three layers.

Now, when I replace the topo layer with the nice world_light_gray_basemap (http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer) and when i use the switcher to load the grey_basemap, it never displays.

when i initialize the map contol with the world_light_gray_basemap, it draws, but the other two layers won't display anymore. can somebody tell me why that happens and how I can switch between the world_light_grey_base and other tiledmapservice layers?

Thanks a lot,
Stefan
0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
On startup you create a map in Geographical Coordinates (tiled layer ESRI_StreetMap_World_2D). Then you can't display a Web Mercator tiled layer(such as http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer).

You should either use only Web Mercator base maps (such as http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer) or change the spatial reference of the map by clearing all layers and resetting the Extent of the map before adding the new layers.
0 Kudos
stefanschlaefli
Regular Contributor
This helps. Thank you.
Stefan
0 Kudos