display multiple kml files on same leaflet map component
This commit is contained in:
@@ -44,22 +44,20 @@ const LogTrackMaps = ({ rowKey, trackUrls }: LogTrackMapsProps) => {
|
|||||||
}, [trackUrls])
|
}, [trackUrls])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<MapContainer
|
||||||
<MapContainer
|
center={[45.14489, -93.21019]}
|
||||||
center={[45.14489, -93.21019]}
|
scrollWheelZoom={false}
|
||||||
scrollWheelZoom={false}
|
style={{ height: '500px', width: '100%' }}
|
||||||
style={{ height: '500px', width: '100%' }}
|
zoom={8}
|
||||||
zoom={8}
|
>
|
||||||
>
|
<TileLayer
|
||||||
<TileLayer
|
attribution='© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
|
||||||
attribution='© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
|
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
||||||
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
/>
|
||||||
/>
|
{tracks.length > 0 && tracks.map((track) => (
|
||||||
{tracks.length > 0 && tracks.map((track) => (
|
<ReactLeafletKml kml={track} />
|
||||||
<ReactLeafletKml kml={track} />
|
))}
|
||||||
))}
|
</MapContainer>
|
||||||
</MapContainer>
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user