Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QML Map correct zoomLevel
Qt 6.11 is out! See what's new in the release blog

QML Map correct zoomLevel

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 2 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jano
    wrote on last edited by
    #1

    Hi all,

    I'm new in Qt development. I'm using QML Map element ( Qt Mobility 1.1 QML plugin ) to show map on the device. Everything works as expected, but i have one issue which i don't know how to resolve it and might need some correct directions/possible solution.

    My problems is:
    I have a map and some MapCircles ( some circles are shown on some coordinates. I will change that probably to Landmarks later ). I want to set correct zoomLevel to the map so that all Circles ( points ) will be visible?? Is there any algorithm to calculate that? Any better approach/solution?

    In general: i just want to set corretct zoom level so that all landmarks/circles will be visible. Maybe is there tottally different approach to achive that?

    Many thanks for any directions/help!

    Thanks,
    Jano

    1 Reply Last reply
    0
    • C Offline
      C Offline
      conny
      wrote on last edited by
      #2

      Hi,

      I don't think there's a function available to do this using QML. At least in QtM 1.1 there wasn't. The C++ API has QGraphicsGeoMap::fitInViewport(). You can pass this method a bounding box and it will try zooming to fit the box into the viewport.
      http://doc.qt.nokia.com/qtmobility-1.2/qgraphicsgeomap.html

      Not sure that will help you, but it's all I'm currently aware of.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved