var map; 
function load(){ 
var latlng=new GLatLng(35.689485, 139.687500);

//地図を作成
map = new GMap2( document.getElementById("mapArea")); 
map.setCenter( latlng, 16 );
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());

//オリジナルマーカーの画像を作成
var myIcon = new GIcon();
myIcon.image = "http://www.bellesalle.co.jp/common/images/bellesalle.png";
myIcon.iconSize = new GSize(52, 50);
myIcon.iconAnchor = new GPoint(30, 30);
myIcon.infoWindowAnchor = new GPoint(14, 0);
myIcon.printImage = "http://www.bellesalle.co.jp/common/images/bellesalle.png";

//ラインを地図に追加
var points01 = [];
points01[0] = new GLatLng(35.690529, 139.690422);
points01[1] = new GLatLng(35.690659, 139.690357);
points01[2] = new GLatLng(35.690537, 139.689896);
points01[3] = new GLatLng(35.690468, 139.689531);
points01[4] = new GLatLng(35.690328, 139.689413);
points01[5] = new GLatLng(35.690241, 139.689392);
points01[6] = new GLatLng(35.690259, 139.688952);
points01[7] = new GLatLng(35.690267, 139.688694);
points01[8] = new GLatLng(35.690015, 139.688619);
points01[9] = new GLatLng(35.689736, 139.688405);
points01[10] = new GLatLng(35.689849, 139.688255);
points01[11] = new GLatLng(35.689727, 139.688083);
var polyline01 = new GPolyline(points01, "#ffa000", 5, 0.7);
map.addOverlay(polyline01);

var points02 = [];
points02[0] = new GLatLng(35.690154, 139.684886);
points02[1] = new GLatLng(35.691078, 139.687053);
points02[2] = new GLatLng(35.689727, 139.688083);
var polyline02 = new GPolyline(points02, "#0000ff", 5, 0.7);
map.addOverlay(polyline02);

var points03 = [];
points03[0] = new GLatLng(35.690529, 139.690422);
points03[1] = new GLatLng(35.68867, 139.690915);
points03[2] = new GLatLng(35.68833, 139.688834);
points03[3] = new GLatLng(35.689132, 139.688576);
points03[4] = new GLatLng(35.689727, 139.688083);
var polyline03 = new GPolyline(points03, "#ff0000", 5, 0.7);
map.addOverlay(polyline03);
	  
//マーカーを地図に追加
var marker= new GMarker(new GLatLng(35.689727,139.688083),{title:"ベルサール西新宿", icon: myIcon});
GEvent.addListener(marker,"click",function(){
	//マーカーがクリックされたら、ポップアップを表示する
	marker.openInfoWindowHtml("<div style='text-align:left;'><b>ベルサール西新宿	</b><br />（住友不動産西新宿ビル3号館）</div>");
});
map.addOverlay(marker);
      
//マーカーに擬似的にクリックされたイベントを発生させる
GEvent.trigger(marker,"click");
}

window.onload=load;
window.onunload=GUnload;
