Fix precision input change in mouse-position example
This commit is contained in:
@@ -39,9 +39,8 @@ projectionSelect.on('change:value', function() {
|
|||||||
mousePositionControl.setProjection(ol.proj.get(projectionSelect.getValue()));
|
mousePositionControl.setProjection(ol.proj.get(projectionSelect.getValue()));
|
||||||
});
|
});
|
||||||
|
|
||||||
var precisionInput = new ol.dom.Input(document.getElementById('precision'));
|
var precisionInput = document.getElementById('precision');
|
||||||
precisionInput.on('change:value', function() {
|
precisionInput.addEventListener('change', function() {
|
||||||
var precision = /** @type {number} */ (precisionInput.getValueAsNumber());
|
var format = ol.coordinate.createStringXY(precisionInput.valueAsNumber);
|
||||||
var format = ol.coordinate.createStringXY(precision);
|
|
||||||
mousePositionControl.setCoordinateFormat(format);
|
mousePositionControl.setCoordinateFormat(format);
|
||||||
});
|
}, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user