BingMap地圖怎樣顯示中文
阿新 • • 發佈:2017-05-21
splay hand ani eight tro virt map false 英文
這是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地圖怎樣顯示中文