开发者

Bing Maps v7 problem when within an AJAX panel

I have a weird problem with Bing Maps version 7.

I have a page that calls the map as a new html page via ajax which doesnt work! If I copy the markup from the page that gets returned using AJAX into a new dummy page and view that within a browser the map works..!?

Any ideas why this would be? Is there a particular way to use the map when calling it AJAX?

Many thanks as always, all the best,

JavaScript to call the map panel

function ShowMap(establishmentCode) {
    $("#Map").hide();
    var element = $("#viewMap" + establishmentCode);
    var url = Url.replace("Show", "GetHotelMap");
    var builder = new AjaxDataBuilder();
    builder.Add("establishmentCode", establishmentCode);

    var successCallback = func开发者_Python百科tion(html) {
    globalElement = element;
    globalHMTL = html;
    globalHotelName = establishmentCode;
    DisplayHotelMap();
}


var errorCallback = function() { alert("Error"); }
var timeoutInMilliseconds = 30000;

var command = new AjaxPostCommand
(
    url,
    builder,
    successCallback,
    errorCallback,
    timeoutInMilliseconds
);

CommandInvoker.getInstance().QueueCommand(command);

}


I suspect its because the code that tries to load the map is being called before you actually display the div that the map is trying to use? this certainly was a problem in similar situations with the v6.3 control

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜