When using here maps that I want to use in my qt application, I get this error and the screen does not come up. how can i solve it
My QML Code
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Window 2.15
// Here Maps import
import QtLocation 5.15
import QtPositioning 5.15
Window {
visible: true
width: 640
height: 480
title: qsTr("Here Maps Example")
Plugin {
id: hereMaps
name: "here"
// Your HERE API key
PluginParameter {
name: "here.app_id"
value: "e--------------tU"
}
PluginParameter {
name: "here.token"
value: "KS---------------0w"
}
}
Map {
anchors.fill: parent
plugin: hereMaps
center: QtPositioning.coordinate(38.4501, 27.1777)
zoomLevel: 14
}
}
my Errors
QML debugging is enabled. Only use this in a safe environment.
No proxy parameter specified.
Failed to read here/nokia map version.
QGeoTileRequestManager: Failed to fetch tile (9430,6293,14) 5 times, giving up. Last error message was: 'Host requires authentication'
QGeoTileRequestManager: Failed to fetch tile (9430,6292,14) 5 times, giving up. Last error message was: 'Host requires authentication'
QGeoTileRequestManager: Failed to fetch tile (9429,6292,14) 5 times, giving up. Last error message was: 'Host requires authentication'
QGeoTileRequestManager: Failed to fetch tile (9427,6293,14) 5 times, giving up. Last error message was: 'Host requires authentication'
QGeoTileRequestManager: Failed to fetch tile (9429,6293,14) 5 times, giving up. Last error message was: 'Host requires authentication'
QGeoTileRequestManager: Failed to fetch tile (9428,6292,14) 5 times, giving up. Last error message was: 'Host requires authentication'
QGeoTileRequestManager: Failed to fetch tile (9429,6294,14) 5 times, giving up. Last error message was: 'Host requires authentication'
QGeoTileRequestManager: Failed to fetch tile (9427,6294,14) 5 times, giving up. Last error message was: 'Host requires authentication'
QGeoTileRequestManager: Failed to fetch tile (9430,6294,14) 5 times, giving up. Last error message was: 'Host requires authentication'
QGeoTileRequestManager: Failed to fetch tile (9428,6293,14) 5 times, giving up. Last error message was: 'Host requires authentication'
QGeoTileRequestManager: Failed to fetch tile (9427,6292,14) 5 times, giving up. Last error message was: 'Host requires authentication'
in this way https://maps.hereapi.com/v3/base/mc/11/1100/672/jpeg?style=satellite.day&apiKey={My api key}
when I try to take an image I can get the image and I can show it as an image in my qt application but it needs to have a dynamic map.
Azim Samet ERGİN is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
7
It looks like the 5.15.2 version of QtPositioning passes the token and application ID as query parameters:
if (!m_token.isEmpty() && !m_applicationId.isEmpty()) { // TODO: remove the if
requestString += "?token=";
requestString += m_token;
requestString += "&app_id=";
requestString += m_applicationId;
}
All the authentication methods I found on the HERE API documentation require the token in the headers:
Authorization: Bearer <token>
You will have to modify the code to do so.
9