AnsweredAssumed Answered

Can't refresh the ServiceUri  property for extent using .Net SDK.

Question asked by kyjote on Sep 26, 2014
Latest reply on Oct 15, 2014 by JNery-esristaff

When I change the esri:ArcGISTiledMapServiceLayer.ServiceUri property in c# the extent that is current sticks.  Zooming in and out show the new ServiceUri property but zooming back to the initial extent will cause the ServiceUri to revert to its original setting.  I have looked into "refresh" and the like but no luck.  Please help.

 

public void SetMapType(object sender, RoutedEventArgs e)
        {
            Button test = (Button)sender;

            if(test.Name=="btnImage")
            {
                this.BaseMapName.ServiceUri = "http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer";
            }
            if (test.Name == "btnRoad")
            {
                this.BaseMapName.ServiceUri = "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer";
            }
            if (test.Name == "btnTopo")
            {
                this.BaseMapName.ServiceUri = "http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer";
            }

}

 

**********************************************

            <esri:Map x:Name="MyMap">

                    <esri:ArcGISTiledMapServiceLayer x:Name="BaseMapName" ID="BaseMap"

                        ServiceUri = "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer">                                         

                </esri:ArcGISTiledMapServiceLayer>

                <esri:Map.InitialExtent>

                    <esri:Envelope       XMin="-9556486"

                                         YMin="4312801"

                                         XMax="-9551302"

                                         YMax="4315166">                

                    </esri:Envelope>

                </esri:Map.InitialExtent>

            </esri:Map>

 

 

Outcomes