var kml_base_url = 'http://kml.nestoria.co.uk'; var www_base_url = 'http://www.nestoria.co.uk'; var country = 'uk'; var prefs = new _IG_Prefs(__MODULE_ID__); var map = new GMap2(); var geoXml; // center map to London // map.setCenter(new GLatLng(51.45,-0.14), 12); function gebi (id) { return document.getElementById(id); } function initForm(){ var tlt = prefs.getString( 'lt' ); if ( tlt == 'rent'){ gebi('rent').checked = 1; gebi('minprice_monthly').value = prefs.getString('minprice_monthly' ); gebi('maxprice_monthly').value = prefs.getString('maxprice_monthly' ); } else { gebi('buy').checked = 1; gebi('minprice').value = prefs.getString('minprice' ); gebi('maxprice').value = prefs.getString('maxprice' ); } if ( gebi('minsize') ){ // DE/IT don't have that gebi('minsize').value = prefs.getString('minsize' ); gebi('maxsize').value = prefs.getString('maxsize' ); } gebi('minbeds').value = prefs.getString('minbeds' ); gebi('minbaths').value = prefs.getString('minbaths' ); gebi('pt').value = prefs.getString('pt' ); } function toogle_price_dropdowns(buyorrent){ if ( buyorrent == 'rent' ){ gebi('div_price_fixed').style.display = 'none'; gebi('div_price_monthly').style.display = 'block'; } else { gebi('div_price_fixed').style.display = 'block'; gebi('div_price_monthly').style.display = 'none'; } } function updateStatus(status) { var text = 'OK.'; if ( status == 1 ){ text = 'Loading results, please wait...'; } gebi('status').innerHTML = text; } function updateWwwUrl(url){ var title = 'See these results on nestoria.co.uk'; var www_url_span = gebi("www_url_span"); www_url_span.innerHTML = '' + title + ''; } function updateResults() { updateStatus(1); var listingtype = prefs.getString( 'lt' ); var minprice = prefs.getString( 'minprice'); var maxprice = prefs.getString( 'maxprice'); if ( listingtype == 'rent' ){ minprice = prefs.getString( 'minprice_monthly'); maxprice = prefs.getString( 'maxprice_monthly'); } var minsize = prefs.getString( 'minsize' ); var maxsize = prefs.getString( 'maxsize' ); var minbeds = prefs.getString( 'minbeds' ); var minrooms = prefs.getString( 'minrooms'); var minbaths = prefs.getString( 'minbaths'); var propertytype = prefs.getString( 'pt' ); map.getBoundsAsync(function(bounds) { var northEast = bounds.getNorthEast(); var southWest = bounds.getSouthWest(); var coords = [northEast.lat(), northEast.lng(), southWest.lat(), southWest.lng()]; var location = 'coord_' + coords.join(','); var parameters = ''; // these countries have the format host/location/property/buy if ( country == 'uk' || country == 'es' ){ parameters = parameters + '/' + location; } if ( propertytype ){ if ( propertytype == 'f' ){ parameters = parameters + '/' + 'flat'; } else if ( propertytype == 'h' ){ parameters = parameters + '/' + 'house'; } else { parameters = parameters + '/' + 'property'; } } else { parameters = parameters + '/' + 'property'; } if ( listingtype && listingtype == 'rent'){ parameters = parameters + '/' + 'rent'; } else { parameters = parameters + '/' + 'buy'; } // these countries have the format host/property/buy/location if ( country == 'it' || country == 'de' ){ parameters = parameters + '/' + location; } if ( minprice && minprice > 0 ){ parameters = parameters + '/minprice-' + minprice; } if ( maxprice ){ parameters = parameters + '/maxprice-' + maxprice; } if ( minbeds ){ parameters = parameters + '/bedrooms-' + minbeds; } if ( minrooms ){ parameters = parameters + '/rooms-' + minrooms; } if ( minbaths ){ parameters = parameters + '/bathrooms-' + minbaths; } var kml_url = kml_base_url + parameters + '/results-100/index.kml'; var www_url = www_base_url + parameters + '/'; kml_url.replace(/\/+/, '/'); www_url.replace(/\/+/, '/'); updateWwwUrl(www_url); if( geoXml ) { map.removeOverlay( geoXml ); } geoXml = new GGeoXml( kml_url ); map.addOverlay( geoXml ); updateStatus(0); }); } // updateResults GEvent.addListener(map, "dragend", function(){updateResults();}); GEvent.addListener(map, "zoomend", function(){updateResults();});
Zoom, move the map or change any of the options below to see new properties.
Find properties:
     
Price:
       to  
Min. Bedrooms:
    
Min. Baths:
    
Houses or Flats:
    
Powered by nestoria.co.uk
]]>