//googlemap_custom (function($){ function initialize() { var mapDiv = document.getElementById("gmap"); var mapCanvas = new google.maps.Map(mapDiv, { center:new google.maps.LatLng(34.700,135.050), zoom:10, scrollwheel: false, mapTypeControlOptions: { mapTypeIds: ['style', google.maps.MapTypeId.ROADMAP] }, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL }, streetViewControl:false, styles: [ { "stylers": [ { "saturation": -100 }, { "visibility": "simplified" }, { "lightness": 22 } ] } ] }); var overlay = $("#gmap-overlay"); var overlayHeight; var preloadImgs = []; //アンエミュ .unemu var unemu = new google.maps.Marker({ position: new google.maps.LatLng(34.742811, 135.298999), //アンエミュ 緯度経度 map: mapCanvas, animation: google.maps.Animation.DROP, clickable:true, icon: new google.maps.MarkerImage("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-off.png") }); google.maps.event.addListener(unemu, 'click', unemuMapClick ); google.maps.event.addListener(unemu, 'mouseover', unemuMapHover ); google.maps.event.addListener(unemu, 'mouseout', unemuMapMouseout ); function unemuMapClick() { $("#gmap-overlay-bg-wrapper, #gmap-overlay , #gmap-overlay .excerpt.unemu").fadeIn(); overlayHeight = overlay.height(); overlay.css("margin-top", -overlayHeight/2); unemu.setAnimation(google.maps.Animation.BOUNCE); unemu.setIcon("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-unemu-on.png"); } function unemuMapHover() { //unemu.setIcon("images/map/pin-unemu-on.png"); } function unemuMapMouseout() { //unemu.setIcon("images/map/pin-off.png"); } // //神戸旧居留地 .kobe // var kobe = new google.maps.Marker({ // position: new google.maps.LatLng(34.68700,135.19600), //神戸旧居留地 緯度経度 // map: mapCanvas, // animation: google.maps.Animation.DROP, // icon: new google.maps.MarkerImage("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-off.png") // }); // google.maps.event.addListener(kobe, 'click', kobeMapClick ); // google.maps.event.addListener(kobe, 'mouseover', kobeMapHover ); // google.maps.event.addListener(kobe, 'mouseout', kobeMapMouseout ); // function kobeMapClick() { // $("#gmap-overlay-bg-wrapper, #gmap-overlay , #gmap-overlay .excerpt.kobe").fadeIn(); // overlayHeight = overlay.height(); // overlay.css("margin-top", -overlayHeight/2); // kobe.setAnimation(google.maps.Animation.BOUNCE); // kobe.setIcon("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-emu-on.png"); // } // function kobeMapHover() { // //kobe.setIcon("images/map/pin-emu-on.png"); // } // function kobeMapMouseout() { // //kobe.setIcon("images/map/pin-off.png"); // } //六甲 .kobe var kobe = new google.maps.Marker({ position: new google.maps.LatLng(34.708612, 135.241471), //六甲 緯度経度 map: mapCanvas, animation: google.maps.Animation.DROP, icon: new google.maps.MarkerImage("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-off.png") }); google.maps.event.addListener(kobe, 'click', kobeMapClick ); google.maps.event.addListener(kobe, 'mouseover', kobeMapHover ); google.maps.event.addListener(kobe, 'mouseout', kobeMapMouseout ); function kobeMapClick() { $("#gmap-overlay-bg-wrapper, #gmap-overlay , #gmap-overlay .excerpt.kobe").fadeIn(); overlayHeight = overlay.height(); overlay.css("margin-top", -overlayHeight/2); kobe.setAnimation(google.maps.Animation.BOUNCE); kobe.setIcon("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-emu-on.png"); } function kobeMapHover() { //kobe.setIcon("images/map/pin-emu-on.png"); } function kobeMapMouseout() { //kobe.setIcon("images/map/pin-off.png"); } //須磨パティオ .suma var suma = new google.maps.Marker({ position: new google.maps.LatLng(34.67720, 135.09492), //須磨パティオ 緯度経度 map: mapCanvas, animation: google.maps.Animation.DROP, icon: new google.maps.MarkerImage("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-off.png") }); google.maps.event.addListener(suma, 'click', sumaMapClick ); google.maps.event.addListener(suma, 'mouseover', sumaMapHover ); google.maps.event.addListener(suma, 'mouseout', sumaMapMouseout ); function sumaMapClick() { $("#gmap-overlay-bg-wrapper, #gmap-overlay , #gmap-overlay .excerpt.suma").fadeIn(); overlayHeight = overlay.height(); overlay.css("margin-top", -overlayHeight/2); suma.setAnimation(google.maps.Animation.BOUNCE); suma.setIcon("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-emu-on.png"); } function sumaMapHover() { //suma.setIcon("images/map/pin-emu-on.png"); } function sumaMapMouseout() { //suma.setIcon("images/map/pin-off.png"); } //西神戸 .nishikobe var nishikobe = new google.maps.Marker({ position: new google.maps.LatLng(34.67497036428581, 135.01537442207336), //西神戸 緯度経度 map: mapCanvas, animation: google.maps.Animation.DROP, icon: new google.maps.MarkerImage("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-off.png") }); google.maps.event.addListener(nishikobe, 'click', nishikobeMapClick ); google.maps.event.addListener(nishikobe, 'mouseover', nishikobeMapHover ); google.maps.event.addListener(nishikobe, 'mouseout', nishikobeMapMouseout ); function nishikobeMapClick() { $("#gmap-overlay-bg-wrapper, #gmap-overlay , #gmap-overlay .excerpt.nishikobe").fadeIn(); overlayHeight = overlay.height(); overlay.css("margin-top", -overlayHeight/2); nishikobe.setAnimation(google.maps.Animation.BOUNCE); nishikobe.setIcon("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-emu-on.png"); } function nishikobeMapHover() { //nishikobe.setIcon("images/map/pin-emu-on.png"); } function nishikobeMapMouseout() { //nishikobe.setIcon("images/map/pin-off.png"); } //大久保 .okubo var okubo = new google.maps.Marker({ position: new google.maps.LatLng(34.69019, 134.95007), //大久保 緯度経度 map: mapCanvas, animation: google.maps.Animation.DROP, icon: new google.maps.MarkerImage("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-off.png") }); google.maps.event.addListener(okubo, 'click', okuboMapClick ); google.maps.event.addListener(okubo, 'mouseover', okuboMapHover ); google.maps.event.addListener(okubo, 'mouseout', okuboMapMouseout ); function okuboMapClick() { $("#gmap-overlay-bg-wrapper, #gmap-overlay , #gmap-overlay .excerpt.okubo").fadeIn(); overlayHeight = overlay.height(); overlay.css("margin-top", -overlayHeight/2); okubo.setAnimation(google.maps.Animation.BOUNCE); okubo.setIcon("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-emu-on.png"); } function okuboMapHover() { //okubo.setIcon("images/map/pin-emu-on.png"); } function okuboMapMouseout() { //okubo.setIcon("images/map/pin-off.png"); } //加古川 .kakogawa var kakogawa = new google.maps.Marker({ position: new google.maps.LatLng(34.74242358621006, 134.8653531074524), //加古川 緯度経度 map: mapCanvas, animation: google.maps.Animation.DROP, icon: new google.maps.MarkerImage("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-off.png") }); google.maps.event.addListener(kakogawa, 'click', kakogawaMapClick ); google.maps.event.addListener(kakogawa, 'mouseover', kakogawaMapHover ); google.maps.event.addListener(kakogawa, 'mouseout', kakogawaMapMouseout ); function kakogawaMapClick() { $("#gmap-overlay-bg-wrapper, #gmap-overlay , #gmap-overlay .excerpt.kakogawa").fadeIn(); overlayHeight = overlay.height(); overlay.css("margin-top", -overlayHeight/2); kakogawa.setAnimation(google.maps.Animation.BOUNCE); kakogawa.setIcon("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-emu-on.png"); } function kakogawaMapHover() { //kakogawa.setIcon("images/map/pin-emu-on.png"); } function kakogawaMapMouseout() { //kakogawa.setIcon("images/map/pin-off.png"); } // $("#gmap-overlay-close, #gmap-overlay-bg-noise").click(function(){ $("#gmap-overlay-bg-wrapper, #gmap-overlay , #gmap-overlay .excerpt").fadeOut(); setTimeout(function(){ unemu.setAnimation(null); }); setTimeout(function(){ kobe.setAnimation(null); }); setTimeout(function(){ suma.setAnimation(null); }); setTimeout(function(){ nishikobe.setAnimation(null); }); setTimeout(function(){ okubo.setAnimation(null); }); setTimeout(function(){ kakogawa.setAnimation(null); }); unemu.setIcon("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-off.png"); kobe.setIcon("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-off.png"); suma.setIcon("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-off.png"); nishikobe.setIcon("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-off.png"); okubo.setIcon("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-off.png"); kakogawa.setIcon("http://studioemu.net/wordpress/wp-content/themes/studioemu_theme/images/map/pin-off.png"); }); //Bounce markers when hovering on articles $("#article-list li").hover(function(){ var key = $(this).attr('class'); mapCanvas.panTo(eval(key).getPosition()); eval(key).setAnimation(google.maps.Animation.BOUNCE); },function() { var key = $(this).attr('class'); eval(key).setAnimation(null); }); //adjust gmap position when scrolled var gmap = $("#gmap"); var mapHeight = gmap.height(); var mapPosition = gmap.offset().top; $(window).scroll(function() { var scrollValue = $(this).scrollTop(); //if ( scrollValue > mapPosition - 20 /*&& scrollValue < 320*/) { // gmap.height(mapHeight - (scrollValue - mapPosition+20)) // .css({"position":"fixed","top":"20px"}); // } // else if( scrollValue > mapPosition ) { // gmap.height(268).css({"position":"fixed","top":"20px"}); // } //else { // gmap.css({"position":"relative", "top":"auto", "height":"400px"}); // } }); google.maps.event.addListenerOnce(mapCanvas, 'idle', function(){ $("#gmap-cover").fadeOut("slow"); }); $.preload = function(array) { var length = array.length, document = window.document, body = document.body, isIE = 'fileSize' in document, object; while (length--) { if (isIE) { new Image().src = array[length]; continue; } object = document.createElement('object'); object.data = array[length]; object.width = object.height = 0; body.appendChild(object); } }; $.preload(preloadImgs); var vague = $("#gmap-overlay-bg").Vague({ intensity:3 //blur intensity }); vague.blur(); } google.maps.event.addDomListener(window, "load", initialize); })(jQuery);