地址地標轉換為經緯度(地理編碼)
阿新 • • 發佈:2018-12-21
MyTextField{//搜尋框 id:searchBox; width: 280; focus: true; Keys.enabled: true; placeholderText: "Please enter landmark"; //Keys.onReturnPressed: Rectangle{ anchors{ right: parent.right; top:parent.top; bottom: parent.bottom; margins:5; } width: 35; color: "transparent"; Image {//搜尋 anchors.centerIn: parent; width: 30; height: width; source:"../../Images/find.png"; visible: searchBox.text.length === 0; MouseArea{ anchors.fill: parent; onClicked: { searchBox.focus = true; } } } } Image {//清除 anchors{ right: parent.right; top:parent.top; bottom: parent.bottom; margins: 5; } width: 27; height: width; source: "../../Images/closeclear.png"; visible: parent.text.length !== 0; MouseArea{ anchors.fill:parent; onClicked: { searchBox.text = ""; coordinateShow.text = ""; } } } Keys.onReturnPressed: { geocodeAddress(searchBox.text); } } } Row{//label anchors.horizontalCenter: parent.horizontalCenter; MyText{text: "The latitude and longitude:";fontSize: s;fontColor: b1;} } Row{//經緯度顯示 anchors.horizontalCenter: parent.horizontalCenter; MyText{id:coordinateShow;text: "";} }