var currentInfoWindow = null; //最後に開いた情報ウィンドウを記憶
var geocoder;
var map_canvas;
var initPos;
var map_Point_Y;
var map_Point_X;
var bounds;
function initialize() {
geocoder = new google.maps.Geocoder();
//地図初期化
initPos = new google.maps.LatLng(37.900747, 139.049799);
var myOptions = {
center : initPos,
zoom : 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map_canvas = new google.maps.Map(document.getElementById("map"), myOptions);
setMarker();
}
function setMarker() {
var bounds = new google.maps.LatLngBounds();
var sai = "0.1";
var minLat = parseFloat(map_Point_X) - parseFloat(sai);
var minLon = parseFloat(map_Point_Y) - parseFloat(sai);
var maxLat = parseFloat(map_Point_X) + parseFloat(sai);
var maxLon = parseFloat(map_Point_Y) + parseFloat(sai);
var cnt = 0;
var $tmplon = "";
var $tmplon = "";
cnt = cnt+1;
var markerPos0 = new google.maps.LatLng("37.663183", "138.914987");
createMarker(map_canvas, markerPos0, "
齋藤歯科医院燕市秋葉町4-6-27
TEL 0256-64-5210
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.663183", "138.914987"));
cnt = cnt+1;
var markerPos1 = new google.maps.LatLng("37.661175", "138.918026");
createMarker(map_canvas, markerPos1, "高井歯科医院燕市秋葉町3-7-23
TEL 0256-63-2492
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.661175", "138.918026"));
cnt = cnt+1;
var markerPos2 = new google.maps.LatLng("37.66634479", "138.9285501");
createMarker(map_canvas, markerPos2, "筒井歯科医院燕市本町2-3-10
TEL 0256-62-2593
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.66634479", "138.9285501"));
cnt = cnt+1;
var markerPos3 = new google.maps.LatLng("37.661461", "138.922714");
createMarker(map_canvas, markerPos3, "細山歯科医院燕市秋葉町1-8-11
TEL 0256-62-2277
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.661461", "138.922714"));
cnt = cnt+1;
var markerPos4 = new google.maps.LatLng("37.686064", "138.879285");
createMarker(map_canvas, markerPos4, "石田歯科医院燕市吉田日之出町2-11
TEL 0256-93-4194
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.686064", "138.879285"));
cnt = cnt+1;
var markerPos5 = new google.maps.LatLng("37.627427", "138.84241");
createMarker(map_canvas, markerPos5, "宮本歯科医院燕市地蔵堂本町3-6-1
TEL 0256-97-2022
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.627427", "138.84241"));
cnt = cnt+1;
var markerPos6 = new google.maps.LatLng("37.66375607", "138.9315055");
createMarker(map_canvas, markerPos6, "高桑歯科医院燕市新町2-37
TEL 0256-64-2785
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.66375607", "138.9315055"));
cnt = cnt+1;
var markerPos7 = new google.maps.LatLng("37.68813", "138.879741");
createMarker(map_canvas, markerPos7, "亀倉歯科医院燕市吉田堤町11-5
TEL 0256-92-7393
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.68813", "138.879741"));
cnt = cnt+1;
var markerPos8 = new google.maps.LatLng("37.620741", "138.841238");
createMarker(map_canvas, markerPos8, "八子歯科医院燕市五千石3649-1
TEL 0256-98-2520
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.620741", "138.841238"));
cnt = cnt+1;
var markerPos9 = new google.maps.LatLng("37.6680406", "138.9193809");
createMarker(map_canvas, markerPos9, "五十嵐歯科医院燕市東太田2971-1
TEL 0256-64-2174
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.6680406", "138.9193809"));
cnt = cnt+1;
var markerPos10 = new google.maps.LatLng("37.701618", "138.881165");
createMarker(map_canvas, markerPos10, "さとう歯科クリニック燕市吉田文京町2-15
TEL 0256-93-3022
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.701618", "138.881165"));
cnt = cnt+1;
var markerPos11 = new google.maps.LatLng("37.665244", "138.920017");
createMarker(map_canvas, markerPos11, "本多歯科医院燕市白山町1-1-14
TEL 0256-63-8241
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.665244", "138.920017"));
cnt = cnt+1;
var markerPos12 = new google.maps.LatLng("37.652329", "138.938221");
createMarker(map_canvas, markerPos12, "さとう歯科クリニック燕市井土巻5-33
TEL 0256-62-4422
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.652329", "138.938221"));
cnt = cnt+1;
var markerPos13 = new google.maps.LatLng("37.6857", "138.957393");
createMarker(map_canvas, markerPos13, "小湊歯科医院燕市次新1048-2
TEL 0256-63-9445
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.6857", "138.957393"));
cnt = cnt+1;
var markerPos14 = new google.maps.LatLng("37.640027", "138.912686");
createMarker(map_canvas, markerPos14, "はすみ歯科医院燕市道金860-1
TEL 0256-62-4182
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.640027", "138.912686"));
cnt = cnt+1;
var markerPos15 = new google.maps.LatLng("37.668305", "138.933241");
createMarker(map_canvas, markerPos15, "篠原歯科医院燕市中央通3-6-20
TEL 0256-66-3111
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.668305", "138.933241"));
cnt = cnt+1;
var markerPos16 = new google.maps.LatLng("37.627404", "138.845632");
createMarker(map_canvas, markerPos16, "なかじま歯科医院燕市分水学校町1-1-19
TEL 0256-97-1110
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.627404", "138.845632"));
cnt = cnt+1;
var markerPos17 = new google.maps.LatLng("37.696443", "138.876113");
createMarker(map_canvas, markerPos17, "河田歯科医院燕市吉田本所99-3
TEL 0256-93-4608
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.696443", "138.876113"));
cnt = cnt+1;
var markerPos18 = new google.maps.LatLng("37.633692", "138.841263");
createMarker(map_canvas, markerPos18, "佐藤歯科医院燕市分水文京町2-1
TEL 0256-98-4181
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.633692", "138.841263"));
cnt = cnt+1;
var markerPos19 = new google.maps.LatLng("37.67146", "138.931552");
createMarker(map_canvas, markerPos19, "わたべ歯科クリニック燕市東太田1204-2
TEL 0256-63-8148
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.67146", "138.931552"));
cnt = cnt+1;
var markerPos20 = new google.maps.LatLng("37.693633", "138.886273");
createMarker(map_canvas, markerPos20, "渡部歯科医院燕市吉田2780-2
TEL 0256-93-6483
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.693633", "138.886273"));
cnt = cnt+1;
var markerPos21 = new google.maps.LatLng("37.62743", "138.852673");
createMarker(map_canvas, markerPos21, "穂苅歯科医院燕市笈ケ島1223-1
TEL 0256-98-6474
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.62743", "138.852673"));
cnt = cnt+1;
var markerPos22 = new google.maps.LatLng("37.627233", "138.881879");
createMarker(map_canvas, markerPos22, "いとう歯科医院燕市横田519-3
TEL 0256-66-5533
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.627233", "138.881879"));
cnt = cnt+1;
var markerPos23 = new google.maps.LatLng("37.625538", "138.852923");
createMarker(map_canvas, markerPos23, "タグチ歯科医院燕市新興野8-33
TEL 0256-91-3200
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.625538", "138.852923"));
cnt = cnt+1;
var markerPos24 = new google.maps.LatLng("37.677138", "138.904616");
createMarker(map_canvas, markerPos24, "奥山歯科医院燕市杣木3167-1
TEL 0256-61-2250
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.677138", "138.904616"));
cnt = cnt+1;
var markerPos25 = new google.maps.LatLng("37.659748", "138.910511");
createMarker(map_canvas, markerPos25, "美樹歯科クリニック燕市水道町4-484-1
TEL 0256-66-4618
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.659748", "138.910511"));
cnt = cnt+1;
var markerPos26 = new google.maps.LatLng("37.639738", "138.921169");
createMarker(map_canvas, markerPos26, "江村歯科医院燕市八王寺703
TEL 0256-61-5884
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.639738", "138.921169"));
cnt = cnt+1;
var markerPos27 = new google.maps.LatLng("37.616795", "138.84591");
createMarker(map_canvas, markerPos27, "田邊歯科医院燕市大川津1126-10
TEL 0256-98-0300
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.616795", "138.84591"));
cnt = cnt+1;
var markerPos28 = new google.maps.LatLng("37.69895782", "138.8836611");
createMarker(map_canvas, markerPos28, "デンタルクリニック ツチヤ燕市吉田3751
TEL 0256-93-1182
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.69895782", "138.8836611"));
cnt = cnt+1;
var markerPos29 = new google.maps.LatLng("37.665661", "138.926322");
createMarker(map_canvas, markerPos29, "井手口歯科クリニック燕市東太田7047-1
TEL 0256-66-5788
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.665661", "138.926322"));
cnt = cnt+1;
var markerPos30 = new google.maps.LatLng("37.6918631", "138.87015");
createMarker(map_canvas, markerPos30, "よしだ歯科クリニック燕市吉田浜首町29-18
TEL 0256-93-5205
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.6918631", "138.87015"));
cnt = cnt+1;
var markerPos31 = new google.maps.LatLng("37.6810117", "138.874072");
createMarker(map_canvas, markerPos31, "小司歯科医院燕市吉田東栄町51-17
TEL 0256-92-2211
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.6810117", "138.874072"));
cnt = cnt+1;
var markerPos32 = new google.maps.LatLng("37.6528234", "138.9319888");
createMarker(map_canvas, markerPos32, "とさかデンタルクリニック燕市井土巻2-237
TEL 0256-66-3748
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.6528234", "138.9319888"));
cnt = cnt+1;
var markerPos33 = new google.maps.LatLng("37.696235", "138.882509");
createMarker(map_canvas, markerPos33, "東町歯科医院燕市吉田東町3257-4
TEL 0256-92-7300
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.696235", "138.882509"));
cnt = cnt+1;
var markerPos34 = new google.maps.LatLng("37.6776123", "138.8784744");
createMarker(map_canvas, markerPos34, "親水公園前歯科燕市吉田下中野3406
TEL 0256-78-8422
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.6776123", "138.8784744"));
cnt = cnt+1;
var markerPos35 = new google.maps.LatLng("37.6578257", "138.9363687");
createMarker(map_canvas, markerPos35, "県央ランドマーク歯科燕市南7-17-9-5
TEL 0256-47-7031
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.6578257", "138.9363687"));
cnt = cnt+1;
var markerPos36 = new google.maps.LatLng("37.6873863", "138.8850623");
createMarker(map_canvas, markerPos36, "県立吉田病院燕市吉田大保町32-14
TEL 0256-92-5111
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.6873863", "138.8850623"));
if (cnt > 0) {
if (cnt == 1) {
map_canvas.setCenter(new google.maps.LatLng(37.6873863, 138.8850623));
map_canvas.setZoom(15);
} else {
map_canvas.fitBounds(bounds);
}
if(document.getElementById("search_cnt") != null) {
document.getElementById("search_cnt").innerHTML = cnt + "件該当しました。";
}
} else {
if(document.getElementById("search_cnt") != null) {
document.getElementById("search_cnt").innerHTML = "該当する情報がありません。";
}
}
}
function createMarker(map, latlng, text) {
var infoWndOpts = {
content : text
};
var infoWnd = new google.maps.InfoWindow(infoWndOpts);
var markerOpts = {
position : latlng,
map : map
};
var marker = new google.maps.Marker(markerOpts);
google.maps.event.addListener(marker, "click", function(){
//先に開いた情報ウィンドウがあれば、closeする
if (currentInfoWindow) {
currentInfoWindow.close();
}
//情報ウィンドウを開く
infoWnd.open(map, marker);
currentInfoWindow = infoWnd;
});
return marker;
}
function getLatLng(address) {
if (geocoder) {
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var bounds = new google.maps.LatLngBounds();
for (var i in results) {
if (results[i].geometry) {
// 緯度経度を取得
latlng = results[i].geometry.location;
// 緯度
map_Point_Y = latlng.lat();
// 経度
map_Point_X = latlng.lng();
map_canvas.setCenter(latlng);
}
}
setMarker();
}
});
}
}
window.onload = initialize;