Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map features, About page changes #665

Merged
merged 7 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"react-dom": "^16.8.6",
"react-leaflet": "^2.4.0",
"react-leaflet-choropleth": "^2.0.0",
"react-leaflet-control": "^2.1.2",
"react-leaflet-easyprint": "^2.0.0",
"react-leaflet-heatmap-layer": "^2.0.0",
"react-leaflet-markercluster": "^2.0.0-rc3",
Expand Down
Binary file added src/assets/about311hero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/cfa-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/empowerla.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 0 additions & 9 deletions src/assets/empowerla.svg

This file was deleted.

Binary file added src/assets/hackforla.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 0 additions & 9 deletions src/assets/hackforla.svg

This file was deleted.

60 changes: 60 additions & 0 deletions src/components/PinMap/ExportLegend.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'proptypes';
import Control from 'react-leaflet-control';
import Icon from '@components/common/Icon';

import { REQUEST_TYPES } from '@components/common/CONSTANTS';

const ExportLegend = ({
requestTypes,
visible,
position,
}) => {
const getRequestTypeFilters = Object.keys(requestTypes).filter(type => type !== 'All' && requestTypes[type]);
const renderLegendTypes = getRequestTypeFilters.map(req => {
const { color, displayName, abbrev } = REQUEST_TYPES[req];
return (
<div key={`export-legend-${abbrev}`}>
<Icon
id={`request-icon-${abbrev}`}
icon="circle"
size="small"
style={{ color }}
/>
{`${displayName} [${abbrev}]`}
</div>
);
});

if (visible) {
return (
<Control position={position}>
<div className="export-legend-wrapper">
<div className="export-legend-title">Request Type Legend:</div>
<div className="leaflet-control-layers-separator" />
{
renderLegendTypes.length ? renderLegendTypes : 'No request types selected'
}
</div>
</Control>
);
}
return null;
};

const mapStateToProps = state => ({
requestTypes: state.filters.requestTypes,
});

ExportLegend.propTypes = {
requestTypes: PropTypes.shape({}).isRequired,
visible: PropTypes.bool.isRequired,
position: PropTypes.oneOf(['topright', 'topleft', 'bottomright', 'bottomleft']),
};

ExportLegend.defaultProps = {
position: 'bottomright',
};

export default connect(mapStateToProps, null)(ExportLegend);
40 changes: 40 additions & 0 deletions src/components/PinMap/HeatmapLegend.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react';
import PropTypes from 'proptypes';
import Control from 'react-leaflet-control';

const HeatmapLegend = ({
visible,
position,
}) => {
if (visible) {
return (
<Control position={position}>
<div className="heatmap-legend-wrapper has-text-centered">
<div className="has-text-centered">
Concentration of Reports
</div>
<div id="heatmap-gradient-legend" className="level columns">
<span className="column has-text-left level-item">
Low
</span>
<span className="column has-text-right level-item">
High
</span>
</div>
</div>
</Control>
);
}
return null;
};

HeatmapLegend.propTypes = {
visible: PropTypes.bool.isRequired,
position: PropTypes.oneOf(['topright', 'topleft', 'bottomright', 'bottomleft']),
};

HeatmapLegend.defaultProps = {
position: 'bottomright',
};

export default HeatmapLegend;
Loading