書式
isHidden()
説明
情報ウィンドウの表示状態を返します。trueであれば非表示、falseであれば表示になります。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps API2 Sample</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAasAJryKxWJnBFVJa487d9hTHGAxTVT7IRADYa-JdYz7xQ8IQZBSthgDZdggYpQHsmm6WYtHstQFfLA" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
var map;
window.onload = function() {
var gpObj = new GLatLng(37,136);
map = new GMap2(document.getElementById("map"));
map.setCenter(gpObj, 5,G_NORMAL_MAP);
map.openInfoWindowHtml(gpObj, "Sample");
}
function hideWin()
{
var infoWin = map.getInfoWindow();
infoWin.hide();
}
function showWin()
{
var infoWin = map.getInfoWindow();
infoWin.show();
}
function checkWin()
{
var infoWin = map.getInfoWindow();
alert(infoWin.isHidden());
}
//]]>
</script>
</head>
<body>
<div id="map" style="width: 500px; height: 400px"></div>
<form>
<input type="button" value="情報ウィンドウを表示" onClick="showWin()">
<input type="button" value="情報ウィンドウを非表示" onClick="hideWin()">
<input type="button" value="情報ウィンドウの表示状態を調べる" onClick="checkWin()">
</form>
</body>
</html>