I'm trying to display Google Map in my Qt Quick Application by a plugin for QtLocation from this repo https://github.com/vladest/googlemaps?tab=readme-ov-file#google-maps-plugin-for-qtlocation
The program throw this error: 1, "The geoservices provider is not supported"
Just wondering if I'm using the plugin correctly.
I'm using Qt 6.5.1 and here are what I have done:
1. gh repo clone vladest/googlemaps in Qt/6.5.1/Src/qtlocation/src/plugins/geoservices folder
2. In CMakeLists.txt of the same folder:
add_subdirectory(itemsoverlay)
if(QT_FEATURE_geoservices_osm)
add_subdirectory(osm)
endif()
if(QT_FEATURE_geoservices_esri)
add_subdirectory(esri)
endif()
if(QT_FEATURE_geoservices_mapbox)
add_subdirectory(mapbox)
endif()
if(QT_FEATURE_geoservices_nokia)
add_subdirectory(nokia)
endif()
//added by me
if(QT_FEATURE_geoservices_googlemaps)
add_subdirectory(googlemaps)
endif()
3. My Qml file look like this:
import QtQuick
import QtQuick.Controls
import QtLocation
import QtPositioning
Rectangle{
anchors.left: parent.left
width: parent.width / 5 * 4
height: parent.height
MapView{
anchors.fill: parent
focus: true
Plugin {
id: mapPlugin
name: "googlemaps"
}
Map {
id: map
anchors.fill: parent
plugin: mapPlugin
center: QtPositioning.coordinate(59.91, 10.75) // Oslo
zoomLevel: 14
property geoCoordinate startCentroid
}
}
}
I have also try to use Qt 5.15.2 with similar steps (step 2 - add subdirectory in geoservices.pro file) and it throw the same error.