this is a JS, which I used for waqtscope, made from LocData