diff --git a/src/components/SightingMap.js b/src/components/SightingMap.js index e2c3e89..6bfdbe2 100644 --- a/src/components/SightingMap.js +++ b/src/components/SightingMap.js @@ -85,6 +85,29 @@ export class MapContainer extends Component { } } + sightingIcon = (type) => { + let pinIcon + + switch(type) { + case 'visual': + pinIcon = 'https://i.postimg.cc/nhYXGQNp/marten-icon.png' + break + case 'roadkill': + pinIcon = 'https://i.postimg.cc/xdfcx1SH/tire-icon.png' + break + case 'viewed_tracks': + pinIcon = 'https://i.postimg.cc/7P761WCS/paws.png' + break + case 'trapped': + pinIcon = 'https://i.postimg.cc/Y9LSsXdK/cage.png' + break + default: + break + } + + return pinIcon + } + // Set the state of the component to contain user coordinates and initial // marker and info window information state = { @@ -99,6 +122,8 @@ export class MapContainer extends Component { } render() { + const {google} = this.props; + return ( // Render the Google Map, Marker, and InfoWindow components