function attachMessage(marker, msg) {
google.maps.event.addListener(marker, 'click', function(event) {
new google.maps.InfoWindow({
content: msg
}).open(marker.getMap(), marker);
});
}
// 位置情報と表示データの組み合わせ
var data = new Array();//マーカー位置の緯度経度
data.push({position: new google.maps.LatLng(34.671459418923504,135.82911425767213), //緯度経度
content: 'イゲタ醤油・五徳味噌醸造元 ㈱井上本店
'+//店名
'奈良市北京終町57
'//住所
+'電話:0742-22-2501'
});
var myMap = new google.maps.Map(document.getElementById('map'), {
zoom: 15,//地図縮尺
center: new google.maps.LatLng(34.671459418923504,135.82911425767213),//地図の中心点
scrollwheel: false,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
for (i = 0; i < data.length; i++) {
var myMarker = new google.maps.Marker({
position: data[i].position,
map: myMap
});
attachMessage(myMarker, data[i].content);
}