How do I create a map using leaflet as I was doing it is showing the following.
./src/Map.js
Attempted import error: 'Map' is not exported from 'react-leaflet' (imported as 'LeafletMap').
Here Is My Code:
import React from 'react';
import './Map.css';
import { Map as LeafletMap, TileLayer } from 'react-leaflet';
function Map() {
return (
<div className="map">
<LeafletMap>
<TileLayer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
attribution='© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
/>
</LeafletMap>
</div>
)
}
export default Map