/* =Google Maps API
-------------------------------------------------------------- */
function initialize(){
var mapData = { pos: { lat: 34.89583, lng: 135.81599 }, zoom: 14 };
var markerData = [ { pos: { lat: 34.89583, lng: 135.81599 }, title: "ヘアーショップ ムカイ", icon: "./wp-content/themes/hs-mukai.jp/img/map-marker.png", infoWindowOpen: false, infoWindowContent: "
- ヘアーショップ ムカイ
- 〒611-0014 京都府宇治市明星町1丁目67-19
TEL: 0774-24-2346
FAX: 0774-24-1127 - 営業時間
平日・土日: 08:00~19:00
定休日: 月曜日
" }, { pos: { lat: 35.225666, lng: 135.924513 }, title: "", icon: "./wp-content/themes/hs-mukai.jp/img/map-marker-2.png", infoWindowOpen: false, infoWindowContent: "" },
];
var map = new google.maps.Map(document.getElementById('map'), {
center: mapData.pos,
zoom: mapData.zoom
});
for( var i=0; i < markerData.length; i++ ){
(function(){
//マーカーの設定と作成
var marker = new google.maps.Marker({
position: markerData[i].pos,
title: markerData[i].title,
icon: markerData[i].icon,
map: map
});
if( markerData[i].infoWindowContent ){
//情報ウインドウの設定と作成
var infoWindow = new google.maps.InfoWindow({
content: markerData[i].infoWindowContent
});
//情報ウインドウのオープンをマーカーのクリックイベントに登録
marker.addListener('click', function(){
infoWindow.open(map, marker);
});
//情報ウインドウのオープン
if( markerData[i].infoWindowOpen )
{
infoWindow.open(map, marker);
}
}
}());
}
var styleOptions = [{"featureType":"landscape","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"stylers":[{"hue":"#00aaff"},{"saturation":-100},{"gamma":2.15},{"lightness":12}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"visibility":"on"},{"lightness":24}]},{"featureType":"road","elementType":"geometry","stylers":[{"lightness":57}]}
];
var styledMapOptions = { name: 'CSSW' }
var CSSWType = new google.maps.StyledMapType(styleOptions, styledMapOptions);
map.mapTypes.set('CSSW', CSSWType);
map.setMapTypeId('CSSW');
}
//ページのロードが完了したら地図を読み込む
window.onload = function(){
initialize();
};