Make seed coordinate sticky

This commit is contained in:
Tim Schaub
2015-08-01 16:57:35 -06:00
parent 6f6698dd6a
commit f2f5cd2630
+6 -8
View File
@@ -103,14 +103,10 @@ var map = new ol.Map({
}) })
}); });
var pixel; var coordinate;
map.getView().on('change', function() { map.on('click', function(event) {
pixel = null; coordinate = event.coordinate;
});
map.on('click', function(ev) {
pixel = map.getPixelFromCoordinate(ev.coordinate);
raster.changed(); raster.changed();
}); });
@@ -118,7 +114,9 @@ raster.on('beforeoperations', function(event) {
// the event.data object will be passed to operations // the event.data object will be passed to operations
var data = event.data; var data = event.data;
data.delta = thresholdControl.value; data.delta = thresholdControl.value;
data.pixel = pixel; if (coordinate) {
data.pixel = map.getPixelFromCoordinate(coordinate);
}
}); });
var thresholdControl = document.getElementById('threshold'); var thresholdControl = document.getElementById('threshold');