Original: ArcGIS API for Silverlight loading Google Maps
Using system;using system.net;using system.windows;using system.windows.controls;using System.Windows.Documents; Using system.windows.ink;using system.windows.input;using system.windows.media;using system.windows.media.animation;using system.windows.shapes;namespace syit.commonclass{public static class Colorrevert {#region Color conversion public static color Tocolor (This string colorname) {if (col Orname.startswith ("#")) ColorName = Colorname.replace ("#", String. Empty); int v = Int. Parse (ColorName, System.Globalization.NumberStyles.HexNumber); return new Color () {A = Convert.tobyte ((v >>) & 255), R = convert.t Obyte ((v >>) & 255), G = Convert.tobyte ((v >> 8) & 255), B = Convert. ToByte ((v >> 0) & 255)}; public static int ToArgb (this color color) {int ARGB = ColoR.A << 24; ARGB + = color. R << 16; ARGB + = color. G << 8; ARGB + = color. B return ARGB; } #endregion}}
private void Btography_mouseleftbuttondown (object sender, System.Windows.Input.MouseButtonEventArgs e) { E.handled = true; private void Btography_mouseleftbuttonup (object sender, System.Windows.Input.MouseButtonEventArgs e) { Set the background color This.rect1.Stroke = new SolidColorBrush (Colorrevert.tocolor ("#FFF29536")); This.rect2.Stroke = new SolidColorBrush (Colorrevert.tocolor ("#FF7392BD")); This.rect3.Stroke = new SolidColorBrush (Colorrevert.tocolor ("#FF7392BD")); Setselectedlineargradientbrush (RECT1); Setunselectedlineargradientbrush (RECT2); Setunselectedlineargradientbrush (RECT3); Set the map to show and hide topographylayer.visible = true; Google topographic map roadlayer.visible = false; Google Traffic Map sateliatelayer.visible = false; Google Satellite Graph sateliatetextlayer.visible = false; Google satellite map text} private void Broad_mouseleftbuttondown (oBject sender, System.Windows.Input.MouseButtonEventArgs e) {e.handled = true; private void Broad_mouseleftbuttonup (object sender, System.Windows.Input.MouseButtonEventArgs e) { Set the background color This.rect1.Stroke = new SolidColorBrush (Colorrevert.tocolor ("#FF7392BD")); This.rect2.Stroke = new SolidColorBrush (Colorrevert.tocolor ("#FFF29536")); This.rect3.Stroke = new SolidColorBrush (Colorrevert.tocolor ("#FF7392BD")); Setunselectedlineargradientbrush (RECT1); Setselectedlineargradientbrush (RECT2); Setunselectedlineargradientbrush (RECT3); Set the map display and hide topographylayer.visible = false; Google topographic map roadlayer.visible = true; Google Traffic Map sateliatelayer.visible = false; Google Satellite Graph sateliatetextlayer.visible = false; Google satellite map text} private void Bsateliate_mouseleftbuttondown (object sender, System.Windows.Input.MouseButtOneventargs e) {e.handled = true; private void Bsateliate_mouseleftbuttonup (object sender, System.Windows.Input.MouseButtonEventArgs e) { Set the background color This.rect1.Stroke = new SolidColorBrush (Colorrevert.tocolor ("#FF7392BD")); This.rect2.Stroke = new SolidColorBrush (Colorrevert.tocolor ("#FF7392BD")); This.rect3.Stroke = new SolidColorBrush (Colorrevert.tocolor ("#FFF29536")); Setunselectedlineargradientbrush (RECT1); Setunselectedlineargradientbrush (RECT2); Setselectedlineargradientbrush (RECT3); Set the map display and hide topographylayer.visible = false; Google topographic map roadlayer.visible = false; Google Traffic Map sateliatelayer.visible = true; Google Satellite map sateliatetextlayer.visible = true; Google satellite Chart text}//check state public void Setselectedlineargradientbrush (Rectangle rect) { Sets the stroke value of rect. Stroke = New SolidColorBrush (Colorrevert.tocolor ("#FFF29536")); Set the gradient color gradientstop GS = new GradientStop (); Gs. Offset = 0.0; Gs. Color = Colorrevert.tocolor ("#FFFDF6DF"); GradientStop GS1 = new GradientStop (); GS1. Offset = 1.0; GS1. Color = Colors.white; GradientStop GS2 = new GradientStop (); Gs2. Offset = 0.5; Gs2. Color = Colorrevert.tocolor ("#FFF9E8B2"); GradientStop GS3 = new GradientStop (); Gs3. Offset = 0.5; Gs3. Color = Colorrevert.tocolor ("#FFFFD75D"); LinearGradientBrush LGB = new LinearGradientBrush (); Lgb. StartPoint = new Point (0.5, 0); Lgb. EndPoint = new Point (0.5, 1); Lgb. Gradientstops.add (GS); Lgb. Gradientstops.add (GS1); Lgb. Gradientstops.add (GS2); Lgb. Gradientstops.add (GS3); Rect. Fill = LGB; }//unchecked state public void SetunselectedlineargraDientbrush (Rectangle rect) {//Set stroke value rect. Stroke = new SolidColorBrush (Colorrevert.tocolor ("#FF7392BD")); Set the gradient color gradientstop GS = new GradientStop (); Gs. Offset = 0.0; Gs. Color = Colorrevert.tocolor ("#FFF5F6FB"); GradientStop GS1 = new GradientStop (); GS1. Offset = 1.0; GS1. Color = Colorrevert.tocolor ("#FFE6EDFC"); GradientStop GS2 = new GradientStop (); Gs2. Offset = 0.5; Gs2. Color = Colorrevert.tocolor ("#FFE6EBF5"); GradientStop GS3 = new GradientStop (); Gs3. Offset = 0.5; Gs3. Color = Colorrevert.tocolor ("#FFD7E3F7"); LinearGradientBrush LGB = new LinearGradientBrush (); Lgb. StartPoint = new Point (0.5, 0); Lgb. EndPoint = new Point (0.5, 1); Lgb. Gradientstops.add (GS); Lgb. Gradientstops.add (GS1); Lgb. Gradientstops.add (GS2); Lgb. GradientStops.ADD (GS3); Rect. Fill = LGB; }
<border horizontalalignment= "left" margin= "50,5,0,0" width= "borderthickness=" 1 "cornerradius=" 5 " Verticalalignment= "Top" > <Border.Effect> <dropshadoweffect direction= " -90" color= "#F F4d4d4d "shadowdepth=" 4 "/> </Border.Effect> <Border.Background> <li Neargradientbrush endpoint= "0.5,1" startpoint= "0.5,0" > <gradientstop color= "#FFDDF1FD" offset= "0" /> <gradientstop color= "#FFCAE9FC" offset= "1"/> </LinearGradientBrush> </Border.Background> <grid horizontalalignment= "left" width= "229" > <bord Er x:name= "btography" horizontalalignment= "left" margin= "16,4,0,4" width= "mouseleftbuttondown=" Btography_ MouseLeftButtonDown "mouseleftbuttonup=" Btography_mouseleftbuttonup "> <Grid> <rectangle stroke= "#FFF29536" radiusx= "1" Radiusy= "1" x:name = "rect1" > <Rectangle.Fill> <lineargr Adientbrush endpoint= "0.5,1" startpoint= "0.5,0" > <gradientstop color= "#FFFDF6DF" offset= "0"/> <gradientstop color= "White" offset= "1"/> <gradientstop color= "#FFF9E8B2" offset= "0.5"/> <gradientstop color= "#FFFFD75D" offset= "0.5"/> </LinearGradientBrush> </ rectangle.fill> </Rectangle> <textblock margin= "16,6,13,2" textw rapping= "Wrap" text= "terrain" foreground= "#FF0B333C" fontweight= "Bold" fontsize= "14.667" fontfamily= "SimSun"/> </Grid> </Border> <border x:name= "broad" margin= "84,4,81,4" MOUSELEFTBU Ttondown= "Broad_mouselefTbuttondown "mouseleftbuttonup=" Broad_mouseleftbuttonup "> <Grid> <re Ctangle stroke= "#FF7392BD" radiusx= "1" radiusy= "1" x:name = "Rect2" > <Rectangle.Fill> <lineargradientbrush endpoint= "0.5,1" startpoint= "0.5,0" > <gradientstop color= "#FFF5F6FB" offset= "0"/> <gradientstop color= "#FFE6 EDFC "offset=" 1 "/> <gradientstop color=" #FFE6EBF5 "offset=" 0.5 "/> <gradientstop color= "#FFD7E3F7" offset= "0.5"/> </lineargrad Ientbrush> </Rectangle.Fill> </Rectangle> <textblock margin= "17,6,11,2" textwrapping= "Wrap" text= "Street" foreground= "#FF0B333C" fontweight= "Bold" fontsize= " 14.667 "fontfamily=" SimSUn "/> </Grid> </Border> <border x:name=" Bsateliate "Hor Izontalalignment= "Right" margin= "0,4,14,4" width= "Up" mouseleftbuttondown= "Bsateliate_mouseleftbuttondown" mouseleftbuttonup= "Bsateliate_mouseleftbuttonup" > <Grid> <rectangle Stroke= "#FF7392BD" radiusx= "1" radiusy= "1" x:name = "Rect3" > <Rectangle.Fill> <lineargradientbrush endpoint= "0.5,1" startpoint= "0.5,0" > & Lt GradientStop color= "#FFF5F6FB" offset= "0"/> <gradientstop color= "#FFE6EDFC" OFFSE t= "1"/> <gradientstop color= "#FFE6EBF5" offset= "0.5"/> <gradientstop color= "#FFD7E3F7" offset= "0.5"/> </LINEARGRADIENTBRUSH&G T </rEctangle. fill> </Rectangle> <textblock margin= "18,6,12,2" textwrapping= "W Rap "text=" image "Foreground=" #FF0B333C "fontweight=" Bold "fontsize=" 14.667 "fontfamily=" SimSun "/> < /grid> </Border> </Grid> </Border>
ArcGIS API for Silverlight loading Google Maps