更改Bing Map上的初始可见位置

时间:2016-04-15 10:45:16

标签: javascript bing

如何在第一次加载Bing地图时更改可见的初始位置? 默认情况下,我看到它设置为美国(见图),我想将它设置为东欧(罗马尼亚)。

enter image description here

这是加载地图的代码:

var map = null;
var points = [];
var shapes = [];
var center = null;

function LoadMap(latitude, longitude, onMapLoaded) {
    map = new VEMap('theMap');
    options = new VEMapOptions();
    options.EnableBirdseye = false;

    // Makes the control bar less obtrusize.
    map.SetDashboardSize(VEDashboardSize.Small);

    if (onMapLoaded != null)
        map.onLoadMap = onMapLoaded;

    if (latitude != null && longitude != null) {
        center = new VELatLong(latitude, longitude);
    }

    map.LoadMap(center, null, null, null, null, null, null, options);
}

1 个答案:

答案 0 :(得分:0)

通过添加else条件来解决此问题:

else {
    center = new VELatLong(45.747806, 24.617061);
}