doc: add Map and showDataOnMap with LeftletMap container
This commit is contained in:
1 parent
21480a174f
commit
a23bb0c09a
1 file changed
+15
-3
+15
-3
@@ -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='© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
|
||||
/>
|
||||
{showDataOnMap(countries, casesType)}
|
||||
</LeafletMap>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
export default Map;
|
||||
export default Map;
|
||||
Reference in new issue
Block a user