﻿var map = null;
var pinid = 0;
var DoPin = 0;

function GetMap()
{
var Postcode = document.getElementById('ctl00_ContentPlaceHolder1_HdnPostcode').value
DoPin = 1;          
map = new VEMap('myMap');           
map.LoadMap(new VELatLong(47.6, -122.33), 10 ,'h' ,false);
map.AttachEvent("onchangeview", function(){AddPin();}); 
map.Find(null, Postcode + ', United Kingdom',null,null,0,1,true, true);    
}   

function AddPin()
{
 if(DoPin == 1)
 {
 var shape = new VEShape(VEShapeType.Pushpin, map.GetCenter());          
 shape.SetTitle('How to find us');                   
 pinid++;          
 map.AddShape(shape);
 map.SetZoomLevel('12');
 DoPin = 0;
 }
}


