Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-58931

Impossible to dynamically set up Map layers

    XMLWordPrintable

Details

    Description

      A new "featured" feature of QtLocation 5.9 is the support for using multiple Map layers on top of each other.

      The Map QML API has also received, among the others, 6 new properties: minimumTilt, maximumTilt, minimumFieldOfView, maximumFieldOfView, bearingSupported and tiltingSupported.
      All of these properties come straight from the plugin, and are read only.

      A typical use case found in many cartographic mobile and desktop apps is to dynamically select what base layer as well as what overlay to use.
      Example:
      Available layers:

      • A, with minimumTilt: 0, maximumTilt: 80
      • B, with minimumTilt: 0, maximumTilt: 60
      • C,with minimumTilt: 0, maximumTilt: 80

      The user starts with A as base map, and enables gestures on that.
      Then adds overlay B, disabling gestures and binding properties from A.

      This would allow the end user to tilt beyond 60 degrees, creating a misalignment of the two layers.

      The simple solution of making these properties R/W is also not sufficient.
      Example:
      Available layers:

      • A, with minimumTilt: 0, maximumTilt: 80
      • B, with minimumTilt: 60, maximumTilt: 80
      • C,with minimumTilt: 0, maximumTilt: 60

      User starts as before with A, then adds layer B, and when she does that, she queries A for current valid tilt range, does the same with B, identifies the maximum common tilting subrange, that is [60, 80], and sets this range on A (and optionally B) so that the enabled gesture area can only operate within valid bounds.

      Then the user removes overlay B and adds overlay C.
      But when trying to identify the maximum common subrange, the result at this point is empty, since the range for A is now [60, 80].

      The solution to this API bug is to
      1) make the minimumTilt, maximumTilt, minimumFieldOfView, maximumFieldOfView properties writable too
      2) Add a new read only property to the Map element with a new type CameraCapabilities, which contains the camera capabilities as defined by Plugin, to be able to query ranges also after the properties of 1) have been set.

      In this way the user can compute actual valid subranges for tilt, zoomLevel, and field of view also after these ranges have been set multiple times.

      Adding such new CameraCapabilities property also causes bearingSupported and tiltingSupported to be removed as they duplicate the API.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            paangele Paolo Angelelli
            paangele Paolo Angelelli
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes