I am trying to combine two JS functions in a WMS; drawing features and getting/showing the coordinates of features, e.g. by clicking the drawn features afterwards.
I can manage to draw features by using this openlayers example; http://openlayers.org/en/latest/examples/draw-features.html
As I understand I should use the function 'drawend' to get coordinates of the drawn features?
How do I combine these two functions in the script? I am new to JS.