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.723535", "138.885436");
createMarker(map_canvas, markerPos0, "
ひらさわ歯科医院新潟市西蒲区和納1443-1
TEL 0256-82-1100
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.723535", "138.885436"));
cnt = cnt+1;
var markerPos1 = new google.maps.LatLng("37.7635778", "138.8876045");
createMarker(map_canvas, markerPos1, "山添歯科医院・山添矯正歯科新潟市西蒲区巻甲2125
TEL 0256-72-2048
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.7635778", "138.8876045"));
cnt = cnt+1;
var markerPos2 = new google.maps.LatLng("37.75712724", "138.8881731");
createMarker(map_canvas, markerPos2, "竹内歯科医院新潟市西蒲区巻甲2529-11
TEL 0256-73-3434
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.75712724", "138.8881731"));
cnt = cnt+1;
var markerPos3 = new google.maps.LatLng("37.75889155", "138.888495");
createMarker(map_canvas, markerPos3, "高木歯科医院新潟市西蒲区巻甲2622
TEL 0256-72-6480
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.75889155", "138.888495"));
cnt = cnt+1;
var markerPos4 = new google.maps.LatLng("37.792853", "138.912677");
createMarker(map_canvas, markerPos4, "八百板歯科医院新潟市西蒲区鱸138-1
TEL 0256-88-6543
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.792853", "138.912677"));
cnt = cnt+1;
var markerPos5 = new google.maps.LatLng("37.791328", "138.916488");
createMarker(map_canvas, markerPos5, "棚橋歯科医院新潟市西蒲区曽根358
TEL 0256-88-6555
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.791328", "138.916488"));
cnt = cnt+1;
var markerPos6 = new google.maps.LatLng("37.75458249", "138.8870788");
createMarker(map_canvas, markerPos6, "白石歯科医院新潟市西蒲区巻甲2427-6
TEL 0256-72-2086
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.75458249", "138.8870788"));
cnt = cnt+1;
var markerPos7 = new google.maps.LatLng("37.724029", "138.881128");
createMarker(map_canvas, markerPos7, "本間歯科医院新潟市西蒲区和納1597-10
TEL 0256-82-4615
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.724029", "138.881128"));
cnt = cnt+1;
var markerPos8 = new google.maps.LatLng("37.76556671", "138.8849652");
createMarker(map_canvas, markerPos8, "高野歯科医院新潟市西蒲区巻甲1404-1
TEL 0256-73-3339
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.76556671", "138.8849652"));
cnt = cnt+1;
var markerPos9 = new google.maps.LatLng("37.748172", "138.912526");
createMarker(map_canvas, markerPos9, "松﨑歯科医院新潟市西蒲区馬堀6571
TEL 0256-73-3155
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.748172", "138.912526"));
cnt = cnt+1;
var markerPos10 = new google.maps.LatLng("37.728425", "138.858122");
createMarker(map_canvas, markerPos10, "清水歯科医院新潟市西蒲区西長島869-1
TEL 0256-82-5131
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.728425", "138.858122"));
cnt = cnt+1;
var markerPos11 = new google.maps.LatLng("37.794064", "138.913677");
createMarker(map_canvas, markerPos11, "さとう歯科医院新潟市西蒲区鱸103-3
TEL 0256-88-6565
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.794064", "138.913677"));
cnt = cnt+1;
var markerPos12 = new google.maps.LatLng("37.75469701", "138.8947821");
createMarker(map_canvas, markerPos12, "上原歯科クリニック新潟市西蒲区巻甲4480-1
TEL 0256-72-7542
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.75469701", "138.8947821"));
cnt = cnt+1;
var markerPos13 = new google.maps.LatLng("37.75794155", "138.8860381");
createMarker(map_canvas, markerPos13, "袖山歯科医院新潟市西蒲区巻甲2920
TEL 0256-76-2966
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.75794155", "138.8860381"));
cnt = cnt+1;
var markerPos14 = new google.maps.LatLng("37.78796", "138.921129");
createMarker(map_canvas, markerPos14, "若月歯科医院新潟市西蒲区押付1-63
TEL 0256-88-5599
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.78796", "138.921129"));
cnt = cnt+1;
var markerPos15 = new google.maps.LatLng("37.75938352", "138.8894713");
createMarker(map_canvas, markerPos15, "アサオ歯科医院新潟市西蒲区巻甲2660-1
TEL 0256-72-3017
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.75938352", "138.8894713"));
cnt = cnt+1;
var markerPos16 = new google.maps.LatLng("37.76040136", "138.8932371");
createMarker(map_canvas, markerPos16, "ゆう歯科医院新潟市西蒲区巻甲4081-5新星ビル2F
TEL 0256-73-5101
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.76040136", "138.8932371"));
cnt = cnt+1;
var markerPos17 = new google.maps.LatLng("37.758192", "138.880649");
createMarker(map_canvas, markerPos17, "たはた歯科医院新潟市西蒲区巻乙1594-1
TEL 0256-73-0648
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.758192", "138.880649"));
cnt = cnt+1;
var markerPos18 = new google.maps.LatLng("37.706895", "138.978905");
createMarker(map_canvas, markerPos18, "のざわ歯科クリニック新潟市西蒲区小吉1076-1
TEL 025-375-8155
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.706895", "138.978905"));
cnt = cnt+1;
var markerPos19 = new google.maps.LatLng("37.76603319", "138.8939238");
createMarker(map_canvas, markerPos19, "八木歯科クリニック新潟市西蒲区巻甲3232-3
TEL 0256-72-1511
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.76603319", "138.8939238"));
cnt = cnt+1;
var markerPos20 = new google.maps.LatLng("37.7178882", "138.9696274");
createMarker(map_canvas, markerPos20, "きちろく歯科医院新潟市西蒲区中之口523-1
TEL 025-375-2786
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.7178882", "138.9696274"));
cnt = cnt+1;
var markerPos21 = new google.maps.LatLng("37.7265234", "138.9593892");
createMarker(map_canvas, markerPos21, "原歯科診療所新潟市西蒲区福島1966
TEL 025-375-3538
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.7265234", "138.9593892"));
cnt = cnt+1;
var markerPos22 = new google.maps.LatLng("37.7604638", "138.8892838");
createMarker(map_canvas, markerPos22, "ながの歯科医院新潟市西蒲区巻甲2679-1
TEL 025-255-3513
[医院詳細]
");
bounds.extend(new google.maps.LatLng("37.7604638", "138.8892838"));
if (cnt > 0) {
if (cnt == 1) {
map_canvas.setCenter(new google.maps.LatLng(37.7604638, 138.8892838));
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;