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

Text using NativeRendering in MapQuickItem pixelates during map zoom

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.9.0
    • Location
    • None
    • Qt 5.9.0, Ubuntu 14.04x64
      NVIDIA GeForce GTX 670 graphics card
      NVIDIA Driver version 367.48

    Description

      Using a MapQuickItem with Text that has renderType:Text.NativeRendering as its sourceItem works well when the zoomLevel for the item is omitted (0.0). When the zoom level is specified, the text appears to be rendered once and then that bitmap is scaled to the zoom of the map. The result is text so ugly it is unusable.

      The workaround is to omit the zoomLevel from the MapQuickItem and instead control the font size of the text as a function of the zoom level of the owning Map.

      In the attached image, the A,B,C,D and circled parking items are drawn using the code below. They are rotated because the map is rotated and I did not unrotate the text based on the map bearing. (The aliased edges of the buildings and other polygons are unrelated QTBUG-61561.)

      TextInMap.qml
      import QtQuick 2.0
      import QtLocation 5.3
      import QtPositioning 5.3
      
      Map {
          plugin: Plugin {
              name: "mapboxgl"
              PluginParameter {
                   name:"mapboxgl.access_token"
                   value:"...our token..."
              }
              PluginParameter {
                   name:"mapboxgl.mapping.additional_style_urls"
                   value:"mapbox://styles/drivecxtest/cj3ubudw5002d2rmuc9avde7f"
              }
          }
      
          center: QtPositioning.coordinate(37.371794, -121.966158)
          zoomLevel: 17
          maximumZoomLevel: 21
          bearing: -90
      
          MapItemView {
              model: ListModel {
                  ListElement { label:'A'; lat:37.370814; lon:-121.964471 }
                  ListElement { label:'B'; lat:37.371500; lon:-121.963900 }
                  ListElement { label:'C'; lat:37.370820; lon:-121.963150 }
                  ListElement { label:'D'; lat:37.370248; lon:-121.963929 }
                  ListElement { label:'Ⓟ'; lat:37.371660; lon:-121.962860 }
              }
              delegate: MapQuickItem {
                  coordinate: QtPositioning.coordinate(lat, lon)
                  zoomLevel: 17
                  sourceItem: Text {
                      width:0; height:0
                      renderType: Text.NativeRendering
                      text: label; color:'white'
                      font { family:mainFont; weight:Font.Medium; pointSize:36 }
                      verticalAlignment:Text.AlignVCenter; horizontalAlignment:Text.AlignHCenter
                  }
              }
          }
      }
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: