google-maps-api-3 - Mootools 打破谷歌地图街景 - 黑屏
问题描述
在 Maps JavaScript API Hello World 示例中包含 mootools.min.js 会导致街景功能无法渲染街道图像。我正在使用 Joomla,并且在插入我的代码之前加载了 mootools。
我减少了这个问题,直到我使用文档中提供的 HelloWorld 示例。我本地的 mootools 版本是 1.4.5。我已经使用托管的 1.45 以及最新版本 1.6.0 对其进行了测试。
<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/mootools/1.6.0/mootools.min.js"></script>
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -34.397, lng: 150.644},
zoom: 8
});
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY_HERE&callback=initMap"
async defer></script>
</body>
</html>
将街景人放到街道网络后,我看到两个控制台错误:
获取关于:无效的网络::ERR_UNKNOWN_URL_SCHEME
街景界面似乎正在工作 - 导航箭头显示并可点击,只是没有图像。
解决方案
推荐阅读
- parameters - 如何使用 Sails req.param 函数检索和更新记录
- java - Bootstrap.yaml 中的分析
- apache-kafka - 阅读 Kafka 主题中的所有偶数偏移
- javascript - vanilla js中的关闭模式
- scala - 从 Spark 数据帧的行创建对象的规范方法是什么?
- docker - 掌舵安装 | 错误:预安装失败:作业失败:BackoffLimitExceeded
- apache-kafka - Confluent RabbitMQ 源连接器 - 配置、许可证相关错误?
- go - Gorilla Websocket 中的 WriteMessage 和 ReadMessage 是如何工作的?
- python - 为什么要造轮子
在高山 Linux docker 环境中带有(PEP 517)指示非常慢 - python - RuntimeError:给定输入大小:(40x256x1)。计算的输出大小:(40x253x-2)。输出尺寸太小