map.on('click', function(evt){ var coordinate = evt.coordinate; $("#result").text('You clicked here: x:' + coordinate[0].toFixed(2) + " m - y:" + coordinate[1].toFixed(2) + " m"); overlay.setPosition(coordinate); content.innerHTML = '

You clicked here:


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