Adding a vector layer from a local GeoJSON file using a function for the popup template
Data from Kahramanmaraş Survey created by Elizabeth Carter and published on OpenContext add distributed with CC BY 4.0 International license.
import {
MapLeaflet,
VectorLayer
} from "../../../modules/scms.js"
<MapLeaflet
height="400px"
baseLayers={["OSM"]}
>
<VectorLayer
name="Sites"
source={{
path2data: {
path: "/data/ksa.geojson"
}
}}
fitToContent={true}
checked={true}
popupTemplate={ (props) => `<p><strong>${props.Item_Label}</strong>. ${props.Site_Name} <br />Date: ${props.Early} — ${props.Late}</p>`}
/>
</MapLeaflet>