var currentInfoWindow = null; //最後に開いた情報ウィンドウを記憶
function initialize() {
//地図初期化
var initPos = new google.maps.LatLng(35.73608,139.783369);
var myOptions = {
center : initPos,
zoom : 12,
mapTypeId : google.maps.MapTypeId.ROADMAP
};
var map_canvas = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
//マーカーを作成
var markerPos0 = new google.maps.LatLng(35.7308714,139.7694955);
var markerPos1 = new google.maps.LatLng(35.7293799,139.7701399);
var markerPos2 = new google.maps.LatLng(35.7292021,139.7703483);
var markerPos3 = new google.maps.LatLng(35.7304215,139.7703121);
var markerPos4 = new google.maps.LatLng(35.7303103,139.7701649);
var markerPos5 = new google.maps.LatLng(35.7315962,139.7685594);
var markerPos6 = new google.maps.LatLng(35.7322961,139.7681372);
var markerPos7 = new google.maps.LatLng(35.7319545,139.7682317);
var markerPos8 = new google.maps.LatLng(35.7291300,139.7722314);
var markerPos9 = new google.maps.LatLng(35.7292021,139.7703483);
var markerPos10 = new google.maps.LatLng(35.7314601,139.7685928);
createMarker(map_canvas, markerPos0, "エーゲ海
東京都荒川区西日暮里2-53-9
03-3807-2338
詳細","./marker/pin_lov01.png");
createMarker(map_canvas, markerPos1, "エル
東京都荒川区西日暮里2-21-4
03-3807-9411
詳細","./marker/pin_lov02.png");
createMarker(map_canvas, markerPos2, "シャルム日暮里1
東京都荒川区西日暮里2-20-4
03-3802-4810
詳細","./marker/pin_lov03.png");
createMarker(map_canvas, markerPos3, "ステーション日暮里
東京都荒川区西日暮里2-51-5
03-3891-7047
詳細","./marker/pin_lov04.png");
createMarker(map_canvas, markerPos4, "たかしま
東京都荒川区西日暮里2-52-11
03-3891-5325
詳細","./marker/pin_lov05.png");
createMarker(map_canvas, markerPos5, "ピース1
東京都荒川区西日暮里5-18-2
03-3802-5855
詳細","./marker/pin_lov06.png");
createMarker(map_canvas, markerPos6, "プレステージ
東京都荒川区西日暮里5-14-5
03-3803-7911
詳細","./marker/pin_lov07.png");
createMarker(map_canvas, markerPos7, "ホテルパピオン西日暮里店
東京都荒川区西日暮里5-15-5
03-3803-3355
詳細","./marker/pin_lov08.png");
createMarker(map_canvas, markerPos8, "ホテルBガール
東京都荒川区西日暮里2-17-9
03-3802-4686
詳細","./marker/pin_lov09.png");
createMarker(map_canvas, markerPos9, "ホテルぼん
東京都荒川区西日暮里2-20-6
03-3806-2334
詳細","./marker/pin_lov10.png");
createMarker(map_canvas, markerPos10, "イーアイ西日暮里
東京都荒川区西日暮里5-18-4
03-3802-7775
詳細","./marker/pin_lov11.png");
}
function createMarker(map, latlng, text, icon) {
var infoWndOpts = {
content : text
};
var infoWnd = new google.maps.InfoWindow(infoWndOpts);
var image = icon;
var markerOpts = {
position : latlng,
map : map,
icon : image
};
var marker = new google.maps.Marker(markerOpts);
google.maps.event.addListener(marker, "click", function(){
//先に開いた情報ウィンドウがあれば、closeする
if (currentInfoWindow) {
currentInfoWindow.close();
}
//情報ウィンドウを開く
infoWnd.open(map, marker);
currentInfoWindow = infoWnd;
});
return marker;
}