feat: Fetch and merge multiple country GeoJSON files

This commit is contained in:
Sean Morley
2024-07-24 11:52:39 -04:00
parent 6a5e8ba1ec
commit 0720481937
2 changed files with 20 additions and 24 deletions

View File

@@ -17,19 +17,11 @@
let clickedName = '';
let markers = data.props.markers;
let us = data.props.USjson;
let ca = data.props.CAjson;
// combine the two geojsons
let geoJSON = {
type: 'FeatureCollection',
features: [...us.features, ...ca.features]
};
console.log(markers);
let visitedRegions = data.props.visitedRegions;
let geoJSON = data.props.geoJSON;
let visitArray = [];
// turns in into an array of the visits
@@ -37,6 +29,7 @@
visitArray.push(el.region);
});
// mapped to the checkbox
let showGEO = true;
</script>
@@ -94,7 +87,7 @@
{/if}
{/each}
{#if showGEO}
<GeoJSON id="states" data={geoJSON} promoteId="ISOCODE">
<GeoJSON id="states" data={data.props.geoJSON} promoteId="ISOCODE">
<LineLayer
layout={{ 'line-cap': 'round', 'line-join': 'round' }}
paint={{ 'line-color': 'grey', 'line-width': 3 }}