Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt Location Esri Plugin



  • Qt 5.15.2, macOS

    I'm trying to build a PlaceSearchModel using the Esri plugin. The code successfully runs using the Mapbox plugin but doesn't work when swapped with the Esri plugin. Any advice or leads would be greatly appreciated!

    PlaceSearchModel {
        plugin: EsriPlugin // singleton
        property variant _searchRegion: QtPositioning.circle(searchLocation,
                                                            searchRadius)
        searchArea: _searchRegion
    ...
    }
    

    When a search is entered, the model returns this error from the Esri servers:

    Error transferring http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?f=json&location=-118.338,34.069&searchExtent=-118.392,34.114,-118.284,34.0241&singleLine=pi&outFields=* - server replied: Bad Request

    I noticed the Geocode endpoint in Esri's documentation is a different pattern than the one in the error code above.
    https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?address={searchText}&outFields={fieldList}&f=json&token=YOUR-API-KEY

    Any idea what's going wrong, or how I should approach this problem?
    Thank you!

    Update:

    I manually retrieved the server's JSON response through the browser

    {"error":{"code":400,"message":"HTTP not supported","details":[]}}
    

    Seems the plugin uses HTTP instead of HTTPS. The same request using HTTPS works successfully.



  • Replacing HTTP with HTTPS in the QtLocation esri plugin code solved the problem.
    QTBUG-92111



  • Replacing HTTP with HTTPS in the QtLocation esri plugin code solved the problem.
    QTBUG-92111


Log in to reply