$(function(){ mapInit(); var position = $("#mapCanvas").offset().top-20; $(".placeNameBoxWrap").click(function () { $('html,body').animate({ scrollTop : position }, 'fast'); mapClick($(this).prop("rel")); return false; }); /*$(".placeNameBoxWrap").mouseover(function () { mapClick($(this).prop("rel")); return false; });*/ $("#locationBtn").click(function () { var selectLocation = $('[name=locationSelector]').val(); window.location.href = selectLocation; location.reload(); }); }); //地図の基本設定 var myOptions; var styledMapOptions; var map; var markers; function mapInit() { if("#sagamihara" == location.hash) { sagamihara(); }else if("#machida" == location.hash) { machida(); }else if("#hashimoto" == location.hash) { hashimoto(); }else if("#fuchinobe" == location.hash) { fuchinobe(); }else if("#hachioji" == location.hash) { hachioji(); }else{ sagamihara(); } //地図のスタイルを設定 var styleOptions = [ { "stylers": [ { "gamma": 2.01 }, { "hue": "#ff0033" }, { "visibility": "simplified" }, { "lightness": -5 }, { "saturation": -5 } ] } ]; var mapType = new google.maps.StyledMapType(styleOptions, styledMapOptions); map.mapTypes.set('okusama', mapType); map.setMapTypeId('okusama'); var countNum = 0; for (var i = 0; i < markers.length; i++) { countNum++; icon = new google.maps.MarkerImage( '/sagamihara/images/mapIconBL_'+ countNum +'.png', new google.maps.Size(25,37), new google.maps.Point(0,0) ); var content = markers[i][0]; var latlng = new google.maps.LatLng(markers[i][1],markers[i][2]); createMarker(latlng,content,map,icon,i); } } //JR相模原駅 function sagamihara() { $(".locationSelector").val("#sagamihara"); $('.sagamihara').css('display','block'); //地図の中心点と拡大率を設定 myOptions = { zoom: 16, disableDefaultUI: true, /*streetViewControl: false,*/ center: new google.maps.LatLng(35.5793840,139.3693282), mapTypeControlOptions: { mapTypeIds: ['okusama', google.maps.MapTypeId.ROADMAP] } }; map = new google.maps.Map(document.getElementById("mapCanvas"),myOptions); styledMapOptions = { name: 'JR相模原駅待ち合わせ場所' } //アイコンの場所の名前と緯度経度を追加 markers = [ ['
',
35.5786700, 139.3692330],
['
',
35.5796070, 139.3704742],
['
',
35.5782410, 139.3706210],
['
',
35.5797510, 139.3706715]
];
}
//町田駅
function machida() {
$(".locationSelector").val("#machida");
$('.machida').css('display','block');
//地図の中心点と拡大率を設定
myOptions = {
zoom: 18,
disableDefaultUI: true,
/*streetViewControl: false,*/
center: new google.maps.LatLng(35.5419950,139.4454127),
mapTypeControlOptions: { mapTypeIds: ['okusama', google.maps.MapTypeId.ROADMAP] }
};
map = new google.maps.Map(document.getElementById("mapCanvas"),myOptions);
styledMapOptions = { name: '町田駅待ち合わせ場所' }
//アイコンの場所の名前と緯度経度を追加
markers = [
['