Simple Map
HTML
<div id="map"></div>
<!-- Replace the value of the key parameter with your own API key. -->
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk&callback=initMap" async defer></script>
CSS
/* 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;
}
JavaScript
function initMap() {
var center = {lat: 25.0339639, lng: 121.5622835};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 16,
center: center
});
var contentString = '<div id="content">'+
'<div id="siteNotice">'+
'</div>'+
'<h1 id="firstHeading" class="firstHeading">台北101</h1>'+
'<div id="bodyContent">'+
'台北101(TAIPEI 101)[2]是位於臺灣臺北市信義區的摩天大樓,樓高509.2公尺(1,671英尺),地上樓層共有101層、另有地下5層,總樓地板面積37萬4千平方公尺,由李祖原聯合建築師事務所設計,KTRT團隊承造,於1999年9月動工,2004年12月31日完工開幕。最初名稱為臺北國際金融中心(英語:Taipei World Financial Center),2003年改為現名[5]。興建與經營機構為台北金融大樓公司。其為台灣第一高樓、以及唯一樓層超過100層的建築物,曾於2004年12月31日至2010年1月4日間擁有世界第一高樓的紀錄,世界上第一棟超過500公尺的建築物,目前為世界第十二高樓(截至2018)以及地震帶最高摩天大廈,完工以來即成為臺北重要地標之一。此外,大樓內擁有全球第二大(僅次上海中心大廈)、全球唯二開放遊客觀賞的巨型阻尼器(另一為上海中心大廈),以及目前全球起降速度第四快的電梯。' +
'</div>'+
'</div>';
var infowindow = new google.maps.InfoWindow({
content: contentString
});
var marker = new google.maps.Marker({
position: center,
map: map,
title: 'Hello World!'
});
marker.addListener('click', function() {
infowindow.open(map, marker);
});
}