Only show listings that are visible in the current view
This commit is contained in:
@@ -51,7 +51,7 @@ class Main extends React.Component {
|
||||
};
|
||||
var searchBox = new google.maps.places.Autocomplete(input, options);
|
||||
|
||||
searchBox.addListener('place_changed', function() {
|
||||
searchBox.addListener('place_changed', () => {
|
||||
var place = searchBox.getPlace();
|
||||
|
||||
if (!place.geometry) {
|
||||
@@ -66,6 +66,7 @@ class Main extends React.Component {
|
||||
map.setZoom(18);
|
||||
}
|
||||
console.log(map.getBounds());
|
||||
this.dispatch({type: 'SEARCH_PLACE_CHANGED'});
|
||||
});
|
||||
|
||||
control.addEventListener('click', (e) => {
|
||||
@@ -154,7 +155,10 @@ class Main extends React.Component {
|
||||
onBackClick={this.onBackClick.bind(this)}/>);
|
||||
} else {
|
||||
children.push(<Filters filters={this.state.filters} dispatch={this.dispatch.bind(this)} onClose={this.onCloseClick.bind(this)}/>);
|
||||
children.push(<Listings onListingClick={this.onListingClick.bind(this)}/>);
|
||||
children.push(<Listings
|
||||
listings={this.state.listings}
|
||||
dispatch={this.dispatch.bind(this)}
|
||||
onListingClick={this.onListingClick.bind(this)}/>);
|
||||
}
|
||||
const content = (
|
||||
<div className="right-content">
|
||||
|
||||
Reference in New Issue
Block a user