0

我认为这个问题与/或原始Javascript和JQuery有关..但我认为它也与ArcGIS Javascript API地图类有关..我的问题是IE9问题;该应用程序在 Chrome 和 FF 中运行良好。(我也在 E​​SRIs JS 论坛上问过这个问题,但到目前为止没有答案......)

我有一个网络应用程序,其中地图在地图单击时在其自己的 div 中打开(不使用 window.open 或 iframes)。第一次加载应用程序后,底图按预期打开(起初地图只是没有其他图层的底图)......但是当我关闭地图div,然后再次打开它时,底图出现了大约1第二,然后消失......但背景颜色和缩放按钮仍然存在......

地图是这样以 HTML 格式设置的:

            <div class="map-content">
        <div class="map-close" style="display: none;"><a href="#">Close</a>      </div><!--buttons--->
        <div class="map-fullscreen" style="display: none;"><a href="#">Fullscreen</a></div>
        <div style='width:100%;  height:100%'><object type="text/html" name ="mapPage" style='width:100%;         
                       height:100%' data='mapPage.html'>

            </object></div>
    </div>

在 init JS 中,底图被添加为 TiledMapServiceLayer。

..没有更多的代码!正如我所说,所有这些都在 FF 和 Chrome 中正常工作.....

我已经尝试过我遇到的 HTML 中的每个 IE 标签或条件,但没有一个能解决这个问题......我有 meta http-equiv="X-UA-Compatible" content="IE=7,IE=9 " /> 在标题和脚本中 type="text/javascript" src="JavaScript/modernizr-2.5.3.js">

也在里面......

我的主索引页面中也有这些标签:

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"><![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-  ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><html class="no-js"><![endif]-->

(*ps 我也在使用 Jquery Mobile ......)

这是打开地图的按钮的 JS(主要是很多调整大小的东西:)

     mapTrigger.click(function(){

    $FirstConstrainerWidth = $('.firstConstrainer').outerWidth();

    console.log("locsizeConstWidth: " + $SizeConstrainerWidth + "  locfirstConstrainer: " + $FirstConstrainerWidth);

    if  ($SizeConstrainerWidth > $FirstConstrainerWidth)
    {
        $SizeConstrainerWidth=$FirstConstrainerWidth;
    }
    // scroll to top to make sure header is visible
    $('html, body').animate({scrollTop:0}, 'fast');
    //animate the containers height to the height of the slideshow

        mapContainer.animate({

            "height" : $('#sizeConstrainer').outerHeight() - $('#bg').outerHeight() - $('#footer').outerHeight(), // TODO:adjust the height of the map on window resize
            "width" : $SizeConstrainerWidth,
            "top" : $('#bg').outerHeight(),
            "left" : $SizeConstrainerLeft,
            "bottom" : $('#footer').outerHeight()
        }, 300, function() {
            // When the animation is complete
            // hide the loading indicator
            // Fade in the controls

            $(".map-close, .map-fullscreen").fadeIn("slow");

        });


});

我通过点击关闭地图的功能与此比较相似......

我还将这段代码添加到地图页面 html 中,我认为这应该有助于 IE 版本正确解释 JQuery Mobile:

<script type="text/javascript">
//run this script after jQuery loads, but before jQuery Mobile loads

//customize jQuery Mobile to let IE7+ in (Mobile IE)
$(document).bind("mobileinit", function() {
    $.extend($.mobile, {
        //extend gradeA qualifier to include IE7+
        gradeA : function() {
            //IE version check by James Padolsey, modified by jdalton - from http://gist.github.com/527683
            var ie = ( function() {
                    var v = 3, div = document.createElement('div'), a = div.all || [];
                    while (div.innerHTML = '<!--[if gt IE ' + (++v) + ']><br><![endif]-->', a[0]);
                    return v > 4 ? v : !v;
                }());
            //must either support media queries or be IE7+
            return $.support.mediaquery || (ie && ie >= 7);
        }
    });
});

    </script>

...到目前为止没有任何效果..ap 在 FF 和 Chrome 中再次按预期工作,但是 IE 中的这个闪烁的地图让我发疯(还有一些其他较小的 css 问题,但这是最大的问题)。 ..当然,当使用早期版本的 IE 查看时,我的应用程序看起来和行为更加怪异。

帮助?谢谢!// 杰森

4

0 回答 0