我正在使用简单的侧边栏bootstrap,但是地图未显示的某些原因。我认为仅将<div id="map"></div>
放入页面内容就足够了,但地图没有显示。我错过了什么?谢谢!这是我的代码:
https://codepen.io/william251082/pen/rgnpqr
Check your api key <script src="https://maps.googleapis.com/maps/api/js?
key=YOUR_API_KEY&callback=initMap"></script>
----------------------
window.initMap = function() {
var location = {lat: 51.47672559, lng: -3.17107379};
var markerloc = {lat: 51.476852, lng: -3.167869};
map = new google.maps.Map(document.getElementById('map'), {
center: location,
scrollwheel: false,
zoom: 17
});
var marker = new google.maps.Marker({
position: markerloc,
map: map,
title: 'Hello World!'
});
};