If im not mistaken, if I have a map of say, Wisconsin, and I know what the Latitude coords (degrees, hours, minutes) of the top and bottom of the map, and I know how many pixels tall the map is, then I should be able to convert, with math, degrees:hours:mins to pixels. (same thing with longitude, but lets just focus on one way first)
I would first find out how may hours (minutes would be over kill for my app) there are to a pixel. Thats pretty easy. But this gives me a decimal number. How do i convert a decimal value (like 10.25) back to degrees and hours (in other words, how do i make .25 a “60” based value)?
Ultimately, i want the user to be able to input coords in the form of degrees, hours, mins. Then convert that to X, Y (to place a marker on the map).
Has any one had experience with this or know how to do this? Probably just some easy math…right? :tb:
Thank you for the reply, but I’m not sure how to follow what you replied with to a solution on my end. I understand Math.round… but i don’t understand how you’re converting a decimal number to degrees:hours:min (and in turn, converting a GPS coordinate into a X, Y position on an arbitrarily scaled map)