Smobiler是一個在VS環境中使用.Net語言來開發APP的開發平台,也許比Xamarin更方便
我們要實現上圖中的效果,需要如下的操作:
VB: Dim Longitude As Decimal = 0 Dim Latitude As Decimal = 0 Dim addressInfo As String = "" Private Sub btnAddress_Click(sender As Object, e As EventArgs) Handles btnAddress.Click If Longitude <> 0 & Latitude <> 0 & addressInfo.Trim().Length > 0 Then Me.Gps1.GetEditGps(New GPSData(Longitude, Latitude, addressInfo)) Else Toast("定位失敗") End If End Sub
C#: private decimal Longitude = 0; private decimal Latitude = 0; private string addressInfo = ""; private void btnAddress_Click(object sender, EventArgs e) { if (Longitude != 0 & Latitude != 0 & addressInfo.Trim().Length > 0) { this.Gps1.GetEditGps(new GPSData(Longitude, Latitude, addressInfo)); } else { Toast("定位失敗"); } }
注:該界面除地點微調以外的其他事件代碼見MapView控件