Created
May 22, 2015 11:55
-
-
Save niiyz/7d5d2c5a8086dde2eee0 to your computer and use it in GitHub Desktop.
GoogleMapでWebサービスを作る説明ソース10。
This file contains 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 lang="ja"> | |
<meta charset="UTF-8"> | |
<style> | |
html, body, #myMap { | |
width: 100%; | |
height: 100%; | |
margin: 0px; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="myMap"></div> | |
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js"></script> | |
<script> | |
function initialize() { | |
var latLng = new google.maps.LatLng(36.861751, 136.991468); | |
var mapOptions = { | |
zoom: 10, | |
center: latLng | |
}; | |
var div = document.getElementById("myMap"); | |
var map = new google.maps.Map(div, mapOptions); | |
var textBox = document.createElement('input'); | |
textBox.style.width = '250px'; | |
textBox.style.marginTop = '30px'; | |
textBox.value = 'てすと'; | |
map.controls[google.maps.ControlPosition.TOP_LEFT].push(textBox); | |
} | |
google.maps.event.addDomListener(window, 'load', initialize); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment