Files
React-COVID-Tracker/src/Map.js
T

21 lines
596 B
JavaScript

import React from "react";
import { Map as LeafletMap, TileLayer } from "react-leaflet";
import "./Map.css";
import { showDataOnMap } from "./util";
function Map({ countries, casesType, center, zoom }) {
return (
<section className="map">
<LeafletMap center={center} zoom={zoom}>
<TileLayer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
/>
{showDataOnMap(countries, casesType)}
</LeafletMap>
</section>
);
}
export default Map;