Rename ratio to mapScale, refactor draw.js