// title 必須
var title = "宝龍鍼灸整骨院";
// address 必須
var address = "兵庫県伊丹市南町4-5-27";
// 地図の縮尺初期値
var zoom = 17;
// マーカー表示位置の調整
// 緯度1分で約111km 経度1分:北緯35度付近では約91km
// 緯度で100mずらす場合は約0.0009
// 経度で100mずらす場合北緯35度付近では約0.001
var x = -0.0008; // 経度調整 右にずらす場合はマイナス値
var y = -0.0007; // 緯度調整 上にずらす場合はマイナス値
// 吹き出しに表示する文字(HTML)
var content = '';
content += '宝龍鍼灸整骨院
';
content += '〒664-0854
';
content += '兵庫県伊丹市南町4-5-27
';
content += 'Tex&fax:072-786-9018';
// 吹き出しの表示 true:表示 false:クリックで表示
var content_display = false;
function initialize() {
var myOptions = {
zoom: zoom,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var geocoder = new google.maps.Geocoder();
geocoder.geocode({address: address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var latlng = results[0].geometry.location;
var pos = new google.maps.LatLng(latlng.lat() + y, latlng.lng() + x);
map.setCenter(pos);
marker = new google.maps.Marker({
map: map,
position: latlng,
title: title
});
var message = content;
infowindow = new google.maps.InfoWindow({
content: message,
size: new google.maps.Size(50, 50)
});
if(content_display)
{
infowindow.open(map, marker);
}
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map, marker);
});
} else {
alert("Geocode was not successfull for the following reason: " + status);
}
});
}