Dido_kz

not displayed (

Discussion created by Dido_kz on Dec 23, 2012
Latest reply on Jan 4, 2013 by dbroux-esristaff
Where did I go wrong?
   [PHP]private void RadioButton_Click(object sender, RoutedEventArgs e)
        {
            MyMap.Layers.Clear();
            ArcGISTiledMapServiceLayer arcgisLayer = new ArcGISTiledMapServiceLayer();
            Envelope env = new Envelope();
            switch (((RadioButton)e.OriginalSource).Name)
            {
                case "Layer1":
                    arcgisLayer.InitializationFailed += Layer_InitializationFailed;
                    arcgisLayer.Url = "http://myserver/arcgis/rest/services/kz28/MapServer";
                    arcgisLayer.Initialize();
                    env = new Envelope(-1176967.4359368654, 4452540.931675468, 1966840.1233924914, 6252256.853320533);
                    env.SpatialReference = new SpatialReference(32642);
                    MyMap.Extent = env;
                    MyMap.Layers.Add(arcgisLayer);
                break;
                case "OpenStreesMap":
                    OpenStreetMapLayer osmLayer =new OpenStreetMapLayer();
                    osmLayer.InitializationFailed += Layer_InitializationFailed;
                    string layerTypeTag = ((RadioButton)e.OriginalSource).Tag as string;
                    osmLayer.Style = OpenStreetMapLayer.MapStyle.Mapnik ;
                    osmLayer.Initialize();

                break;
                case "Layer3":
                    arcgisLayer.Url ="http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer";
                    arcgisLayer.InitializationFailed += Layer_InitializationFailed;
                    env = new Envelope(-20037507.2295943, -19971868.8804086, 20037507.2295943, 19971868.8804086);
                    env.SpatialReference = new SpatialReference(102100);
                    MyMap.Extent = env;
                    MyMap.Layers.Add(arcgisLayer);
                break;
            }  
           
        }[/PHP]

Outcomes