Skip to content

Instantly share code, notes, and snippets.

@vincentisambart
Created September 16, 2009 06:13
Show Gist options
  • Save vincentisambart/187904 to your computer and use it in GitHub Desktop.
Save vincentisambart/187904 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>test</title>
<script src="http://maps.google.co.jp/maps/api/js?sensor=false" type="text/javascript"></script>
<script type="text/javascript">
function init() {
var latLng = new google.maps.LatLng(35.660617498849, 139.72924947738647);
var bounds = new google.maps.LatLngBounds(
new google.maps.LatLng(35.66050853612091, 139.72911536693573),
new google.maps.LatLng(35.6607264614284, 139.72938358783722)
);
var div = document.getElementById('mydiv');
var geocoder = new google.maps.Geocoder();
var request = {
language: 'ja',
country: 'jp',
latLng: latLng,
bounds: bounds
};
geocoder.geocode(request, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var html = '';
for (var i = 0; i < results.length; ++i) {
html += 'address: ' + results[i].formatted_address + '<br />';
}
div.innerHTML = html;
}
});
}
</script>
</head>
<body onload="init()">
<div id="mydiv"></div>
<div id="mymap" style="width: 100px; height: 100px;"></div>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment