Skip to content

Commit

Permalink
Add generic markers
Browse files Browse the repository at this point in the history
Adds generic markers for fatalities without a type. The marker will be a
simple plain circle. We decided not to add an icon to avoid confusing
the users.

Fixes scrapd#126
  • Loading branch information
rgreinho committed Jun 27, 2019
1 parent 5235bd3 commit c9c192f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions components/scrapd-map/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,24 +123,23 @@ function clusterMarker(coordinates, count) {

function SingleMarker(fatality) {
let Icon;
let markerStyle = markerStyle;
let SingleMarkerStyle = markerStyle;
if (fatality.Type == 'motorcycle') {
markerStyle = markerStyleMotorcycle;
SingleMarkerStyle = markerStyleMotorcycle;
Icon = <FontAwesomeIcon icon={faMotorcycle} />;
} else if (fatality.Type == 'pedestrian') {
markerStyle = markerStylePedestrian;
SingleMarkerStyle = markerStylePedestrian;
Icon = <FontAwesomeIcon icon={faWalking} />;
} else if (fatality.Type == 'bicycle') {
markerStyle = markerStyleBicycle;
SingleMarkerStyle = markerStyleBicycle;
Icon = <FontAwesomeIcon icon={faBiking} />;
} else if (fatality.Type == 'motor vehicle') {
markerStyle = markerStyleMotor;
SingleMarkerStyle = markerStyleMotor;
Icon = <FontAwesomeIcon icon={faCarCrash} />;
}

return (
<Marker key={fatality.Case} style={markerStyle} coordinates={[fatality.Longitude, fatality.Latitude]}>
{/* <Icon /> */}
<Marker key={fatality.Case} style={SingleMarkerStyle} coordinates={[fatality.Longitude, fatality.Latitude]}>
{Icon}
</Marker>
);
Expand Down

0 comments on commit c9c192f

Please sign in to comment.