﻿var map = null;
var icon = "<img src='i/flags/flag.gif' alt='flag' />";   

$(document).ready(function(){

    GetMap();
    
});

function GetMap()
{
    map = new VEMap('map');
    map.LoadMap(new VELatLong(mapx, mapy), 15 ,'h' ,false);
    AddPushpin();
    /*map.ClearInfoBoxStyles();     */
    
}    

/**/
function AddPushpin()
{
 
    var arr_holesx = holesx.split('|');                                       
    var arr_holesy = holesy.split('|');
    var arr_title = title.split('|');
    var arr_desc = desc.split('|');
    var arr_hole = holenumbers.split('|');

    var num=0;
    while (num < arr_holesx.length){               
        var shape = new VEShape(VEShapeType.Pushpin, new VELatLong(arr_holesx[num], arr_holesy[num]));
        shape.SetCustomIcon("<img src='i/flags/" + arr_hole[num] + ".gif' alt='flag' />");
        shape.SetTitle(arr_title[num]);
        shape.SetDescription(arr_desc[num]);        
        map.AddShape(shape);          
        num+=1;  
    }                                            

}

function showLocation(){
    
    document.getElementById("Text1").value = Math.round((map.GetCenter()).Latitude * 10000) / 10000;
    document.getElementById("Text2").value = Math.round((map.GetCenter()).Longitude * 1000000) / 1000000;

}

