SCRIPT5009: 'BMapGL' is undefined on IE11

79 Views Asked by At

Here is the code

// src: https://lbsyun.baidu.com/jsdemo.htm#aCreateMap
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <style>
      ....
    </style>
    <script src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=API_KEY"></script>
</head>
<body>
    <div id="container"></div>
</body>
</html>
<script>
var map = new BMapGL.Map('container'); 
map.centerAndZoom(new BMapGL.Point(116.404, 39.915), 12); 
map.enableScrollWheelZoom(true); 
</script>

How to resolve 'SCRIPT5009: BMapGL is undefined' error displayed on IE11 while the code works fine on Chrome, Edge, and Firefox?

0

There are 0 best solutions below