マーカーなしで情報ウィンドウだけページ開いた瞬間に出す。
window.onload = function() { var map = new GMap(document.getElementById("map")); if (GBrowserIsCompatible()) { map.centerAndZoom(new GPoint(-122.1419, 37.4419), 4); map.openInfoWindow(map.getCenterLatLng(), document.createTextNode("Hello, world")); } }
<div id="map"><!--GoogleMap--></div>
var map = new GMap(document.getElementById("map"));
地図を表示する要素のIDを指定する。
map.centerAndZoom(new GPoint(-122.1419, 37.4419), 4);
GPointで地図の中心、後の数字で拡大率を指定する。
map.openInfoWindow(map.getCenterLatLng(),
mapの中心を取得して情報ウィンドウを表示
document.createTextNode("Hello, world"));
情報ウィンドウにHello,worldというテキスト(オブジェクト)を作って入れる