以下のコードでwebアプリ等にGoogleMapを表記することができる。 “`
<script>
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: 緯度, lng: 経度},
zoom: 8
});
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=APIキー&callback=initMap"
async defer></script>APIキーはGoogle Cloud Platformから取得する。 なお、地図のサイズはstyleタグやcssファイル等で指定する。


