Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6945085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:23:26+00:00 2026-05-27T13:23:26+00:00

I think I have two different questions here, I’m building off this question .

  • 0

I think I have two different questions here, I’m building off this question. Id like to take this one step more and convert the px values to true latitude and longitude coordinates.

So I would like to turn 251px N, 10px E to 40° 10′ 33” N, 3° 4′ 56” E

40° = 40 degrees

10′ = 10 minutes

33” = 33 seconds

or 40.133 I think but when minutes go to 60 it kicks the next degree up one. so 41 when its 40.559 + 1 more second. I hope someone understands.

var screenX = $(document).width() / 2;
var screenY = $(document).height() / 2;

$(document).mousemove(function(e){

var apX = screenX - e.pageX;
var apY = screenY - e.pageY;

var latT = (apY>=0) ? 'N' : 'S';
var lonT = (apX>=0) ? 'W' : 'E';

apX = Math.round(Math.abs(apX));
apY = Math.round(Math.abs(apY));

$('#detect').html( apX  + 'px '+ latT +', '+ apY + 'px '+ lonT  );

});

Demo of the above code. Any advice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:23:26+00:00Added an answer on May 27, 2026 at 1:23 pm

    Something like this should work:

    $('#detect').html( toGeo(apX, screenX)  + latT +', '+ toGeo(apY, screenY) + lonT  );
    
    function toGeo(d, max) {
       var c = '';
    
       var r = d/max * 180;
       var deg = Math.floor(r);
       c += deg + "° ";
    
       r = (r - deg) * 60;
       var min = Math.floor(r);
       c += min + "′ ";
    
       r = (r - min) * 60;
       var sec = Math.floor(r);
       c += sec + "″";
    
       return c;
    }
    

    Just as a reminder: These are “fake” coordinates, they won’t correspond to a real map.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here are two different questions but I think they are related. When using Git,
I actually have two questions regarding the same problem but I think it is
We have two different projects on our source safe database (one of them is
I have tried solving this problem by posting other related questions here that focused
I know this looks similar to other questions here but I don't think my
I have a two part question. The first I think I have an okay
Here's the situation. I've got a two different window hooks, one's a global hook
i recently asked question which was closed down linked here. https://stackoverflow.com/questions/3827349/how-to-use-one-openid-across-multiple-domains-closed I did not
Given I have two File objects I can think of the following implementation: public
Okay i have two models: posts and comments. as you can think comments has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.