IE 7/8上的Esri bootstrap-map-js和无效参数错误

时间:2014-03-16 04:46:27

标签: internet-explorer-7 arcgis arcgis-js-api dojo

我正在使用这个名为bootstrap-map-js的精彩项目。

  

使用ArcGIS构建响应式地图应用程序的简单框架   和Bootstrap。

由于Esri ArcGIS JavaScript API声明他们support IE7+我认为这个惊人的bootstrap-map-js项目也会与IE 7兼容。也许是这样,问题出现在我的代码中......

我在Invalid Argument文档模式下模拟页面时,在IE 11 Developer Tools控制台窗口中没有进一步信息时出现IE 7/8错误。 IE 9以后效果很好。所有其他浏览器也很棒! :)只有挑剔的IE拒绝一如既往地工作......

enter image description here

看起来dojo.require在某处咆哮。请参阅此相关问题:Dojo nested requires on IE7 and IE8 causes Invalid Argument Exception

如果删除对bootstrapmap.jsvar map = ...声明的引用,则代码可以正常工作,我会看到hey Leniel!,否则代码会中断,我会看到Invalid argument。代码在调用BootstrapMap.create

时中断

任何人都可以了解 挑剔 IE的内容吗?我有什么办法可以从错误中看到更多内容吗?正如您在图片中看到的那样,没有消息,描述等:(

这是我必须组装的最小代码才能找到导致错误的原因:

<!-- ArcGIS JavaScript API v3.8 -->
<script type="text/javascript" src="http://localhost/arcgis_js_api/library/3.8/3.8/init.js"></script>

<script type="text/javascript">

function init()
{
    require([
        "esri/map",
        "/myproject/Scripts/bootstrapmap.js",
        "esri/layers/FeatureLayer"
    ], function(
        Map,
        BootstrapMap,
        FeatureLayer
    )
    {

        // Get a reference to the ArcGIS Map class
        var map = BootstrapMap.create("mapDiv", {
            basemap: "oceans",
            center: [-117.789, 33.543],
            zoom: 12
        });

        alert('hey Leniel!');

    });
}

dojo.addOnLoad(init);

</script>

我在这个问题上取得了一些进展,因为你可以阅读here

我阅读了Configuring Dojo with dojoConfig,然后在ArcGIS JS API脚本标记之前添加了此内容:

<!-- set Dojo configuration, load Dojo -->
<script>
    dojoConfig = {
        has: {
            "dojo-firebug": true
        },
        parseOnLoad: true,
        async: true
    };
</script>

现在,我得到了更具描述性的错误,而不仅仅是Invalid argumentIE Dev Tools显示了这一点:

SCRIPT87: Invalid argument.
File: init.js, Line: 136, Column: 65

当我点击136提供的链接时,这是[{1}}中的init.js行:

IE Dev Tools

enter image description here

b;b=d[b]?"cssFloat"in f.style?"cssFloat":"styleFloat":b;if(3==k)return q?g(f,e):f.style[b]=e;for(var r in b)l.set(a,r,b[r]);return l.getComputedStyle(f)};return l})},"dojo/dom-geometry":function(){define(["./sniff","./_base/window","./dom","./dom-style"],function(b,n,k,m){function l(a,b,d,c,h,f){f=f||"px";a=a.style;isNaN(b)||(a.left=b+f);isNaN(d)||(a.top=d+f);0<=c&&(a.width=c+f);0<=h&&(a.height=h+f)}function r(a){return"button"==a.tagName.toLowerCase()||"input"==a.tagName.toLowerCase()&&"button"== 对于IE 7/8进行的一些疯狂CSS操纵感到咆哮。

1 个答案:

答案 0 :(得分:0)

修正了连接点......

搜索NaNpx e的价值,因为我之前从未见过。找到了这个jQuery ticket

遵循那里给出的建议并更改了行return中的136

从:

return q?g(f,e):f.style[b]=e;

为:

return q?g(f,e):f.style[b]=(e=='NaNpx'?'0px':e);

注意:我使用的jQuery 1.11.0 supports IE 7