×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    33

    QGraphicsGeoMap::fitInViewport with a QGeoMapRouteObject::boundingBox error

    So I have this code in which I have a perfectly valid QGeoMapRouteObject and QGraphicsGeoMap. Everything works fine when I add the route object to the map (it shows up properly and everything). However, when I tell the QGraphicsGeoMap to fitInViewport with my QGeoMapRouteObject's boundingBox, all I get back is a blank map. Anybody got their QGraphicsGeoMap to automatically fit in a route? Thanks.

  2. #2
    Nokia Developer Expert
    Join Date
    Dec 2009
    Posts
    81

    Re: QGraphicsGeoMap::fitInViewport with a QGeoMapRouteObject::boundingBox error

    I think there's a bug with the bounding box returned by the route object. I'll have a poke around and file something in the bug tracker shortly.

    We'll fix it eventually, but if you want a work around in the short term you could scan the route coordinates, track the minimum and maximum latitude and longitude and build the bounding box out of that.

    Unless there's a fitInViewport bug we don't know about. Let me know how it works out for you.

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    33

    Re: QGraphicsGeoMap::fitInViewport with a QGeoMapRouteObject::boundingBox error

    Quote Originally Posted by dalaing View Post
    I think there's a bug with the bounding box returned by the route object. I'll have a poke around and file something in the bug tracker shortly.

    We'll fix it eventually, but if you want a work around in the short term you could scan the route coordinates, track the minimum and maximum latitude and longitude and build the bounding box out of that.

    Unless there's a fitInViewport bug we don't know about. Let me know how it works out for you.
    I tired to do it in that method and it actually ends up zooming out to the globe. I tried several others and it appears the whole fitInViewport function doesn't work at all.

  4. #4
    Registered User
    Join Date
    Dec 2010
    Location
    Goa, India
    Posts
    6

    Re: QGraphicsGeoMap::fitInViewport with a QGeoMapRouteObject::boundingBox error

    QGraphicsGeoMap::fitInViewport() zooms out to the entire globe when I try to show a route with perfectly valid QGeoBoundingBox.

    Code:
    QGeoBoundingBox routeBounds = routeLine->boundingBox();
    if (routeBounds.isValid()) {
    fitInViewport(routeBounds); // Doesn't work :-(

    // Alternative code below works
    setCenter(routeBounds.center());
    setZoomLevel(maximumZoomLevel());
    while (!viewport().contains(routeBounds.topLeft())) {
    setZoomLevel(zoomLevel() - 1);
    }
    }
    Last edited by ameypg; 2011-01-07 at 06:48.

  5. #5
    Registered User
    Join Date
    Dec 2010
    Location
    Goa, India
    Posts
    6

    Re: QGraphicsGeoMap::fitInViewport with a QGeoMapRouteObject::boundingBox error

    Quote Originally Posted by dalaing View Post
    Unless there's a fitInViewport bug we don't know about. Let me know how it works out for you.
    Yes, the bug is in QGraphicsGeoMap::fitInViewport().

  6. #6
    Nokia Developer Expert
    Join Date
    Dec 2009
    Posts
    81

    Re: QGraphicsGeoMap::fitInViewport with a QGeoMapRouteObject::boundingBox error

    Quote Originally Posted by ameypg View Post
    Yes, the bug is in QGraphicsGeoMap::fitInViewport().
    The bug is being tracked by http://bugreports.qt.nokia.com/browse/QTMOBILITY-876

Similar Threads

  1. Fatal: IO Error:SymbainOS error = -34 : General: System error
    By dharmeshkhatri in forum Mobile Java Networking & Messaging & Security
    Replies: 9
    Last Post: 2010-04-12, 15:17
  2. Replies: 1
    Last Post: 2008-06-05, 07:44
  3. Replies: 4
    Last Post: 2007-05-31, 07:06
  4. Replies: 6
    Last Post: 2007-03-01, 05:48
  5. Replies: 13
    Last Post: 2006-12-01, 01:30

Posting Permissions

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