Disable map sleep in chrome
This commit is contained in:
parent
ce18aab493
commit
5cf985aada
4 changed files with 8 additions and 4 deletions
|
|
@ -22,6 +22,7 @@ import Control from 'react-leaflet-control';
|
|||
import { Row, Col, Button, ButtonGroup } from 'react-bootstrap';
|
||||
import subsUnion from '/imports/ui/components/Maps/SubsUnion/SubsUnion';
|
||||
import UserSubsToFiresCollection from '/imports/api/Subscriptions/Subscriptions';
|
||||
import { isChrome } from '/imports/ui/components/Utils/isMobile';
|
||||
import './SelectionMap.scss';
|
||||
|
||||
export const action = {
|
||||
|
|
@ -173,7 +174,7 @@ class SelectionMap extends Component {
|
|||
className="selectionmap-leaflet-container"
|
||||
onViewportChanged={this.onViewportChanged}
|
||||
animate
|
||||
sleep={window.location.pathname === '/'}
|
||||
sleep={window.location.pathname === '/' && !isChrome}
|
||||
sleepTime={10750}
|
||||
wakeTime={750}
|
||||
sleepNote
|
||||
|
|
|
|||
|
|
@ -4,3 +4,5 @@ import isMobile from 'ismobilejs';
|
|||
export const isHomeAndMobile = (window.location.pathname === '/' && isMobile.any);
|
||||
export const isNotHomeAndMobile = !isHomeAndMobile;
|
||||
export const isAnyMobile = isMobile.any;
|
||||
// https://stackoverflow.com/questions/18625321/detect-webkit-browser-in-javascript
|
||||
export const isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import Loading from '/imports/ui/components/Loading/Loading';
|
|||
import ActiveFiresCollection from '/imports/api/ActiveFires/ActiveFires';
|
||||
import FireAlertsCollection from '/imports/api/FireAlerts/FireAlerts';
|
||||
import UserSubsToFiresCollection from '/imports/api/Subscriptions/Subscriptions';
|
||||
import { isNotHomeAndMobile } from '/imports/ui/components/Utils/isMobile';
|
||||
import { isNotHomeAndMobile, isChrome } from '/imports/ui/components/Utils/isMobile';
|
||||
|
||||
import './FiresMap.scss';
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ class FiresMap extends React.Component {
|
|||
onClick={this.onClickReset}
|
||||
viewport={this.state.viewport}
|
||||
onViewportChanged={this.onViewportChanged}
|
||||
sleep={window.location.pathname === '/'}
|
||||
sleep={window.location.pathname === '/' && !isChrome}
|
||||
sleepTime={10750}
|
||||
wakeTime={750}
|
||||
sleepNote
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import subsUnion from '/imports/ui/components/Maps/SubsUnion/SubsUnion';
|
|||
import DefMapLayers from '/imports/ui/components/Maps/DefMapLayers';
|
||||
import Loading from '/imports/ui/components/Loading/Loading';
|
||||
import UserSubsToFiresCollection from '/imports/api/Subscriptions/Subscriptions';
|
||||
import { isChrome } from '/imports/ui/components/Utils/isMobile';
|
||||
|
||||
import './SubscriptionsMap.scss';
|
||||
|
||||
|
|
@ -97,7 +98,7 @@ class SubscriptionsMap extends React.Component {
|
|||
center={this.state.viewport.center}
|
||||
className="subscriptionsmap-leaflet-container"
|
||||
animate
|
||||
sleep={window.location.pathname === '/'}
|
||||
sleep={window.location.pathname === '/' && !isChrome}
|
||||
sleepTime={10750}
|
||||
wakeTime={750}
|
||||
sleepNote
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue