8,734
社区成员
发帖
与我相关
我的任务
分享
<UserControl x:Class="bingMap.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:m="clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="1400">
<Grid x:Name="LayoutRoot" Background="White">
<m:Map CredentialsProvider="Key" Width="1400" Height="800"
NavigationVisibility="Collapsed" Mode="Road" ZoomLevel="8" Center="30.5213, 121.3300" Name="map">
</m:Map>
</Grid>
</UserControl>
谷歌道路
public GoogleRoadTileSource() : base("http://mt{0}.google.com/vt/lyrs=m@104&hl=zh-CN&x={1}&y={2}&z={3}&s=Ga") { }
public override Uri GetUri(int x, int y, int zoomLevel)
{
string str = "Galileo";
int length = new Random().Next(str.Length);
str = str.Substring(0, length);
return new Uri(string.Format(base.UriFormat, new object[] { x % 4, x, y, zoomLevel, str }));
}
谷歌卫星
private const string url = "http://mt{0}.google.com/vt/lyrs=s@113&hl=zh-CN&gl=cn&src=app&x={1}&y={2}&z={3}&s=Ga";
public GoogleAreaTitleSource() : base(url) { }
public override Uri GetUri(int x, int y, int zoomLevel)
{
return new Uri(string.Format(base.UriFormat, new object[] { x % 4, x, y, zoomLevel }));
}
bingmaps中文
public override Uri GetUri(int x, int y, int zoomLevel)
{
string quadkey = new QuadKey(x, y, zoomLevel).Key;
string uri = "http://r3.tiles.ditu.live.com/tiles/r"
+ quadkey + ".png?g=47";
return new Uri(uri);
}
<UserControl xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="mySilverlight.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
<telerik:RadMap Center="29.5213, 121.3300" GeoBoundsNW="42.222637, 96.41695" GeoBoundsSE="18.156115, 130.593246" ZoomBarPresetsVisibility="Collapsed" CommandBarVisibility="Collapsed" ZoomBarVisibility="Collapsed" NavigationVisibility="Collapsed" x:Name="RadMap1" MouseClickMode="None" MaxZoomLevel="19" MinZoomLevel="5" ZoomLevel="14">
<telerik:RadMap.Providers>
<telerik:OpenStreetMapProvider />
<telerik:BingMapProvider ApplicationId="Key..." Mode="Road" IsLabelVisible="True"/>
</telerik:RadMap.Providers>
<telerik:InformationLayer x:Name="informationLayer">
<telerik:InformationLayer.Colorizer>
<telerik:ColorMeasureScale ExtendedPropertyName="status" MinValue="1" MaxValue="12" Mode="RangesPredefinedColors">
<telerik:ColorMeasureScale.ShapeFillCollection>
<telerik:MapShapeFill Fill="Green" Stroke="White" StrokeThickness="2" />
<telerik:MapShapeFill Fill="Green" Stroke="White" StrokeThickness="2" />
</telerik:ColorMeasureScale.ShapeFillCollection>
<telerik:ColorMeasureScale.RangeCollection>
<telerik:MapRange MinValue="1" MaxValue="1">
<telerik:MapRange.ShapeFill>
<telerik:MapShapeFill Fill="#4EEA4E" />
</telerik:MapRange.ShapeFill>
</telerik:MapRange>
<telerik:MapRange MinValue="2" MaxValue="2">
<telerik:MapRange.ShapeFill>
<telerik:MapShapeFill Fill="#FFFF93" />
</telerik:MapRange.ShapeFill>
</telerik:MapRange>
<telerik:MapRange MinValue="3" MaxValue="3">
<telerik:MapRange.ShapeFill>
<telerik:MapShapeFill Fill="#00FFFF" />
</telerik:MapRange.ShapeFill>
</telerik:MapRange>
<telerik:MapRange MinValue="4" MaxValue="4">
<telerik:MapRange.ShapeFill>
<telerik:MapShapeFill Fill="#000000" />
</telerik:MapRange.ShapeFill>
</telerik:MapRange>
<telerik:MapRange MinValue="5" MaxValue="5">
<telerik:MapRange.ShapeFill>
<telerik:MapShapeFill Stroke="#4EEA4E" StrokeThickness="4"/>
</telerik:MapRange.ShapeFill>
</telerik:MapRange>
<telerik:MapRange MinValue="6" MaxValue="6">
<telerik:MapRange.ShapeFill>
<telerik:MapShapeFill Stroke="#FFFF93" StrokeThickness="4"/>
</telerik:MapRange.ShapeFill>
</telerik:MapRange>
<telerik:MapRange MinValue="7" MaxValue="7">
<telerik:MapRange.ShapeFill>
<telerik:MapShapeFill Stroke="#00FFFF" StrokeThickness="4"/>
</telerik:MapRange.ShapeFill>
</telerik:MapRange>
<telerik:MapRange MinValue="8" MaxValue="8">
<telerik:MapRange.ShapeFill>
<telerik:MapShapeFill Stroke="#000000" StrokeThickness="4"/>
</telerik:MapRange.ShapeFill>
</telerik:MapRange>
</telerik:ColorMeasureScale.RangeCollection>
</telerik:ColorMeasureScale>
</telerik:InformationLayer.Colorizer>
</telerik:InformationLayer>
</telerik:RadMap>
</Grid>
</UserControl>