﻿// JScript ファイル
	//<![CDATA[
    var initflg = 0;
    var map;
    var searchUrl = 'http://okepi.net/all.aspx?key=keyword&value=';

//--------------------------------------------
//  GoogleMap 初期ロード
    function loadMap() {

        map = new GMap2(document.getElementById("map"));

        // 中心座標設定
        var latlng = new GLatLng(document.getElementById('map_init_lat').value, document.getElementById('map_init_lng').value);
        map.setCenter(latlng, 16);
        map.clearOverlays();

        // 左上の移動ツールを表示
        map.addControl(new GLargeMapControl());

        // 表示モード切替ツールを表示
        map.addControl(new GMapTypeControl());

        //マーカー設置
        addMarker(latlng,document.getElementById('map_type').value);

        //地図表示デフォルトをハイブリッドタイプに        
        //map.setMapType(G_HYBRID_MAP); 
                     
    }

//--------------------------------------------
//  マップにマーカーを１つ置く
//  引数    latlng    : 緯度経度(GLatLngクラス)
//          datatype  : データの種類 'theater'(劇場) or 'shop'(飲食店)
    function addMarker(latlng, datatype){
        var icon = new GIcon();
//        if (datatype == 'theater') {
//            icon.image = "http://okepi.net/map/images/hallicon.png";
//            icon.shadow = "http://okepi.net/map/images/shadow50.png";        
//        } else if (datatype == 'shop') {
//            icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
//            icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";                
//        }
        icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
        icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";                
        
        icon.iconSize = new GSize(12, 20);
        icon.shadowSize = new GSize(22, 20);
		icon.iconAnchor = new GPoint(6, 20);
		icon.infoWindowAnchor = new GPoint(5, 1);

        var marker = new GMarker(latlng, icon);
        map.addOverlay(marker);
    }

	//]]>
