var map; var bounds; var mapIconGold = _gdoc_root+'img/map-icon-gold.png'; var mapIconGreen = _gdoc_root+'img/map-icon-green.png'; window.onload = function () { var styles = [ { "elementType": "labels.text.fill", "stylers": [ { "visibility": "on" }, { "color": "#245C40" } ] } ]; var markerPosHardCoded = new google.maps.LatLng(51.5782854,-0.1779822); // var markerPos02 = new google.maps.LatLng(51.560686,-0.18571); var options = { // center: markerPos01, // zoom: 16, scrollwheel: false, //prevents the map zooming when the user is scroll-wheeling the web page disableDefaultUI: false , // mapTypeControlOptions: { // mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.SATELLITE] // } }; var div = document.getElementById('propertyMap'); map = new google.maps.Map(div, options); bounds = new google.maps.LatLngBounds(); var markerPos0 = new google.maps.LatLng(51.61774,-0.225496); var marker0 = new google.maps.Marker({ position: markerPos0, map: map,icon: mapIconGreen,id: '151'});var iw0 = new google.maps.InfoWindow({ content: "
Rosary Manor,  Prices start from £1,000,000 
" });google.maps.event.addListener(marker0, "mouseover", function (e) { iw0.open(map, this); }); google.maps.event.addListener(marker0, "mouseout", function (e) { iw0.close(map, this); });google.maps.event.addListener(marker0, 'click', function() { if ($('#map_'+this.id).length > 0 ) { $('html, body').animate({ scrollTop: $('#map_'+this.id).offset().top}, 2000); }else{ //Make Ajax cal to get the DIV var i = new ajaxVars; i.incModule = "common"; i.vars["action"] = "runFunction"; i.vars["func"] = "getPropDiv"; i.vars["nosplit"] = 1; i.vars["type"] = 'all'; i.vars["from_price"] = '0'; i.vars["to_price"] = '1000000'; i.vars["orderBy"] = 'DESC'; i.vars["page"] = selPage; i.vars["rental"] = '2'; i.vars["location"] = ''; i.vars["latest"] = ''; i.vars["latestFlag"] = ''; i.vars["showFav"] = '0'; i.vars["sold"] = ''; i.vars["id"] = this.id; i.fnVars["id"] = this.id; i.gotoFunction = "propDivAdd"; i.AjaxPostSQL() }});bounds.extend(markerPos0);var markerPos1 = new google.maps.LatLng(51.56571688850167,-0.19623123117447294); var marker1 = new google.maps.Marker({ position: markerPos1, map: map,icon: mapIconGreen,id: '188'});var iw1 = new google.maps.InfoWindow({ content: "
West Heath Place,  Prices from £950,000 
" });google.maps.event.addListener(marker1, "mouseover", function (e) { iw1.open(map, this); }); google.maps.event.addListener(marker1, "mouseout", function (e) { iw1.close(map, this); });google.maps.event.addListener(marker1, 'click', function() { if ($('#map_'+this.id).length > 0 ) { $('html, body').animate({ scrollTop: $('#map_'+this.id).offset().top}, 2000); }else{ //Make Ajax cal to get the DIV var i = new ajaxVars; i.incModule = "common"; i.vars["action"] = "runFunction"; i.vars["func"] = "getPropDiv"; i.vars["nosplit"] = 1; i.vars["type"] = 'all'; i.vars["from_price"] = '0'; i.vars["to_price"] = '1000000'; i.vars["orderBy"] = 'DESC'; i.vars["page"] = selPage; i.vars["rental"] = '2'; i.vars["location"] = ''; i.vars["latest"] = ''; i.vars["latestFlag"] = ''; i.vars["showFav"] = '0'; i.vars["sold"] = ''; i.vars["id"] = this.id; i.fnVars["id"] = this.id; i.gotoFunction = "propDivAdd"; i.AjaxPostSQL() }});bounds.extend(markerPos1);var markerPos2 = new google.maps.LatLng(51.564754,-0.196653); var marker2 = new google.maps.Marker({ position: markerPos2, map: map,icon: mapIconGreen,id: '156'});var iw2 = new google.maps.InfoWindow({ content: "
The Lexington,  Prices from £825,000 
" });google.maps.event.addListener(marker2, "mouseover", function (e) { iw2.open(map, this); }); google.maps.event.addListener(marker2, "mouseout", function (e) { iw2.close(map, this); });google.maps.event.addListener(marker2, 'click', function() { if ($('#map_'+this.id).length > 0 ) { $('html, body').animate({ scrollTop: $('#map_'+this.id).offset().top}, 2000); }else{ //Make Ajax cal to get the DIV var i = new ajaxVars; i.incModule = "common"; i.vars["action"] = "runFunction"; i.vars["func"] = "getPropDiv"; i.vars["nosplit"] = 1; i.vars["type"] = 'all'; i.vars["from_price"] = '0'; i.vars["to_price"] = '1000000'; i.vars["orderBy"] = 'DESC'; i.vars["page"] = selPage; i.vars["rental"] = '2'; i.vars["location"] = ''; i.vars["latest"] = ''; i.vars["latestFlag"] = ''; i.vars["showFav"] = '0'; i.vars["sold"] = ''; i.vars["id"] = this.id; i.fnVars["id"] = this.id; i.gotoFunction = "propDivAdd"; i.AjaxPostSQL() }});bounds.extend(markerPos2);var markerPos3 = new google.maps.LatLng(51.5759692,-0.20624559999998837); var marker3 = new google.maps.Marker({ position: markerPos3, map: map,icon: mapIconGreen,id: '85'});var iw3 = new google.maps.InfoWindow({ content: "
Belview Lodge,  £1,700,000 
" });google.maps.event.addListener(marker3, "mouseover", function (e) { iw3.open(map, this); }); google.maps.event.addListener(marker3, "mouseout", function (e) { iw3.close(map, this); });google.maps.event.addListener(marker3, 'click', function() { if ($('#map_'+this.id).length > 0 ) { $('html, body').animate({ scrollTop: $('#map_'+this.id).offset().top}, 2000); }else{ //Make Ajax cal to get the DIV var i = new ajaxVars; i.incModule = "common"; i.vars["action"] = "runFunction"; i.vars["func"] = "getPropDiv"; i.vars["nosplit"] = 1; i.vars["type"] = 'all'; i.vars["from_price"] = '0'; i.vars["to_price"] = '1000000'; i.vars["orderBy"] = 'DESC'; i.vars["page"] = selPage; i.vars["rental"] = '2'; i.vars["location"] = ''; i.vars["latest"] = ''; i.vars["latestFlag"] = ''; i.vars["showFav"] = '0'; i.vars["sold"] = ''; i.vars["id"] = this.id; i.fnVars["id"] = this.id; i.gotoFunction = "propDivAdd"; i.AjaxPostSQL() }});bounds.extend(markerPos3); map.setCenter(bounds.getCenter()); map.fitBounds(bounds); zoomChangeBoundsListener = google.maps.event.addListenerOnce(map, 'bounds_changed', function(event) { if (map.getZoom()){ map.setCenter(new google.maps.LatLng(51.5711882,-0.1490688)); map.setZoom(11); } }); }