BingMaps Silverlight 显示国内地图方法?

接分为押宝 2012-06-12 04:04:42
目前项目使用Silverlight 5

最终问题:telerik:RadMap控件只能显示上海,北京等,一线城市的街道主干道信息。

原因为:telerik:RadMap 使用微软Bing 地图 国外版

如何使 telerik:RadMap 使用微软Bing 地图 国内版

必须显示如重庆,宁波等城市主干道信息,悲剧ing。


目前问题:单独创建测试项目,使用BingMaps Silverlight添加2个.bll文件引用

出现地图为英文地图:http://cn.bing.com/maps/

如何出现中国地图如:http://cn.bing.com/ditu/
附上代码:

<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>



大牛帮忙。顶顶
...全文
416 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
这里有一个小工具。仅作技术人员研究使用。

http://demo.mapslight.com:60080/download/W2GBuddy.exe
接分为押宝 2012-06-26
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 的回复:]

这里有一个小工具。仅作技术人员研究使用。

http://demo.mapslight.com:60080/download/W2GBuddy.exe
[/Quote]
谢了,Google地图算了吧,中国政府说不好,一旦真被禁用中国市场,

程序就不好过了。
冬日萤火虫 2012-06-23
  • 打赏
  • 举报
回复
telerik:RadMap ,看来用telerik的人不少
abis 2012-06-21
  • 打赏
  • 举报
回复

谷歌道路
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);
}


下面这个网址上有例子
http://sl.abis.com.cn/setup.aspx
接分为押宝 2012-06-15
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 的回复:]

自己写一个。
[/Quote]

还真不会写. . .
接分为押宝 2012-06-14
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 的回复:]

引用 2 楼 的回复:

你代码的这段例子使用的也不是telerik:RadMap啊。telerik:RadMap支持
•Bing Maps
•OpenStreet Maps
•Empty Provider
Bing Maps到微软的网站申请就可以。如果企业级应用会收一部分费用。


是,telerik:RadMap 我只是做个例子,看看不使用telerik:RadMap,
……
[/Quote]
bing已能出现国内地图,

telerik:RadMap绑定还是没出现。


<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>


接分为押宝 2012-06-14
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]

你代码的这段例子使用的也不是telerik:RadMap啊。telerik:RadMap支持
•Bing Maps
•OpenStreet Maps
•Empty Provider
Bing Maps到微软的网站申请就可以。如果企业级应用会收一部分费用。
[/Quote]

是,telerik:RadMap 我只是做个例子,看看不使用telerik:RadMap,

Bing Maps能不能使用国内地图。
wwwljh 2012-06-14
  • 打赏
  • 举报
回复
你代码的这段例子使用的也不是telerik:RadMap啊。telerik:RadMap支持
•Bing Maps
•OpenStreet Maps
•Empty Provider
Bing Maps到微软的网站申请就可以。如果企业级应用会收一部分费用。
海涵德 2012-06-14
  • 打赏
  • 举报
回复
自己写一个。
  • 打赏
  • 举报
回复
找找使用谷歌地图的方法吧。见到bind map可以绕道走。
接分为押宝 2012-06-13
  • 打赏
  • 举报
回复

LZ一人,独领风骚,帮忙顶顶。分分都有. . .
适合人群:【学习前提】 1. 具备python3语言基础 【学习人群】 1. 手工测试人员学习UI自动化测试技能 2. 开发人员转岗测试开发岗位 3. 如具有丰富的自动化测经验,本课程可能并不满足你学习计划:1.下载课程中配套的软件资料 2.结合课件中Demo可完成学习任务课程目标:掌握UI自动化测试框架的设计与实现课程简介:UI自动化框架的设计需储备基础知识,方能完成自动化测试框架的实现,如数据驱动、日志、配置文件等AutoUiTestFrame自动化框架的目录结构初步进行规划,目录结构如下:Config 配置文件的目录v  config.ini 配置文件;v  globalconfig.py 获得日志路径、测试用例路径、测试报告路径、测试数据路径;v  Data 测试数据;v  TestData.xlsx 测试数据。Public 公共文件库v  Common 封装的公共的方法n  Commonconfig.py 公共的参数配置:调试过程中的测试数据等;n  DoExcel.py 操作excel(数据驱动);n  Send_mail.py 发送邮件(html);n  ReadConfigIni.py 读取ini格式的配置文件;n  TestCaseInfo.py  测试用例信息;n  Log.py 日志类。设置日志类,其他模块或文件需要日志类时,调用该文件。v  Pages 使用po模式设计的测试页面n  BasePage.py  基类,对一些测试页面公共方法、属性的封装及webdrive一些方法的二次封装;n  Bing.py 测试页面。Report 测试报告v  Log 日志目录n  *****log日志。v  TestReport 测试报告目录n  ***html测试报告。TestCase 测试用例v  TC_bing.py。Run.py  控制测试用例的运行。

8,734

社区成员

发帖
与我相关
我的任务
社区描述
WPF/Silverlight相关讨论
社区管理员
  • WPF/Silverlight社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧