summaryrefslogtreecommitdiff
path: root/src/location/maps
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2018-03-27 14:18:44 +0300
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-03-28 11:40:58 +0000
commit27837cdf26a2f7d83f57f55a1a4e7ce947479592 (patch)
tree8a54947c50714bdcc018f249970d92e7dece2fc0 /src/location/maps
parentbda6fa9d1f67525e741b45362c58ac4f1a780624 (diff)
downloadqtlocation-27837cdf26a2f7d83f57f55a1a4e7ce947479592.tar.gz
Implement QGeoRoute{,Private}Mapbox
Adds QGeoRoutePrivate::metadata(), which provides a QVariantMap containing route plugin-specific data, that could be privately used by other plugins. Taking Mapbox routes as example, we want to expose the route JSON server reply, so we've added QGeoRouteMapbox for that purpose. Change-Id: I6823ed4623b05a0e678b73676b2361cf74823ddb Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Diffstat (limited to 'src/location/maps')
-rw-r--r--src/location/maps/qgeoroute.cpp9
-rw-r--r--src/location/maps/qgeoroute_p.h2
2 files changed, 10 insertions, 1 deletions
diff --git a/src/location/maps/qgeoroute.cpp b/src/location/maps/qgeoroute.cpp
index 12ac16bd..979c1667 100644
--- a/src/location/maps/qgeoroute.cpp
+++ b/src/location/maps/qgeoroute.cpp
@@ -41,6 +41,7 @@
#include "qgeoroutesegment.h"
#include <QDateTime>
+#include <QVariantMap>
QT_BEGIN_NAMESPACE
@@ -339,7 +340,8 @@ bool QGeoRoutePrivate::equals(const QGeoRoutePrivate &other) const
&& (travelTime() == other.travelTime())
&& (distance() == other.distance())
&& (travelMode() == other.travelMode())
- && (path() == other.path()));
+ && (path() == other.path()))
+ && (metadata() == other.metadata());
}
void QGeoRoutePrivate::setId(const QString &id)
@@ -427,6 +429,11 @@ const QGeoRoutePrivate *QGeoRoutePrivate::routePrivateData(const QGeoRoute &rout
return route.d_ptr.data();
}
+QVariantMap QGeoRoutePrivate::metadata() const
+{
+ return QVariantMap();
+}
+
/*******************************************************************************
*******************************************************************************/
diff --git a/src/location/maps/qgeoroute_p.h b/src/location/maps/qgeoroute_p.h
index d56b2d44..384802ee 100644
--- a/src/location/maps/qgeoroute_p.h
+++ b/src/location/maps/qgeoroute_p.h
@@ -94,6 +94,8 @@ public:
virtual void setFirstSegment(const QGeoRouteSegment &firstSegment);
virtual QGeoRouteSegment firstSegment() const;
+ virtual QVariantMap metadata() const;
+
virtual QString engineName() const = 0;
virtual int segmentsCount() const = 0;