Skip to content

Commit

Permalink
fixed broken geojson and small refactorings
Browse files Browse the repository at this point in the history
  • Loading branch information
p3t3r67x0 committed Nov 22, 2024
1 parent 2ed4883 commit c1c44fb
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,23 @@ function renderParcelMeta(data) {
map.removeLayer(currentLayer)
}

const feature = JSON.parse(data['geojson'])
const geoJsonData = {
'type': 'FeatureCollection',
'features': [{
'type': 'Feature',
'geometry': {
'type': data['geojson']['type'],
'coordinates': data['geojson']['coordinates']
},
'properties': {}
}]
}

currentLayer = L.geoJSON(feature, {
currentLayer = L.geoJSON(geoJsonData, {
style: {
color: '#0069f6',
fillOpacity: 0.1,
weight: 2
color: '#333',
weight: 2,
fillOpacity: 0.1
}
}).addTo(map)

Expand Down

0 comments on commit c1c44fb

Please sign in to comment.