var map = new google.maps.Map(document.getElementById("map"), opts); var latlng = new google.maps.LatLng(35.658517, 139.745493); map.setCenter(latlng); 新しく指定した緯度と経度の座標の位置で地図が表示されます。 function initMap() { tokyo = new google.maps.LatLng(35.689614,139.691585); osaka = new google.maps.LatLng(34.686272,135.519649); var opts = { zoom: 15, center: tokyo map = new google.maps.Map(document.getElementById("map"), opts); function setTokyo() { map.setCenter(tokyo); function setOsaka() { map.setCenter(osaka); Google Maps API サンプル

東京都庁と大阪府庁

ブラウザでWebページを開くと次のように表示されます。