doc: add Map and showDataOnMap with LeftletMap container

This commit is contained in:
Leon Xu committed 2022-05-03 15:37:34 -07:00
1 parent 21480a174f
commit a23bb0c09a
1 file changed
+15 -3
+15 -3
View File
@@ -1,8 +1,20 @@
import React from "react";
import { Map as LeafletMap, TileLayer } from "react-leaflet";
import "./Map.css";
import { showDataOnMap } from "./util";
function Map() {
return <section className="map"></section>;
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;
export default Map;