Last active
December 18, 2015 01:09
-
-
Save chikoski/5702190 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@CHARSET "UTF-8"; | |
#map{ | |
width: 300px; | |
height: 300px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Map App</title> | |
<link rel="stylesheet" type="text/css" href="css/mapApp.css"> | |
</head> | |
<body> | |
<section> | |
<section role="region"> | |
<header> | |
<h1>Map App</h1> | |
</header> | |
</section> | |
<div id="map"></div> | |
</section> | |
<script src="http://maps.google.com/maps/api/js?sensor=false"></script> | |
<script src="js/mapApp.js"></script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 地図が代入される変数 | |
var map; | |
// 地図を初期化する関数 | |
var initMap = function(){ | |
// 緯度経度から地点を表すデータを作成 | |
var latlng = new google.maps.LatLng(35.388276, 139.427348); | |
// マップの表示方法に関する設定をまとめたオブジェクトの作成 | |
var opt = { | |
zoom: 15, | |
center: latlng, | |
mapTypeId: google.maps.MapTypeId.ROADMAP | |
}; | |
//地図の表示 | |
map = new google.maps.Map(document.getElementById('map'), opt); | |
// 表示中の地図を返す | |
return map; | |
}; | |
var initApp = function(){ | |
initMap(); | |
}; | |
window.onload = initApp; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment