Bind more layer properties in layer-group example

This allows to update hue, saturation, brightness, contrast values.
This commit is contained in:
Bruno Binet
2013-06-13 14:17:29 +02:00
parent 1100cc67da
commit d84477c1c0
2 changed files with 37 additions and 2 deletions

View File

@@ -42,8 +42,11 @@ var map = new ol.Map({
function bindInputs(layerid, layer) {
new ol.dom.Input($(layerid + ' .visible')[0])
.bindTo('checked', layer, 'visible');
new ol.dom.Input($(layerid + ' .opacity')[0])
.bindTo('value', layer, 'opacity');
$.each(['opacity', 'hue', 'saturation', 'contrast', 'brightness'],
function(i, v) {
new ol.dom.Input($(layerid + ' .' + v)[0]).bindTo('value', layer, v);
}
);
}
map.getLayers().forEach(function(layer, i) {
bindInputs('#layer' + i, layer);