Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no supportedMapTypes? #43

Open
nicoatSQDR opened this issue Jul 7, 2023 · 1 comment
Open

no supportedMapTypes? #43

nicoatSQDR opened this issue Jul 7, 2023 · 1 comment

Comments

@nicoatSQDR
Copy link

Hello, I'm trying to change the map type and i get
qrc:/main.qml:24: ReferenceError: supportedMapTypes is not defined qrc:/main.qml: 24
when i try to get the maptypes.
This is my qml file.

`import QtQuick 2.0
import QtQuick.Window 2.14
import QtLocation 5.15
import QtPositioning 5.15
import QtQuick.Controls 2.15

Window {
width: Qt.platform.os == "android" ? Screen.width : 512
height: Qt.platform.os == "android" ? Screen.height : 512
visible: true

Plugin {
    id: mapPlugin
    name: "googlemaps"
    PluginParameter{
        name: "activeMapType"
        value: "1"
    }
    PluginParameter{
        name: "googlemaps.maps.highdpi"
        value: "1"
    }
    Component.onCompleted: {
                for( var i_type in supportedMapTypes ) {
                    if( supportedMapTypes[i_type].name.localeCompare( "Custom URL Map" ) === 0 ) {
                        activeMapType = supportedMapTypes[i_type]
                    }
                }
            }
}

Map {
    anchors.fill: parent
    plugin: mapPlugin
    center: QtPositioning.coordinate(45, 5) // Oslo
    zoomLevel: 14
}

// GroupBox{
// title:"map types"
// ComboBox{
// model:mapPlugin.supportedMapTypes
// textRole:"description"
// onCurrentIndexChanged: mapPlugin.activeMapType = mapPlugin.supportedMapTypes[currentIndex]
// }
// }
}
`

Is it implemented?
Thanks!

@Brucethebat
Copy link

Hi i dont have any idea about google maps and QtLocation. But you can use webview and some extra coding like that ?
https://stackoverflow.com/questions/8515598/how-to-add-google-maps-in-my-application-in-qt

Also you can code your own plugin to implement google maps ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants