Advertisement
Guest User

Untitled

a guest
Nov 12th, 2018
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 3.11 KB | None | 0 0
  1. import QtQuick 2.9
  2. import QtQuick.Controls 2.2
  3. import QtQuick.Window 2.0
  4. import QtLocation 5.6
  5. import QtPositioning 5.6
  6.  
  7.  
  8.  
  9. ApplicationWindow {
  10.  
  11.     id: app_window
  12.     visible: true
  13.     width: 1024
  14.     height: 800
  15.     title: qsTr("Navigation")
  16.  
  17.     Plugin {
  18.         id: mapPlugin
  19.         name: "osm"
  20. }
  21.  
  22.     Rectangle {
  23.         id: mapRectangleID
  24.         width: 500
  25.         height: 500
  26.         anchors.horizontalCenter: parent.horizontalCenter
  27.         anchors.verticalCenter: parent.verticalCenter
  28.         Map {
  29.             id: map
  30.             anchors.fill: parent
  31.             plugin: mapPlugin
  32.             center {
  33.                 latitude: 59.91//länge
  34.                 longitude: 10.75//breite
  35.             }
  36.             zoomLevel: 14
  37. //******************************START POINT******************************//
  38.                 MapCircle {
  39.                         id: startPointCircle
  40.                         center {
  41.                             latitude: 59.91
  42.                             longitude: 10.75
  43.                         }
  44.                         radius: 100000.0
  45.                         color: 'green'
  46.                         border.width: 3
  47.                     }
  48.     //******************************FINISH POINT******************************//
  49.                 MapCircle {
  50.                         id: endPointCircle
  51.                         center {
  52.                             latitude: 51.20
  53.                             longitude: 12.22
  54.                         }
  55.                         radius: 100000.0
  56.                         color: 'red'
  57.                         border.width: 3
  58.                     }
  59.         }// Map
  60.     } //Rectangle
  61. //******************************START POINT INPUT FIELD BREITE******************************//
  62.         Rectangle{
  63.  
  64.             id:_ifStartingPoint
  65.             width: 100
  66.             height: 20
  67.             border.color: 'gray'
  68.             border.width: 2
  69.             x: 900
  70.             y: 100
  71.  
  72.             anchors.left: app_window.right
  73.  
  74.             TextInput {
  75.                 id: txtPlainStartPointLatitude
  76.                 anchors.fill: parent
  77.                 anchors.margins: 4
  78.             }
  79.  
  80.         }
  81. //******************************END POINT INPUT FIELD LAENGE******************************//
  82.         Rectangle{
  83.  
  84.             id:_ifEndPoint
  85.             width: 100
  86.             height: 20
  87.             border.color: 'gray'
  88.             border.width: 2
  89.             x: 900
  90.             y: 150
  91.             anchors.left: app_window.right
  92.  
  93.             TextInput {
  94.                 id: txtPlainStartPointLongitude
  95.                 anchors.fill: parent
  96.                 anchors.margins: 4
  97.             }
  98.  
  99.         }
  100.  
  101.         Button {
  102.             text: "Zeige den weg"
  103.             x: 900;
  104.             y: 200
  105.             onClicked: {
  106.                // map.Longitude = txtPlainStartPointLatitude.Text
  107.                 center: QtPositioning.coordinate(latitude= txtPlainStartPointLatitude.Text, longitude= txtPlainStartPointLatitude.Text)
  108.             }
  109.         }
  110.  
  111.     PositionSource {
  112.     nmeaSource: "socket://127.0.0.1:12345"
  113.     }
  114.  
  115.  
  116. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement