Mapbox widget (#20751)
* squash mapbox stuff * only hacks for pc * no hack there * only update when needed * get destination from param * no need for user agent * add athena method * change nav path color * layout cleanups * margin top * add build scripts * rename header file * set pitch * fix icon blinking * keep both options * draw on top to fix last blinking * only recomput with gps * fix include * put map in onroadwidget * update mapbox plugin to allow specifying directions url * cycle through views * dynamic resize * only when present * add map_helpers * whitespace * small fixes * let scons decide * update setup files * implicit dependency * fix alerts * Update selfdrive/ui/SConscript * move clearLayout to util.h * only build when map.cc present * move maps to own folder Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>pull/20930/head
|
@ -28,6 +28,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
liblzma-dev \
|
liblzma-dev \
|
||||||
libomp-dev \
|
libomp-dev \
|
||||||
libopencv-dev \
|
libopencv-dev \
|
||||||
|
libqt5sql5-sqlite \
|
||||||
|
libqt5svg5-dev \
|
||||||
libsqlite3-dev \
|
libsqlite3-dev \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
libsystemd-dev \
|
libsystemd-dev \
|
||||||
|
@ -40,7 +42,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
python-dev \
|
python-dev \
|
||||||
qml-module-qtquick2 \
|
qml-module-qtquick2 \
|
||||||
qt5-default \
|
qt5-default \
|
||||||
|
qtlocation5-dev \
|
||||||
qtmultimedia5-dev \
|
qtmultimedia5-dev \
|
||||||
|
qtpositioning5-dev \
|
||||||
qtwebengine5-dev \
|
qtwebengine5-dev \
|
||||||
sudo \
|
sudo \
|
||||||
valgrind \
|
valgrind \
|
||||||
|
|
|
@ -128,6 +128,7 @@ else:
|
||||||
libpath = [
|
libpath = [
|
||||||
"#phonelibs/snpe/x86_64-linux-clang",
|
"#phonelibs/snpe/x86_64-linux-clang",
|
||||||
"#phonelibs/libyuv/x64/lib",
|
"#phonelibs/libyuv/x64/lib",
|
||||||
|
"#phonelibs/mapbox-gl-native-qt/x86_64",
|
||||||
"#cereal",
|
"#cereal",
|
||||||
"#selfdrive/common",
|
"#selfdrive/common",
|
||||||
"/usr/lib",
|
"/usr/lib",
|
||||||
|
@ -190,6 +191,7 @@ env = Environment(
|
||||||
"#phonelibs/android_system_core/include",
|
"#phonelibs/android_system_core/include",
|
||||||
"#phonelibs/linux/include",
|
"#phonelibs/linux/include",
|
||||||
"#phonelibs/snpe/include",
|
"#phonelibs/snpe/include",
|
||||||
|
"#phonelibs/mapbox-gl-native-qt/include",
|
||||||
"#phonelibs/nanovg",
|
"#phonelibs/nanovg",
|
||||||
"#phonelibs/qrcode",
|
"#phonelibs/qrcode",
|
||||||
"#phonelibs",
|
"#phonelibs",
|
||||||
|
@ -272,7 +274,7 @@ Export('envCython')
|
||||||
|
|
||||||
# Qt build environment
|
# Qt build environment
|
||||||
qt_env = env.Clone()
|
qt_env = env.Clone()
|
||||||
qt_modules = ["Widgets", "Gui", "Core", "Network", "Concurrent", "Multimedia", "Quick", "Qml", "QuickWidgets"]
|
qt_modules = ["Widgets", "Gui", "Core", "Network", "Concurrent", "Multimedia", "Quick", "Qml", "QuickWidgets", "Location", "Positioning"]
|
||||||
if arch != "aarch64":
|
if arch != "aarch64":
|
||||||
qt_modules += ["DBus"]
|
qt_modules += ["DBus"]
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
x86_64 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
larch64 filter=lfs diff=lfs merge=lfs -text
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
cd /tmp
|
||||||
|
git clone --recursive https://github.com/commaai/mapbox-gl-native.git
|
||||||
|
cd mapbox-gl-native
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake -DMBGL_WITH_QT=ON ..
|
||||||
|
make -j$(nproc) mbgl-qt
|
|
@ -0,0 +1 @@
|
||||||
|
#include "qmapbox.hpp"
|
|
@ -0,0 +1 @@
|
||||||
|
#include "qmapboxgl.hpp"
|
|
@ -0,0 +1,147 @@
|
||||||
|
#ifndef QMAPBOX_H
|
||||||
|
#define QMAPBOX_H
|
||||||
|
|
||||||
|
#include <QColor>
|
||||||
|
#include <QPair>
|
||||||
|
#include <QString>
|
||||||
|
#include <QVariant>
|
||||||
|
#include <QVector>
|
||||||
|
|
||||||
|
// This header follows the Qt coding style: https://wiki.qt.io/Qt_Coding_Style
|
||||||
|
|
||||||
|
#if !defined(QT_MAPBOXGL_STATIC)
|
||||||
|
# if defined(QT_BUILD_MAPBOXGL_LIB)
|
||||||
|
# define Q_MAPBOXGL_EXPORT Q_DECL_EXPORT
|
||||||
|
# else
|
||||||
|
# define Q_MAPBOXGL_EXPORT Q_DECL_IMPORT
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# define Q_MAPBOXGL_EXPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace QMapbox {
|
||||||
|
|
||||||
|
typedef QPair<double, double> Coordinate;
|
||||||
|
typedef QPair<Coordinate, double> CoordinateZoom;
|
||||||
|
typedef QPair<double, double> ProjectedMeters;
|
||||||
|
|
||||||
|
typedef QVector<Coordinate> Coordinates;
|
||||||
|
typedef QVector<Coordinates> CoordinatesCollection;
|
||||||
|
|
||||||
|
typedef QVector<CoordinatesCollection> CoordinatesCollections;
|
||||||
|
|
||||||
|
struct Q_MAPBOXGL_EXPORT Feature {
|
||||||
|
enum Type {
|
||||||
|
PointType = 1,
|
||||||
|
LineStringType,
|
||||||
|
PolygonType
|
||||||
|
};
|
||||||
|
|
||||||
|
/*! Class constructor. */
|
||||||
|
Feature(Type type_ = PointType, const CoordinatesCollections& geometry_ = CoordinatesCollections(),
|
||||||
|
const QVariantMap& properties_ = QVariantMap(), const QVariant& id_ = QVariant())
|
||||||
|
: type(type_), geometry(geometry_), properties(properties_), id(id_) {}
|
||||||
|
|
||||||
|
Type type;
|
||||||
|
CoordinatesCollections geometry;
|
||||||
|
QVariantMap properties;
|
||||||
|
QVariant id;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Q_MAPBOXGL_EXPORT ShapeAnnotationGeometry {
|
||||||
|
enum Type {
|
||||||
|
LineStringType = 1,
|
||||||
|
PolygonType,
|
||||||
|
MultiLineStringType,
|
||||||
|
MultiPolygonType
|
||||||
|
};
|
||||||
|
|
||||||
|
/*! Class constructor. */
|
||||||
|
ShapeAnnotationGeometry(Type type_ = LineStringType, const CoordinatesCollections& geometry_ = CoordinatesCollections())
|
||||||
|
: type(type_), geometry(geometry_) {}
|
||||||
|
|
||||||
|
Type type;
|
||||||
|
CoordinatesCollections geometry;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Q_MAPBOXGL_EXPORT SymbolAnnotation {
|
||||||
|
Coordinate geometry;
|
||||||
|
QString icon;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Q_MAPBOXGL_EXPORT LineAnnotation {
|
||||||
|
/*! Class constructor. */
|
||||||
|
LineAnnotation(const ShapeAnnotationGeometry& geometry_ = ShapeAnnotationGeometry(), float opacity_ = 1.0f,
|
||||||
|
float width_ = 1.0f, const QColor& color_ = Qt::black)
|
||||||
|
: geometry(geometry_), opacity(opacity_), width(width_), color(color_) {}
|
||||||
|
|
||||||
|
ShapeAnnotationGeometry geometry;
|
||||||
|
float opacity;
|
||||||
|
float width;
|
||||||
|
QColor color;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Q_MAPBOXGL_EXPORT FillAnnotation {
|
||||||
|
/*! Class constructor. */
|
||||||
|
FillAnnotation(const ShapeAnnotationGeometry& geometry_ = ShapeAnnotationGeometry(), float opacity_ = 1.0f,
|
||||||
|
const QColor& color_ = Qt::black, const QVariant& outlineColor_ = QVariant())
|
||||||
|
: geometry(geometry_), opacity(opacity_), color(color_), outlineColor(outlineColor_) {}
|
||||||
|
|
||||||
|
ShapeAnnotationGeometry geometry;
|
||||||
|
float opacity;
|
||||||
|
QColor color;
|
||||||
|
QVariant outlineColor;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef QVariant Annotation;
|
||||||
|
typedef quint32 AnnotationID;
|
||||||
|
typedef QVector<AnnotationID> AnnotationIDs;
|
||||||
|
|
||||||
|
enum NetworkMode {
|
||||||
|
Online, // Default
|
||||||
|
Offline,
|
||||||
|
};
|
||||||
|
|
||||||
|
Q_MAPBOXGL_EXPORT QVector<QPair<QString, QString> >& defaultStyles();
|
||||||
|
|
||||||
|
Q_MAPBOXGL_EXPORT NetworkMode networkMode();
|
||||||
|
Q_MAPBOXGL_EXPORT void setNetworkMode(NetworkMode);
|
||||||
|
|
||||||
|
// This struct is a 1:1 copy of mbgl::CustomLayerRenderParameters.
|
||||||
|
struct Q_MAPBOXGL_EXPORT CustomLayerRenderParameters {
|
||||||
|
double width;
|
||||||
|
double height;
|
||||||
|
double latitude;
|
||||||
|
double longitude;
|
||||||
|
double zoom;
|
||||||
|
double bearing;
|
||||||
|
double pitch;
|
||||||
|
double fieldOfView;
|
||||||
|
};
|
||||||
|
|
||||||
|
class Q_MAPBOXGL_EXPORT CustomLayerHostInterface {
|
||||||
|
public:
|
||||||
|
virtual ~CustomLayerHostInterface() = default;
|
||||||
|
virtual void initialize() = 0;
|
||||||
|
virtual void render(const CustomLayerRenderParameters&) = 0;
|
||||||
|
virtual void deinitialize() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
Q_MAPBOXGL_EXPORT double metersPerPixelAtLatitude(double latitude, double zoom);
|
||||||
|
Q_MAPBOXGL_EXPORT ProjectedMeters projectedMetersForCoordinate(const Coordinate &);
|
||||||
|
Q_MAPBOXGL_EXPORT Coordinate coordinateForProjectedMeters(const ProjectedMeters &);
|
||||||
|
|
||||||
|
} // namespace QMapbox
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(QMapbox::Coordinate);
|
||||||
|
Q_DECLARE_METATYPE(QMapbox::Coordinates);
|
||||||
|
Q_DECLARE_METATYPE(QMapbox::CoordinatesCollection);
|
||||||
|
Q_DECLARE_METATYPE(QMapbox::CoordinatesCollections);
|
||||||
|
Q_DECLARE_METATYPE(QMapbox::Feature);
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(QMapbox::SymbolAnnotation);
|
||||||
|
Q_DECLARE_METATYPE(QMapbox::ShapeAnnotationGeometry);
|
||||||
|
Q_DECLARE_METATYPE(QMapbox::LineAnnotation);
|
||||||
|
Q_DECLARE_METATYPE(QMapbox::FillAnnotation);
|
||||||
|
|
||||||
|
#endif // QMAPBOX_H
|
|
@ -0,0 +1,277 @@
|
||||||
|
#ifndef QMAPBOXGL_H
|
||||||
|
#define QMAPBOXGL_H
|
||||||
|
|
||||||
|
#include <QImage>
|
||||||
|
#include <QMapbox>
|
||||||
|
#include <QMargins>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QPointF>
|
||||||
|
#include <QSize>
|
||||||
|
#include <QString>
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
class QMapboxGLPrivate;
|
||||||
|
|
||||||
|
// This header follows the Qt coding style: https://wiki.qt.io/Qt_Coding_Style
|
||||||
|
|
||||||
|
class Q_MAPBOXGL_EXPORT QMapboxGLSettings
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QMapboxGLSettings();
|
||||||
|
|
||||||
|
enum GLContextMode {
|
||||||
|
UniqueGLContext = 0,
|
||||||
|
SharedGLContext
|
||||||
|
};
|
||||||
|
|
||||||
|
enum MapMode {
|
||||||
|
Continuous = 0,
|
||||||
|
Static
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ConstrainMode {
|
||||||
|
NoConstrain = 0,
|
||||||
|
ConstrainHeightOnly,
|
||||||
|
ConstrainWidthAndHeight
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ViewportMode {
|
||||||
|
DefaultViewport = 0,
|
||||||
|
FlippedYViewport
|
||||||
|
};
|
||||||
|
|
||||||
|
GLContextMode contextMode() const;
|
||||||
|
void setContextMode(GLContextMode);
|
||||||
|
|
||||||
|
MapMode mapMode() const;
|
||||||
|
void setMapMode(MapMode);
|
||||||
|
|
||||||
|
ConstrainMode constrainMode() const;
|
||||||
|
void setConstrainMode(ConstrainMode);
|
||||||
|
|
||||||
|
ViewportMode viewportMode() const;
|
||||||
|
void setViewportMode(ViewportMode);
|
||||||
|
|
||||||
|
unsigned cacheDatabaseMaximumSize() const;
|
||||||
|
void setCacheDatabaseMaximumSize(unsigned);
|
||||||
|
|
||||||
|
QString cacheDatabasePath() const;
|
||||||
|
void setCacheDatabasePath(const QString &);
|
||||||
|
|
||||||
|
QString assetPath() const;
|
||||||
|
void setAssetPath(const QString &);
|
||||||
|
|
||||||
|
QString accessToken() const;
|
||||||
|
void setAccessToken(const QString &);
|
||||||
|
|
||||||
|
QString apiBaseUrl() const;
|
||||||
|
void setApiBaseUrl(const QString &);
|
||||||
|
|
||||||
|
QString localFontFamily() const;
|
||||||
|
void setLocalFontFamily(const QString &);
|
||||||
|
|
||||||
|
std::function<std::string(const std::string &)> resourceTransform() const;
|
||||||
|
void setResourceTransform(const std::function<std::string(const std::string &)> &);
|
||||||
|
|
||||||
|
private:
|
||||||
|
GLContextMode m_contextMode;
|
||||||
|
MapMode m_mapMode;
|
||||||
|
ConstrainMode m_constrainMode;
|
||||||
|
ViewportMode m_viewportMode;
|
||||||
|
|
||||||
|
unsigned m_cacheMaximumSize;
|
||||||
|
QString m_cacheDatabasePath;
|
||||||
|
QString m_assetPath;
|
||||||
|
QString m_accessToken;
|
||||||
|
QString m_apiBaseUrl;
|
||||||
|
QString m_localFontFamily;
|
||||||
|
std::function<std::string(const std::string &)> m_resourceTransform;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Q_MAPBOXGL_EXPORT QMapboxGLCameraOptions {
|
||||||
|
QVariant center; // Coordinate
|
||||||
|
QVariant anchor; // QPointF
|
||||||
|
QVariant zoom; // double
|
||||||
|
QVariant bearing; // double
|
||||||
|
QVariant pitch; // double
|
||||||
|
};
|
||||||
|
|
||||||
|
class Q_MAPBOXGL_EXPORT QMapboxGL : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PROPERTY(double latitude READ latitude WRITE setLatitude)
|
||||||
|
Q_PROPERTY(double longitude READ longitude WRITE setLongitude)
|
||||||
|
Q_PROPERTY(double zoom READ zoom WRITE setZoom)
|
||||||
|
Q_PROPERTY(double bearing READ bearing WRITE setBearing)
|
||||||
|
Q_PROPERTY(double pitch READ pitch WRITE setPitch)
|
||||||
|
Q_PROPERTY(QString styleJson READ styleJson WRITE setStyleJson)
|
||||||
|
Q_PROPERTY(QString styleUrl READ styleUrl WRITE setStyleUrl)
|
||||||
|
Q_PROPERTY(double scale READ scale WRITE setScale)
|
||||||
|
Q_PROPERTY(QMapbox::Coordinate coordinate READ coordinate WRITE setCoordinate)
|
||||||
|
Q_PROPERTY(QMargins margins READ margins WRITE setMargins)
|
||||||
|
|
||||||
|
public:
|
||||||
|
enum MapChange {
|
||||||
|
MapChangeRegionWillChange = 0,
|
||||||
|
MapChangeRegionWillChangeAnimated,
|
||||||
|
MapChangeRegionIsChanging,
|
||||||
|
MapChangeRegionDidChange,
|
||||||
|
MapChangeRegionDidChangeAnimated,
|
||||||
|
MapChangeWillStartLoadingMap,
|
||||||
|
MapChangeDidFinishLoadingMap,
|
||||||
|
MapChangeDidFailLoadingMap,
|
||||||
|
MapChangeWillStartRenderingFrame,
|
||||||
|
MapChangeDidFinishRenderingFrame,
|
||||||
|
MapChangeDidFinishRenderingFrameFullyRendered,
|
||||||
|
MapChangeWillStartRenderingMap,
|
||||||
|
MapChangeDidFinishRenderingMap,
|
||||||
|
MapChangeDidFinishRenderingMapFullyRendered,
|
||||||
|
MapChangeDidFinishLoadingStyle,
|
||||||
|
MapChangeSourceDidChange
|
||||||
|
};
|
||||||
|
|
||||||
|
enum MapLoadingFailure {
|
||||||
|
StyleParseFailure,
|
||||||
|
StyleLoadFailure,
|
||||||
|
NotFoundFailure,
|
||||||
|
UnknownFailure
|
||||||
|
};
|
||||||
|
|
||||||
|
// Determines the orientation of the map.
|
||||||
|
enum NorthOrientation {
|
||||||
|
NorthUpwards, // Default
|
||||||
|
NorthRightwards,
|
||||||
|
NorthDownwards,
|
||||||
|
NorthLeftwards,
|
||||||
|
};
|
||||||
|
|
||||||
|
QMapboxGL(QObject* parent = 0,
|
||||||
|
const QMapboxGLSettings& = QMapboxGLSettings(),
|
||||||
|
const QSize& size = QSize(),
|
||||||
|
qreal pixelRatio = 1);
|
||||||
|
virtual ~QMapboxGL();
|
||||||
|
|
||||||
|
QString styleJson() const;
|
||||||
|
QString styleUrl() const;
|
||||||
|
|
||||||
|
void setStyleJson(const QString &);
|
||||||
|
void setStyleUrl(const QString &);
|
||||||
|
|
||||||
|
double latitude() const;
|
||||||
|
void setLatitude(double latitude);
|
||||||
|
|
||||||
|
double longitude() const;
|
||||||
|
void setLongitude(double longitude);
|
||||||
|
|
||||||
|
double scale() const;
|
||||||
|
void setScale(double scale, const QPointF ¢er = QPointF());
|
||||||
|
|
||||||
|
double zoom() const;
|
||||||
|
void setZoom(double zoom);
|
||||||
|
|
||||||
|
double minimumZoom() const;
|
||||||
|
double maximumZoom() const;
|
||||||
|
|
||||||
|
double bearing() const;
|
||||||
|
void setBearing(double degrees);
|
||||||
|
void setBearing(double degrees, const QPointF ¢er);
|
||||||
|
|
||||||
|
double pitch() const;
|
||||||
|
void setPitch(double pitch);
|
||||||
|
void pitchBy(double pitch);
|
||||||
|
|
||||||
|
NorthOrientation northOrientation() const;
|
||||||
|
void setNorthOrientation(NorthOrientation);
|
||||||
|
|
||||||
|
QMapbox::Coordinate coordinate() const;
|
||||||
|
void setCoordinate(const QMapbox::Coordinate &);
|
||||||
|
void setCoordinateZoom(const QMapbox::Coordinate &, double zoom);
|
||||||
|
|
||||||
|
void jumpTo(const QMapboxGLCameraOptions&);
|
||||||
|
|
||||||
|
void setGestureInProgress(bool inProgress);
|
||||||
|
|
||||||
|
void setTransitionOptions(qint64 duration, qint64 delay = 0);
|
||||||
|
|
||||||
|
void addAnnotationIcon(const QString &name, const QImage &sprite);
|
||||||
|
|
||||||
|
QMapbox::AnnotationID addAnnotation(const QMapbox::Annotation &);
|
||||||
|
void updateAnnotation(QMapbox::AnnotationID, const QMapbox::Annotation &);
|
||||||
|
void removeAnnotation(QMapbox::AnnotationID);
|
||||||
|
|
||||||
|
bool setLayoutProperty(const QString &layer, const QString &property, const QVariant &value);
|
||||||
|
bool setPaintProperty(const QString &layer, const QString &property, const QVariant &value);
|
||||||
|
|
||||||
|
bool isFullyLoaded() const;
|
||||||
|
|
||||||
|
void moveBy(const QPointF &offset);
|
||||||
|
void scaleBy(double scale, const QPointF ¢er = QPointF());
|
||||||
|
void rotateBy(const QPointF &first, const QPointF &second);
|
||||||
|
|
||||||
|
void resize(const QSize &size);
|
||||||
|
|
||||||
|
double metersPerPixelAtLatitude(double latitude, double zoom) const;
|
||||||
|
QMapbox::ProjectedMeters projectedMetersForCoordinate(const QMapbox::Coordinate &) const;
|
||||||
|
QMapbox::Coordinate coordinateForProjectedMeters(const QMapbox::ProjectedMeters &) const;
|
||||||
|
QPointF pixelForCoordinate(const QMapbox::Coordinate &) const;
|
||||||
|
QMapbox::Coordinate coordinateForPixel(const QPointF &) const;
|
||||||
|
|
||||||
|
QMapbox::CoordinateZoom coordinateZoomForBounds(const QMapbox::Coordinate &sw, QMapbox::Coordinate &ne) const;
|
||||||
|
QMapbox::CoordinateZoom coordinateZoomForBounds(const QMapbox::Coordinate &sw, QMapbox::Coordinate &ne, double bearing, double pitch);
|
||||||
|
|
||||||
|
void setMargins(const QMargins &margins);
|
||||||
|
QMargins margins() const;
|
||||||
|
|
||||||
|
void addSource(const QString &sourceID, const QVariantMap& params);
|
||||||
|
bool sourceExists(const QString &sourceID);
|
||||||
|
void updateSource(const QString &sourceID, const QVariantMap& params);
|
||||||
|
void removeSource(const QString &sourceID);
|
||||||
|
|
||||||
|
void addImage(const QString &name, const QImage &sprite);
|
||||||
|
void removeImage(const QString &name);
|
||||||
|
|
||||||
|
void addCustomLayer(const QString &id,
|
||||||
|
QScopedPointer<QMapbox::CustomLayerHostInterface>& host,
|
||||||
|
const QString& before = QString());
|
||||||
|
void addLayer(const QVariantMap ¶ms, const QString& before = QString());
|
||||||
|
bool layerExists(const QString &id);
|
||||||
|
void removeLayer(const QString &id);
|
||||||
|
|
||||||
|
QVector<QString> layerIds() const;
|
||||||
|
|
||||||
|
void setFilter(const QString &layer, const QVariant &filter);
|
||||||
|
QVariant getFilter(const QString &layer) const;
|
||||||
|
// When rendering on a different thread,
|
||||||
|
// should be called on the render thread.
|
||||||
|
void createRenderer();
|
||||||
|
void destroyRenderer();
|
||||||
|
void setFramebufferObject(quint32 fbo, const QSize &size);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void render();
|
||||||
|
void connectionEstablished();
|
||||||
|
|
||||||
|
// Commit changes, load all the resources
|
||||||
|
// and renders the map when completed.
|
||||||
|
void startStaticRender();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void needsRendering();
|
||||||
|
void mapChanged(QMapboxGL::MapChange);
|
||||||
|
void mapLoadingFailed(QMapboxGL::MapLoadingFailure, const QString &reason);
|
||||||
|
void copyrightsChanged(const QString ©rightsHtml);
|
||||||
|
|
||||||
|
void staticRenderFinished(const QString &error);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Q_DISABLE_COPY(QMapboxGL)
|
||||||
|
|
||||||
|
QMapboxGLPrivate *d_ptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(QMapboxGL::MapChange);
|
||||||
|
Q_DECLARE_METATYPE(QMapboxGL::MapLoadingFailure);
|
||||||
|
|
||||||
|
#endif // QMAPBOXGL_H
|
|
@ -0,0 +1 @@
|
||||||
|
x86_64 filter=lfs diff=lfs merge=lfs -text
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
# Qtlocation plugin with extra fields parsed from api response
|
||||||
|
cd /tmp
|
||||||
|
git clone https://github.com/commaai/qtlocation.git
|
||||||
|
cd qtlocation
|
||||||
|
qmake
|
||||||
|
make -j$(nproc)
|
|
@ -0,0 +1,56 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
version="1.1"
|
||||||
|
id="triangle-11"
|
||||||
|
width="75.758675"
|
||||||
|
height="89.153732"
|
||||||
|
viewBox="0 0 75.758675 89.153734"
|
||||||
|
sodipodi:docname="triangle.svg"
|
||||||
|
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)">
|
||||||
|
<metadata
|
||||||
|
id="metadata8">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs6" />
|
||||||
|
<sodipodi:namedview
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1278"
|
||||||
|
inkscape:window-height="1418"
|
||||||
|
id="namedview4"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="3.7926636"
|
||||||
|
inkscape:cx="58.39757"
|
||||||
|
inkscape:cy="42.569591"
|
||||||
|
inkscape:window-x="2480"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
inkscape:current-layer="triangle-11" />
|
||||||
|
<path
|
||||||
|
id="rect3338"
|
||||||
|
d="m 38.008927,0.00304862 c -1.672524,-0.07115 -3.24191,1.10742798 -4.103539,3.08128498 L 0.63797357,79.511649 c -1.85216397,4.240355 0.59099403,9.61933 3.95882353,9.642068 3.3678291,0.02287 28.1477799,-24.380023 33.9100889,-24.380023 5.762307,0 29.946434,24.380314 32.624742,24.380023 2.678305,-2.9e-4 3.249598,-1.351011 4.021616,-3.231338 0.772007,-1.880328 0.863286,-4.290554 -0.06281,-6.41073 L 58.456744,41.297993 41.823037,3.0843336 C 41.013805,1.2321186 39.577483,0.07190362 38.008927,0.00304862 Z"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
style="fill:#cccccc;stroke-width:9.76952076"
|
||||||
|
sodipodi:nodetypes="ccczzzscccc" />
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 865 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 658 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 113 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.7 KiB |