I'm trying to get qtlocation running with the osm provider but for some reason when the application starts up it just hangs. Cannot even close it.
When I change it to use the "mapboxgl" provider it works fine. I've been using it for many years on ubuntu 20.04 but since I've switched to Ubuntu 22.04 (qt 5.15.3) I'm having issues. Am I missing parameters?
using gcc 11.3.0
Any help would be appreciated
I'm running Qt's test/example app qt's example code
main.cpp:
#include <QGuiApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
const QUrl url(QStringLiteral("qrc:/main.qml"));
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl)
QCoreApplication::exit(-1);
}, Qt::QueuedConnection);
engine.load(url);
return app.exec();
}
main.qml:
import QtQuick 2.12
import QtQuick.Window 2.12
import QtLocation 5.12
import QtPositioning 5.12
Window {
width: 512
height: 512
visible: true
Plugin {
id: osmPlugin
name: "osm"
// specify plugin parameters if necessary
// PluginParameter {
// name:
// value:
// }
}
Map {
anchors.fill: parent
plugin: osmPlugin
center: QtPositioning.coordinate(59.91, 10.75) // Oslo
zoomLevel: 10
}
}
Then I also tried with qt 5.15.10. same result
Also noted that it stops as soon as it loads 1 tile. every time you run it again you see an extra tile showing(probably cached tiles).