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 6705667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:25:50+00:00 2026-05-26T07:25:50+00:00

I have a problem with converting pixel location from screen to degrees (EPSG4326). The

  • 0

I have a problem with converting pixel location from screen to degrees (EPSG4326).

The lon/lat value in EPSG900913 is correct, according to http://proj4js.org/ and google maps.

Some example values I’m getting are

EPSG:900913 lon: 2763836.8383036, lat: 8815158.7073107

after conversion

EPSG:4326  x: 79.18791 y: 24.08555

When the values should be

EPSG 4326: Y: 24.69090 X: 60.193680

Any ideas as to what I’m doing wrong?

Here’s the relevant parts of my code.

$mapObj.bind("contextmenu.zoom", function (evt) {
   var _px = new OpenLayers.Pixel(evt.pageX, evt.pageY),
   _lonlat = _mapObj.getLonLatFromPixel(_px),
   _point = new OpenLayers.Geometry.Point(_lonlat.lat, _lonlat.lon);

   _point = _point.transform(new OpenLayers.Projection("EPSG:900913"), new OpenLayers.Projection("EPSG:4326"));
});
  • 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-26T07:25:51+00:00Added an answer on May 26, 2026 at 7:25 am

    … and the answer is, i mixed up lat & lon order on this row:

    _point = new OpenLayers.Geometry.Point(_lonlat.lat, _lonlat.lon);
    

    should be

    _point = new OpenLayers.Geometry.Point(_lonlat.lon, _lonlat.lat);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem while converting a string whose value is dd.mm.yyyy to DateTime
I have problem converting from string to date. The first one i Ok: Date
I have problem, when converting Windows application from .NET2.0 to .NET3.5. I do this
I have a problem with converting string to float. print gettype($value[$id]); //returns string var_dump($value[$id]);//returns
i have a problem with reading from a file, and converting content to double.
I have some problem converting my data from an plist to objects. The plist
I have a problem with converting a text file from ANSI to UTF8 in
I have a problem converting a string binary to a decimal I was using
I seem to always have problems with converting data to and from XML in
Hi stackoverflow team i have a problem in converting base64 string to bitmap in

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.