必应地图-如何在鸟瞰图中关闭街道标签? [英] Bing maps - how can I turn off street labels in Bird's Eye view?

查看:124
本文介绍了必应地图-如何在鸟瞰图中关闭街道标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于一个客户,我需要在鸟瞰视图中显示静态的必应地图,并关闭街道标签.我只需单击鸟瞰图的工具栏按钮并关闭标签,即可完成对 dynamic 视图没有标签的鸟瞰图.但是我的目标是在加载时为静态映射显示此图像,而无需单击任何按钮.

谢谢!

解决方案

我将所有内容放入<body>中以进行演示.您可能已将外部mapcontrol库的加载和GetMap()函数放入<head>中.您甚至可能希望将自己的脚本放入外部文件中.

<body onload="GetMap();">
<div id='myMap' style="position:relative; width:400px; height:400px;"></div>
<script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2"></script>
<script type="text/javascript">
var map = null;

function GetMap() {
    map = new VEMap('myMap');
    map.LoadMap(new VELatLong(47.6, -122.33), 10, VEMapStyle.Birdseye, false);
}   
</script>
</body>

VEMap.LoadMap( VELatLong zoom 样式固定模式 showSwitch tileBuffer mapOptions )是:

VELatLong 一个VELatLong类对象,它表示地图的中心.可选.

缩放要显示的缩放级别.有效值的范围是1到19.可选.默认值为4.请注意, VEMapStyle.Birdseye 似乎仅支持两个缩放级别:1为您提供宽视角,其他任何东西都为特写视角.

style 一个VEMapStyle枚举值,指定地图样式.选修的.默认值为VEMapStyle.Road. 我将其更改为 VEMapStyle.Birdseye ,如 Bing Maps Interactive SDK 是一个很好的资源,可用于试图弄清楚事情如何工作以及必应地图控件类参考文档整个API.

For a client I need to show a static Bing map, in Bird's Eye view, with the street labels turned off. I can accomplish Bird's Eye view with no labels for dynamic view by just clicking the toolbar buttons for Bird's Eye view and labels off. But my goal is to show this for a static map, on load, without the need to click any buttons.

Thank you!

解决方案

I'm putting everything in the <body> for demonstration purposes. You'd probably put the loading of the external mapcontrol library and your GetMap() function in the <head>. You might even want to put your own script in an external file.

<body onload="GetMap();">
<div id='myMap' style="position:relative; width:400px; height:400px;"></div>
<script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2"></script>
<script type="text/javascript">
var map = null;

function GetMap() {
    map = new VEMap('myMap');
    map.LoadMap(new VELatLong(47.6, -122.33), 10, VEMapStyle.Birdseye, false);
}   
</script>
</body>

The parameters for VEMap.LoadMap(VELatLong, zoom, style, fixed, mode, showSwitch, tileBuffer, mapOptions) are:

VELatLong A VELatLong Class object that represents the center of the map. Optional.

zoom The zoom level to display. Valid values range from 1 through 19. Optional. Default is 4. Note that VEMapStyle.Birdseye seems to only support two zoom levels: 1 gives you the wide view, anything else gives you the close-up view.

style A VEMapStyle Enumeration value specifying the map style. Optional. Default is VEMapStyle.Road. I changed this to VEMapStyle.Birdseye as documented at VEMapStyle.

fixed A Boolean value that specifies whether the map view is displayed as a fixed map that the user cannot change. Optional. Default is false.

mode A VEMapMode Enumeration value that specifies whether to load the map in 2D or 3D mode. Optional. Default is VEMapMode.Mode2D.

showSwitch A Boolean value that specifies whether to show the map mode switch on the dashboard control. Optional. Default is true (the switch is displayed).

tileBuffer How much tile buffer to use when loading map. Default is 0 (do not load an extra boundary of tiles). This parameter is ignored in 3D mode.

mapOptions A VEMapOptions Class that specifies other map options to set.


Lastly, the Bing Maps Interactive SDK is a great resource for playing around and trying to figure out how things work and the Bing Map Control Class Reference documents the entire API.

这篇关于必应地图-如何在鸟瞰图中关闭街道标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆