﻿function showAddress(map, address)
{
	if (geocoder) {
		geocoder.getLatLng(
		address,
		function(point) {
			if (!point) {
				alert(address + " を地図から表示できません");
			} else {
				map.setCenter(point, 13);
				map.setZoom(17);
				//var marker = new GMarker(point);
				//map.addOverlay(marker);
				//marker.openInfoWindowHtml(address);
			}
		}
        	);
	}
}

function onLoad()
{
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById('googlemap'));

		map.disableInfoWindow();

		// GClientGeocoderを初期化
		geocoder = new GClientGeocoder();
		showAddress(map, $F('address'));

		map.addControl(new GSmallMapControl());
	} else {
		alert('ブラウザが地図表示に非対応です');
	}
}

