Bug fix: google places not working on mobile correctly

This commit is contained in:
Edin Dazdarevic
2017-04-17 12:45:44 +02:00
parent 746d28d0fd
commit 9de077df32
2 changed files with 9 additions and 6 deletions

View File

@@ -155,7 +155,14 @@ class Main extends React.Component {
} }
if (place.geometry.viewport) { if (place.geometry.viewport) {
map.fitBounds(place.geometry.viewport) console.log('we have viewport', place);
if (this.state.mobileView === 'MAP') {
map.fitBounds(place.geometry.viewport)
} else {
this.dispatch({type: 'MOBILE_MAP_VIEW'})
map.fitBounds(place.geometry.viewport)
}
} else { } else {
map.setCenter(place.geometry.location) map.setCenter(place.geometry.location)
map.setZoom(18) map.setZoom(18)
@@ -166,10 +173,6 @@ class Main extends React.Component {
}) })
control.addEventListener('click', e => { control.addEventListener('click', e => {
//this.setState({
//mapClicked: true
//})
this.dispatch({ this.dispatch({
type: 'OPEN_FILTERS' type: 'OPEN_FILTERS'
}) })

View File

@@ -1,7 +1,7 @@
import fetch from 'isomorphic-fetch' import fetch from 'isomorphic-fetch'
//const BASE_URL = 'localhost'; //const BASE_URL = 'localhost';
const BASE_URL = '192.168.1.117'; const BASE_URL = '192.168.0.13';
export const saveContactRequest = (listingId, params) => { export const saveContactRequest = (listingId, params) => {