Calculate the offset for the tile images

It's very likely to be wrong where latitude and longitude are not positive, but for now
it must be enough.
Add support for moving around using the middle mouse button