Skip to content

Commit 749bccc

Browse files
committed
Add shortcut to move layer to the top
1 parent d306aa8 commit 749bccc

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

worldwind-gs-viewer/src/main/resources/explorer/index.html

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -458,18 +458,6 @@ <h4 class="sub-header">
458458
data-bind="css: {'glyphicon-eye-open': $data.enabled(), 'glyphicon-eye-close': !$data.enabled()}"></span>
459459
<span class="layer" data-bind="text: $data.name()"></span>
460460
</button>
461-
<!--Conditionally display a legend button-->
462-
<button type="button"
463-
class="btn btn-default collapse"
464-
style="display: block; width: 10%;"
465-
data-toggle="collapse"
466-
data-bind="css: {active: $data.enabled(), in: $data.enabled()},
467-
attr: {
468-
'data-target': '#collapse-layer-' + $data.id(),
469-
'aria-controls': 'collapse-layer-' + $data.id(),
470-
'aria-expanded': $data.enabled() ? 'true' : 'false'}">
471-
<span class="glyphicon glyphicon-stats"></span>
472-
</button>
473461
<!--Settings button-->
474462
<button type="button"
475463
class="btn btn-default"
@@ -497,12 +485,18 @@ <h4 class="sub-header">
497485
data-bind="css: {active: $data.enabled()}, click: $root.onMoveLayerDown">
498486
<span class="glyphicon glyphicon-arrow-down"></span>
499487
</button>
488+
<button type="button"
489+
class="btn btn-default"
490+
style="display: block; width: 10%;"
491+
data-bind="css: {active: $data.enabled()}, click: $root.onMoveLayerToTop">
492+
<span class="glyphicon glyphicon-circle-arrow-up"></span>
493+
</button>
500494
</div>
501495
<div class="collapse" data-bind="attr: {id: 'collapse-layer-' + $data.id()}">
502496
<div class="well">
503497
<!--Controls and Legend-->
504498
<div>
505-
<img data-bind="attr: {src: legendUrl}"/>
499+
<img data-bind="attr: {src: $data.legendUrl}"/>
506500
</div>
507501
</div>
508502
</div>
@@ -516,6 +510,10 @@ <h4 class="sub-header">
516510
<div id="layer-settings-dialog">
517511
Opacity
518512
<div id="opacity-slider" auto-focus></div>
513+
<div>
514+
<!-- TODO not binding the url -->
515+
<img data-bind="attr: {src: $data.legendUrl}"/>
516+
</div>
519517
</div>
520518
</div>
521519

worldwind-gs-viewer/src/main/resources/explorer/js/views/LayersViewModel.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ define(['knockout', 'jquery', 'jqueryui', 'bootstrap', 'model/Constants', 'model
109109
layerManager.moveLayer(layer, "up");
110110
};
111111

112+
self.onMoveLayerToTop = function(layer) {
113+
layerManager.moveLayer(layer, 0);
114+
};
115+
112116
self.onMoveLayerDown = function (layer) {
113117
layerManager.moveLayer(layer, "down");
114118
}

0 commit comments

Comments
 (0)