//<![CDATA[
var map;
var markers = new Array(1);
function gmap() {

  //基本設定
  map = new GMap2(document.getElementById("map"));
  map.setCenter(new GLatLng(35.170651114358144,136.88406944274902),17);
  map.addControl(new GLargeMapControl());
  map.addControl(new GMapTypeControl());
  map.setMapType(G_NORMAL_MAP);

  //マーカー設定（青）
  var icon = new GIcon();
  icon.image = "http://labs.google.com/ridefinder/images/mm_20_blue.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);

//  //WINC AICHIマーカー
//  var marker = null;
//  var n_markers = 0;
//  var markeropts = new Object();
//  marker = new GMarker(new GPoint(136.8863171339035,35.170675670886304), markeropts);
//  markers[n_markers] = marker;
//  n_markers++;
//  map.addOverlay(marker);
//
//
//  //待ち合わせ場所マーカー
//  var marker2 = null;
//  var n_markers2 = 1;
//  var markeropts2 = new Object();
//  var marker_point2 = new GPoint(136.88400506973267,35.1707432012001);
//  marker2 = new GMarker(marker_point2, icon);
//  markers[n_markers2] = marker2;
//  n_markers2++;
//
//  //待ち合わせ場所フキダシ
//  GEvent.addListener(map, 'click', function(overlay, marker_point2) {
//    if (overlay) {
//      overlay.openInfoWindow(
//           document.createTextNode("待ち合わせ場所"));
//    }
//  });
//
//  map.addOverlay(marker2);
//
//
//  //駐車場マーカー
//  var marker3 = null;
//  var n_markers3 = 0;
//  var markeropts3 = new Object();
//  var marker_point3 = new GPoint(136.88578069210052,35.17063795908649);
//  marker3 = new GMarker(marker_point3, icon);
//  markers[n_markers3] = marker3;
//  n_markers3++;
//
//  //駐車場フキダシ
//  GEvent.addListener(map, 'click', function(overlay, marker_point3) {
//    if (overlay) {
//      overlay.openInfoWindow(
//           document.createTextNode("駐車場入口 会場駐車場入り口です。３０分２５０円１８００円打切となります"));
//    }
//  });
//
//  map.addOverlay(marker3);


//マーカー（一括）
  var pos = [];
  pos[0] = new Array(35.170675670886304, 136.8863171339035, "WINC AICHI");
  pos[1] = new Array(35.1707432012001, 136.88400506973267, "待ち合わせ場所<BR />緑色と白の地図看板が目印です。<BR />隣に禁煙区域の看板があります。<BR />階段の左側に交番があります。",icon);
  pos[2] = new Array(35.17063795908649, 136.88578069210052, "駐車場入口<BR />会場駐車場入り口です。<BR />３０分２５０円１８００円打切となります",icon);

  for (i = 0; i < 3; i++) {
      var marker = myMarker(pos[i]);
      map.addOverlay(marker);
  }


  //動線（ＪＲ名古屋）
  var points1 = [];
  points1[0] = new GLatLng(35.170979995457614, 136.88326478004456);
  points1[1] = new GLatLng(35.17102384617039, 136.88338816165924);
  points1[2] = new GLatLng(35.17077828187437, 136.88351154327393);
  points1[3] = new GLatLng(35.17079582220582, 136.88362687826157);
  points1[4] = new GLatLng(35.1707914371233, 136.88399702310562);
  points1[5] = new GLatLng(35.170716890684474, 136.8840828537941);
  points1[6] = new GLatLng(35.170798014746985, 136.88452005386353);
  points1[7] = new GLatLng(35.1708330953976, 136.88454419374466);
  points1[8] = new GLatLng(35.17083748047785, 136.8856492638588);
  points1[9] = new GLatLng(35.17081336253347, 136.8856680393219);
  points1[10] = new GLatLng(35.17080897745192, 136.88579946756363);
  points1[11] = new GLatLng(35.1708330953976, 136.88583433628082);
  points1[12] = new GLatLng(35.1708330953976, 136.88629299402237);
  points1[13] = new GLatLng(35.17067523235064, 136.88630640506744);
  var polyline1 = new GPolyline(points1);
  map.addOverlay(polyline1);

  //動線（近鉄）
  var points2 = [];
  points2[0] = new GLatLng(35.169195251380174, 136.88441812992096);
  points2[1] = new GLatLng(35.169230332722286, 136.88459515571594);
  points2[2] = new GLatLng(35.17003062172808, 136.88435643911362);
  points2[3] = new GLatLng(35.17002842916622, 136.88430279493332);
  points2[4] = new GLatLng(35.170716890684474, 136.8840828537941);
  var polyline2 = new GPolyline(points2);
  map.addOverlay(polyline2);

  //動線（名駅）
  var points3 = [];
  points3[0] = new GLatLng(35.16971269964135, 136.8839728832245);
  points3[1] = new GLatLng(35.16994072664338, 136.88389778137207);
  points3[2] = new GLatLng(35.17002842916622, 136.88430279493332);
  var polyline3 = new GPolyline(points3);
  map.addOverlay(polyline3);

  //動線（名駅・近鉄 合流点）
  var points4 = [];
  points4[0] = new GLatLng(35.17042418562391, 136.88390046358109);
  points4[1] = new GLatLng(35.17047022918642, 136.88416130840778);
  var polyline4 = new GPolyline(points4);
  map.addOverlay(polyline4);

  //WINC AICHI塗りつぶし
  var points5 = [];
  points5[0] = new GLatLng(35.1704500148578, 136.88607305288315);
  points5[1] = new GLatLng(35.1705574497689, 136.88607305288315);
  points5[2] = new GLatLng(35.17057876033775, 136.8858041963997);
  points5[3] = new GLatLng(35.170694965248266, 136.88581556081772);
  points5[4] = new GLatLng(35.17069715779216, 136.88605159521103);
  points5[5] = new GLatLng(35.17080897745192, 136.88605159521103);
  points5[6] = new GLatLng(35.17081116999274, 136.88690185546875);
  points5[7] = new GLatLng(35.17054587212536, 136.88709497451782);
  points5[8] = new GLatLng(35.17049763605649, 136.88708156347275);
  points5[9] = new GLatLng(35.17040774148811, 136.88692599534988);
  points5[10] = new GLatLng(35.170572182696326, 136.88677042722702);
  points5[11] = new GLatLng(35.1704500148578, 136.88607305288315);
  var polyline5 = new GPolygon(points5, '#000000', 0.5, 0.5, '#0000ff', 0.5);

  map.addOverlay(polyline5);

}

function myMarker(p) {
    var marker = new google.maps.Marker(new google.maps.LatLng(p[0], p[1]),p[3]);
    google.maps.Event.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(p[2]);
    });
    return marker;
}

//]]>
