admin管理员组文章数量:1306663
I am facing major problem with Bing Maps. I am using : .ashx?v=6.3
First I am getting error in firebug as :
this.CreditsFor=function(a,i,j,h)
{
var e=[];
if(a!="undefined"&&a!=null&&typeof m_tableKeys[a]!="undefined"&&
........
MVC_Init_FlatlandView_Drawing();
MVC_Init_View3D_Drawing()};
if(typeof closeDependency!="undefined")
closeDependency("mapcontrol.js")
After that I put the .LoadMap() call inside try-catch block. it was throwing exception:
p_elSource.attachEvent is not a function
I already tried out following solutions whihc were remended in msdn forums:
- Setting defualt value for VEMapOptions.BirdseyeOrientation before calling LoadMap()
- Ensured that DOCTYPE is there
This happens only when firebug is enabled.
I am facing major problem with Bing Maps. I am using : http://dev.virtualearth/mapcontrol/mapcontrol.ashx?v=6.3
First I am getting error in firebug as :
this.CreditsFor=function(a,i,j,h)
{
var e=[];
if(a!="undefined"&&a!=null&&typeof m_tableKeys[a]!="undefined"&&
........
MVC_Init_FlatlandView_Drawing();
MVC_Init_View3D_Drawing()};
if(typeof closeDependency!="undefined")
closeDependency("mapcontrol.js")
After that I put the .LoadMap() call inside try-catch block. it was throwing exception:
p_elSource.attachEvent is not a function
I already tried out following solutions whihc were remended in msdn forums:
- Setting defualt value for VEMapOptions.BirdseyeOrientation before calling LoadMap()
- Ensured that DOCTYPE is there
This happens only when firebug is enabled.
Share Improve this question edited Apr 13, 2011 at 4:59 Sai Kalyan Kumar Akshinthala 11.8k8 gold badges45 silver badges68 bronze badges asked Apr 6, 2011 at 12:31 ZeNoZeNo 1,6582 gold badges16 silver badges28 bronze badges 1- Does anybody else has ever faced similar issue.. or I am the only one out here facing this issue?? – ZeNo Commented Apr 8, 2011 at 7:27
1 Answer
Reset to default 10Zeno,
Are you using FF4? I had the problem in FF4, and it was caused by a race condition where my script was calling VE functions that hadn't been defined yet. I got a solution here.
In particular, note the answer from Josh Unger where he describes using setInterval to wait for an auxiliary library to load and do it's thing.
var interval = setInterval(function() {
if (eval("typeof VEMap") != "undefined" &&
document.getElementById("map").attachEvent != undefined)
{
clearInterval(interval);
LoadMap();
}
}, 10);
You'll have to update the sample code to fit your circumstances. The important part is to avoid calling anything in VE until you are sure that the VE script has loaded and the auxiliary library has loaded.
People using FF4 reported the problem to me recently. I suspect that something about FF4 pared to FF3 (perhaps faster script execution, or a difference in when scripts execute) has triggered the error. In any case, when I updated my code to delay calling VE until the libs were loaded, the error went away and the maps worked properly.
Note that I am not doing lazy loading, and Firebug is not the issue. Those were evidently factors when the thread was active in 2008/2009.
本文标签: javascriptIssue with Bing Map pelSourceattachEvent is not a functionStack Overflow
版权声明:本文标题:javascript - Issue with Bing Map --p_elSource.attachEvent is not a function - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741820546a2399339.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论