<style>
#map {height: 400px; width: 600px; max-width: 100%;}
</style>
<div id="map"></div>
<script>
let map;
function initMap() {
const myLatLng = { lat: -25, lng: -119};
const map = new google.maps.Map(document.getElementById("map"), {
center: myLatLng,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
const image = 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png';
const marker = new google.maps.Marker({
position: myLatLng,
map: map,
animation: google.maps.Animation.BOUNCE
});
}
window.initMap = initMap;
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=apikey&callback=initMap" async defer></script>
实现 地址 显示在谷歌地图