OpenLayers:在Internet Explorer中不起作用 [英] OpenLayers: Does not work in internet explorer

查看:113
本文介绍了OpenLayers:在Internet Explorer中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个简单的代码:

<HTML>
<head>
<title>Vector Icon Example</title>
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
<link rel="stylesheet" href="../apidoc/styles/bootstrap.min.css">
<script src="../apidoc/scripts/bootstrap.min.js"></script>
    <link rel="stylesheet" href="../css/ol.css" type="text/css">
<script src="../build/ol.js"></script>


</head>
<BODY>
<div id="map" style="width: 100%, height: 400px">ggg</div>
<script>
  new ol.Map({
    layers: [
      new ol.layer.Tile({source: new ol.source.OSM()})
    ],
    view: new ol.View({
      center: [0, 0],
      zoom: 2
    }),
    target: 'map'
  });
</script>
</BODY>
</HTML>

它在chrome中可以正常工作,但在IE 11中什么也没有出现.问题出在哪里?

It works correctly in chrome, but in IE 11 does not appear anything. where is the problem?

推荐答案

这解决了我的问题:

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

这篇关于OpenLayers:在Internet Explorer中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆