Results 1 to 7 of 7

Thread: Mercator for google static maps

  1. #1
    Join Date
    Sep 2010
    Posts
    8
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Question Mercator for google static maps

    Hi,
    I am new to QT and m developint an application for mobile.
    I want to display google map and also put some buttons at specific places on the map.
    Earlier I thought of using QWebview and google maps javascript API.
    But then in that case I was not able to get the current location being displayed on map.
    So I am trying to use static map api.
    I am displaying the map image in a graphics scene so that I am able to drag the image.
    Now I want to place some buttons @specific position on the map.For that i need to convert the lat lon in the map image to pixels.I have heard about mercator algo for that,but i didnt fing any cpp implementation for it
    I am not sure how to do this.
    Also How can i plave a button over the graphicsview wigdet,coz i am using layouts.
    any help will be appriciated.
    Thanx in advance

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Mercator for google static maps

    First, you need to know what projection the map is displayed in; you can't just blindly reach for the Mercator projection, because it is only one of literally hundreds of map projections available. For relatively close-up views, orthographic projections are often used, or just a simple Platte-Carre projection which uses a direct mapping between screen coordinates and latitude/longitude. But you have to determine which is being used; whatever the source of your map image is should provide this information.

    Once you know that, there are many sources for converting between various projection frames. Flattening the Earth: 2000 Years of Map Projections is probably the best reference on the topic that's readily available.

  3. The following user says thank you to SixDegrees for this useful post:

    daarsh (29th September 2010)

  4. #3
    Join Date
    May 2009
    Location
    Canada
    Posts
    163
    Thanks
    7
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows Android

    Default Re: Mercator for google static maps

    A layout can be given widgets and other layouts, which it arranges in different ways depending on its type -- see Layout Management for more information.

    Once you have your layout structure defined, use QGraphicsView::setLayout(QLayout *).

  5. The following user says thank you to Urthas for this useful post:

    daarsh (29th September 2010)

  6. #4
    Join Date
    Sep 2010
    Posts
    8
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Default Re: Mercator for google static maps

    Thanx a lot guys for the Quick replies.
    @ Urthas
    I have some info abt layouts,
    but haw can we put the buttons in the layout according to our choice??
    In VBox/HBox Form and grid layouts,we are not able to give the exact locations to our widgets right??

  7. #5
    Join Date
    May 2009
    Location
    Canada
    Posts
    163
    Thanks
    7
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows Android

    Default Re: Mercator for google static maps

    Quote Originally Posted by daarsh View Post
    but haw can we put the buttons in the layout according to our choice?? In VBox/HBox Form and grid layouts,we are not able to give the exact locations to our widgets right??
    Not as such. But you can frequently get widgets laid out acceptably by nesting layouts and using spacing elements. If you are wanting to put widgets (like buttons) at specific, context-dependent locations you will probably have to embed them in the QGraphicsScene instead of the QGraphicsView by using QGraphicsProxyWidget.
    Last edited by Urthas; 29th September 2010 at 08:08.

  8. The following user says thank you to Urthas for this useful post:

    daarsh (29th September 2010)

  9. #6
    Join Date
    Sep 2010
    Posts
    8
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Default Re: Mercator for google static maps

    @urthas..
    thnx for the pointer buddy...vl try this proxy wodget!!

  10. #7
    Join Date
    Sep 2010
    Posts
    8
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Default Re: Mercator for google static maps

    @ SixDegrees: thnx for the reply.
    Was trying to search the projecction which google uses for static maps,but no success...
    do u know...or any guesses??

Similar Threads

  1. Google Maps API and Qt 4 desktop app integration
    By udit in forum Qt Programming
    Replies: 6
    Last Post: 4th September 2009, 19:03
  2. Qt & Goole Maps
    By codeman in forum Qt Programming
    Replies: 1
    Last Post: 17th June 2009, 16:34
  3. Map is not displayed from maps.google.com
    By abhilashajha in forum Qt Programming
    Replies: 2
    Last Post: 11th June 2009, 14:19
  4. Does anyone know google earth?
    By miaoliang in forum General Discussion
    Replies: 1
    Last Post: 30th November 2006, 12:48
  5. need help about calibrating scanned maps.
    By high_flyer in forum General Discussion
    Replies: 4
    Last Post: 26th July 2006, 18:27

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.