Skip to content

Commit

Permalink
Merge pull request #139 from chargetrip/fix/isoline-example
Browse files Browse the repository at this point in the history
fix: isoline rendering fixed
  • Loading branch information
Wouter125 authored Oct 8, 2024
2 parents 7a89b85 + e3695e8 commit a0aa68b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
6 changes: 3 additions & 3 deletions examples/5.isolines/1.isoline/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ export const drawIso = data => {
const loadingToast = document.getElementById('loading-toast');

if (map.loaded()) {
while (index < data.polygon_count) {
while (index < data.polygons.length) {
addLayer(data.polygons[index].geometry.coordinates, index);
index = index + 1;
}

loadingToast.style.transform = `translateY(100%)`;
} else {
map.on('load', () => {
while (index < data.polygon_count) {
while (index < data.polygons.length) {
addLayer(data.polygons[index].geometry.coordinates, index);
index = index + 1;
}
Expand Down Expand Up @@ -83,7 +83,7 @@ const addLayer = (dataLayer, index) => {
paint: {
'line-color': '#0078ff',
'line-width': 1,
'line-opacity': index === 4 ? 1 : 0.2, // 1 - (index + 1) * 0.1
'line-opacity': index === 4 ? 1 : 0.2,
},
});
};
7 changes: 0 additions & 7 deletions examples/5.isolines/1.isoline/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ subscription createIsoline($id: ID!){
index
}
}
polygon_count
season
origin{
geometry{
coordinates
}
}
}
}
`;

0 comments on commit a0aa68b

Please sign in to comment.