Skip to content

Commit

Permalink
fix ordering of layers
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatysinger committed May 11, 2024
1 parent f94b154 commit b1d929d
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions src/routes/dashboard/Dashboard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,35 @@
'layout': {'visibility': 'visible'},
});
// ADD DASHBOARD LAYER
map.addSource(dashboardSourceId, {
type: 'geojson',
data: 'https://raw.githubusercontent.com/yoakiyama/zoning-dashboard-fp/main/data/Boston_Cambridge_all.geojson',
generateId: false
});
dashboardLayerId = 'boston_cambridge_all';
dashboardLineLayerId = 'boston_cambridge_all_outline';
map.addLayer({
'id': dashboardLayerId,
'source': dashboardSourceId,
'type': 'fill',
'paint': {
'fill-color': 'hsla(200, 100%, 100%, 0.8)'
},
'layout': {'visibility': 'none'},
});
map.addLayer({
'id': dashboardLineLayerId,
'source': dashboardSourceId,
'type': 'line',
'paint': {
'line-color': defaultOutlineColor,
'line-opacity': 0.95
},
'layout': {'visibility': 'none'},
});
// ADD COMMUTE LAYER
map.addSource("Boston_Cambridge_Commute", {
type: 'geojson',
Expand Down Expand Up @@ -362,34 +391,7 @@
'layout': {'visibility': 'none'},
});
// ADD DASHBOARD LAYER
map.addSource(dashboardSourceId, {
type: 'geojson',
data: 'https://raw.githubusercontent.com/yoakiyama/zoning-dashboard-fp/main/data/Boston_Cambridge_all.geojson',
generateId: false
});
dashboardLayerId = 'boston_cambridge_all';
dashboardLineLayerId = 'boston_cambridge_all_outline';
map.addLayer({
'id': dashboardLayerId,
'source': dashboardSourceId,
'type': 'fill',
'paint': {
'fill-color': 'hsla(200, 100%, 100%, 0.8)'
},
'layout': {'visibility': 'none'},
});
map.addLayer({
'id': dashboardLineLayerId,
'source': dashboardSourceId,
'type': 'line',
'paint': {
'line-color': defaultOutlineColor,
'line-opacity': 0.95
},
'layout': {'visibility': 'none'},
});
Expand Down

0 comments on commit b1d929d

Please sign in to comment.