File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,12 @@ function App() {
2626
2727 // Take the name property of each collection and set it's initial visibility to true
2828 const layerNames = collections . map ( ( fc ) => fc . name )
29- const visbilityMap = layerNames . reduce ( ( map , name ) => { map [ name ] = true ; return map } , { } as LayerVisibilityMap )
30- setLayerVisibility ( { ...visbilityMap } )
29+ const visibilityMap = layerNames . reduce ( ( map , name ) => { map [ name ] = true ; return map } , { } as LayerVisibilityMap )
30+ setLayerVisibility ( { ...visibilityMap } )
3131 } , )
3232 } , [ ] )
3333
3434 const layersToRender = layers . filter ( ( fc ) => layerVisibility [ fc . name ] )
35- console . log ( layersToRender )
3635
3736 return (
3837 < div className = "app-container" >
Original file line number Diff line number Diff line change @@ -11,7 +11,10 @@ interface LayerProps {
1111export const Layer : React . FC < LayerProps > = ( { featureCollection } ) => {
1212 return (
1313 featureCollection . features . map ( ( feature , idx ) => (
14- < GeoJSON key = { idx } data = { feature } />
14+ < GeoJSON
15+ key = { `${ featureCollection . name } -${ feature . id || idx } ` }
16+ data = { feature }
17+ />
1518 ) )
1619 )
1720}
You can’t perform that action at this time.
0 commit comments