简体   繁体   English

IE8中的Mapael大小/调整大小问题

[英]Mapael size/resize issue in IE8

[Edit, found the issue...] [编辑,发现问题...]
(I know, why IE8, and jquery 1.12.4...I have to support it for a while yet) (我知道,为什么IE8和jquery 1.12.4 ...我必须支持它一段时间。)
I want to display a US map at 400px wide with a few points on it. 我想显示400像素宽的美国地图,上面有几点。 Using the latest Mapael (2.0.0) examples I modified the code below from the samples folder. 使用最新的Mapael(2.0.0)示例,我从示例文件夹中修改了以下代码。 In FF, Chrome and IE 9+ it works well. 在FF,Chrome和IE 9+中,效果很好。 In IE8, which I need to support, the map is normal size and clipped. 在我需要支持的IE8中,地图大小正常且已裁剪。 It seems like the automatic resize doesn't work. 自动调整大小似乎不起作用。 You can test this by using the code below and set the emulation to IE8. 您可以使用下面的代码对此进行测试,并将仿真设置为IE8。


Am I missing something? 我想念什么吗?

Code... 码...

    <!DOCTYPE html>
    <html>
    <head>
        <script src="https://code.jquery.com/jquery-1.12.4.min.js" charset="utf-8"></script>
        <!-- Doesn't work with IE8 -->
         //src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.2.0/raphael-min.js" 
        <!-- Doesn't work with IE8 -->

        <!-- The correct one for IE8 -->
        <script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.2/raphael-min.js" charset="utf-8"></script>
        <!-- The correct one for IE8 -->

        <script src="https://rawgit.com/neveldo/jQuery-Mapael/2.0.0/js/jquery.mapael.min.js" charset="utf-8"></script>
        <script src="https://rawgit.com/neveldo/jQuery-Mapael/2.0.0/js/maps/usa_states.js" charset="utf-8"></script>

        <script type="text/javascript">
            $(function () {
                $(".mapcontainer").mapael({
                    map: {name: "usa_states"},
                    plots: {
                        'ny': {
                           latitude: 42.9538,
                            longitude: -75.5268,
                            tooltip: {content: "New York"},
                            value: [50]
                        }
                    }
                });
            });
        </script>
    </head>
    <body>
    <div class="container" style="width:400px;">
        <div class="mapcontainer">
            <div class="map">
            </div>
        </div>
    </div>
    </body>
    </html>

The issue was I was using the new Raphael JS library. 问题是我正在使用新的Raphael JS库。 I needed to use an older one. 我需要使用一个旧的。

Doesn't work with IE8: src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.2.0/raphael-min.js" 不适用于IE8:src =“ https://cdnjs.cloudflare.com/ajax/libs/raphael/2.2.0/raphael-min.js”

The correct one for IE8: src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.2/raphael-min.js" IE8的正确版本:src =“ https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.2/raphael-min.js”

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

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