Skip to content

Commit 8ab6c3b

Browse files
committed
Website updates
1 parent 7bda031 commit 8ab6c3b

18 files changed

+43
-34
lines changed

dist/en/main/examples/common.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/examples/common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/examples/export-map.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/examples/filter-points-webgl.html

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,12 @@ <h5 class="modal-title" id="tag-example-title"></h5>
206206

207207
<div class="row-fluid">
208208
<p id="shortdesc">Using WebGL to filter large quantities of features</p>
209-
<div id="docs"><p>This example shows how to use <code>ol/layer/WebGLPoints</code> with a literal style to dynamically filter a large amount
209+
<div id="docs"><p>This example shows how to use <code>ol/layer/WebGLVector</code> with a literal style to dynamically filter a large amount
210210
of point geometries. The above map is based on a dataset from the NASA containing 45k recorded meteorite
211211
landing sites. Each meteorite is marked by a circle on the map (the bigger the circle, the heavier
212212
the object). A pulse effect has been added, which is slightly offset by the year of the impact.</p>
213213
<p>Adjusting the sliders causes the objects outside of the date range to be filtered out of the map. This is done
214-
by mutating the variables in the <code>style</code> object provided to the WebGL layer. Also note that the last snippet
214+
by mutating the variables used by the <code>style</code> object provided to the WebGL layer. Also note that the last snippet
215215
of code is necessary to make sure the map refreshes itself every frame.</p>
216216
</div>
217217
</div>
@@ -223,7 +223,7 @@ <h5 class="source-heading">main.js</h5>
223223
import View from &#x27;ol/View.js&#x27;;
224224
import Point from &#x27;ol/geom/Point.js&#x27;;
225225
import TileLayer from &#x27;ol/layer/Tile.js&#x27;;
226-
import WebGLPointsLayer from &#x27;ol/layer/WebGLPoints.js&#x27;;
226+
import WebGLVectorLayer from &#x27;ol/layer/WebGLVector.js&#x27;;
227227
import {fromLonLat} from &#x27;ol/proj.js&#x27;;
228228
import StadiaMaps from &#x27;ol/source/StadiaMaps.js&#x27;;
229229
import Vector from &#x27;ol/source/Vector.js&#x27;;
@@ -271,17 +271,6 @@ <h5 class="source-heading">main.js</h5>
271271
&#x27;circle-opacity&#x27;: [&#x27;-&#x27;, 1.0, [&#x27;*&#x27;, animRatio, 0.75]],
272272
};
273273

274-
const pointsLayer &#x3D; new WebGLPointsLayer({
275-
variables: {
276-
minYear: 1850,
277-
maxYear: 2015,
278-
},
279-
style,
280-
filter: [&#x27;between&#x27;, [&#x27;get&#x27;, &#x27;year&#x27;], [&#x27;var&#x27;, &#x27;minYear&#x27;], [&#x27;var&#x27;, &#x27;maxYear&#x27;]],
281-
source: vectorSource,
282-
disableHitDetection: true,
283-
});
284-
285274
// handle input values &amp; events
286275
const minYearInput &#x3D; document.getElementById(&#x27;min-year&#x27;);
287276
const maxYearInput &#x3D; document.getElementById(&#x27;max-year&#x27;);
@@ -292,12 +281,30 @@ <h5 class="source-heading">main.js</h5>
292281
div.querySelector(&#x27;span.max-year&#x27;).textContent &#x3D; maxYearInput.value;
293282
}
294283

284+
const pointsLayer &#x3D; new WebGLVectorLayer({
285+
variables: {
286+
minYear: parseInt(minYearInput.value),
287+
maxYear: parseInt(maxYearInput.value),
288+
},
289+
style: {
290+
style,
291+
filter: [
292+
&#x27;between&#x27;,
293+
[&#x27;get&#x27;, &#x27;year&#x27;],
294+
[&#x27;var&#x27;, &#x27;minYear&#x27;],
295+
[&#x27;var&#x27;, &#x27;maxYear&#x27;],
296+
],
297+
},
298+
source: vectorSource,
299+
disableHitDetection: true,
300+
});
301+
295302
minYearInput.addEventListener(&#x27;input&#x27;, function () {
296303
pointsLayer.updateStyleVariables({minYear: parseInt(minYearInput.value)});
297304
updateStatusText();
298305
});
299306
maxYearInput.addEventListener(&#x27;input&#x27;, function () {
300-
pointsLayer.updateStyleVariables({maxYear: parseInt(minYearInput.value)});
307+
pointsLayer.updateStyleVariables({maxYear: parseInt(maxYearInput.value)});
301308
updateStatusText();
302309
});
303310
updateStatusText();

dist/en/main/examples/filter-points-webgl.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)