|
libosmscout 0.1
|
Qt Quick widget for displaying map. More...
#include <MapWidget.h>
Public Slots | |
| void | addOverlayObject (int id, QObject *o) |
| Method for registering map overlay objects. | |
| void | addPositionMark (int id, double lat, double lon) |
| Add "mark" (small red circle) on top of map. | |
| void | changeView (const MapView &view) |
| OverlayArea * | createOverlayArea (QString type="_highlighted") |
| OverlayNode * | createOverlayNode (QString type="_highlighted") |
| OverlayWay * | createOverlayWay (QString type="_route") |
| void | deactivateIcons () |
| void | locationChanged (bool locationValid, double lat, double lon, bool horizontalAccuracyValid=false, double horizontalAccuracy=0, const QDateTime &lastUpdate=QDateTime::currentDateTime()) |
| void | move (QVector2D vector) |
| void | moveDown () |
| void | moveLeft () |
| void | moveRight () |
| void | moveUp () |
| void | onIconFound (QPoint lookupCoord, MapIcon icon) |
| void | pivotBy (double angleChange) |
| void | recenter () |
| void | redraw () |
| void | reloadStyle () |
| void | reloadTmpStyle () |
| void | removeAllOverlayObjects () |
| void | removeOverlayObject (int id) |
| void | removePositionMark (int id) |
| void | rotateLeft () |
| void | rotateRight () |
| void | rotateTo (double angle) |
| Rotate view to specified angle [radians; [0 ~ 2*PI) ]. | |
| void | setVehicleScaleFactor (float factor) |
| Method for configuring the aspect ratio of painted items. | |
| void | showCoordinates (double lat, double lon) |
| void | showCoordinates (osmscout::GeoCoord coord, osmscout::Magnification magnification) |
| void | showCoordinatesInstantly (double lat, double lon) |
| void | showCoordinatesInstantly (osmscout::GeoCoord coord, osmscout::Magnification magnification) |
| void | showLocation (LocationEntry *location) |
| void | toggleDaylight () |
| bool | toggleDebug () |
| bool | toggleInfo () |
| void | zoom (double zoomFactor) |
| void | zoom (double zoomFactor, const QPoint widgetPosition) |
| void | zoomIn (double zoomFactor) |
| void | zoomIn (double zoomFactor, const QPoint widgetPosition) |
| void | zoomOut (double zoomFactor) |
| void | zoomOut (double zoomFactor, const QPoint widgetPosition) |
Signals | |
| void | angleChanged () |
| void | databaseLoaded (osmscout::GeoBox) |
| void | doubleTap (const int screenX, const int screenY, const double lat, const double lon) |
| void | finishedChanged (bool finished) |
| void | flushCachesRequest (const std::chrono::milliseconds &idleMs) |
| void | followVehicleChanged () |
| void | iconTapped (QPoint screenCoord, double lat, double lon, QString databasePath, QString objectType, quint64 objectId, int poiId, QString type, QString name, QString altName, QString ref, QString operatorName, QString phone, QString website, QString openingHours) |
| void | latChanged () |
| void | lockToPositionChanged () |
| void | lonChanged () |
| void | longTap (const int screenX, const int screenY, const double lat, const double lon) |
| void | magLevelChanged () |
| void | mouseMove (const int screenX, const int screenY, const double lat, const double lon, const Qt::KeyboardModifiers modifiers) |
| void | objectPicked (const ObjectFileRef object) |
| void | pixelSizeChanged () |
| void | renderingTypeChanged (QString type) |
| void | screenChanged (QScreen *) |
| void | styleErrorsChanged () |
| void | stylesheetFilenameChanged () |
| void | tap (const int screenX, const int screenY, const double lat, const double lon) |
| void | tapLongTap (const int screenX, const int screenY, const double lat, const double lon) |
| void | vehicleAutoRotateMapChanged () |
| void | viewChanged () |
Public Member Functions | |
| int | firstStylesheetErrorColumn () const |
| QString | firstStylesheetErrorDescription () const |
| int | firstStylesheetErrorLine () const |
| void | FlushCaches (const std::chrono::milliseconds &idleMs) |
| void | focusOutEvent (QFocusEvent *event) override |
| double | GetAngle () const |
| osmscout::GeoCoord | GetCenter () const |
| double | GetLat () const |
| double | GetLon () const |
| int | GetMagLevel () const |
| double | GetPixelSize () const |
| osmscout::MercatorProjection | getProjection () const |
| QString | GetRenderingType () const |
| bool | getShowCurrentPosition () const |
| QString | GetStylesheetFilename () const |
| double | getVehicleIconSize () const |
| QString | getVehicleInTunnelIconFile () const |
| QString | getVehicleNoGpsSignalIconFile () const |
| VehiclePosition * | GetVehiclePosition () const |
| QString | getVehicleStandardIconFile () const |
| MapView * | GetView () const |
| MapViewStruct | GetViewStruct () const |
| QString | GetZoomLevelName () const |
| bool | hasInteractiveIcons () const |
| void | hoverMoveEvent (QHoverEvent *event) override |
| bool | isDatabaseLoaded () |
| bool | IsFinished () const |
| bool | isFollowVehicle () const |
| Q_INVOKABLE bool | isInDatabaseBoundingBox (double lat, double lon) |
| bool | isLockedToPosition () const |
| bool | isPreventMouseStealing () const |
| bool | isVehicleAutoRotateMap () const |
| MapWidget (QQuickItem *parent=nullptr) | |
| void | mouseMoveEvent (QMouseEvent *event) override |
| void | mousePressEvent (QMouseEvent *event) override |
| void | mouseReleaseEvent (QMouseEvent *event) override |
| void | paint (QPainter *painter) override |
| Q_INVOKABLE QPointF | screenPosition (double lat, double lon) |
| void | setFollowVehicle (bool) |
| void | setInteractiveIcons (bool b) |
| void | setLockToPosition (bool) |
| void | SetMapView (QObject *o) |
| void | setPreventMouseStealing (bool b) |
| void | SetRenderingType (QString type) |
| void | setShowCurrentPosition (bool b) |
| void | setVehicleAutoRotateMap (bool) |
| void | setVehicleIconSize (double value) |
| void | setVehicleInTunnelIconFile (const QString &file) |
| void | setVehicleNoGpsSignalIconFile (const QString &file) |
| void | SetVehiclePosition (QObject *o) |
| void | setVehicleStandardIconFile (const QString &file) |
| bool | stylesheetHasErrors () const |
| void | touchEvent (QTouchEvent *event) override |
| void | translateToTouch (QMouseEvent *event, Qt::TouchPointStates states) |
| void | wheelEvent (QWheelEvent *event) override |
| ~MapWidget () override | |
Static Public Member Functions | |
| static QImage | loadSVGIcon (const QString &directory, const QString fileName, double iconPixelSize) |
| Helper for loading SVG graphics. | |
Properties | |
| double | angle |
| bool | databaseLoaded |
| bool | finished {false} |
| bool | followVehicle |
| bool | interactiveIcons |
| double | lat |
| bool | lockToPosition |
| double | lon |
| double | pixelSize |
| bool | preventMouseStealing {false} |
| This property holds whether the mouse events may be stolen from this Widget. | |
| QString | renderingType |
| bool | showCurrentPosition {false} |
| int | stylesheetErrorColumn |
| QString | stylesheetErrorDescription |
| int | stylesheetErrorLine |
| QString | stylesheetFilename |
| bool | stylesheetHasErrors |
| bool | vehicleAutoRotateMap |
| double | vehicleIconSize |
| QString | vehicleInTunnelIconFile |
| QString | vehicleNoGpsSignalIconFile |
| QObject * | vehiclePosition |
| QString | vehicleStandardIconFile |
| QObject * | view |
| int | zoomLevel |
| QString | zoomLevelName |
Qt Quick widget for displaying map.
Type should to be registered by qmlRegisterType method and DBThread instance should be initialized before first usage.
| osmscout::MapWidget::MapWidget | ( | QQuickItem * | parent = nullptr | ) |
References osmscout::TapRecognizer::doubleTap(), FlushCaches(), flushCachesRequest(), osmscout::OSMScoutQt::GetDBThread(), osmscout::OSMScoutQt::GetInstance(), osmscout::OSMScoutQt::GetSettings(), osmscout::TapRecognizer::longTap(), osmscout::Magnification::magContinent, redraw(), osmscout::TapRecognizer::tap(), osmscout::TapRecognizer::tapAndDrag(), osmscout::TapRecognizer::tapLongTap(), osmscout::IconAnimation::update(), and view.
|
override |
References view.
|
slot |
Method for registering map overlay objects.
Usage from QML:
var way=map.createOverlayWay(); way.addPoint(50.09180646851823, 14.498789861494872); way.addPoint(50.09180646851823, 14.60); map.addOverlayObject(0,way);
| id | |
| o |
References osmscout::OverlayObject::getObjectType(), osmscout::refArea, osmscout::refNode, and osmscout::refWay.
Referenced by flushCachesRequest().
|
slot |
Add "mark" (small red circle) on top of map.
It will be rendered in UI thread, count of marks should be limited.
Referenced by flushCachesRequest().
|
signal |
Referenced by changeView().
|
slot |
References osmscout::MapView::angle, angleChanged(), osmscout::MapView::GetLat(), osmscout::Magnification::GetLevel(), osmscout::MapView::GetLon(), GetPixelSize(), latChanged(), lonChanged(), magLevelChanged(), osmscout::MapView::magnification, pixelSizeChanged(), redraw(), view, and viewChanged().
Referenced by flushCachesRequest(), SetMapView(), and showCoordinatesInstantly().
|
slot |
References osmscout::OverlayObject::setTypeName().
Referenced by flushCachesRequest().
|
slot |
References osmscout::OverlayObject::setTypeName().
Referenced by flushCachesRequest().
|
slot |
References osmscout::OverlayObject::setTypeName().
Referenced by flushCachesRequest().
|
signal |
|
slot |
Referenced by flushCachesRequest().
|
signal |
|
signal |
| int osmscout::MapWidget::firstStylesheetErrorColumn | ( | ) | const |
References osmscout::OSMScoutQt::GetDBThread(), and osmscout::OSMScoutQt::GetInstance().
| QString osmscout::MapWidget::firstStylesheetErrorDescription | ( | ) | const |
References osmscout::OSMScoutQt::GetDBThread(), and osmscout::OSMScoutQt::GetInstance().
| int osmscout::MapWidget::firstStylesheetErrorLine | ( | ) | const |
References osmscout::OSMScoutQt::GetDBThread(), and osmscout::OSMScoutQt::GetInstance().
| void osmscout::MapWidget::FlushCaches | ( | const std::chrono::milliseconds & | idleMs | ) |
Referenced by MapWidget().
|
signal |
References addOverlayObject(), addPositionMark(), angle, changeView(), createOverlayArea(), createOverlayNode(), createOverlayWay(), deactivateIcons(), lat, locationChanged(), lon, move(), moveDown(), moveLeft(), moveRight(), moveUp(), onIconFound(), pivotBy(), recenter(), redraw(), reloadStyle(), reloadTmpStyle(), removeAllOverlayObjects(), removeOverlayObject(), removePositionMark(), rotateLeft(), rotateRight(), rotateTo(), setVehicleScaleFactor(), showCoordinates(), showCoordinatesInstantly(), showLocation(), toggleDaylight(), toggleDebug(), toggleInfo(), view, zoom(), zoomIn(), and zoomOut().
Referenced by MapWidget().
|
override |
References view.
|
signal |
|
inline |
References view.
|
inline |
References view.
Referenced by getProjection().
|
inline |
References view.
|
inline |
References view.
|
inline |
References view.
|
inline |
References getProjection().
Referenced by changeView().
|
inline |
References GetCenter(), osmscout::MercatorProjection::Set(), and view.
Referenced by GetPixelSize(), hoverMoveEvent(), paint(), and screenPosition().
| QString osmscout::MapWidget::GetRenderingType | ( | ) | const |
References renderingType, and osmscout::TiledRendering.
Referenced by SetRenderingType().
|
inline |
References showCurrentPosition.
| QString osmscout::MapWidget::GetStylesheetFilename | ( | ) | const |
References osmscout::OSMScoutQt::GetDBThread(), and osmscout::OSMScoutQt::GetInstance().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| QString osmscout::MapWidget::GetZoomLevelName | ( | ) | const |
References osmscout::MagnificationConverter::Convert(), and view.
|
inline |
|
override |
|
signal |
Referenced by onIconFound().
| bool osmscout::MapWidget::isDatabaseLoaded | ( | ) |
|
inline |
References finished.
|
inline |
| bool osmscout::MapWidget::isInDatabaseBoundingBox | ( | double | lat, |
| double | lon ) |
|
inline |
|
inline |
References preventMouseStealing.
|
inline |
|
signal |
Referenced by changeView().
|
static |
Helper for loading SVG graphics.
|
slot |
References lat, lon, and redraw().
Referenced by flushCachesRequest().
|
signal |
|
signal |
Referenced by changeView().
|
signal |
|
signal |
Referenced by changeView().
|
signal |
Referenced by hoverMoveEvent().
|
override |
References translateToTouch().
|
override |
References translateToTouch().
|
override |
References translateToTouch().
|
slot |
References view.
Referenced by flushCachesRequest(), moveDown(), moveLeft(), moveRight(), and moveUp().
|
slot |
References move().
Referenced by flushCachesRequest().
|
slot |
References move().
Referenced by flushCachesRequest().
|
slot |
References move().
Referenced by flushCachesRequest().
|
slot |
References move().
Referenced by flushCachesRequest().
|
signal |
|
slot |
References osmscout::MapIcon::altName, osmscout::MapIcon::coord, osmscout::MapIcon::databasePath, osmscout::ObjectFileRef::GetFileOffset(), osmscout::GeoCoord::GetLat(), osmscout::GeoCoord::GetLon(), osmscout::ObjectFileRef::GetName(), osmscout::ObjectFileRef::GetTypeName(), osmscout::MapIcon::iconStyle, iconTapped(), osmscout::MapIcon::name, osmscout::MapIcon::objectRef, osmscout::MapIcon::openingHours, osmscout::MapIcon::operatorName, osmscout::MapIcon::phone, osmscout::MapIcon::poiId, osmscout::MapIcon::ref, osmscout::MapIcon::screenCoord, osmscout::MapIcon::type, and osmscout::MapIcon::website.
Referenced by flushCachesRequest(), and setInteractiveIcons().
|
override |
References osmscout::Bearing::AsDegrees(), osmscout::Projection::ConvertWidthToPixel(), finished, finishedChanged(), osmscout::MercatorProjection::GeoToPixel(), osmscout::Projection::GetAngle(), osmscout::Projection::GetMeterInPixel(), getProjection(), GetViewStruct(), osmscout::Vertex2D::GetX(), osmscout::Vertex2D::GetY(), osmscout::MercatorProjection::IsValid(), osmscout::Bearing::Radians(), and showCurrentPosition.
|
slot |
References view.
Referenced by flushCachesRequest().
|
signal |
Referenced by changeView().
|
slot |
References osmscout::GeoBox::GetCenter(), osmscout::OSMScoutQt::GetDBThread(), osmscout::GetEllipsoidalDistance(), osmscout::OSMScoutQt::GetInstance(), osmscout::GeoBox::GetMaxCoord(), osmscout::GeoBox::GetMinCoord(), osmscout::GeoBox::IsValid(), and showCoordinates().
Referenced by flushCachesRequest().
|
slot |
Referenced by changeView(), flushCachesRequest(), locationChanged(), MapWidget(), reloadStyle(), reloadTmpStyle(), setShowCurrentPosition(), setVehicleIconSize(), setVehicleInTunnelIconFile(), setVehicleNoGpsSignalIconFile(), SetVehiclePosition(), setVehicleScaleFactor(), setVehicleStandardIconFile(), and toggleDaylight().
|
slot |
References osmscout::OSMScoutQt::GetDBThread(), osmscout::OSMScoutQt::GetInstance(), and redraw().
Referenced by flushCachesRequest().
|
slot |
References osmscout::OSMScoutQt::GetDBThread(), osmscout::OSMScoutQt::GetInstance(), redraw(), and TMP_SUFFIX.
Referenced by flushCachesRequest().
|
slot |
Referenced by flushCachesRequest().
|
slot |
Referenced by flushCachesRequest().
|
slot |
Referenced by flushCachesRequest().
|
signal |
Referenced by SetRenderingType().
|
slot |
References osmscout::DELTA_ANGLE, and view.
Referenced by flushCachesRequest().
|
slot |
References osmscout::DELTA_ANGLE, and view.
Referenced by flushCachesRequest().
|
slot |
Rotate view to specified angle [radians; [0 ~ 2*PI) ].
| angle |
Referenced by flushCachesRequest().
|
signal |
| QPointF osmscout::MapWidget::screenPosition | ( | double | lat, |
| double | lon ) |
| void osmscout::MapWidget::setFollowVehicle | ( | bool | follow | ) |
References view.
| void osmscout::MapWidget::setInteractiveIcons | ( | bool | b | ) |
| void osmscout::MapWidget::setLockToPosition | ( | bool | lock | ) |
References view.
|
inline |
References changeView(), and view.
|
inline |
References preventMouseStealing.
| void osmscout::MapWidget::SetRenderingType | ( | QString | type | ) |
|
inline |
References redraw(), and showCurrentPosition.
| void osmscout::MapWidget::setVehicleAutoRotateMap | ( | bool | b | ) |
References vehicleAutoRotateMapChanged().
|
inline |
References redraw().
|
inline |
References redraw().
|
inline |
References redraw().
|
slot |
Method for configuring the aspect ratio of painted items.
Default value is 1.0. Using HiDPI it is required to set the value according with the scale factor.
| ratio |
References redraw().
Referenced by flushCachesRequest().
|
inline |
References redraw().
|
slot |
References lat, lon, osmscout::Magnification::magVeryClose, and showCoordinates().
|
slot |
References view.
Referenced by flushCachesRequest(), recenter(), showCoordinates(), and showLocation().
|
slot |
References lat, lon, osmscout::Magnification::magVeryClose, and showCoordinatesInstantly().
|
slot |
References osmscout::MapView::center, changeView(), osmscout::MapView::magnification, and view.
Referenced by flushCachesRequest(), and showCoordinatesInstantly().
|
slot |
References osmscout::LocationEntry::getBBox(), osmscout::GeoBox::GetCenter(), osmscout::LocationEntry::getCoord(), osmscout::GetEllipsoidalDistance(), osmscout::GeoBox::GetMaxCoord(), osmscout::GeoBox::GetMinCoord(), osmscout::GeoBox::IsValid(), osmscout::Meters(), and showCoordinates().
Referenced by flushCachesRequest().
|
signal |
|
signal |
| bool osmscout::MapWidget::stylesheetHasErrors | ( | ) | const |
References osmscout::OSMScoutQt::GetDBThread(), and osmscout::OSMScoutQt::GetInstance().
|
signal |
|
signal |
|
slot |
References osmscout::OSMScoutQt::GetDBThread(), osmscout::OSMScoutQt::GetInstance(), and redraw().
Referenced by flushCachesRequest().
|
slot |
References osmscout::log.
Referenced by flushCachesRequest().
|
slot |
References osmscout::log.
Referenced by flushCachesRequest().
|
override |
References preventMouseStealing, and view.
Referenced by translateToTouch().
| void osmscout::MapWidget::translateToTouch | ( | QMouseEvent * | event, |
| Qt::TouchPointStates | states ) |
References touchEvent().
Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().
|
signal |
Referenced by setVehicleAutoRotateMap().
|
signal |
Referenced by changeView().
|
override |
|
slot |
References zoom().
Referenced by flushCachesRequest(), zoom(), zoomIn(), and zoomOut().
|
slot |
References view.
|
slot |
References zoomIn().
Referenced by flushCachesRequest(), wheelEvent(), and zoomIn().
|
slot |
References zoom().
|
slot |
References zoomOut().
Referenced by flushCachesRequest(), wheelEvent(), and zoomOut().
|
slot |
References zoom().
|
read |
Referenced by flushCachesRequest(), and rotateTo().
|
read |
|
read |
Referenced by finishedChanged(), IsFinished(), and paint().
|
readwrite |
|
readwrite |
|
read |
|
readwrite |
|
read |
|
read |
|
readwrite |
This property holds whether the mouse events may be stolen from this Widget.
By default this property is false. see https://doc.qt.io/qt-5/qml-qtquick-mousearea.html#preventStealing-prop
Referenced by isPreventMouseStealing(), setPreventMouseStealing(), and touchEvent().
|
readwrite |
Referenced by GetRenderingType(), and SetRenderingType().
|
readwrite |
Referenced by getShowCurrentPosition(), paint(), and setShowCurrentPosition().
|
read |
|
read |
|
read |
|
read |
|
read |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
Referenced by changeView(), flushCachesRequest(), focusOutEvent(), GetAngle(), GetCenter(), GetLat(), GetLon(), GetMagLevel(), getProjection(), GetView(), GetViewStruct(), GetZoomLevelName(), MapWidget(), move(), pivotBy(), rotateLeft(), rotateRight(), rotateTo(), setFollowVehicle(), setLockToPosition(), SetMapView(), SetVehiclePosition(), showCoordinates(), showCoordinatesInstantly(), touchEvent(), zoom(), and ~MapWidget().
|
read |
|
read |