QT Location Plugin

976
3
06-01-2023 11:22 AM
Labels (2)
DevalGupta
New Contributor

Hello,

I am trying to use the QT Quick Example project for a minimal map and it is not working with the esri plug in. I remember using it almost a year ago and it was working. I know the map code is working since I can use the osm plug in successfully. I have tried with my API key, and without. Since I am just trying to show a map I don't think I even need the API key. 

I have tried the two following approaches. 

    Plugin {
        id: mapPlugin
        name: "esri"
        PluginParameter { name: "esri.token"; value: "my-api-key" }
    }

 

And

    Plugin {
        id: mapPlugin
        name: "esri"
    }

 

Can someone provide help why this is not working. I am using QT 5 and this specific example:

https://doc.qt.io/qt-5/qtlocation-minimal-map-example.html

0 Kudos
3 Replies
JamesBallard1
Esri Regular Contributor

Hi @DevalGupta . I did a quick test on macOS and it worked for me, but I did not specify any PluginParameters.

As a starting point, see if you can get a map loading with that alone.

Here are more details about the "esri" plugin: https://doc.qt.io/qt-5/location-plugin-esri.html. This will provide more details on what is required.

Screen Shot 2023-06-01 at 12.47.59 PM.png

It is worth mentioning that the "esri" Qt location provider has not be ported to Qt 6, so you'll be limited to working with Qt 5.

0 Kudos
DevalGupta
New Contributor

I am running on linux, and my code looks the exact same and it is not working. 

Screenshot 2023-06-01 at 1.00.38 PM.png

Screenshot 2023-06-01 at 1.01.43 PM.png

0 Kudos
JamesBallard1
Esri Regular Contributor

@DevalGupta I tried on Linux and I get the same thing.

I checked the network requests and this logic is using the older, non-https endpoints by default. For example this request goes out for a map tile:

http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/15/9530/17362

ArcGIS Online returns a 301 redirect for the https endpoint version and that works fine on macOS. I don't know for certain, but I suspect there could be a problem with the SSL configuration on Linux with Qt 5 since that would be required for the https tile endpoints, or the networking is getting tripped up by the 301 redirect. I suspect the SSL issue.

I hope this is helpful even if I wasn't able to fully get to the bottom of the issue.

0 Kudos