Problem with pathfinder

I need some help with a pathfinder. I started working some time ago on some map interface, so the user could click on some point and know the shortest path up to it.

The problem is the map must have zoom in and zoom out function, along with a drag one,and I’m currently stuck with it, since am not able to come up with a nice formula that doesn’t give problems when the zoom factor is very high…

The map is huge, and uses 10x10 tiles. Any help?