map.on('click', function(evt){ coordinate = evt.coordinate; if(document.getElementById('bild-switch_2').checked == true){ coordinate[0] = 45- coordinate[0]; coordinate[1] = coordinate[1]; overlay.setPosition(coordinate); }else{ overlay.setPosition(coordinate); } $("#result").show(); $("#result").text('You clicked here: x:' + coordinate[0].toFixed(2) + " m - y:" + coordinate[1].toFixed(2) + " m"); content.innerHTML = '

You clicked here:


x: ' + coordinate[0].toFixed(2) + ' m
y: ' + coordinate[1].toFixed(2) + ' m
'; container.style.display = 'block'; });