×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Regular Contributor
    Join Date
    Oct 2007
    Location
    India
    Posts
    349

    Question How to use Map or OVI Map in Qt for Symbian/MeeGo

    Hi,
    In my application I have Lat/Lon and I want to display its position on map. What I need to do. Is there any Map kind of view or I need use OVI MAP. And how to use OVI Map.

    OR

    Can we ues GoogleMap, if yes then how?


    Any help regarding the map would be helpful...

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to use Map or OVI Map in Qt for Symbian/MeeGo

    Why do you post general questions to symbian sub-forum?
    Did you try to read Ovi Maps, Google Maps and Qt documentation?

  3. #3
    Regular Contributor
    Join Date
    Oct 2007
    Location
    India
    Posts
    349

    Re: How to use Map or OVI Map in Qt for Symbian/MeeGo

    Quote Originally Posted by divanov View Post
    Why do you post general questions to symbian sub-forum?
    Did you try to read Ovi Maps, Google Maps and Qt documentation?
    You are right, my mistake :-(

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: How to use Map or OVI Map in Qt for Symbian/MeeGo

    also wiki would have some nice examples that should get you started pretty well: http://wiki.forum.nokia.com/index.php/Qt_Maps_Examples

  5. #5
    Regular Contributor
    Join Date
    Oct 2007
    Location
    India
    Posts
    349

    Re: How to use Map or OVI Map in Qt for Symbian/MeeGo

    Quote Originally Posted by symbianyucca View Post
    also wiki would have some nice examples that should get you started pretty well: http://wiki.forum.nokia.com/index.php/Qt_Maps_Examples
    Thanks Yucca,
    I have downloaded the first example "HelloMap", But unable to compile it. I m getting following error:

    error: qgeomappingmanager.h: No such file or directory
    error: QGeoServiceProvider: No such file or directory and so on.

    What is the problem here.

    I am using Nokia Qt SDK 1.0.2 and Qt 4.6

    Actually I have to develop an application for Qt 4.6 & Higher supported devices and I want to use Maps.

    Kindly waiting for the reply.

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: How to use Map or OVI Map in Qt for Symbian/MeeGo

    the wiki page says that it has been tested with 4.7.2 & mobility 1.1.1, it does indeed require Mobility 1.1.x ..

  7. #7
    Regular Contributor
    Join Date
    Oct 2007
    Location
    India
    Posts
    349

    Re: How to use Map or OVI Map in Qt for Symbian/MeeGo

    Quote Originally Posted by symbianyucca View Post
    the wiki page says that it has been tested with 4.7.2 & mobility 1.1.1, it does indeed require Mobility 1.1.x ..
    Oh, So could you please provide me any link or something like that for using Map in Qt 4.6 ?

    Ultimately I am looking for Map API for Qt 4.6

  8. #8
    Registered User
    Join Date
    Mar 2010
    Posts
    39

    Re: How to use Map or OVI Map in Qt for Symbian/MeeGo

    Hi narendar_discover,

    Two options for using maps in a Qt 4.6.3 application:

    1. Google Maps: You can use the Google Maps API with the QtWebkit classes like QWebview. It's very easy to get it work. But if you need some help, make a Google search for examples, like this one from the Forum Nokia Wiki http://wiki.forum.nokia.com/index.ph..._With_QWebView

    2. I'm not sure, but I think that Qt 4.6.3 supports Qt Mobility 1.0 that provides maps functionality via the Location API. Here's an example using Open Street maps, but again there should be more of them in the wiki, forums, blogs, etc. Just make more specific searches .

    Hope it helps!

  9. #9
    Regular Contributor
    Join Date
    Oct 2007
    Location
    India
    Posts
    349

    Re: How to use Map or OVI Map in Qt for Symbian/MeeGo

    Thanks for the 2 suggested options for Maps:
    I have gone through first option ie Google Map: After running the sample app, In emulator I am getting white screen not exactly the map. What may have the problem. Is this code complete or something is missing ?

    Kindly waiting for any solution :-)

  10. #10
    Regular Contributor
    Join Date
    Oct 2007
    Location
    India
    Posts
    349

    Re: How to use Map or OVI Map in Qt for Symbian/MeeGo

    Now I was able to display Google Map. What I have done, I have created a QWebView and set HTML via setHtml(htmlBody) function. The htmlBody is full HTML/JavaSript code to display maps.

    //Code in Brief:
    QWebView *webView = new QWebView();
    webView->setHtml(htmlBody);
    webView->show();
    htmlBody is here:

    // Map Without PIN
    webView->setHtml("<html xmlns=\"http://www.w3.org/1999/xhtml\"><head><script src=\"http://maps.google.com/maps?file=api&amp;v=2&amp;key=abcdefg&sensor=true_or_false\" type=\"text/javascript\"></script><script type=\"text/javascript\">function initialize() {if (GBrowserIsCompatible()) {var map = new GMap2(document.getElementById(\"map_canvas\"));map.setCenter( new GLatLng(37.4419, -122.1419),16 );map.setUIToDefault();}}</script></head><body onload=\"initialize()\" onunload=\"GUnload()\"><div id=\"map_canvas\" style=\"width: 360px; height: 640px\"></div></body></html>");

    // Map With PIN
    webView->setHtml("<html xmlns=\"http://www.w3.org/1999/xhtml\"><head><script src=\"http://maps.google.com/maps?file=api&amp;v=2&amp;key=abcdefg&sensor=true_or_false\" type=\"text/javascript\"></script><script type=\"text/javascript\">function initialize() {if (GBrowserIsCompatible()) {var map = new GMap2(document.getElementById(\"map_canvas\"));var bounds = new GLatLngBounds; map.setCenter( new GLatLng(37.4419, -122.1419),16 ); var markers = new GMarker(new GLatLng(37.4419, -122.1419)); bounds.extend(markers.getPoint()); map.addOverlay(markers); map.setCenter(bounds.getCenter()); map.setUIToDefault(); }}</script></head><body onload=\"initialize()\" onunload=\"GUnload()\"><div id=\"map_canvas\" style=\"width: 360px; height: 640px\"></div></body></html>");


    // Note
    // You need to add "webkit" in .pro file ie QT += webkit gui core
    // You DONT Need to add any Mobility API


    If somebody has any issue with above please reply me.

  11. #11
    Regular Contributor
    Join Date
    Oct 2007
    Location
    India
    Posts
    349

    Re: How to use Map or OVI Map in Qt for Symbian/MeeGo

    This code is not working on device.

  12. #12
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: How to use Map or OVI Map in Qt for Symbian/MeeGo

    I would not have no idea why google maps are not working, but anyway, you could use Nokia Maps as suggested, here's the link again: http://wiki.forum.nokia.com/index.php/Qt_Maps_Examples

  13. #13
    Regular Contributor
    Join Date
    Oct 2007
    Location
    India
    Posts
    349

    Re: How to use Map or OVI Map in Qt for Symbian/MeeGo

    Quote Originally Posted by symbianyucca View Post
    I would not have no idea why google maps are not working, but anyway, you could use Nokia Maps as suggested, here's the link again: http://wiki.forum.nokia.com/index.php/Qt_Maps_Examples
    Thanks Yucca, but I am using Nokia Qt SDK 1.0.2 and Qt Mobility version is 1.0.2. So will the suggested examples work on Symbian^3 and <Symbian^3 devices.

    And one more question: How can I detect which device supports which Qt Mobility Version?

  14. #14
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: How to use Map or OVI Map in Qt for Symbian/MeeGo

    you could check the release notes and information released with Qt SDKs, basically Qt 4.7 is supported only by the touch devices, the mobiltity 1.1.x support is still a bit unclear. Though on Ovi sales revenue point of view, I suppose touch devices are making most of the downloads on paid content.

Similar Threads

  1. How to use Worker Thread in Qt for Symbian/MeeGo?
    By narendar_discover in forum Qt
    Replies: 8
    Last Post: 2011-03-17, 11:27
  2. Replies: 2
    Last Post: 2009-02-13, 03:19

Posting Permissions

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