Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

Add generic markers #137

Merged
merged 1 commit into from
Jun 27, 2019
Merged
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
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