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.951048", "139.147582");
createMarker(map_canvas, markerPos0, "
近藤歯科医院新潟市北区松浜本町1-12-14
TEL 025-259-7040
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.951048", "139.147582"));
cnt = cnt+1;
var markerPos1 = new google.maps.LatLng("37.927164", "139.156472");
createMarker(map_canvas, markerPos1, "萩原歯科医院新潟市北区つくし野2-1-1
TEL 025-259-8101
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.927164", "139.156472"));
cnt = cnt+1;
var markerPos2 = new google.maps.LatLng("37.922145", "139.184184");
createMarker(map_canvas, markerPos2, "ほんま歯科医院新潟市北区早通北4-6-31
TEL 025-386-1115
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.922145", "139.184184"));
cnt = cnt+1;
var markerPos3 = new google.maps.LatLng("37.955475", "139.153165");
createMarker(map_canvas, markerPos3, "有田歯科医院新潟市北区松浜東町2-13-34
TEL 025-259-8686
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.955475", "139.153165"));
cnt = cnt+1;
var markerPos4 = new google.maps.LatLng("37.949628", "139.148543");
createMarker(map_canvas, markerPos4, "北村歯科医院新潟市北区三軒屋町15-31
TEL 025-259-2627
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.949628", "139.148543"));
cnt = cnt+1;
var markerPos5 = new google.maps.LatLng("37.955865", "139.141362");
createMarker(map_canvas, markerPos5, "すずき歯科クリニック新潟市北区松浜6-13-27
TEL 025-258-3748
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.955865", "139.141362"));
cnt = cnt+1;
var markerPos6 = new google.maps.LatLng("37.919848", "139.159738");
createMarker(map_canvas, markerPos6, "すみれ野歯科医院新潟市北区すみれ野1-13-13
TEL 025-259-5085
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.919848", "139.159738"));
cnt = cnt+1;
var markerPos7 = new google.maps.LatLng("37.920653", "139.179292");
createMarker(map_canvas, markerPos7, "小林歯科医院新潟市北区早通南1-5-10
TEL 025-386-3103
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.920653", "139.179292"));
cnt = cnt+1;
var markerPos8 = new google.maps.LatLng("37.920254", "139.219449");
createMarker(map_canvas, markerPos8, "曽我歯科医院新潟市北区太田甲5629-8
TEL 025-386-3260
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.920254", "139.219449"));
cnt = cnt+1;
var markerPos9 = new google.maps.LatLng("37.919962", "139.223218");
createMarker(map_canvas, markerPos9, "本間歯科医院新潟市北区朝日町2-1-2
TEL 025-386-1414
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.919962", "139.223218"));
cnt = cnt+1;
var markerPos10 = new google.maps.LatLng("37.918337", "139.210264");
createMarker(map_canvas, markerPos10, "安達歯科医院新潟市北区柳原4-1-12
TEL 025-386-6400
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.918337", "139.210264"));
cnt = cnt+1;
var markerPos11 = new google.maps.LatLng("37.91701", "139.21703");
createMarker(map_canvas, markerPos11, "冨田歯科医院新潟市北区白新町2-4-21
TEL 025-387-2216
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.91701", "139.21703"));
cnt = cnt+1;
var markerPos12 = new google.maps.LatLng("37.918865", "139.177407");
createMarker(map_canvas, markerPos12, "吉副歯科医院新潟市北区早通南3-1-6
TEL 025-386-2121
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.918865", "139.177407"));
cnt = cnt+1;
var markerPos13 = new google.maps.LatLng("37.915871", "139.215786");
createMarker(map_canvas, markerPos13, "常木歯科医院新潟市北区白新町2-7-13
TEL 025-387-2050
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.915871", "139.215786"));
cnt = cnt+1;
var markerPos14 = new google.maps.LatLng("37.910505", "139.219597");
createMarker(map_canvas, markerPos14, "林歯科医院新潟市北区嘉山6-6-1
TEL 025-388-2200
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.910505", "139.219597"));
cnt = cnt+1;
var markerPos15 = new google.maps.LatLng("37.911547", "139.222513");
createMarker(map_canvas, markerPos15, "やまだデンタルクリニック新潟市北区東栄町1-12-9
TEL 025-388-1111
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.911547", "139.222513"));
cnt = cnt+1;
var markerPos16 = new google.maps.LatLng("37.913607", "139.210281");
createMarker(map_canvas, markerPos16, "ひぐち歯科医院新潟市北区葛塚白新町94-1
TEL 025-388-5336
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.913607", "139.210281"));
cnt = cnt+1;
var markerPos17 = new google.maps.LatLng("37.924209", "139.214958");
createMarker(map_canvas, markerPos17, "グリーン歯科医院新潟市北区石動1-2-37
TEL 025-387-0800
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.924209", "139.214958"));
cnt = cnt+1;
var markerPos18 = new google.maps.LatLng("37.921279", "139.211825");
createMarker(map_canvas, markerPos18, "もろ歯科クリニック新潟市北区石動1-23-4
TEL 025-388-1101
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.921279", "139.211825"));
cnt = cnt+1;
var markerPos19 = new google.maps.LatLng("37.922604", "139.213833");
createMarker(map_canvas, markerPos19, "豊栄病院新潟市北区石動1-11-1
TEL 025-386-2311
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.922604", "139.213833"));
cnt = cnt+1;
var markerPos20 = new google.maps.LatLng("37.931538", "139.173467");
createMarker(map_canvas, markerPos20, "新潟リハビリテーション病院新潟市北区木崎761
TEL 025-388-2111
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.931538", "139.173467"));
cnt = cnt+1;
var markerPos21 = new google.maps.LatLng("37.88288", "139.178955");
createMarker(map_canvas, markerPos21, "しげたに歯科医院新潟市北区長戸呂427-2
TEL 025-388-3600
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.88288", "139.178955"));
cnt = cnt+1;
var markerPos22 = new google.maps.LatLng("37.9175595", "139.1860865");
createMarker(map_canvas, markerPos22, "かとう歯科医院新潟市北区須戸2-6-40
TEL 025-384-6855
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.9175595", "139.1860865"));
cnt = cnt+1;
var markerPos23 = new google.maps.LatLng("37.920915", "139.2141247");
createMarker(map_canvas, markerPos23, "くまくらデンタルオフィス新潟市北区石動1-15-5
TEL 025-384-7888
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.920915", "139.2141247"));
cnt = cnt+1;
var markerPos24 = new google.maps.LatLng("37.9431928", "139.1915788");
createMarker(map_canvas, markerPos24, "こうの歯科医院新潟市北区木崎2761-36
TEL 025-282-7959
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.9431928", "139.1915788"));
cnt = cnt+1;
var markerPos25 = new google.maps.LatLng("37.9290055", "139.2184809");
createMarker(map_canvas, markerPos25, "おだ歯科医院新潟市北区かぶとやま2-1-62
TEL 025-282-5454
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.9290055", "139.2184809"));
cnt = cnt+1;
var markerPos26 = new google.maps.LatLng("37.9093014", "139.2198894");
createMarker(map_canvas, markerPos26, "小飯塚歯科クリニック新潟市北区嘉山5-6-8
TEL 025-212-2118
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.9093014", "139.2198894"));
cnt = cnt+1;
var markerPos27 = new google.maps.LatLng("37.9557284", "139.1407513");
createMarker(map_canvas, markerPos27, "すずき歯科クリニック新潟市北区松浜6-13-27
TEL 025-258-3748
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.9557284", "139.1407513"));
if (cnt > 0) {
if (cnt == 1) {
map_canvas.setCenter(new google.maps.LatLng(37.9557284, 139.1407513));
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;