8#include <QtLocation/private/qgeorouteparserosrmv5_p.h>
9#include <QtLocation/qgeoroutesegment.h>
10#include <QtLocation/qgeomaneuver.h>
12#include <QtCore/QJsonDocument>
13#include <QtCore/QJsonObject>
14#include <QtCore/QJsonArray>
15#include <QtCore/QUrlQuery>
16#include <QtCore/QDebug>
72 if (voiceInstructionValue.isObject())
101 if (bannerComponentValue.isObject())
155 if (bannerInstructionValue.isObject())
164 QVariantMap extendedAttributes =
m.extendedAttributes();
167 if (!maneuverInstructionText.
isEmpty())
168 m.setInstructionText(maneuverInstructionText);
178 m.setExtendedAttributes(extendedAttributes);
198 bool use_mapbox_text_instructions =
true;
212 m_routeParser = parser;
215 errorString->
clear();
229 QGeoRouteRequest::TravelModes travelModes =
request.travelModes();
238 if (trafficFeatureIdx >= 0 &&
253 this, &QGeoRoutingManagerEngineMapbox::replyFinished);
255 this, &QGeoRoutingManagerEngineMapbox::replyError);
262 return m_routeParser;
265void QGeoRoutingManagerEngineMapbox::replyFinished()
void updateSegment(QGeoRouteSegment &segment, const QJsonObject &step, const QJsonObject &maneuver) const override
QGeoRouteParserOsrmV5ExtensionMapbox(const QString &accessToken, bool useMapboxTextInstructions)
bool m_useMapboxTextInstructions
void updateQuery(QUrlQuery &query) const override
void setExtension(const QGeoRouteParserOsrmV5Extension *extension)
QUrl requestUrl(const QGeoRouteRequest &request, const QString &prefix) const
void setTrafficSide(TrafficSide trafficSide)
void finished()
This signal is emitted when this reply has finished processing.
Error
Describes an error which prevented the completion of the operation.
void errorOccurred(QGeoRouteReply::Error error, const QString &errorString=QString())
This signal is emitted when an error has been detected in the processing of this reply.
FeatureWeight
Defines the weight to associate with a feature during the planning of a route.
QGeoRoutingManagerEngineMapbox(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString)
const QGeoRouteParser * routeParser() const
~QGeoRoutingManagerEngineMapbox()
QGeoRouteReply * calculateRoute(const QGeoRouteRequest &request) override
void errorOccurred(QGeoRouteReply *reply, QGeoRouteReply::Error error, const QString &errorString=QString())
This signal is emitted when an error has been detected in the processing of reply.
void finished(QGeoRouteReply *reply)
This signal is emitted when reply has finished processing.
Error
Describes an error related to the loading and setup of a service provider plugin.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
QJsonValue value(const QString &key) const
Returns a QJsonValue representing the value for the key key.
QString toString() const
Converts the value to a QString and returns it.
MeasurementSystem measurementSystem() const
static QLocale system()
Returns a QLocale object initialized to the system locale.
iterator insert(const Key &key, const T &value)
T value(const Key &key, const T &defaultValue=T()) const
bool contains(const Key &key) const
The QNetworkAccessManager class allows the application to send network requests and receive replies.
QNetworkReply * get(const QNetworkRequest &request)
Posts a request to obtain the contents of the target request and returns a new QNetworkReply object o...
The QNetworkReply class contains the data and headers for a request sent with QNetworkAccessManager.
The QNetworkRequest class holds a request to be sent with QNetworkAccessManager.
void setHeader(KnownHeaders header, const QVariant &value)
Sets the value of the known header header to be value, overriding any previously set headers.
void setUrl(const QUrl &url)
Sets the URL this network request is referring to be url.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
\macro QT_RESTRICTED_CAST_FROM_ASCII
QByteArray toLatin1() const &
void clear()
Clears the contents of the string and makes it null.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString toString() const
Returns the variant as a QString if the variant has a userType() including, but not limited to:
bool toBool() const
Returns the variant as a bool if the variant has userType() Bool.
QMap< QString, QString > map
[6]
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
static QVariantMap parseMapboxBannerComponent(const QJsonObject &bannerComponent)
static QVariantMap parseMapboxBannerInstruction(const QJsonObject &bannerInstruction)
static QVariantList parseMapboxBannerComponents(const QJsonArray &bannerComponents)
static QVariantMap parseMapboxBanner(const QJsonObject &banner)
static QVariantList parseMapboxVoiceInstructions(const QJsonArray &voiceInstructions)
static QVariantList parseMapboxBannerInstructions(const QJsonArray &bannerInstructions)
static QVariantMap parseMapboxVoiceInstruction(const QJsonObject &voiceInstruction)
static const QByteArray mapboxDefaultUserAgent
static const QString mapboxDirectionsApiPath
QLatin1StringView QLatin1String
#define QStringLiteral(str)
static int toInt(const QChar &qc, int R)
static double toDouble(Value v)
QUrl url("example.com")
[constructor-url-reference]
QNetworkRequest request(url)
char * toString(const MyType &t)
[31]
qsizetype indexOf(const AT &t, qsizetype from=0) const noexcept