vladest / googlemaps

QtLocation plugin for Google maps tile API
MIT License
137 stars 61 forks source link

Google api metrics (api key) not working #40

Open sputnik-alarm opened 2 years ago

sputnik-alarm commented 2 years ago

Hi. I made simple project in Qt Creator with QML. The map is working, but Google doesn't see my api key activity. I have another project on JS with the same api key, which activity is being recognized by Google. I enabled all api's in my google maps account.

Rectangle { width: 1024 height: 600

    Plugin
    {
        id: mapPlugin
        name: "googlemaps"
        PluginParameter
        {
            name: "googlemaps.apikey"  //not working
            //name: "googlemaps.maps.apikey"   //not working
            value: "AI.......................................................mE"
        }
    }

    Map
    {
        id: map
        anchors.fill: parent
        plugin: mapPlugin
        center: QtPositioning.coordinate(59.919716, 30.277555)
        zoomLevel: map_zoom_level

I rebuild plugin adding direct specifing of api key like this:

if (parameters.contains(QStringLiteral("googlemaps.places.apikey"))) m_apiKey = parameters.value(QStringLiteral("googlemaps.places.apikey")).toString().toLatin1(); else m_apiKey = parameters.value(QStringLiteral("googlemaps.apikey")).toString().toLatin1(); m_apiKey = "AI.......................................................................mE";

I found 4 files where i can do it. I redeployed project and refreshed plugin library files in the project and Qt folders. Not working.