This tutorial shows how to use the transform util to tranform coordinates
Transform ZXY tile coordinates to latitude/longitude/zoom location coordinates
Result:
Transform latitude,longitude,zoom location coordinates to ZXY tile coordinates
Result:
main.js