SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jul 2005
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Please help: lat lon to x y

    Please, does anyone know how to convert latitude, longitude, zoom to x,y

    i need a function fimilar to googles fromLatLngToContainerPixel or fromLatLngToPixel that can return x and y from given data:

    map center (lat0, lon0) >> (45.541531,18.683195)
    point (lat, lon)
    map zoom (15)
    map dimensions w,h (560, 410) px

    Please i'm desperate....

  2. #2
    Community Advisor silver trophy

    Join Date
    Nov 2006
    Location
    UK
    Posts
    2,547
    Mentioned
    40 Post(s)
    Tagged
    1 Thread(s)
    If you look through the code from here you'll most likely find what you're looking for.

  3. #3
    SitePoint Member
    Join Date
    Jul 2005
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nop, i looked up google groups and apis, but nothing... i need a algorithm for translating the mercator projection on to a rectangular grid....

    still no luck....

  4. #4
    Community Advisor silver trophy

    Join Date
    Nov 2006
    Location
    UK
    Posts
    2,547
    Mentioned
    40 Post(s)
    Tagged
    1 Thread(s)
    The project I linked to has the code necessary to achieve what you want if you dig through it. All google maps projects must ultimately convert a lat/long to an x/y or else they wouldn't be able to display tiles


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •