Googlemaps satellite view is not working



  • Hi,

    I'm new to QML so I'm pretty sure that there is an error in my code. I have built and installed the googlemaps plugin and now I'm working on the minimal_map example, but I can't display the satellite view. The plugin is working right because using the mapviewer example I can see the satellite view.

    here is my code:

    import QtQuick 2.0
    import QtQuick.Window 2.0
    import QtLocation 5.6
    import QtPositioning 5.6
    
    Window {
        property variant map
        width: 512
        height: 512
        visible: true
    
        Plugin {
            id: googleMaps
            name: "googlemaps" // "mapboxgl", "esri", ...
            // specify plugin parameters if necessary
            // PluginParameter {
            //     name:
            //     value:
            // }
            
        }
    
        Map {
            id: maps
            anchors.fill: parent
            activeMapType: MapType.SatelliteMapDay
            plugin: googleMaps
    
            center: QtPositioning.coordinate(59.91, 10.75) // Oslo
            zoomLevel: 14
        }
    }
    

    Can anyone give me any hint?

    Thanks in advance.



  • Ok, I found it myself:

       Plugin {
            id: googleMaps
            name: "googlemaps" // "mapboxgl", "esri", ...
            // specify plugin parameters if necessary
            // PluginParameter {
            //     name:
            //     value:
            // }
    
        }
    
        Map {
            id: maps
            anchors.fill: parent
            plugin: googleMaps
            activeMapType: supportedMapTypes[1]   //you should use this, instead of MapType.SatelliteMapDay
    
            center: QtPositioning.coordinate(59.91, 10.75) // Oslo
            zoomLevel: 14   
        }
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.