From 6e0282d6792553eae7aff9c8afdc33525a41ab94 Mon Sep 17 00:00:00 2001 From: vjrj Date: Tue, 6 Mar 2018 15:55:27 +0100 Subject: [PATCH] FiresMap refactor --- imports/ui/pages/FiresMap/FiresMap.js | 105 +++++++++++++------------- 1 file changed, 53 insertions(+), 52 deletions(-) diff --git a/imports/ui/pages/FiresMap/FiresMap.js b/imports/ui/pages/FiresMap/FiresMap.js index cf7a9d8..0d7f4ae 100644 --- a/imports/ui/pages/FiresMap/FiresMap.js +++ b/imports/ui/pages/FiresMap/FiresMap.js @@ -152,7 +152,7 @@ class FiresMap extends React.Component { } centerOnUserLocation(viewport) { - this.setState({ viewport }); + this.setState({ viewport: { center: viewport.center, zoom: 10 } }); } useMarkers(use) { @@ -218,50 +218,51 @@ class FiresMap extends React.Component { {title} } -

Fuegos activos

- - -

- { (this.props.activefires.length + this.props.firealerts.length) === 0 ? - No hay fuegos activos en esta zona del mapa. {{ countTotal: this.props.activefirestotal }} fuegos activos en el mundo. Actualizado . : - En rojo, {{ count: this.props.activefires.length + this.props.firealerts.length }} fuegos activos. {{ countTotal: this.props.activefirestotal }} fuegos activos en el mundo. Actualizado . - } -

- {isNotHomeAndMobile() && this.props.firealerts.length > 0 && -

En naranja, los fuegos notificados por nuestros usuarios/as recientemente.

} - {isNotHomeAndMobile() && this.props.firealerts.length === 0 && !isAnyMobile && +

Fuegos activos

+ + + {isNotHomeAndMobile() && + + this.onAutocompleteChange(value)} + /> + this.setShowSubsUnion(e.target.checked)}> + Resaltar en verde el área vigilada por nuestros usuarios/as (*) + + {(this.state.viewport.zoom >= MAXZOOM) && + this.useMarkers(e.target.checked)}> + Resaltar los fuegos con un marcador + } + } + + +

+ { (this.props.activefires.length + this.props.firealerts.length) === 0 ? + No hay fuegos activos en esta zona del mapa. {{ countTotal: this.props.activefirestotal }} fuegos activos en el mundo. Actualizado . : + En rojo, {{ count: this.props.activefires.length + this.props.firealerts.length }} fuegos activos. {{ countTotal: this.props.activefirestotal }} fuegos activos en el mundo. Actualizado . + } +

+ {isNotHomeAndMobile() && this.props.firealerts.length > 0 && +

En naranja, los fuegos notificados por nuestros usuarios/as recientemente.

} + { /* disabled */ false && isNotHomeAndMobile() && this.props.firealerts.length === 0 && !isAnyMobile &&

No hay fuegos notificados recientemente por nuestros usuarios/as en esta zona.

} - - - {isNotHomeAndMobile() && - - this.onAutocompleteChange(value)} - /> - this.setShowSubsUnion(e.target.checked)}> - Resaltar en verde el área vigilada por nuestros usuarios/as (*) - - {(this.state.viewport.zoom >= MAXZOOM) && - this.useMarkers(e.target.checked)}> - Resaltar los fuegos con un marcador - } - } -

- { this.state.viewport.zoom >= MAXZOOMREACTIVE ? - Los fuegos activos se actualizan en tiempo cuasi real. : - Haga zoom en una zona de su interés si quiere que los fuegos se actualicen en tiempo real. - } - -

- -
- {this.props.loading || !this.props.subsready ? - - : ''} + +

+ { this.state.viewport.zoom >= MAXZOOMREACTIVE ? + Los fuegos activos se actualizan en tiempo cuasi real. : + Haga zoom en una zona de su interés si quiere que los fuegos se actualicen en tiempo real. + } + +

+ +
+ {this.props.loading || !this.props.subsready ? + + : ''} {/* https://github.com/CliffCloud/Leaflet.Sleep */} { @@ -419,14 +420,14 @@ export default translate([], { wait: true })(withTracker(() => { mapSize.get()[1].lat ); /* if (withIndustries) { - Meteor.subscribe( - 'industriesMyloc', - mapSize.get()[0].lng, - mapSize.get()[0].lat, - mapSize.get()[1].lng, - mapSize.get()[1].lat - ); - } */ + Meteor.subscribe( + 'industriesMyloc', + mapSize.get()[0].lng, + mapSize.get()[0].lat, + mapSize.get()[1].lng, + mapSize.get()[1].lat + ); + } */ } });