Skip to content

Commit

Permalink
Website updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaub committed Dec 5, 2024
1 parent 531d419 commit 1d0262d
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 28 deletions.
24 changes: 13 additions & 11 deletions dist/en/main/examples/filter-points-webgl.html
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,6 @@ <h5 class="source-heading">main.js</h5>
];

const style &#x3D; {
variables: {
minYear: 1850,
maxYear: 2015,
},
filter: [&#x27;between&#x27;, [&#x27;get&#x27;, &#x27;year&#x27;], [&#x27;var&#x27;, &#x27;minYear&#x27;], [&#x27;var&#x27;, &#x27;maxYear&#x27;]],
&#x27;circle-radius&#x27;: [
&#x27;*&#x27;,
Expand All @@ -276,6 +272,16 @@ <h5 class="source-heading">main.js</h5>
&#x27;circle-opacity&#x27;: [&#x27;-&#x27;, 1.0, [&#x27;*&#x27;, animRatio, 0.75]],
};

const pointsLayer &#x3D; new WebGLPointsLayer({
variables: {
minYear: 1850,
maxYear: 2015,
},
style: style,
source: vectorSource,
disableHitDetection: true,
});

// handle input values &amp; events
const minYearInput &#x3D; document.getElementById(&#x27;min-year&#x27;);
const maxYearInput &#x3D; document.getElementById(&#x27;max-year&#x27;);
Expand All @@ -287,11 +293,11 @@ <h5 class="source-heading">main.js</h5>
}

minYearInput.addEventListener(&#x27;input&#x27;, function () {
style.variables.minYear &#x3D; parseInt(minYearInput.value);
pointsLayer.updateStyleVariables({minYear: parseInt(minYearInput.value)});
updateStatusText();
});
maxYearInput.addEventListener(&#x27;input&#x27;, function () {
style.variables.maxYear &#x3D; parseInt(maxYearInput.value);
pointsLayer.updateStyleVariables({maxYear: parseInt(minYearInput.value)});
updateStatusText();
});
updateStatusText();
Expand Down Expand Up @@ -336,11 +342,7 @@ <h5 class="source-heading">main.js</h5>
layer: &#x27;stamen_toner&#x27;,
}),
}),
new WebGLPointsLayer({
style: style,
source: vectorSource,
disableHitDetection: true,
}),
pointsLayer,
],
target: document.getElementById(&#x27;map&#x27;),
view: new View({
Expand Down
2 changes: 1 addition & 1 deletion dist/en/main/examples/filter-points-webgl.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/en/main/examples/filter-points-webgl.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 14 additions & 13 deletions dist/en/main/examples/icon-sprite-webgl.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,6 @@ <h5 class="source-heading">main.js</h5>
const newColor &#x3D; [180, 255, 200];

const style &#x3D; {
variables: {
filterShape: &#x27;all&#x27;,
},
filter: [
&#x27;any&#x27;,
[&#x27;&#x3D;&#x3D;&#x27;, [&#x27;var&#x27;, &#x27;filterShape&#x27;], &#x27;all&#x27;],
Expand Down Expand Up @@ -282,9 +279,20 @@ <h5 class="source-heading">main.js</h5>
&#x27;icon-scale&#x27;: 0.5,
};

const pointsLayer &#x3D; new WebGLPointsLayer({
variables: {
filterShape: &#x27;all&#x27;,
},
source: new VectorSource({
features: [],
attributions: &#x27;National UFO Reporting Center&#x27;,
}),
style: style,
});

const shapeSelect &#x3D; document.getElementById(&#x27;shape-filter&#x27;);
shapeSelect.addEventListener(&#x27;input&#x27;, function () {
style.variables.filterShape &#x3D; shapeSelect.value;
pointsLayer.updateStyleVariables({filterShape: shapeSelect.value});
map.render();
});
function fillShapeSelect(shapeTypes) {
Expand Down Expand Up @@ -332,15 +340,8 @@ <h5 class="source-heading">main.js</h5>
);
}
shapeTypes[&#x27;all&#x27;] &#x3D; features.length;
map.addLayer(
new WebGLPointsLayer({
source: new VectorSource({
features: features,
attributions: &#x27;National UFO Reporting Center&#x27;,
}),
style: style,
}),
);
pointsLayer.getSource().addFeatures(features);
map.addLayer(pointsLayer);
fillShapeSelect(shapeTypes);
});
client.send();
Expand Down
Loading

0 comments on commit 1d0262d

Please sign in to comment.