Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. google maps in qt
Forum Updated to NodeBB v4.3 + New Features

google maps in qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
14 Posts 7 Posters 9.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SGaist
    Lifetime Qt Champion
    wrote on 25 Apr 2016, 21:57 last edited by
    #4

    Hi,

    There's also a forum member that has implemented a backend for it. See this thread

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    S 1 Reply Last reply 26 Apr 2016, 09:56
    1
    • S SGaist
      25 Apr 2016, 21:57

      Hi,

      There's also a forum member that has implemented a backend for it. See this thread

      S Offline
      S Offline
      saitej
      wrote on 26 Apr 2016, 09:56 last edited by
      #5

      @SGaist

      Hi I found this googlemaps plugin link in the thread you sent. As I am quiet new to Qt, could you give some hint on how to use this plugin along with Qtlocation C++.

      ? 1 Reply Last reply 26 Apr 2016, 10:07
      0
      • S saitej
        26 Apr 2016, 09:56

        @SGaist

        Hi I found this googlemaps plugin link in the thread you sent. As I am quiet new to Qt, could you give some hint on how to use this plugin along with Qtlocation C++.

        ? Offline
        ? Offline
        A Former User
        wrote on 26 Apr 2016, 10:07 last edited by
        #6

        @saitej Don't know what you want to do, just as a reminder: "Currently it is not possible to interact with maps via C++".

        S 1 Reply Last reply 26 Apr 2016, 10:19
        0
        • ? A Former User
          26 Apr 2016, 10:07

          @saitej Don't know what you want to do, just as a reminder: "Currently it is not possible to interact with maps via C++".

          S Offline
          S Offline
          saitej
          wrote on 26 Apr 2016, 10:19 last edited by
          #7

          @Wieland
          Hi ..
          I want to display the current location as the first step using the googlemaps plugin either in qml or c++ which ever is possible.

          ? 1 Reply Last reply 26 Apr 2016, 10:25
          0
          • S saitej
            26 Apr 2016, 10:19

            @Wieland
            Hi ..
            I want to display the current location as the first step using the googlemaps plugin either in qml or c++ which ever is possible.

            ? Offline
            ? Offline
            A Former User
            wrote on 26 Apr 2016, 10:25 last edited by
            #8

            @saitej You can't do this in C++ but QtQuick comes with the easy to use Map type.

            S 1 Reply Last reply 27 Apr 2016, 06:17
            0
            • ? A Former User
              26 Apr 2016, 10:25

              @saitej You can't do this in C++ but QtQuick comes with the easy to use Map type.

              S Offline
              S Offline
              saitej
              wrote on 27 Apr 2016, 06:17 last edited by
              #9

              @Wieland

              I tried the code from the link you had sent but am unable to view any map.
              This is my main.qml code. The code doesn’t give an error but displays a blank window.

              import QtPositioning 5.5
              import QtLocation 5.6
              import QtQuick 2.6
              import QtQuick.Window 2.2
              Window {
                  visible: true
                  width: 400
                  height: 600
              
                  MouseArea {
                      anchors.fill: parent
                      onClicked: {
                          Qt.quit();
                      }
                  }
                  Plugin{
                      id:myplugin
                      name: "osm"
                  }
                  Map {
                      id: map
                      plugin: myplugin
                      center {
                          latitude: -27
                          longitude: 153
                      }
                      zoomLevel: map.minimumZoomLevel
              
                      gesture.enabled: true
                  }
              
              
              }
              
              
              
              
              
              ? 1 Reply Last reply 27 Apr 2016, 09:27
              0
              • K Offline
                K Offline
                khryleption
                wrote on 27 Apr 2016, 07:00 last edited by
                #10

                In my case, I used the API QMapControl Under LGPL license.
                It's very easy to use.

                1 Reply Last reply
                1
                • S saitej
                  27 Apr 2016, 06:17

                  @Wieland

                  I tried the code from the link you had sent but am unable to view any map.
                  This is my main.qml code. The code doesn’t give an error but displays a blank window.

                  import QtPositioning 5.5
                  import QtLocation 5.6
                  import QtQuick 2.6
                  import QtQuick.Window 2.2
                  Window {
                      visible: true
                      width: 400
                      height: 600
                  
                      MouseArea {
                          anchors.fill: parent
                          onClicked: {
                              Qt.quit();
                          }
                      }
                      Plugin{
                          id:myplugin
                          name: "osm"
                      }
                      Map {
                          id: map
                          plugin: myplugin
                          center {
                              latitude: -27
                              longitude: 153
                          }
                          zoomLevel: map.minimumZoomLevel
                  
                          gesture.enabled: true
                      }
                  
                  
                  }
                  
                  
                  
                  
                  
                  ? Offline
                  ? Offline
                  A Former User
                  wrote on 27 Apr 2016, 09:27 last edited by
                  #11

                  @saitej Add anchors.fill: contentItem to your Map item ;-)

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    saitej
                    wrote on 1 May 2016, 05:58 last edited by
                    #12

                    Hi
                    I am having few basic issues with this code. I am unable to display the marker on the map.
                    Also, where do I write the signal showRoute(startCoordinate,endCoordinate)
                    It's giving me already declared error

                    I am used to c++ and I just started to use qml. so the doubts will be pretty basic so please bear with me

                    import QtPositioning 5.5
                    import QtLocation 5.6
                    import QtQuick 2.6
                    import QtQuick.Window 2.2
                    import QtQuick.Controls 1.4
                    import QtQuick.Layouts 1.3
                    
                    Window {
                        visible: true
                        width: 400
                        height: 600
                    
                        MouseArea {
                            anchors.fill: parent
                            //        onClicked: {
                            //            Qt.quit();
                            //        }
                        }
                    
                        //    splitview
                    
                        SplitView {
                            anchors.fill: parent
                            orientation: Qt.Vertical
                            //rect1
                            Rectangle {
                                height: 150
                                Layout.maximumHeight:  200
                                //               color: "lightblue"
                    
                                Label {
                                    id: label1
                                    text: "Latitude Start"
                                    x:0
                                    y:2
                    
                                }
                                Label{
                                    id : label2
                                    text: "Longitude Start"
                                    x:0
                                    y:25
                                }
                    
                                Label {
                                    id: label3
                                    text: "Latitude End"
                                    x:0
                                    y:50
                    
                                }
                                Label{
                                    id : label4
                                    text: "Longitude End"
                                    x:0
                                    y:75
                                }
                                //            textinputs
                                TextInput {
                                    //                anchors.fill:
                                    id: input1
                                    x:150
                                    y:2
                                    font.pixelSize: 12; font.bold: false
                                    cursorVisible: true
                                    text:  "12.9716"
                                    //                acceptableInput:
                                    validator : RegExpValidator { regExp : /[0-9]+\.[0-9]+/ }
                                    focus:true
                                }
                                TextInput {
                                    //                anchors.fill: contentItem
                                    id: input2
                                    x:150
                                    y:25
                                    font.pixelSize: 12; font.bold: false
                                    //                acceptableInput:
                                    validator : RegExpValidator { regExp : /[0-9]+\.[0-9]+/ }
                                    //                focus:true
                                    echoMode: TextInput.Normal
                                    activeFocusOnTab: true
                                    text: "77.5946"
                                }
                    
                                TextInput {
                                    //                anchors.fill: contentItem
                                    id: input3
                                    x:150
                                    y:50
                                    font.pixelSize: 12; font.bold: false
                                    //                acceptableInput:
                                    validator : RegExpValidator { regExp : /[0-9]+\.[0-9]+/ }
                                    //                focus:true
                                    echoMode: TextInput.Normal
                                    activeFocusOnTab: true
                                    text: "19.0760"
                    
                                }
                    
                    
                                TextInput {
                                    //                anchors.fill: contentItem
                                    id: input4
                                    x:150
                                    y:75
                                    font.pixelSize: 12; font.bold: false
                                    //                acceptableInput:
                                    validator : RegExpValidator { regExp : /[0-9]+\.[0-9]+/ }
                                    //                focus:true
                                    echoMode: TextInput.Normal
                                    activeFocusOnTab: true
                                    text: "72.8777"
                    
                                }
                    
                                Button{
                                    id:goButton
                                    text : "GO!"
                                    anchors.horizontalCenter: parent.horizontalCenter
                                    y: 100
                                    onClicked: {
                                        var startCoordinate = QtPositioning.coordinate(parseFloat(input1.text),
                                                                                       parseFloat(input2.text));
                                        var endCoordinate = QtPositioning.coordinate(parseFloat(input3.text),
                                                                                     parseFloat(input4.text));
                                        if (startCoordinate.isValid && endCoordinate.isValid) {
                    
                                            goButton.enabled = false;
                                            showRoute(startCoordinate,endCoordinate)
                                        }
                    
                                    }
                    
                                }
                                Plugin{
                                    id:myplugin
                                    name: "osm"
                                }
                    
                    
                    
                    
                    
                            } //rectangle ends here
                    
                    
                    
                    
                            Map {
                                id: map
                                plugin: myplugin
                                center {
                    
                                    //                latitude: 12.9716 //
                                    //                longitude: 77.5946 //
                                    latitude :input1.text
                                    longitude:input2.text
                    
                                }
                                zoomLevel: 13
                                anchors.fill: contentItem
                                gesture.enabled: true
                                //            property variant location: QtPositioning.coordinate( input1.text, input2.text)
                                MapItemView {
                                    model:PlaceSearchModel
                                    delegate: MapQuickItem {
                                        id : marker
                                        coordinate: QtPositioning.coordinate( input1.text, input2.text)
                    
                                        anchorPoint.x: image.width * 0.5
                                        anchorPoint.y: image.height
                                        sourceItem: Image {
                                            id: image
                                            source: "qrc:/marker.png"
                    
                                        }
                    
                                    }
                    
                                }
                    
                            }
                    
                    
                        }
                    
                    
                    }
                    
                    
                    
                    
                    
                    bahman309B 1 Reply Last reply 25 Aug 2017, 05:23
                    0
                    • S saitej
                      1 May 2016, 05:58

                      Hi
                      I am having few basic issues with this code. I am unable to display the marker on the map.
                      Also, where do I write the signal showRoute(startCoordinate,endCoordinate)
                      It's giving me already declared error

                      I am used to c++ and I just started to use qml. so the doubts will be pretty basic so please bear with me

                      import QtPositioning 5.5
                      import QtLocation 5.6
                      import QtQuick 2.6
                      import QtQuick.Window 2.2
                      import QtQuick.Controls 1.4
                      import QtQuick.Layouts 1.3
                      
                      Window {
                          visible: true
                          width: 400
                          height: 600
                      
                          MouseArea {
                              anchors.fill: parent
                              //        onClicked: {
                              //            Qt.quit();
                              //        }
                          }
                      
                          //    splitview
                      
                          SplitView {
                              anchors.fill: parent
                              orientation: Qt.Vertical
                              //rect1
                              Rectangle {
                                  height: 150
                                  Layout.maximumHeight:  200
                                  //               color: "lightblue"
                      
                                  Label {
                                      id: label1
                                      text: "Latitude Start"
                                      x:0
                                      y:2
                      
                                  }
                                  Label{
                                      id : label2
                                      text: "Longitude Start"
                                      x:0
                                      y:25
                                  }
                      
                                  Label {
                                      id: label3
                                      text: "Latitude End"
                                      x:0
                                      y:50
                      
                                  }
                                  Label{
                                      id : label4
                                      text: "Longitude End"
                                      x:0
                                      y:75
                                  }
                                  //            textinputs
                                  TextInput {
                                      //                anchors.fill:
                                      id: input1
                                      x:150
                                      y:2
                                      font.pixelSize: 12; font.bold: false
                                      cursorVisible: true
                                      text:  "12.9716"
                                      //                acceptableInput:
                                      validator : RegExpValidator { regExp : /[0-9]+\.[0-9]+/ }
                                      focus:true
                                  }
                                  TextInput {
                                      //                anchors.fill: contentItem
                                      id: input2
                                      x:150
                                      y:25
                                      font.pixelSize: 12; font.bold: false
                                      //                acceptableInput:
                                      validator : RegExpValidator { regExp : /[0-9]+\.[0-9]+/ }
                                      //                focus:true
                                      echoMode: TextInput.Normal
                                      activeFocusOnTab: true
                                      text: "77.5946"
                                  }
                      
                                  TextInput {
                                      //                anchors.fill: contentItem
                                      id: input3
                                      x:150
                                      y:50
                                      font.pixelSize: 12; font.bold: false
                                      //                acceptableInput:
                                      validator : RegExpValidator { regExp : /[0-9]+\.[0-9]+/ }
                                      //                focus:true
                                      echoMode: TextInput.Normal
                                      activeFocusOnTab: true
                                      text: "19.0760"
                      
                                  }
                      
                      
                                  TextInput {
                                      //                anchors.fill: contentItem
                                      id: input4
                                      x:150
                                      y:75
                                      font.pixelSize: 12; font.bold: false
                                      //                acceptableInput:
                                      validator : RegExpValidator { regExp : /[0-9]+\.[0-9]+/ }
                                      //                focus:true
                                      echoMode: TextInput.Normal
                                      activeFocusOnTab: true
                                      text: "72.8777"
                      
                                  }
                      
                                  Button{
                                      id:goButton
                                      text : "GO!"
                                      anchors.horizontalCenter: parent.horizontalCenter
                                      y: 100
                                      onClicked: {
                                          var startCoordinate = QtPositioning.coordinate(parseFloat(input1.text),
                                                                                         parseFloat(input2.text));
                                          var endCoordinate = QtPositioning.coordinate(parseFloat(input3.text),
                                                                                       parseFloat(input4.text));
                                          if (startCoordinate.isValid && endCoordinate.isValid) {
                      
                                              goButton.enabled = false;
                                              showRoute(startCoordinate,endCoordinate)
                                          }
                      
                                      }
                      
                                  }
                                  Plugin{
                                      id:myplugin
                                      name: "osm"
                                  }
                      
                      
                      
                      
                      
                              } //rectangle ends here
                      
                      
                      
                      
                              Map {
                                  id: map
                                  plugin: myplugin
                                  center {
                      
                                      //                latitude: 12.9716 //
                                      //                longitude: 77.5946 //
                                      latitude :input1.text
                                      longitude:input2.text
                      
                                  }
                                  zoomLevel: 13
                                  anchors.fill: contentItem
                                  gesture.enabled: true
                                  //            property variant location: QtPositioning.coordinate( input1.text, input2.text)
                                  MapItemView {
                                      model:PlaceSearchModel
                                      delegate: MapQuickItem {
                                          id : marker
                                          coordinate: QtPositioning.coordinate( input1.text, input2.text)
                      
                                          anchorPoint.x: image.width * 0.5
                                          anchorPoint.y: image.height
                                          sourceItem: Image {
                                              id: image
                                              source: "qrc:/marker.png"
                      
                                          }
                      
                                      }
                      
                                  }
                      
                              }
                      
                      
                          }
                      
                      
                      }
                      
                      
                      
                      
                      
                      bahman309B Offline
                      bahman309B Offline
                      bahman309
                      wrote on 25 Aug 2017, 05:23 last edited by
                      #13

                      @saitej
                      anybody can to used google map api in QML
                      and used navigation and traffic from google map api ?

                      1 Reply Last reply
                      0
                      • Z Offline
                        Z Offline
                        zhangsi
                        wrote on 30 Aug 2017, 03:04 last edited by
                        #14

                        QWebView::load

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved