Skip to content

Commit 61ff881

Browse files
committed
Website updates
1 parent 7c15bdd commit 61ff881

11 files changed

Lines changed: 77 additions & 81 deletions

dist/en/main/examples/common.js

Lines changed: 11 additions & 21 deletions
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/layer-group.html

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,7 @@ <h5>Click on layer nodes below to change their properties.</h5>
217217

218218
<div class="row-fluid">
219219
<h5 class="source-heading">main.js</h5>
220-
<pre><code id="example-js-source" class="language-js">import $ from &#x27;jquery&#x27;;
221-
import Map from &#x27;ol/Map.js&#x27;;
220+
<pre><code id="example-js-source" class="language-js">import Map from &#x27;ol/Map.js&#x27;;
222221
import View from &#x27;ol/View.js&#x27;;
223222
import LayerGroup from &#x27;ol/layer/Group.js&#x27;;
224223
import TileLayer from &#x27;ol/layer/Tile.js&#x27;;
@@ -262,17 +261,20 @@ <h5 class="source-heading">main.js</h5>
262261
});
263262

264263
function bindInputs(layerid, layer) {
265-
const visibilityInput &#x3D; $(layerid + &#x27; input.visible&#x27;);
266-
visibilityInput.on(&#x27;change&#x27;, function () {
264+
const visibilityInput &#x3D; document.querySelector(layerid + &#x27; input.visible&#x27;);
265+
visibilityInput.addEventListener(&#x27;change&#x27;, function () {
267266
layer.setVisible(this.checked);
268267
});
269-
visibilityInput.prop(&#x27;checked&#x27;, layer.getVisible());
268+
visibilityInput.addEventListener(&#x27;change&#x27;, function () {
269+
layer.setVisible(this.checked);
270+
});
271+
visibilityInput.checked &#x3D; layer.getVisible();
270272

271-
const opacityInput &#x3D; $(layerid + &#x27; input.opacity&#x27;);
272-
opacityInput.on(&#x27;input&#x27;, function () {
273+
const opacityInput &#x3D; document.querySelector(layerid + &#x27; input.opacity&#x27;);
274+
opacityInput.addEventListener(&#x27;input&#x27;, function () {
273275
layer.setOpacity(parseFloat(this.value));
274276
});
275-
opacityInput.val(String(layer.getOpacity()));
277+
opacityInput.value &#x3D; String(layer.getOpacity());
276278
}
277279
function setup(id, group) {
278280
group.getLayers().forEach(function (layer, i) {
@@ -285,12 +287,15 @@ <h5 class="source-heading">main.js</h5>
285287
}
286288
setup(&#x27;#layer&#x27;, map.getLayerGroup());
287289

288-
$(&#x27;#layertree li &gt; span&#x27;)
289-
.click(function () {
290-
$(this).siblings(&#x27;fieldset&#x27;).toggle();
291-
})
292-
.siblings(&#x27;fieldset&#x27;)
293-
.hide();
290+
document.querySelectorAll(&#x27;#layertree li &gt; span&#x27;).forEach(function (element) {
291+
element.addEventListener(&#x27;click&#x27;, function () {
292+
this.parentNode.querySelector(&#x27;fieldset&#x27;).style.display &#x3D;
293+
this.parentNode.querySelector(&#x27;fieldset&#x27;).style.display &#x3D;&#x3D;&#x3D; &#x27;none&#x27;
294+
? &#x27;&#x27;
295+
: &#x27;none&#x27;;
296+
});
297+
element.parentNode.querySelector(&#x27;fieldset&#x27;).style.display &#x3D; &#x27;none&#x27;;
298+
});
294299
</code></pre>
295300
</div>
296301

@@ -378,8 +383,7 @@ <h5 class="source-heading">package.json</h5>
378383
<pre><code id="example-pkg-source" class="language-json">{
379384
&quot;name&quot;: &quot;layer-group&quot;,
380385
&quot;dependencies&quot;: {
381-
&quot;ol&quot;: &quot;10.7.1-dev&quot;,
382-
&quot;jquery&quot;: &quot;3.7.1&quot;
386+
&quot;ol&quot;: &quot;10.7.1-dev&quot;
383387
},
384388
&quot;devDependencies&quot;: {
385389
&quot;vite&quot;: &quot;^3.2.3&quot;

dist/en/main/examples/layer-group.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/layer-group.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/topolis.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.2/css/brands.css" crossorigin="anonymous">
1111
<link rel="stylesheet" type="text/css" href="./theme/ol.css">
1212
<link rel="stylesheet" type="text/css" href="/theme/site.css">
13-
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.4/toastr.min.css">
1413
<link rel="icon" type="image/svg+xml" href="/theme/img/logo-light.svg" media="(prefers-color-scheme: light)" />
1514
<link rel="icon" type="image/svg+xml" href="/theme/img/logo-dark.svg" media="(prefers-color-scheme: dark)" />
1615
</head>
@@ -482,7 +481,7 @@ <h5 class="source-heading">main.js</h5>
482481
}
483482
topo.addEdgeNewFaces(start, end, edgeGeom);
484483
} catch (e) {
485-
toastr.warning(e.toString());
484+
alert(e.toString());
486485
}
487486
}
488487

@@ -506,7 +505,6 @@ <h5 class="source-heading">index.html</h5>
506505
&lt;head&gt;
507506
&lt;meta charset="UTF-8"&gt;
508507
&lt;title&gt;topolis integration&lt;/title&gt;
509-
&lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.4/toastr.min.css"&gt;
510508
&lt;link rel="stylesheet" href="node_modules/ol/ol.css"&gt;
511509
&lt;style&gt;
512510
.map {
@@ -519,8 +517,6 @@ <h5 class="source-heading">index.html</h5>
519517
&lt;div id&#x3D;&quot;map&quot; class&#x3D;&quot;map&quot;&gt;&lt;/div&gt;
520518

521519
&lt;script src="https://cdn.jsdelivr.net/npm/topolis@0.2.5/dist/topolis.js"&gt;&lt;/script&gt;
522-
&lt;script src="https://code.jquery.com/jquery-3.7.1.min.js"&gt;&lt;/script&gt;
523-
&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.4/toastr.min.js"&gt;&lt;/script&gt;
524520
&lt;script type="module" src="main.js"&gt;&lt;/script&gt;
525521
&lt;/body&gt;
526522
&lt;/html&gt;</code></pre>
@@ -546,8 +542,6 @@ <h5 class="source-heading">package.json</h5>
546542

547543
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js"></script>
548544
<script src="https://cdn.jsdelivr.net/npm/topolis@0.2.5/dist/topolis.js"></script>
549-
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
550-
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.4/toastr.min.js"></script>
551545
<script src="common.js"></script>
552546
<script src="topolis.js"></script>
553547
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.28.0/components/prism-core.min.js"></script>

0 commit comments

Comments
 (0)