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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:22:14+00:00 2026-06-09T00:22:14+00:00

I have put together a cities database from MaxMind and it includes the lat/lng

  • 0

I have put together a cities database from MaxMind and it includes the lat/lng values for each city in the database. I have also put together a map of North/America and I would like to have a icon appear on the x/y coordinates of the map which are derived from the lat/lng coordinates of the city database record.

From my understanding I need to find the left/top bounds of the map first (lat/lng -> x/y) and then use that as a difference for the linear relationship between any of the north american city x/y coords. Finally, depending on the size of the map, its just a few simple division and subtraction operations to figure out where to place the point.

However I can’t seem to figure out how todo the following:

  1. I’m not sure what the lat/lng mapping system is. How do I find this out?
  2. Using a JavaScript library, how do I convert the lat/lng to pixels for the 0,0 coord and each of the city coords. I’ve tried Proj4js, but they require that you specify your coordinate map types and so on. Here is another question that asked something similar.
    Convert long/lat to pixel x/y on a given picture

Any ideas?

— EDIT —

The output map (of North America) is a continuous cylinder: “Miller cylindrical projection”. http://en.wikipedia.org/wiki/Miller_cylindrical_projection

  • 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-06-09T00:22:16+00:00Added an answer on June 9, 2026 at 12:22 am

    Latitude and Longitude are imaginary lines drawn on earth so that you can accurately pinpoint any location on the world . simply put they are the X and Y coords of a plane.
    Latitude is a vertical line running from north to south with its 90 deg at the north pole and -90deg at the south pole.

    Longitude on the other hand is a horizontal line running east to south with -180deg in the west and 180deg in the east.

    you can convert the latLng into pixel coords as by assuming that the width of the html container is the width of the world and the same applies to the the height.

    Formula – Longitude – pixel

    (givenLng*widthOfContainerElement)/360
    

    where 360 is the total longitude in degrees

    Formula -Latitude – pixed

    (givenLat*heightOfContainerElement)/180
    

    where 360 is the total longitude in degree

    //Height is calculated from the bottom
    

    let me know if you still need any clarifications.

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

Sidebar

Related Questions

I've tried to put together a solution from similar questions but have failed miserably.
I have put together the following code, the problem is that each while loop
I have put together some code from various sources but javascript is somewhat unknown
I have an HttpModule that I have put together from cobbling a couple of
I have put together this code Selected rows into clipboard from a lisview. procedure
I have a camera object that I have put together from reading on the
I have a list of coordinates of lat/lon values consisting of cities around the
I have put together a navigation bar which expands a submenu on hover. See
I have put together a .net winform application which consumes a wcf service exposed
I have put together an API that responds to a POST request by putting

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.