Select to view content in your preferred language

Bing Basemap / ESRI Basemap interchangeability

679
3
08-26-2011 08:30 AM
DavidBrown6
New Contributor
Hi,

Currently we have a silverlight application that is using ESRI base maps. Everything works as it should. We were wondering how easy it would be to switch to use Bing base maps. Switching the code was fairly painless, but now the zoom feature doesn't work exactly right when using the Bing base maps. When finding an address, it is configured to zoom in on the result. With the Bing maps, however, it seems to zoom in way too far. Is there a required adjustment that is needed to be made to the zoom function in order for this to work properly?
0 Kudos
3 Replies
ChristopherHill
Occasional Contributor
What was the spatial reference of the esri base map you were using? the bing maps base map is web mercator. if the previous base map wasn't web mercator you may want to start looking there first.
0 Kudos
DavidBrown6
New Contributor
The problem was the minimum resolution for the BING map was much lower than the ESRI. Everything else lined up fine.

Now my question is, is it possible to have both BING and ESRI basemaps on the same application and be able to switch between them?

I have two esri:Map nodes, one for BING and one for ESRI. It seems that whichever is placed before the other is the one that will be loaded. I have a toolbar which can be used to switch between the two, but it doesn't seem to be working. Here is the code:

  private void RadioButton_Click(object sender, RoutedEventArgs e)
        {

            RadioButton layerObject = sender as RadioButton;
            if (layerObject.GroupName == "ESRI")
            {
                //_candidateGraphicsLayer1 = null;
                //_candidateGraphicsLayer = MyMap.Layers["CandidateGraphicsLayer"] as GraphicsLayer;
                //_candidateGraphicsLayer.RendererTakesPrecedence.Equals(false);
                ArcGISTiledMapServiceLayer arcgisLayer = MyMap.Layers["StreetMapLayer"] as ArcGISTiledMapServiceLayer;
                arcgisLayer.Url = layerObject.Tag.ToString();
            }
            else if (layerObject.GroupName == "BING")
            {
                //_candidateGraphicsLayer = null;
                //_candidateGraphicsLayer1 = MyMap1.Layers["CandidateGraphicsLayer1"] as GraphicsLayer;
                //_candidateGraphicsLayer1.RendererTakesPrecedence.Equals(false);
                ESRI.ArcGIS.Client.Bing.TileLayer tileLayer = MyMap1.Layers["BingLayer"] as TileLayer;
                string layerTypeTag = (string)((RadioButton)sender).Tag;
                TileLayer.LayerType newLayerType = (TileLayer.LayerType)System.Enum.Parse(typeof(TileLayer.LayerType), layerTypeTag, true);
                tileLayer.LayerStyle = newLayerType;

            }

        }
0 Kudos
JenniferNery
Esri Regular Contributor
You can try the following, they share the same SpatialReference. You can simply toggle their visibility, in code-behind or use LegendControl: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#LegendWithTemplates
<esri:Map x:Name="MyMap"  Extent="-15000000,2000000,-7000000,8000000" >
 <bing:TileLayer ID="Bing.AerialWithLabels" LayerStyle="AerialWithLabels"  Visible="True" 
     ServerType="Production" 
     Token="{StaticResource MyBingKey}" />
 <esri:ArcGISTiledMapServiceLayer ID="Street Map" Visible="False" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
</esri:Map>
0 Kudos