//this file is used to display a single property
var oMap;

function MappingGoogle_OnLoad(){
	if ( GBrowserIsCompatible() ){
	
		var ipropertylatitude = HttpManager.Document.GetObject("txtproperty_latitude").value;
		var ipropertylongitude = HttpManager.Document.GetObject("txtproperty_longitude").value;
	
		oMap = new GMap(HttpManager.Document.GetObject("pnlGoogleMap"));
		if ( HttpManager.Document.GetObject("maptype_isaerial").value.toLowerCase() == "true" ){
			oMap.setMapType( G_SATELLITE_MAP );
		}
		oMap.addControl(new GSmallMapControl());
		oMap.centerAndZoom(new GPoint(-2.0015, 53.4967),11);
		
		var oPropertyIcon = new GIcon();
		oPropertyIcon.image = "images/icons/map_house.gif";
		oPropertyIcon.iconSize = new GSize(30,30);
		oPropertyIcon.iconAnchor = new GPoint(1,1);
		oPropertyIcon.iconWindowAnchor = new GPoint(5,1);
		//append the icon to the map
		var oPropertyPoint = new GPoint(ipropertylongitude, ipropertylatitude);
		
		var oMarker = new GMarker(oPropertyPoint);
		oMap.addOverlay( oMarker );
		
		oMap.setCenter(new GLatLng(ipropertylatitude, ipropertylongitude),15);
		
	}
}