码迷,mamicode.com
首页 > 其他好文 > 详细

BingMap地图怎样显示中文

时间:2017-05-21 17:54:33      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:run   int   push   enable   net   selector   tar   data-   mkt   

这是bingMap的js引用

<script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&mkt=zh-cn"></script>

mkt=en-us:英文显示【默认选项】

mkt=zh-cn:中文显示

在BingMap的官网地图上我还真没有找到设置显示中文的选项。

 

Test code:

Html:

<form id="form1" runat="server">
    <div id="divMap">
    
    </div>
    </form>

Js:

<script type="text/javascript">
	var map = null;
	var bingMapKey = "AvHCAx5M3rKrzF-3b_DpRotDCe5Bs53FsqmGhg6i4t0ISDPjadyZsCke61VGacfd";
	var infobox = null;

	$(document).ready(function ()
	{
		var mapOptions = {
			credentials: bingMapKey,
			enableClickableLogo: false,
			enableSearchLogo: false,
			showMapTypeSelector: true,
			showCopyright: false,
			mapTypeId: Microsoft.Maps.MapTypeId.road,
			//zoom: 10,
			//animate:false
			useInertia:false
		};
		map = new Microsoft.Maps.Map($(‘#divMap‘)[0], mapOptions);

		var pushpin = new Microsoft.Maps.Pushpin(new Microsoft.Maps.Location(41, -72));
		// Add a handler to the pushpin drag
		Microsoft.Maps.Events.addHandler(pushpin, ‘click‘, DisplayLoc);
		map.entities.push(pushpin);

		//Infobox
		var infoboxOptions = {
			width: 300,
			height: 100,
			title: "Title1",
			description: "Description1",
			animate: false,
			showPointer: false
		};
		infobox = new Microsoft.Maps.Infobox(pushpin, infoboxOptions);
		map.entities.push(infobox);

		var _chartLayer = new Microsoft.Maps.EntityCollection();
		map.entities.push(_chartLayer);

	})
</script>



 

BingMap地图怎样显示中文

标签:run   int   push   enable   net   selector   tar   data-   mkt   

原文地址:http://www.cnblogs.com/wzzkaifa/p/6885348.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!