简体   繁体   English

为什么我的地图无法在IE8中使用?

[英]Why doesn't my map work in IE8?

I have developed a WebApp that functions in Chrome, FireFox, and newer IE. 我已经开发了可在Chrome,FireFox和更新的IE中运行的WebApp。 Most of the functionality is not working in IE8. 大部分功能在IE8中均不起作用。

A user inputs a Zip Code and the map zooms to the Zip Code, displays the associated delivery routes, and fills a table with required data from the route. 用户输入邮政编码,地图将缩放至邮政编码,显示关联的配送路线,并使用该路线中的所需数据填写表格。

In IE8, the map doesn't zoom to the extent of the route, nor does the table get filled. 在IE8中,地图不会缩放到路线范围,也不会填充表格。 Here is my code that should zoom to the features of the zip code: 这是我的代码,应该放大到邮政编码的功能:

function displayResults(results, messages) { var featureset = results[0].value; 函数displayResults(结果,消息){var featureset = results [0] .value;

var simplePolySymbol = new esri.symbol.SimpleFillSymbol();
simplePolySymbol.setOutline(new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0, 96, 170, .75]), 1));

dojo.forEach(featureset.features, function (feature) {
    feature.setSymbol(simplePolySymbol);

    resultsLayer.add(feature);
});

myMap.addLayer(resultsLayer);
myMap.Search.handleStats(results, messages);

var extent = esri.graphicsExtent(featureset.features);
myMap.setExtent(extent, true);
}

And here is my code which is supposed to populate a table with the route data: 这是我的代码,应该使用路由数据填充表:

myMap.Search = {
gpGetStats: new esri.tasks.Geoprocessor(gpURL),
getRouteStats: function () {
    console.log(dojo.byId('resultsLayer').value);
    var params = {
        "ZIP_CRID": dojo.byId('resultsLayer').value
    };
    resultsLayer.Search.gpGetStats.execute(params, resultsLayer.Search.handleStats);
},

handleStats: function (results, messages) {
    console.log(results);

    var content = '';

    content += '<table>';
    content += '<tr><td> ZIP CRID </td><td> Bus </td><td> Res </td><td> Tot </td><td> &lt;200 </td><td> DS Key </td></tr>';

    dojo.forEach(results[0].value.features, function (crid, i) {
        console.log(crid.attributes.ZIP_CRID + ', ');
        content += '<tr><td>' + crid.attributes.ZIP_CRID;
        content += '</td><td> ' + crid.attributes.BUS_CNT;
        content += '</td><td> ' + crid.attributes.RES_CNT;
        content += '</td><td> ' + crid.attributes.TOT_CNT;
        content += '</td><td> ' + crid.attributes.LT_200_IND;
        content += '</td><td> ' + crid.attributes.DS_KEY + '</td></tr>';
    });
    content += '</table>';
    dojo.byId('details').innerHTML = content;
},

Im pretty stuck, can't figure out what to fix. 我很困惑,不知道要解决什么。 Thanks for your help! 谢谢你的帮助!

Instead of using the dojo library to add the contents to your your html object with the Details ID you can do this yourself with something like: 不用使用dojo库通过Details ID将内容添加到您的html对象中,您可以自己执行以下操作:

var element=document.getElementById('details');
element.innerHTML = content

Check this site for more information and please note that the site shows that this is supported in IE http://www.w3schools.com/jsref/prop_html_innerhtml.asp 检查此网站以获取更多信息,请注意,该网站显示IE http://www.w3schools.com/jsref/prop_html_innerhtml.asp支持此功能

ArcGIS API for Javascript run at IE 8 and dojo run at IE 8 ArcGIS API for Javascript在IE 8上运行,而dojo在IE 8上运行

but there is a javascript code not run directly in IE 8 但有一个JavaScript代码未在IE 8中直接运行

as Chrome and firefox 作为Chrome和Firefox

you must write javascript code correctly to run at IE 8 您必须正确编写javascript代码才能在IE 8上运行

and IE 8 can`t run this code : 和IE 8无法运行此代码:

dojo.byId('details').innerHTML = content;

this link help you to write correct code to run at IE 8 此链接可帮助您编写正确的代码以在IE 8上运行

http://msdn.microsoft.com/en-us/library/ie/ms533897(v=vs.85).aspx http://msdn.microsoft.com/zh-cn/library/ie/ms533897(v=vs.85).aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM