【发布时间】:2018-04-24 06:26:41
【问题描述】:
HTML
<h3>My Google Maps Demo</h3>
<div id="map"></div>
<!-- Replace the value of the key parameter with your own API key. -->
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk&callback=initMap"></script>
js
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -34.397, lng: 150.644},
zoom: 8
});
}
css(非必要)
#map {
height: 100%;
}
html, body {
height: 100%;
margin: 0;
padding: 0;
}
我想将这个简单示例谷歌地图代码左上角的 satellite-map 按钮移动到右上角,但我不知道该怎么做。
你能帮帮我吗?
【问题讨论】:
标签: javascript html css google-maps