Move coordinate mapping functions to plugin code.