Fitting map to the contents of a vector layer (local GeoJSON)
<MapLibre
baseLayers={["EsriSatellite"]}>
<VectorLayerLibre
name="Sites"
source={{
path2data: {
path: "/data/ksa.geojson"
}
}}
fitToContent={true}
checked={true}
searchInFields={{
Item_Label: "Label",
Site_Name: "Site name",
Site_Description: "Site description"
}}
style={{
id: "ksaSites",
type: "circle",
paint: {
"circle-radius": 4,
"circle-color": "#007cbf",
"circle-stroke-width": 1.5,
"circle-stroke-color": "#000000"
}
}}
popupTemplate={`<div>
<h4>${Site_Name}</h4>
<p>${Site_Description}</p>
<small>${Item_Label}</small>
</div>`}
/>
</MapLibre>Data from Kahramanmaraş Survey created by Elizabeth Carter and published on OpenContext add distributed with CC BY 4.0 International license.
