diff --git a/imports/api/ActiveFires/server/publications.js b/imports/api/ActiveFires/server/publications.js index ac2ff81..5bdfcce 100644 --- a/imports/api/ActiveFires/server/publications.js +++ b/imports/api/ActiveFires/server/publications.js @@ -56,7 +56,7 @@ const activefires = (zoom, lat, lng, height, width) => { const distUnt = resolution * Math.max(height, width); const distance = Math.trunc(distUnt); // console.log(`so ${height}x${width} gives ${Math.trunc(resolution*height/1000)} x ${Math.trunc(resolution*width/1000)} km, so looking in ${distance}`); - console.log(`So ${height}x${width} gives ${Math.trunc(resolution)} of resolution, so looking in ${Math.trunc(distance / 1000)}km`); + // console.log(`So ${height}x${width} gives ${Math.trunc(resolution)} of resolution, so looking in ${Math.trunc(distance / 1000)}km`); const fires = ActiveFires.find({ ourid: { @@ -76,7 +76,7 @@ const activefires = (zoom, lat, lng, height, width) => { scan: 1 } }); - console.log(`Fires total: ${fires.count()}`); + // console.log(`Fires total: ${fires.count()}`); return fires; }; @@ -85,7 +85,7 @@ Meteor.publish('allActiveFires', function allActive() { // latitude -90 and 90 and the longitude between -180 and 180 const { latitude, longitude } = localize().location; - console.log(`${latitude}, ${longitude}`); + // console.log(`${latitude}, ${longitude}`); check(latitude, NumberBetween(-90, 90)); check(longitude, NumberBetween(-180, 180)); // https://docs.meteor.com/api/collections.html#Mongo-Collection-find @@ -117,10 +117,10 @@ Meteor.publish('activefiresmyloc', function activeInMyLoc(zoom, lat, lng, height check(lng, NullOr(Number)); check(height, NullOr(Number)); check(width, NullOr(Number)); - console.log(`Check active fires in ${lat},${lng} with zoom ${zoom} pixels in ${height}x${width} map`); + // console.log(`Check active fires in ${lat},${lng} with zoom ${zoom} pixels in ${height}x${width} map`); if (lat === null || lng === null) { const location = localize(); - console.log(`${location.latitude}, ${location.longitude}`); + // console.log(`${location.latitude}, ${location.longitude}`); return activefires(zoom, location.latitude, location.longitude, height, width); } return activefires(zoom, lat, lng, height, width); diff --git a/imports/ui/components/Maps/SubsUnion/SubsUnion.js b/imports/ui/components/Maps/SubsUnion/SubsUnion.js index 90b5f64..1088273 100644 --- a/imports/ui/components/Maps/SubsUnion/SubsUnion.js +++ b/imports/ui/components/Maps/SubsUnion/SubsUnion.js @@ -38,7 +38,7 @@ const subsUnion = (union, options) => { const fillColor = options.fillColor || 'green'; const opacity = options.options || 0.1; - if (options.subs.length > 0) { + if (options.subs) { const lmap = options.map.leafletElement; // http://leafletjs.com/reference-1.2.0.html#layergroup // FeatureGroup has getBounds @@ -49,7 +49,7 @@ const subsUnion = (union, options) => { } union = null; - if (options.show) { + if (options.subs.length > 0 && options.show) { // http://leafletjs.com/reference-1.2.0.html#path const copts = { parts: 144 diff --git a/imports/ui/components/Prompt/Confirm.js b/imports/ui/components/Prompt/Confirm.js new file mode 100644 index 0000000..f19e8a4 --- /dev/null +++ b/imports/ui/components/Prompt/Confirm.js @@ -0,0 +1,11 @@ +import { createConfirmation } from 'react-confirm'; +import Prompt from './Prompt'; + +// create confirm function +const confirm = createConfirmation(Prompt); + +// This is optional. But I recommend to define your confirm function easy to call. +export default function (confirmation, options = {}) { + // You can pass whatever you want to the component. These arguments will be your Component's props + return confirm({ confirmation, ...options }); +} diff --git a/imports/ui/components/Prompt/Prompt.js b/imports/ui/components/Prompt/Prompt.js new file mode 100644 index 0000000..1b39ebb --- /dev/null +++ b/imports/ui/components/Prompt/Prompt.js @@ -0,0 +1,111 @@ +/* eslint-disable react/jsx-indent-props */ +/* eslint-disable react/jsx-indent */ +/* eslint-disable import/no-absolute-path */ + +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { Modal, Button } from 'react-bootstrap'; +import { confirmable } from 'react-confirm'; + +class Prompt extends Component { + // constructor(props) { + /* super(props); + * this.state = { + * open: true + * }; + } + + componentDidMount() { + * console.log(this.prompt); + * this.setState({ open: true }); + } + */ + + render2() { + const { + show, + proceed, + dismiss, + cancel, + confirmation, + okBtn, + cancelBtn + } = this.props; + return ( +
Modal body text goes here.
+{confirmation}
+