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.947319", "139.330406");
createMarker(map_canvas, markerPos0, "
豊島歯科医院新発田市中央町1-1-2
TEL 0254-22-2169
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.947319", "139.330406"));
cnt = cnt+1;
var markerPos1 = new google.maps.LatLng("37.942565", "139.334917");
createMarker(map_canvas, markerPos1, "片山歯科医院新発田市豊町2-1-20
TEL 0254-22-1188
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.942565", "139.334917"));
cnt = cnt+1;
var markerPos2 = new google.maps.LatLng("37.951233", "139.319321");
createMarker(map_canvas, markerPos2, "西方歯科医院新発田市大手町2-9-10
TEL 0254-22-2755
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.951233", "139.319321"));
cnt = cnt+1;
var markerPos3 = new google.maps.LatLng("37.9432059", "139.3256234");
createMarker(map_canvas, markerPos3, "西方歯科診療所新発田市大栄町3-1-16
TEL 0254-23-6480
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.9432059", "139.3256234"));
cnt = cnt+1;
var markerPos4 = new google.maps.LatLng("37.946281", "139.327273");
createMarker(map_canvas, markerPos4, "村山歯科医院新発田市大栄町7-1-8
TEL 0254-23-1019
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.946281", "139.327273"));
cnt = cnt+1;
var markerPos5 = new google.maps.LatLng("37.951483", "139.322693");
createMarker(map_canvas, markerPos5, "山崎歯科医院新発田市大手町2-2-2
TEL 0254-24-2171
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.951483", "139.322693"));
cnt = cnt+1;
var markerPos6 = new google.maps.LatLng("37.939426", "139.324574");
createMarker(map_canvas, markerPos6, "布村歯科医院新発田市大栄町6-6-21
TEL 0254-26-1579
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.939426", "139.324574"));
cnt = cnt+1;
var markerPos7 = new google.maps.LatLng("37.947952", "139.318455");
createMarker(map_canvas, markerPos7, "大平歯科医院新発田市御幸町2-4-6
TEL 0254-23-2117
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.947952", "139.318455"));
cnt = cnt+1;
var markerPos8 = new google.maps.LatLng("37.945878", "139.33142");
createMarker(map_canvas, markerPos8, "白勢歯科医院新発田市諏訪町1-4-9
TEL 0254-23-2130
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.945878", "139.33142"));
cnt = cnt+1;
var markerPos9 = new google.maps.LatLng("37.940291", "139.339043");
createMarker(map_canvas, markerPos9, "原田歯科医院新発田市豊町2-6
TEL 0254-23-2333
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.940291", "139.339043"));
cnt = cnt+1;
var markerPos10 = new google.maps.LatLng("37.97067", "139.363346");
createMarker(map_canvas, markerPos10, "田崎歯科医院新発田市上館甲701
TEL 0254-24-6880
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.97067", "139.363346"));
cnt = cnt+1;
var markerPos11 = new google.maps.LatLng("37.944034", "139.323654");
createMarker(map_canvas, markerPos11, "有田歯科医院新発田市大栄町3-3-18
TEL 0254-23-5411
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.944034", "139.323654"));
cnt = cnt+1;
var markerPos12 = new google.maps.LatLng("37.950746", "139.308431");
createMarker(map_canvas, markerPos12, "キフネ歯科医院新発田市住吉町3-3-30
TEL 0254-23-5588
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.950746", "139.308431"));
cnt = cnt+1;
var markerPos13 = new google.maps.LatLng("37.950988", "139.321712");
createMarker(map_canvas, markerPos13, "佐藤歯科医院新発田市大手町2-5-2
TEL 0254-22-2134
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.950988", "139.321712"));
cnt = cnt+1;
var markerPos14 = new google.maps.LatLng("37.954782", "139.327478");
createMarker(map_canvas, markerPos14, "貴船歯科クリニック新発田市大手町5-2-12
TEL 0254-26-5366
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.954782", "139.327478"));
cnt = cnt+1;
var markerPos15 = new google.maps.LatLng("37.934566", "139.345308");
createMarker(map_canvas, markerPos15, "こばやし歯科医院新発田市五十公野7096
TEL 0254-26-2122
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.934566", "139.345308"));
cnt = cnt+1;
var markerPos16 = new google.maps.LatLng("37.949772", "139.328601");
createMarker(map_canvas, markerPos16, "山田歯科医院新発田市中央町1-6-19
TEL 0254-24-8318
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.949772", "139.328601"));
cnt = cnt+1;
var markerPos17 = new google.maps.LatLng("37.954624", "139.337063");
createMarker(map_canvas, markerPos17, "柳川歯科医院新発田市新富町1-5-10
TEL 0254-22-6655
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.954624", "139.337063"));
cnt = cnt+1;
var markerPos18 = new google.maps.LatLng("37.963006", "139.318871");
createMarker(map_canvas, markerPos18, "稲富歯科医院新発田市城北町3-8-2
TEL 0254-26-8008
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.963006", "139.318871"));
cnt = cnt+1;
var markerPos19 = new google.maps.LatLng("37.938737", "139.383292");
createMarker(map_canvas, markerPos19, "飯島歯科医院新発田市下羽津2112-1
TEL 0254-25-3391
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.938737", "139.383292"));
cnt = cnt+1;
var markerPos20 = new google.maps.LatLng("37.946569", "139.312489");
createMarker(map_canvas, markerPos20, "小宮歯科医院新発田市住吉町4-2-20
TEL 0254-24-5959
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.946569", "139.312489"));
cnt = cnt+1;
var markerPos21 = new google.maps.LatLng("37.952533", "139.263427");
createMarker(map_canvas, markerPos21, "野田歯科医院新発田市佐々木164
TEL 0254-27-8301
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.952533", "139.263427"));
cnt = cnt+1;
var markerPos22 = new google.maps.LatLng("37.924473", "139.354494");
createMarker(map_canvas, markerPos22, "田上歯科医院新発田市五十公野5083-3
TEL 0254-22-8148
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.924473", "139.354494"));
cnt = cnt+1;
var markerPos23 = new google.maps.LatLng("37.960504", "139.333369");
createMarker(map_canvas, markerPos23, "阿部矯正歯科医院新発田市緑町2-16-23
TEL 0254-24-0508
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.960504", "139.333369"));
cnt = cnt+1;
var markerPos24 = new google.maps.LatLng("37.940418", "139.341614");
createMarker(map_canvas, markerPos24, "石井歯科クリニック新発田市豊町4-5-3
TEL 0254-26-6298
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.940418", "139.341614"));
cnt = cnt+1;
var markerPos25 = new google.maps.LatLng("37.947678", "139.328912");
createMarker(map_canvas, markerPos25, "長島歯科医院新発田市中央町1-3-6
TEL 0254-22-2282
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.947678", "139.328912"));
cnt = cnt+1;
var markerPos26 = new google.maps.LatLng("37.966499", "139.360849");
createMarker(map_canvas, markerPos26, "石橋歯科医院新発田市三日市473-3
TEL 0254-21-1484
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.966499", "139.360849"));
cnt = cnt+1;
var markerPos27 = new google.maps.LatLng("37.953342", "139.29991");
createMarker(map_canvas, markerPos27, "いいじま歯科クリニック新発田市新栄町1-6-13
TEL 0254-23-0648
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.953342", "139.29991"));
cnt = cnt+1;
var markerPos28 = new google.maps.LatLng("37.956703", "139.309014");
createMarker(map_canvas, markerPos28, "木戸歯科医院新発田市舟入町2-5-4
TEL 0254-23-8020
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.956703", "139.309014"));
cnt = cnt+1;
var markerPos29 = new google.maps.LatLng("37.968222", "139.327717");
createMarker(map_canvas, markerPos29, "歯科小林クリニック新発田市小舟町2丁目1-21
TEL 0254-24-0808
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.968222", "139.327717"));
cnt = cnt+1;
var markerPos30 = new google.maps.LatLng("38.01659269", "139.3247609");
createMarker(map_canvas, markerPos30, "河内歯科医院新発田市稲荷岡2068
TEL 0254-41-2016
[医院詳細]
");
bounds.extend(new google.maps.LatLng("38.01659269", "139.3247609"));
cnt = cnt+1;
var markerPos31 = new google.maps.LatLng("37.959629", "139.337869");
createMarker(map_canvas, markerPos31, "スズキ歯科医院新発田市緑町2-4-12
TEL 0254-26-5506
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.959629", "139.337869"));
cnt = cnt+1;
var markerPos32 = new google.maps.LatLng("37.881034", "139.310395");
createMarker(map_canvas, markerPos32, "赤松歯科医院新発田市月岡温泉590
TEL 0254-32-3166
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.881034", "139.310395"));
cnt = cnt+1;
var markerPos33 = new google.maps.LatLng("38.019434", "139.38147");
createMarker(map_canvas, markerPos33, "佐藤歯科医院新発田市下小中山1024-150
TEL 0254-33-2903
[医院詳細]
");
bounds.extend(new google.maps.LatLng("38.019434", "139.38147"));
cnt = cnt+1;
var markerPos34 = new google.maps.LatLng("38.012949", "139.320627");
createMarker(map_canvas, markerPos34, "斎藤歯科医院新発田市稲荷岡2400-5
TEL 0254-41-2700
[医院詳細]
");
bounds.extend(new google.maps.LatLng("38.012949", "139.320627"));
cnt = cnt+1;
var markerPos35 = new google.maps.LatLng("37.913358", "139.301484");
createMarker(map_canvas, markerPos35, "北村歯科医院新発田市下飯塚82
TEL 0254-23-5055
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.913358", "139.301484"));
cnt = cnt+1;
var markerPos36 = new google.maps.LatLng("37.9540433", "139.3193543");
createMarker(map_canvas, markerPos36, "山城歯科医院新発田市西園町3-1-33
TEL 0254-23-6222
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.9540433", "139.3193543"));
cnt = cnt+1;
var markerPos37 = new google.maps.LatLng("37.944228", "139.32594");
createMarker(map_canvas, markerPos37, "くまくら歯科医院新発田市大栄町2-2-20
TEL 0254-26-8148
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.944228", "139.32594"));
cnt = cnt+1;
var markerPos38 = new google.maps.LatLng("37.941923", "139.311672");
createMarker(map_canvas, markerPos38, "星野歯科医院新発田市住吉町5-14-2
TEL 0254-21-0960
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.941923", "139.311672"));
cnt = cnt+1;
var markerPos39 = new google.maps.LatLng("37.9469502", "139.3340863");
createMarker(map_canvas, markerPos39, "新潟県立新発田病院新発田市本町1-2-8
TEL 0254-22-3121
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.9469502", "139.3340863"));
cnt = cnt+1;
var markerPos40 = new google.maps.LatLng("37.9552089", "139.3041452");
createMarker(map_canvas, markerPos40, "齋藤デンタルクリニック新発田市舟入町3-13-2
TEL 0254-21-0031
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.9552089", "139.3041452"));
cnt = cnt+1;
var markerPos41 = new google.maps.LatLng("37.9502995", "139.3238122");
createMarker(map_canvas, markerPos41, "宇賀村歯科医院新発田市大手町1-11-12
TEL 0254-22-2232
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.9502995", "139.3238122"));
cnt = cnt+1;
var markerPos42 = new google.maps.LatLng("37.9600702", "139.3174683");
createMarker(map_canvas, markerPos42, "ハート歯科クリニック新発田市中曽根町1-3-10
TEL 0254-21-7667
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.9600702", "139.3174683"));
cnt = cnt+1;
var markerPos43 = new google.maps.LatLng("37.9524743", "139.3275923");
createMarker(map_canvas, markerPos43, "おぐま歯科医院新発田市中央町4-11-15
TEL 0254-28-7557
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.9524743", "139.3275923"));
cnt = cnt+1;
var markerPos44 = new google.maps.LatLng("37.9621418", "139.3104385");
createMarker(map_canvas, markerPos44, "片桐歯科医院新発田市中曽根町3-13-4
TEL 0254-20-0648
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.9621418", "139.3104385"));
cnt = cnt+1;
var markerPos45 = new google.maps.LatLng("37.9524743", "139.3275923");
createMarker(map_canvas, markerPos45, "鈴木歯科医院新発田市中央町4-11-15
TEL 0254-22-5505
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.9524743", "139.3275923"));
cnt = cnt+1;
var markerPos46 = new google.maps.LatLng("37.9317709", "139.3212771");
createMarker(map_canvas, markerPos46, "遠藤歯科クリニック新発田市荒町甲1456-3
TEL 0254-24-0100
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.9317709", "139.3212771"));
cnt = cnt+1;
var markerPos47 = new google.maps.LatLng("37.9442536", "139.3034168");
createMarker(map_canvas, markerPos47, "まるやま歯科医院新発田市富塚町1-24-15
TEL 0254-28-9242
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.9442536", "139.3034168"));
if (cnt > 0) {
if (cnt == 1) {
map_canvas.setCenter(new google.maps.LatLng(37.9442536, 139.3034168));
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;