Forums

OverviewFelgo 2 Support (Qt 5) › Map on Android has very small text

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #20742

    Julian

    Hello,

    I have the issue (Felgo 2.16.1 – 2.18.2), that on Android all text (like street names, etc.) in a map are very small.

    I figured out that, if I set:

    <meta-data android:name="android.app.auto_screen_scale_factor" android:value="true"/>

    In AndroidManifest.xml the scaling of the text is correct, unfortunately the NavigationBar is now double the size it should be.

    Does anybody has the same issue? I wonder, how no one saw that.

    Best,

    Julian

    #20743

    Julian
    #20757

    Julian

    Any news here?

    #20760

    Günther
    Felgo Team

    Hi Julian,

    you do not require the

    <meta-data android:name="android.app.auto_screen_scale_factor" android:value="true"/>
    

    setting in AndroidManifest, as this can lead to wrong scaling as seen with the NavigationBar.

     

    About the Map issue:

    • Which device(s) are you using for testing and what is their Android OS version?
    • Which map provider are you using for the map?

    Note: The MapBox provider also allows a highdpi_tiles setting, are you using this setting?

    AppMap {
            id: map
            anchors.fill: parent
    
            plugin: Plugin {
              name: "mapbox"
              // configure your own map_id and access_token here
              parameters: [  PluginParameter {
                  name: "mapbox.mapping.map_id"
                  value: "mapbox.streets"
                },
                PluginParameter {
                  name: "mapbox.access_token"
                  value: "pk.eyJ1IjoiZ3R2cGxheSIsImEiOiJjaWZ0Y2pkM2cwMXZqdWVsenJhcGZ3ZDl5In0.6xMVtyc0CkYNYup76iMVNQ"
                },
                PluginParameter {
                  name: "mapbox.mapping.highdpi_tiles"
                  value: true
                }]
            }
    }

    Best,
    Günther

     

     

    #20761

    Julian

    Hey Günther,

    thanks for your reply. I tried osm, mapbox, and mapboxgl. All with the same result. To show the issue even better I just took the Felgo Showcase app, run it as Desktop application, where everything is fine:

    https://www.dropbox.com/s/y06brgi61a37yhj/Screen%20Shot%202018-12-17%20at%2019.15.26.png?dl=0

    And ran it in Android emulator, where the text is super small:

    https://www.dropbox.com/s/q0k844920zjy398/Screen%20Shot%202018-12-17%20at%2019.23.35.png?dl=0

    Here are some details about my env if it helps:

    macOS 10.13.6

    NDK: android-ndk-16b

    SDK: Android build platform: android-27

    Emulator: Pixel_2_XL_API_27 (ABI: x86, Target: Android 8.1 (Google APIs))

    This also happens on a Huawei P20 Pro.

    Can you reproduce it with the Showcase app?

    Best regards,

    Julian

    #20766

    Günther
    Felgo Team

    Hi Julian,
    thanks for the follow-up!

    I am able to reproduce the problem – I’ve added the issue to our bug-tracker for further investigation.

    As a workaround, you can apply additional scaling based on the screen density on Android like this:

          AppMap {
            id: map
            anchors.fill: parent
    
            // fix map scaling on android
            scale: Theme.isAndroid ? dp(1) : 1
    
            
            plugin: Plugin {
              name: "mapbox"
              // configure your own map_id and access_token here
              parameters: [  PluginParameter {
                  name: "mapbox.mapping.map_id"
                  value: "mapbox.streets"
                },
                PluginParameter {
                  name: "mapbox.access_token"
                  value: "pk.eyJ1IjoiZ3R2cGxheSIsImEiOiJjaWZ0Y2pkM2cwMXZqdWVsenJhcGZ3ZDl5In0.6xMVtyc0CkYNYup76iMVNQ"
                },
                PluginParameter {
                  name: "mapbox.mapping.highdpi_tiles"
                  value: true
                }]
            }
    }

    Note: The scale setting on AppMap also applies to e.g. custom MapQuickItem objects you place on the map. To not scale them along with the actual map, you can reverse the scale for these items:

    MapQuickItem {
                // reverse scale for correct sizing
                scale: 1 / map.scale
    
               // other configurations
    }

    Best,
    Günther from Felgo

    #20778

    Julian

    Hey Günther,

    thanks for you reply. That indeed worked around the problem. Just for future readers, instead of using anchors.fill: parent I had to apply some math:

    -        anchors.fill: parent
    +
    +        // reverse scale for correct sizing
    +        anchors.bottom: parent.bottom
    +        anchors.left: parent.left
    +        anchors.bottomMargin: (page.height - (page.height / map.scale)) / 2.0
    +        anchors.leftMargin: (page.width - (page.width / map.scale)) / 2.0
    +        width: page.width / map.scale
    +        height: page.height / map.scale

     

    Otherwise the map is over- or underflowing the parent.

     

    Best,

    Julian

    #21748

    Micu

    Any news for this bug?

Viewing 8 posts - 1 through 8 (of 8 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support