Remove use of function copied from OL3