diff --git a/examples/arcgis-image.html b/examples/arcgis-image.html index 87b6e43089..241e0c1def 100644 --- a/examples/arcgis-image.html +++ b/examples/arcgis-image.html @@ -6,6 +6,6 @@ docs: > This example shows how to use a dynamic ArcGIS REST MapService. This source type supports Map and Image Services. For dyamic ArcGIS services. -tags: arcgis, image, dynamiclayer" +tags: "arcgis, image, dynamiclayer" ---
diff --git a/examples/arcgis-tiled.html b/examples/arcgis-tiled.html index 576abf6b4d..a92546eca5 100644 --- a/examples/arcgis-tiled.html +++ b/examples/arcgis-tiled.html @@ -7,6 +7,6 @@ docs: > This source type supports Map and Image Services. For cached ArcGIS services, better performance is available by usingol/source/XYZ instead.
-tags: arcgis, tile, tilelayer"
+tags: "arcgis, tile, tilelayer"
---
diff --git a/examples/bing-maps.html b/examples/bing-maps.html
index e201f69efc..2752130f9e 100644
--- a/examples/bing-maps.html
+++ b/examples/bing-maps.html
@@ -6,7 +6,7 @@ docs: >
When the Bing Maps tile service doesn't have tiles for a given resolution and region it returns "placeholder" tiles indicating that. Zoom the map beyond level 19 to see the "placeholder" tiles. If you want OpenLayers to display stretched tiles in place of "placeholder" tiles beyond zoom level 19 then set maxZoom to 19 in the options passed to ol/source/BingMaps.
The map on the top preloads low resolution tiles. The map on the bottom does not use any preloading. Try zooming out and panning to see the difference.
tags: "preload, bing" cloak: - - key: ApTJzdkyN1DdFKkRAE6QIDtzihNaf6IWJsT-nQ_2eMoO4PN__0Tzhl2-WgJtXFSp + - key: ApTJzdkyN1DdFKkRAE6QIDtzihNaf6IWJsT-nQ_2eMoO4PN__0Tzhl2-WgJtXFSp value: Your Bing Maps Key from http://www.bingmapsportal.com/ here --- diff --git a/examples/preload.js b/examples/preload.js index 4ee22ba30c..2ca51436aa 100644 --- a/examples/preload.js +++ b/examples/preload.js @@ -13,8 +13,7 @@ const map1 = new Map({ new TileLayer({ preload: Infinity, source: new BingMaps({ - key: - 'ApTJzdkyN1DdFKkRAE6QIDtzihNaf6IWJsT-nQ_2eMoO4PN__0Tzhl2-WgJtXFSp ', + key: 'ApTJzdkyN1DdFKkRAE6QIDtzihNaf6IWJsT-nQ_2eMoO4PN__0Tzhl2-WgJtXFSp', imagerySet: 'Aerial', }), }), @@ -28,8 +27,7 @@ const map2 = new Map({ new TileLayer({ preload: 0, // default value source: new BingMaps({ - key: - 'ApTJzdkyN1DdFKkRAE6QIDtzihNaf6IWJsT-nQ_2eMoO4PN__0Tzhl2-WgJtXFSp ', + key: 'ApTJzdkyN1DdFKkRAE6QIDtzihNaf6IWJsT-nQ_2eMoO4PN__0Tzhl2-WgJtXFSp', imagerySet: 'AerialWithLabelsOnDemand', }), }), diff --git a/examples/webpack/config.js b/examples/webpack/config.js index f1e7012195..57306a0626 100644 --- a/examples/webpack/config.js +++ b/examples/webpack/config.js @@ -71,6 +71,7 @@ module.exports = { {from: 'resources', to: 'resources'}, {from: 'Jugl.js', to: 'Jugl.js'}, {from: 'index.html', to: 'index.html'}, + {from: 'index.js', to: 'index.js'}, ], }), ], diff --git a/examples/webpack/example-builder.js b/examples/webpack/example-builder.js index e1f1dd521e..39a94acec7 100644 --- a/examples/webpack/example-builder.js +++ b/examples/webpack/example-builder.js @@ -42,26 +42,19 @@ function createWordIndex(exampleData) { const keys = ['shortdesc', 'title', 'tags']; exampleData.forEach((data, i) => { keys.forEach((key) => { - let text = data[key]; + let text = data[key] || ''; if (Array.isArray(text)) { text = text.join(' '); } - const words = text ? text.split(/\W+/) : []; + const words = text.toLowerCase().split(/\W+/); words.forEach((word) => { if (word) { - word = word.toLowerCase(); let counts = index[word]; - if (counts) { - if (index in counts) { - counts[i] += 1; - } else { - counts[i] = 1; - } - } else { + if (!counts) { counts = {}; - counts[i] = 1; index[word] = counts; } + counts[i] = (counts[i] || 0) + 1; } }); }); @@ -169,14 +162,19 @@ class ExampleBuilder { await Promise.all(promises); + exampleData.sort((a, b) => + a.title.localeCompare(b.title, 'en', {sensitivity: 'base'}) + ); const info = { examples: exampleData, index: createWordIndex(exampleData), - tags: Array.from(uniqueTags), + tags: Array.from(uniqueTags) + .sort() // sort twice to get predictable, case insensitve order + .sort((a, b) => a.localeCompare(b, 'en', {sensitivity: 'base'})), }; - const indexSource = `var info = ${JSON.stringify(info)}`; - compilation.assets['index.js'] = new RawSource(indexSource); + const indexSource = `const info = ${JSON.stringify(info)};`; + compilation.assets['examples-info.js'] = new RawSource(indexSource); }); }