住所
最寄り駅
JR「東京駅」徒歩1分
上野東京ライン「東京駅」徒歩1分
公式サイト
Event東京駅グランスタのイベント
開催中
2025.1.8(水)~2025.3.27(木)
発売中
2024.12.26(木)~2025.1.15(水)
発売中
2024.12.4(水)~2025.1.13(月)
News東京駅グランスタのニュース
Past Event過去開催のイベント
2024.11.1(金)~2024.12.25(水) 発売
2024.10.10(木)~2024.12.20(金) 発売
Recommend Topicおすすめトピック
Shops・Brands東京駅グランスタ - 店舗・取り扱い
'
}
html += "" +
'
'+this.name+'';
html += '
'
var genre = this.genre
if(genre == null){
genre = ""
}
genres_spans = genre.split(",").map(function(i) {return (i != null && i != "") ? '
' + const_map_genre[i] + '' : ''}).join("")
html += '
' + genres_spans + '
'
html += '
'
})
$(".fp_maps .map_wrapper").html(html)
}
function get_distance($lat1, $lon1, $lat2, $lon2, $mode=false){
dist = distance($lat1, $lon1, $lat2, $lon2, $mode)
if(dist > 500){
return Math.round(dist*100/1000)/100 + "km"
}else{
return dist + "m"
}
}
function deg2rad(degrees) {
return degrees * Math.PI / 180;
};
/**
* 2地点間の距離(m)を求める
* ヒュベニの公式から求めるバージョン
*
* @param float $lat1 緯度1
* @param float $lon1 経度1
* @param float $lat2 緯度2
* @param float $lon2 経度2
* @param boolean $mode 測地系 true:世界 false:日本
* @return float 距離(m)
*/
function distance($lat1, $lon1, $lat2, $lon2, $mode){
// 緯度経度をラジアンに変換
$radLat1 = deg2rad($lat1); // 緯度1
$radLon1 = deg2rad($lon1); // 経度1
$radLat2 = deg2rad($lat2); // 緯度2
$radLon2 = deg2rad($lon2); // 経度2
// 緯度差
$radLatDiff = $radLat1 - $radLat2;
// 経度差算
$radLonDiff = $radLon1 - $radLon2;
// 平均緯度
$radLatAve = ($radLat1 + $radLat2) / 2.0;
// 測地系による値の違い
$a = $mode ? 6378137.0 : 6377397.155; // 赤道半径
$b = $mode ? 6356752.314140356 : 6356078.963; // 極半径
//$e2 = ($a*$a - $b*$b) / ($a*$a);
$e2 = $mode ? 0.00669438002301188 : 0.00667436061028297; // 第一離心率^2
//$a1e2 = $a * (1 - $e2);
$a1e2 = $mode ? 6335439.32708317 : 6334832.10663254; // 赤道上の子午線曲率半径
$sinLat = Math.sin($radLatAve);
$W2 = 1.0 - $e2 * ($sinLat*$sinLat);
$M = $a1e2 / (Math.sqrt($W2)*$W2); // 子午線曲率半径M
$N = $a / Math.sqrt($W2); // 卯酉線曲率半径
$t1 = $M * $radLatDiff;
$t2 = $N * Math.cos($radLatAve) * $radLonDiff;
$dist = Math.sqrt(($t1*$t1) + ($t2*$t2));
return Math.round($dist); /* m */
}
async function main(){
const { Map } = await google.maps.importLibrary("maps");
const { AdvancedMarkerElement } = await google.maps.importLibrary("marker");
var map_initialized = false
var gmap = null
var maps = [{"id":62331,"shop_id":2821,"img_src":null,"href":"/maps/62331","name":"ABCマート(ABC-MART)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"shoes","genres":["シューズ"],"pref":{"id":13,"name":"東京"}},{"id":61439,"shop_id":null,"img_src":null,"href":"/maps/61439","name":"Made in ピエール・エルメ(Made in PIERRE HERMÉ)","lat":35.681832,"lng":139.766775,"tags_ja":"ショップ, レストラン・カフェ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62336,"shop_id":null,"img_src":null,"href":"/maps/62336","name":"とらや 東京駅グランスタ(TORAYA)","lat":35.681518,"lng":139.767295,"tags_ja":"スイーツ店","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62829,"shop_id":null,"img_src":null,"href":"/maps/62829","name":"アイボリッシュ(Ivorish)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62330,"shop_id":null,"img_src":null,"href":"/maps/62330","name":"アネモネ(ANEMONE)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"accessary,goods","genres":["アクセサリ","グッズ"],"pref":{"id":13,"name":"東京"}},{"id":62334,"shop_id":null,"img_src":null,"href":"/maps/62334","name":"アンリ・シャルパンティエ 東京駅グランスタ(Henri Charpentier)","lat":35.681518,"lng":139.767295,"tags_ja":"スイーツ店","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":8153,"shop_id":null,"img_src":null,"href":"/maps/8153","name":"オサジ(OSAJI)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"beauty,gourmet","genres":["ビューティ","グルメ"],"pref":{"id":13,"name":"東京"}},{"id":43739,"shop_id":null,"img_src":null,"href":"/maps/43739","name":"オードリー 東京駅グランスタ(AUDREY)","lat":35.681518,"lng":139.767295,"tags_ja":"スイーツ店","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":59142,"shop_id":null,"img_src":null,"href":"/maps/59142","name":"カファレル(Caffarel)","lat":35.68173,"lng":139.766185,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62338,"shop_id":null,"img_src":null,"href":"/maps/62338","name":"ガトーフェスタ ハラダ(GATEAU FESTA HARADA)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62332,"shop_id":null,"img_src":null,"href":"/maps/62332","name":"グラニフ(graniph)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"","genres":[],"pref":{"id":13,"name":"東京"}},{"id":62337,"shop_id":null,"img_src":null,"href":"/maps/62337","name":"コロンバン(colombin)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":66697,"shop_id":null,"img_src":null,"href":"/maps/66697","name":"ゴンチャ(Gong cha)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ, レストラン・カフェ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62342,"shop_id":null,"img_src":null,"href":"/maps/62342","name":"ジンズ(JINS)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"eyewear","genres":["眼鏡&サングラス"],"pref":{"id":13,"name":"東京"}},{"id":9463,"shop_id":null,"img_src":null,"href":"/maps/9463","name":"スターバックス コーヒー 東京駅 グランルーフ 東京駅グランスタ(Starbucks)","lat":35.681518,"lng":139.767295,"tags_ja":"レストラン・カフェ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":67465,"shop_id":null,"img_src":null,"href":"/maps/67465","name":"スターバックス 東京駅グランスタ(Starbucks Coffee)","lat":35.681518,"lng":139.767295,"tags_ja":"レストラン・カフェ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":24213,"shop_id":null,"img_src":null,"href":"/maps/24213","name":"スリーコインズ(3COINS)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"goods","genres":["グッズ"],"pref":{"id":13,"name":"東京"}},{"id":62341,"shop_id":null,"img_src":null,"href":"/maps/62341","name":"タリーズコーヒー 東京駅グランスタ(TULLY'S COFFEE)","lat":35.681518,"lng":139.767295,"tags_ja":"レストラン・カフェ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":64833,"shop_id":null,"img_src":null,"href":"/maps/64833","name":"ディーン&デルーカ(DEAN \u0026 DELUCA)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"","genres":[],"pref":{"id":13,"name":"東京"}},{"id":65555,"shop_id":null,"img_src":null,"href":"/maps/65555","name":"パティスリー ギンノモリ グランスタ東京店(PATEISSERIE GIN NO MORI)","lat":35.681518,"lng":139.767295,"tags_ja":"スイーツ店","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62329,"shop_id":3225,"img_src":null,"href":"/maps/62329","name":"ビープル(Biople)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"beauty,gourmet","genres":["ビューティ","グルメ"],"pref":{"id":13,"name":"東京"}},{"id":25615,"shop_id":null,"img_src":null,"href":"/maps/25615","name":"ピエール マルコリーニ 東京駅グランスタ(Pierre Marcolini)","lat":35.681832,"lng":139.766775,"tags_ja":"スイーツ店","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62335,"shop_id":null,"img_src":null,"href":"/maps/62335","name":"フェアリーケーキフェア(Fairycake Fair)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62328,"shop_id":null,"img_src":null,"href":"/maps/62328","name":"ベイク チーズタルト(BAKE CHEESE TART)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":68066,"shop_id":null,"img_src":null,"href":"/maps/68066","name":"ミスターチーズケーキ(Mr. CHEESECAKE)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":59928,"shop_id":null,"img_src":null,"href":"/maps/59928","name":"メゾンカカオ グランスタ(MAISON CACAO GranSta)","lat":35.681832,"lng":139.766775,"tags_ja":"スイーツ店","genre":"","genres":[],"pref":{"id":13,"name":"東京"}},{"id":23049,"shop_id":null,"img_src":null,"href":"/maps/23049","name":"メリーチョコレート 東京駅グランスタ(Mary's Chocolate)","lat":35.681518,"lng":139.767295,"tags_ja":"スイーツ店","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":24214,"shop_id":null,"img_src":null,"href":"/maps/24214","name":"ユニクロ(UNIQLO)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"","genres":[],"pref":{"id":13,"name":"東京"}},{"id":56528,"shop_id":null,"img_src":null,"href":"/maps/56528","name":"ラデュレ(Ladurée)","lat":35.681832,"lng":139.766775,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":63236,"shop_id":null,"img_src":null,"href":"/maps/63236","name":"ロアリブ(ROAliv)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"beauty","genres":["ビューティ"],"pref":{"id":13,"name":"東京"}},{"id":56374,"shop_id":null,"img_src":null,"href":"/maps/56374","name":"中川政七商店 服(Nakagawa Masashichi Shoten Bunten Fuku GranSta)","lat":35.681832,"lng":139.766775,"tags_ja":"ショップ","genre":"goods","genres":["グッズ"],"pref":{"id":13,"name":"東京"}},{"id":41828,"shop_id":null,"img_src":null,"href":"/maps/41828","name":"東京ミルクチーズ工場 東京駅グランスタ(TOKYO MILK CHEESE FACTORY)","lat":35.681518,"lng":139.767295,"tags_ja":"スイーツ店","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":68067,"shop_id":null,"img_src":null,"href":"/maps/68067","name":"船橋屋こよみ(Funabashiya koyomi)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}}]
var map_bounds = null
var doScale = true
var show_maps = []
var markerData = [{"id":62331,"shop_id":2821,"img_src":null,"href":"/maps/62331","name":"ABCマート(ABC-MART)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"shoes","genres":["シューズ"],"pref":{"id":13,"name":"東京"}},{"id":61439,"shop_id":null,"img_src":null,"href":"/maps/61439","name":"Made in ピエール・エルメ(Made in PIERRE HERMÉ)","lat":35.681832,"lng":139.766775,"tags_ja":"ショップ, レストラン・カフェ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62336,"shop_id":null,"img_src":null,"href":"/maps/62336","name":"とらや 東京駅グランスタ(TORAYA)","lat":35.681518,"lng":139.767295,"tags_ja":"スイーツ店","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62829,"shop_id":null,"img_src":null,"href":"/maps/62829","name":"アイボリッシュ(Ivorish)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62330,"shop_id":null,"img_src":null,"href":"/maps/62330","name":"アネモネ(ANEMONE)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"accessary,goods","genres":["アクセサリ","グッズ"],"pref":{"id":13,"name":"東京"}},{"id":62334,"shop_id":null,"img_src":null,"href":"/maps/62334","name":"アンリ・シャルパンティエ 東京駅グランスタ(Henri Charpentier)","lat":35.681518,"lng":139.767295,"tags_ja":"スイーツ店","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":8153,"shop_id":null,"img_src":null,"href":"/maps/8153","name":"オサジ(OSAJI)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"beauty,gourmet","genres":["ビューティ","グルメ"],"pref":{"id":13,"name":"東京"}},{"id":43739,"shop_id":null,"img_src":null,"href":"/maps/43739","name":"オードリー 東京駅グランスタ(AUDREY)","lat":35.681518,"lng":139.767295,"tags_ja":"スイーツ店","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":59142,"shop_id":null,"img_src":null,"href":"/maps/59142","name":"カファレル(Caffarel)","lat":35.68173,"lng":139.766185,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62338,"shop_id":null,"img_src":null,"href":"/maps/62338","name":"ガトーフェスタ ハラダ(GATEAU FESTA HARADA)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62332,"shop_id":null,"img_src":null,"href":"/maps/62332","name":"グラニフ(graniph)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"","genres":[],"pref":{"id":13,"name":"東京"}},{"id":62337,"shop_id":null,"img_src":null,"href":"/maps/62337","name":"コロンバン(colombin)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":66697,"shop_id":null,"img_src":null,"href":"/maps/66697","name":"ゴンチャ(Gong cha)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ, レストラン・カフェ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62342,"shop_id":null,"img_src":null,"href":"/maps/62342","name":"ジンズ(JINS)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"eyewear","genres":["眼鏡&サングラス"],"pref":{"id":13,"name":"東京"}},{"id":9463,"shop_id":null,"img_src":null,"href":"/maps/9463","name":"スターバックス コーヒー 東京駅 グランルーフ 東京駅グランスタ(Starbucks)","lat":35.681518,"lng":139.767295,"tags_ja":"レストラン・カフェ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":67465,"shop_id":null,"img_src":null,"href":"/maps/67465","name":"スターバックス 東京駅グランスタ(Starbucks Coffee)","lat":35.681518,"lng":139.767295,"tags_ja":"レストラン・カフェ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":24213,"shop_id":null,"img_src":null,"href":"/maps/24213","name":"スリーコインズ(3COINS)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"goods","genres":["グッズ"],"pref":{"id":13,"name":"東京"}},{"id":62341,"shop_id":null,"img_src":null,"href":"/maps/62341","name":"タリーズコーヒー 東京駅グランスタ(TULLY'S COFFEE)","lat":35.681518,"lng":139.767295,"tags_ja":"レストラン・カフェ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":64833,"shop_id":null,"img_src":null,"href":"/maps/64833","name":"ディーン&デルーカ(DEAN \u0026 DELUCA)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"","genres":[],"pref":{"id":13,"name":"東京"}},{"id":65555,"shop_id":null,"img_src":null,"href":"/maps/65555","name":"パティスリー ギンノモリ グランスタ東京店(PATEISSERIE GIN NO MORI)","lat":35.681518,"lng":139.767295,"tags_ja":"スイーツ店","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62329,"shop_id":3225,"img_src":null,"href":"/maps/62329","name":"ビープル(Biople)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"beauty,gourmet","genres":["ビューティ","グルメ"],"pref":{"id":13,"name":"東京"}},{"id":25615,"shop_id":null,"img_src":null,"href":"/maps/25615","name":"ピエール マルコリーニ 東京駅グランスタ(Pierre Marcolini)","lat":35.681832,"lng":139.766775,"tags_ja":"スイーツ店","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62335,"shop_id":null,"img_src":null,"href":"/maps/62335","name":"フェアリーケーキフェア(Fairycake Fair)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":62328,"shop_id":null,"img_src":null,"href":"/maps/62328","name":"ベイク チーズタルト(BAKE CHEESE TART)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":68066,"shop_id":null,"img_src":null,"href":"/maps/68066","name":"ミスターチーズケーキ(Mr. CHEESECAKE)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":59928,"shop_id":null,"img_src":null,"href":"/maps/59928","name":"メゾンカカオ グランスタ(MAISON CACAO GranSta)","lat":35.681832,"lng":139.766775,"tags_ja":"スイーツ店","genre":"","genres":[],"pref":{"id":13,"name":"東京"}},{"id":23049,"shop_id":null,"img_src":null,"href":"/maps/23049","name":"メリーチョコレート 東京駅グランスタ(Mary's Chocolate)","lat":35.681518,"lng":139.767295,"tags_ja":"スイーツ店","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":24214,"shop_id":null,"img_src":null,"href":"/maps/24214","name":"ユニクロ(UNIQLO)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"","genres":[],"pref":{"id":13,"name":"東京"}},{"id":56528,"shop_id":null,"img_src":null,"href":"/maps/56528","name":"ラデュレ(Ladurée)","lat":35.681832,"lng":139.766775,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":63236,"shop_id":null,"img_src":null,"href":"/maps/63236","name":"ロアリブ(ROAliv)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"beauty","genres":["ビューティ"],"pref":{"id":13,"name":"東京"}},{"id":56374,"shop_id":null,"img_src":null,"href":"/maps/56374","name":"中川政七商店 服(Nakagawa Masashichi Shoten Bunten Fuku GranSta)","lat":35.681832,"lng":139.766775,"tags_ja":"ショップ","genre":"goods","genres":["グッズ"],"pref":{"id":13,"name":"東京"}},{"id":41828,"shop_id":null,"img_src":null,"href":"/maps/41828","name":"東京ミルクチーズ工場 東京駅グランスタ(TOKYO MILK CHEESE FACTORY)","lat":35.681518,"lng":139.767295,"tags_ja":"スイーツ店","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}},{"id":68067,"shop_id":null,"img_src":null,"href":"/maps/68067","name":"船橋屋こよみ(Funabashiya koyomi)","lat":35.681518,"lng":139.767295,"tags_ja":"ショップ","genre":"gourmet","genres":["グルメ"],"pref":{"id":13,"name":"東京"}}]
var center = null
var zoom = 15
var selected = {pref_index: 0, map_index: 0}
var const_map_genre = {"beauty":"ビューティ","wear":"ウェア","under":"ルーム&アンダーウェア","mens":"メンズ","womens":"ウィメンズ","shoes":"シューズ","sports_and_outdoor":"スポーツ&アウトドア","gourmet":"グルメ","goods":"グッズ","accessary":"アクセサリ","kids":"キッズ","watch":"腕時計","eyewear":"眼鏡&サングラス"}
if($(window).width()<=768){ // スマホ
}else{
$(".fp_maps .column").show()
initMap(doScale)
map_initialized = true
}
$(".fp_maps .change_area").change(function(){
var pref_id = $('.fp_maps .select_pref select option:selected').data("prefid");
show_maps = []
$.each(maps, function(i ,e){
if(e.pref.id==pref_id || pref_id == 'all'){
show_maps.push(e);
}
})
update_show_maps()
markerData = show_maps
initMap(doScale)
})
function bind_map_hover_if_desktop(){
if($(window).width() >= 769){
$(".other_map,.ot_rich_map").unbind("hover")
$(".other_map,.ot_rich_map").hover(function(){
$.each(markerData, function(i, mker){
markerData[i].infoWindow.close()
})
map_id = $(this).attr("data-id")
$.each(markerData, function(i, mker){
if(mker.id == map_id){
google.maps.event.trigger(markerData[i].marker, 'click');
}
})
},function(){
})
}
}
function markerEvent(map, marker, infoWindow) {
marker.addListener('click', function() { // マーカーをクリックしたとき
infoWindow.open(map, marker); // 吹き出しの表示
});
}
async function initMap(do_scale){
var markers = [];
var infoWindow = [];
if(center != null){
gmap = new Map(document.getElementById('googlemap'), { // bind map to #map
center: {lat: parseFloat(center.lat), lng: parseFloat(center.lng)},
zoom: zoom,
mapId: "fp_map"
});
var marker = new AdvancedMarkerElement({
position: {lat: parseFloat(center.lat), lng: parseFloat(center.lng)},
map: gmap,
});
popup = get_popup(center)
var infoWindow = new google.maps.InfoWindow({ // 吹き出し
content: popup
})
markerEvent(gmap, marker, infoWindow);
}else{
gmap = new Map(document.getElementById('googlemap'), { // bind map to #map
center: {lat: parseFloat(markerData[0]['lat']), lng: parseFloat(markerData[0]['lng'])},
zoom: zoom,
mapId: "fp_map"
});
}
map_bounds = createMarker(gmap, markers, infoWindow, do_scale)
bind_map_hover_if_desktop()
bind_map_click()
}
function createMarkerOfCurrentPosition(map, bounds){
if (navigator.geolocation) {
// 現在地を取得
navigator.geolocation.getCurrentPosition(
function(position) {
// 成功
var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
var marker = new AdvancedMarkerElement({
map : map,
position : latlng,
});
// circle = new google.maps.Circle({
// map: map,
// center: latlng,
// radius: 1000,//1km
// strokeColor: "#3273dc33",
// strokeOpacity: 1,
// strokeWeight: 1,
// fillColor: "#3273dc33",
// fillOpacity: 0.2
// });
map.panTo(latlng);
map.setZoom(15);
},function(error) {
//失敗
}
);
}
}
function isInfoWindowOpen(infoWindow){
var map = infoWindow.getMap();
return (map !== null && typeof map !== "undefined");
}
function createMarker(map, marker, infoWindow, do_scale){
var bounds = new google.maps.LatLngBounds();
var quadrant = {"1": 3, "2": 4, "3": 1,"4": 1,"5": 2,"6": 3,"7": 3,"8": 3,"9": 4,"10": 4,"11": 4,"12": 1,"13": 1,"14": 1,"15": 2,"16": 2,"17": 2,"18": 2,"19": 3,"20": 3,"21": 3,"22": 3,"23": 3,"24": 4,"25": 4,"26": 4,"27": 4,"28": 4,"29": 1,"30": 1,"31": 1,"32": 1,"33": 1,"34": 2,"35": 2,"36": 2,"37": 2,"38": 2,"39": 2,"40": 3}
var qudrant_layer = {"1": 1, "2": 1, "3": 1,"4": 1,"5": 2,"6": 2,"7": 2,"8": 2,"9": 2,"10": 2, "11": 2, "12": 2, "13": 2,"14": 2,"15": 2,"16": 2,"17": 3,"18": 3,"19": 3,"20": 3,"21": 3, "22": 3, "23": 3,"24": 3,"25": 3,"26": 3,"27": 3,"28": 3,"29": 3,"30": 3,"31": 3, "32": 3, "33": 3,"34": 3,"35": 3,"36": 3,"37": 4,"38": 4,"39": 4,"40": 4}
var lat_unit = 2.5 * 0.000010966382364 //1mあたり経度(lat) : 0.000010966382364
var lng_unit = 2.5 * 0.000008983148616 //1mあたり緯度(lng) : 0.000008983148616
// create marker
for (var i = 0; i < markerData.length; i++) {
var count = 0//同一地点が何箇所あるか?
for(var j=0; j
0){
switch(quadrant[count.toString()]){
case 1:
adjust = {lat: qudrant_layer[count.toString()]*lat_unit, lng: qudrant_layer[count.toString()]*lng_unit}
break;
case 2:
adjust = {lat: qudrant_layer[count.toString()]*lat_unit, lng: -qudrant_layer[count.toString()]*lng_unit}
break;
case 3:
adjust = {lat: -qudrant_layer[count.toString()]*lat_unit, lng: -qudrant_layer[count.toString()]*lng_unit}
break;
case 4:
adjust = {lat: -qudrant_layer[count.toString()]*lat_unit, lng: qudrant_layer[count.toString()]*lng_unit}
break;
default:
break;
}
}
markerLatLng = {
lat: parseFloat(markerData[i]['lat'])+adjust["lat"],
lng: parseFloat(markerData[i]['lng'])+adjust["lng"]
}; // 緯度経度のデータ作成
if(center != null){
marker[i] = new AdvancedMarkerElement({
position: markerLatLng,
map: map
});
}else{
marker[i] = new AdvancedMarkerElement({
position: markerLatLng,
map: map,
});
}
if(do_scale){
//scaling
bounds.extend (marker[i].position);
}
popup = get_popup(markerData[i])
infoWindow[i] = new google.maps.InfoWindow({ // 吹き出し
content: popup
})
// Register a click event listener on the marker to display the corresponding infowindow content
google.maps.event.addListener(marker[i], 'click', (function (marker, i) {
return function () {
infoWindow[i].open(map, marker[i])
}
})(marker[i], i));
markerData[i].marker = marker[i]
markerData[i].infoWindow = infoWindow[i]
markerEvent(map, marker[i],infoWindow[i]);
}
if(do_scale){
//scaling confirm, ピンの範囲でzoomを自動調整
map.fitBounds(bounds);
var markerCluster = new markerClusterer.MarkerClusterer({
map: map,
markers: marker,
algorithm: new markerClusterer.GridAlgorithm({ maxDistance: 4000 })
});
}
google.maps.event.addListenerOnce(gmap, 'bounds_changed', function(event) {
if (this.getZoom() > 16) {
this.setZoom(16);
}
});
return bounds
}
function get_popup(map){
target_ = "_blank"
img_tag = ""
class_ = ""
if(map.img_src!=null){
img_tag = ''
class_ = "with_img"
}
popup =
'' +
''
return popup
}
}
if(show_google_map){
main()
}
})