使用了第三方sdk百度地图,调用相关的api时提示Uncaught TypeError: Cannot call method 'centerAndZoom' of undefined这样的错误,但是代码提示又有这个方法的,代码如下
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title></title>
<script src="../js/mui.min.js"></script>
<link href="../css/mui.min.css" rel="stylesheet" />
<script type="text/javascript" charset="utf-8">
mui.init();
mui.plusReady(function(){
var map = plus.maps.Map("allmap");
map.centerAndZoom(plus.maps.Point(116.404, 39.915),12);
});
</script>
</head>
<body>
<div id="allmap"></div>
</body>
</html>
0 个回复