编辑,找到问题...
(我知道,为什么是IE8和jquery 1.12.4……我还得支持一段时间)
我想要显示一个400px宽的美国地图上的几个点。使用最新的Mapael (2.0.0)示例,我修改了samples文件夹中的以下代码。在FF,Chrome和IE 9+中,它工作得很好。在我需要支持的IE8中,地图是正常大小和裁剪的。似乎自动调整大小不起作用。您可以使用下面的代码对此进行测试,并将仿真设置为IE8。
我是不是遗漏了什么?
代码...
<!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>发布于 2017-02-08 03:53:24
问题是我使用的是新的拉斐尔JS库。我需要用一个旧的。
不适用于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.1.2/raphael-min.js“
https://stackoverflow.com/questions/42097421
复制相似问题