'Can't import the named export 'features'.'map' (imported as 'SomaliaData') from default-exporting module
import React from 'react';
import { MapContainer as LeafletMap, MapContainer, Marker, TileLayer } from "react-leaflet"; import { Icon } from "leaflet"; import './App.css';
import * as SomaliaData from "./data/water_facilities.geojson";
function App(){ return ( <MapContainer center={[2.034666528, 45.338165314]} zoom={13}> OpenStreetMap contributors' url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" /> {SomaliaData.features.map(somalia => ( <Marker key = {somalia.properties.WATPNT_ID} position = {[ somalia.geometry.coordinates[1], somalia.geometry.coordinates[0] ]} /> ))} ); }
export default App;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
