[6/30]八峰白神ジオツアー
2018/06/04 06時
// <![CDATA[
//Google Maps基本設定
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 16,//地図縮尺
center: new google.maps.LatLng(40.371205,140.0177556),//地図の中心点
scrollwheel: false,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
//吹き出しを作る関数
function attachMessage(marker, msg, map) {
var infowindow = new google.maps.InfoWindow({
content: msg
});
infowindow.open(map, marker);
google.maps.event.addListener(marker, 'click', function(event) {
//情報ウインドが開いてる場合
if (infowindow.getMap()){
infowindow.close(map, marker);
} else {
infowindow.open(map, marker);
}
});
}
//各データ
var data = new Array();
data.push({position: new google.maps.LatLng(40.371205,140.0177556), content: 'JR八森駅'});
data.push({position: new google.maps.LatLng(40.369512,140.0152176), content: 'ファガス'});
for (i = 0; i < data.length; i++) { var myMarker = new google.maps.Marker({ position: data[i].position, map: map }); attachMessage(myMarker, data[i].content, map); }
// ]]>