Minor changes in fires union
This commit is contained in:
parent
c4cb52abaf
commit
b9457fe141
3 changed files with 6 additions and 17 deletions
|
|
@ -67,12 +67,14 @@ Meteor.publish('activefiresunionmyloc', function activeInMyLoc(northEastLng, nor
|
|||
check(northEastLat, NumberBetween(-90, 90));
|
||||
check(withMarks, Boolean);
|
||||
|
||||
if (!Meteor.isDevelopment) return this.ready(); // empty
|
||||
// I use this for fire stats
|
||||
// if (!Meteor.isDevelopment) return this.ready(); // empty
|
||||
return activeFiresUnion(northEastLng, northEastLat, southWestLng, southWestLat, withMarks);
|
||||
});
|
||||
|
||||
// Warning: this increase always by one the fire stats
|
||||
Meteor.publish('lastFireUnionDetected', function lastFireDetected() {
|
||||
if (!Meteor.isDevelopment) return this.ready(); // empty
|
||||
// I use this for fire stats
|
||||
// if (!Meteor.isDevelopment) return this.ready(); // empty
|
||||
return ActiveFiresUnion.find({}, { limit: 1, sort: { when: -1 } });
|
||||
});
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class FireCircleMark extends Component {
|
|||
} = this.props;
|
||||
const rect = rectangleAround({ lat, lon }, track, track);
|
||||
return (
|
||||
<GeoJSON data={rect} color="red" stroke width="1" opacity=".4" fillOpacity=".3">
|
||||
<GeoJSON data={rect} color="red" stroke width="1" opacity=".4" fillOpacity="1">
|
||||
<FirePopup t={t} history={history} id={id} nasa={nasa} lat={lat} lon={lon} when={when} />
|
||||
</GeoJSON>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -84,19 +84,6 @@ class FiresMap extends React.Component {
|
|||
});
|
||||
}
|
||||
|
||||
/* shouldComponentUpdate(nextProps, nextState) {
|
||||
* const notMoving = !nextState.moving;
|
||||
* const markersChanged = this.state.useMarkers !== nextState.useMarkers;
|
||||
* const unionChanged = this.state.showSubsUnion !== nextState.showSubsUnion;
|
||||
* const otherViewport = this.state.viewport !== nextState.viewport;
|
||||
* // const init = nextState.viewport.center === [0, 0];
|
||||
* // console.log(notMoving ? 'Not moving map' : 'Moving map');
|
||||
* // console.log(otherViewport ? 'Other viewport' : 'Not other viewport');
|
||||
* console.log(`${otherViewport ? 'OTHER' : 'Not other'} viewport ${nextState.viewport.center} zoom: ${nextState.viewport.zoom}`);
|
||||
* return this.state.init || (notMoving && otherViewport && this.state.moved) || unionChanged || markersChanged;
|
||||
* }
|
||||
*/
|
||||
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
const notMoving = !nextState.moving;
|
||||
return notMoving;
|
||||
|
|
@ -249,7 +236,7 @@ class FiresMap extends React.Component {
|
|||
<p className="firesmap-legend">
|
||||
{ (this.props.activefires.length + this.props.firealerts.length) === 0 ?
|
||||
<Fragment><Trans parent="span" i18nKey="noActiveFireInMapCount">No hay fuegos activos en esta zona del mapa. <strong>{{ countTotal: this.props.activefirestotal }}</strong> fuegos activos en el mundo.</Trans> <FireStats loadingAll={loading} {... this.props} /></Fragment> :
|
||||
<Fragment><Trans parent="span" i18nKey="activeFireInMapCount">En rojo, <strong>{{ count: this.props.activefires.length + this.props.firealerts.length }}</strong> fuegos activos. <strong>{{ countTotal: this.props.activefirestotal }}</strong> fuegos activos en el mundo.</Trans> <FireStats loadingAll={loading} {... this.props} /></Fragment>
|
||||
<Fragment><Trans parent="span" i18nKey="activeFireInMapCount">En rojo, <strong>{{ count: this.props.activefiresunion.length + this.props.firealerts.length }}</strong> fuegos activos. <strong>{{ countTotal: this.props.activefirestotal }}</strong> fuegos activos en el mundo.</Trans> <FireStats loadingAll={loading} {... this.props} /></Fragment>
|
||||
}
|
||||
</p>
|
||||
{isNotHomeAndMobile() && this.props.firealerts.length > 0 &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue