Skipped locations from unknown cities when processing cities stats for map

This commit is contained in:
Alejandro Celaya
2019-01-07 21:11:09 +01:00
parent 4870801f8f
commit 00d386f19f
2 changed files with 12 additions and 9 deletions

View File

@@ -9,7 +9,7 @@ const propTypes = {
isOpen: PropTypes.bool,
title: PropTypes.string,
locations: PropTypes.arrayOf(PropTypes.shape({
city: PropTypes.string.isRequired,
cityName: PropTypes.string.isRequired,
latLong: PropTypes.arrayOf(PropTypes.number).isRequired,
count: PropTypes.number.isRequired,
})),
@@ -31,9 +31,9 @@ const MapModal = ({ toggle, isOpen, title, locations }) => (
<ModalBody className="map-modal__modal-body">
<Map center={[ 0, 0 ]} zoom="3">
<OpenStreetMapTile />
{locations.map(({ city, latLong, count }, index) => (
{locations.map(({ cityName, latLong, count }, index) => (
<Marker key={index} position={latLong}>
<Popup><b>{count}</b> visit{count > 1 ? 's' : ''} from <b>{city}</b></Popup>
<Popup><b>{count}</b> visit{count > 1 ? 's' : ''} from <b>{cityName}</b></Popup>
</Marker>
))}
</Map>