0

Find() 関数で番地を渡して Bing Maps を実装しようとしています。Zoom パラメーターが LoadMap() 関数で機能していません。これが私のコードです:

var map;

function GetMap() {
    var street = "Street address";
    var city = "City";
    var state = "State";
    var address = "";
    var zoom = 10;
    if (street != "") {
        address += street;
        zoom = 19;
    }
    if (city != "") {
        if (address != "")
            address += ", ";
        address += city;
    }
    if (state != "") {
        if (address != "")
            address += ", ";
        address += state;
    }

    map = new VEMap('bingMap');
    map.LoadMap(null, zoom, VEMapStyle.Hybrid, false, VEMapMode.Mode2D, true, 1);
    map.Find(null, address, null, null, null, null, null, null, null, null, FindCallback);
}

function FindCallback(layer, resultsArray) {
    var pin = new VEShape(VEShapeType.Pushpin, map.GetCenter());
    pin.SetCustomIcon("<img src='image url' width='30' />");
    map.AddShape(pin);
}

これが19にズームしない理由はありますか?

4

1 に答える 1

0

それ以外の map.LoadMap(null,

試す

map.LoadMap(map.GetCenter()またmap.LoadMap(new VELatLong(45,90)

または

map.SetCenterAndZoom((new VELatLong(lat, lng), zoom);

于 2012-04-10T18:55:37.243 に答える