با سلام و عرض ادب خدمت تمامي دوستان و مهندسان گرانقدر
لطفا اگر در صورت امكان بفرماييد كه چطوري ميتونم مختصاتي را كه از ديتا بيس ميگيريم رو در ماركر گوگل قرار دهم خيلي ممنون ميشم اين سورس برنامم
'Activity module
Sub Process_Globals
Dim GPS1 As GPS
Dim ht2 As HttpJob
End Sub
Sub Globals
Dim mFragment As MapFragment
Dim gmap As GoogleMap
Dim MapPanel As Panel
Dim LM As LocationManagerEx
Dim GpsEnable As Button
Dim PolygonDraw As Button
Dim label1 As Label
Dim parviz As Double
Dim a As Byte
Private Button1 As Button
End Sub
MapPanel.Initialize("")
Activity.AddView(MapPanel, 0, 0, 100%x, 90%y)
If mFragment.IsGooglePlayServicesAvailable = False Then
Dim a As Int = Msgbox2("گوگل پلی را نصب می کنید؟", "", "بله", "خیر", "", Null)
If a = DialogResponse.POSITIVE Then
Dim PI As PhoneIntents
StartActivity(PI.OpenBrowser("http://cafebazaar.ir/app/?id=com.google.android.gms"))
Else
ExitApplication
End If
Else
mFragment.Initialize("Map", MapPanel)
End If
LM.Initialize("LM")
GPS1.Initialize("GPS")
GpsEnable.Initialize("GpsEnable")
PolygonDraw.Initialize("PolygonDraw")
Activity.AddView(GpsEnable, 10%x, 2%y, 20%x, 10%y)
GpsEnable.Text = "GpsEnable"
Activity.AddView(PolygonDraw, 60%x, 2%y, 20%x, 10%y)
PolygonDraw.Text = "PolygonDraw"
End Sub
Sub Map_Ready
gmap = mFragment.GetMap
If gmap.IsInitialized = False Then
ToastMessageShow("Error initializing map", True)
Else
' gmap.AddMarker(39.054925, 46.2650,15)
'parviz=ht2.GetString
gmap.AddMarker(parviz,parviz,15)
gmap.AddMarker2(38.054920,46.2650, parviz, gmap.HUE_ROSE)
Dim cp As CameraPosition
cp.Initialize(38.054920, 46.2650, 15)
gmap.AnimateCamera(cp)
gmap.MapType = gmap.MAP_TYPE_NORMAL
gmap.MyLocationEnabled = True
Sub GpsEnable_Click
If GPS1.GPSEnabled = False Then
StartActivity(GPS1.LocationSettingsIntent)
Else
LM.requestGPSLocation
End If
End Sub
Sub b_Click
End Sub
Sub PolygonDraw_Click
Dim a(5) As LatLng
a(0).Initialize(35.69726412, 51.42567158)
a(1).Initialize(35.69541694, 51.42766714)
a(2).Initialize(35.69313405, 51.42786026)
a(3).Initialize(35.69121706, 51.42382622)
a(4).Initialize(35.69167017, 51.42987728)
Dim l As List
l.Initialize
For i = 0 To 3
l.Clear
l.Add(a(i))
l.Add(a(i+1))
Dim PL As PolygonOptions
PL.Initialize
PL.AddPoints(l)
PL.StrokeColor = Colors.Red
gmap.AddMarker(a(i).Latitude, a(i).Longitude, i)
Dim GME As GoogleMapsExtras
GME.AddPolygon(gmap, PL)
Next
End Sub
Sub LM_locationchanged(locArg As Location)
Dim cp As CameraPosition
cp.Initialize(locArg.Latitude, locArg.Longitude, 14)
gmap.AnimateCamera(cp)
LM.stopGPSListening
End Sub
Sub JobDone (job As HttpJob)
If job.Success=True Then
If job.JobName="read" Then
ProgressDialogHide
label1.Text=ht2.GetString
End If
Else
ToastMessageShow("خطا در برقرای اتصال",False)
End If
سوال
parviz 1
با سلام و عرض ادب خدمت تمامي دوستان و مهندسان گرانقدر
لطفا اگر در صورت امكان بفرماييد كه چطوري ميتونم مختصاتي را كه از ديتا بيس ميگيريم رو در ماركر گوگل قرار دهم خيلي ممنون ميشم اين سورس برنامم
'Activity module
Sub Process_Globals
Dim GPS1 As GPS
Dim ht2 As HttpJob
End Sub
Sub Globals
Dim mFragment As MapFragment
Dim gmap As GoogleMap
Dim MapPanel As Panel
Dim LM As LocationManagerEx
Dim GpsEnable As Button
Dim PolygonDraw As Button
Dim label1 As Label
Dim parviz As Double
Dim a As Byte
Private Button1 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
a=a+1
label1.Text=a
Activity.LoadLayout("test1")
ht2.Initialize("read",Me)
ht2.PostString("http://www.sim808.com/gps/readdata.php","")
MapPanel.Initialize("")
Activity.AddView(MapPanel, 0, 0, 100%x, 90%y)
If mFragment.IsGooglePlayServicesAvailable = False Then
Dim a As Int = Msgbox2("گوگل پلی را نصب می کنید؟", "", "بله", "خیر", "", Null)
If a = DialogResponse.POSITIVE Then
Dim PI As PhoneIntents
StartActivity(PI.OpenBrowser("http://cafebazaar.ir/app/?id=com.google.android.gms"))
Else
ExitApplication
End If
Else
mFragment.Initialize("Map", MapPanel)
End If
LM.Initialize("LM")
GPS1.Initialize("GPS")
GpsEnable.Initialize("GpsEnable")
PolygonDraw.Initialize("PolygonDraw")
Activity.AddView(GpsEnable, 10%x, 2%y, 20%x, 10%y)
GpsEnable.Text = "GpsEnable"
Activity.AddView(PolygonDraw, 60%x, 2%y, 20%x, 10%y)
PolygonDraw.Text = "PolygonDraw"
End Sub
Sub Map_Ready
gmap = mFragment.GetMap
If gmap.IsInitialized = False Then
ToastMessageShow("Error initializing map", True)
Else
' gmap.AddMarker(39.054925, 46.2650,15)
'parviz=ht2.GetString
gmap.AddMarker(parviz,parviz,15)
gmap.AddMarker2(38.054920,46.2650, parviz, gmap.HUE_ROSE)
Dim cp As CameraPosition
cp.Initialize(38.054920, 46.2650, 15)
gmap.AnimateCamera(cp)
gmap.MapType = gmap.MAP_TYPE_NORMAL
gmap.MyLocationEnabled = True
gmap.TrafficEnabled = True
gmap.GetUiSettings.AllGesturesEnabled = True
End If
End Sub
Sub GpsEnable_Click
If GPS1.GPSEnabled = False Then
StartActivity(GPS1.LocationSettingsIntent)
Else
LM.requestGPSLocation
End If
End Sub
Sub b_Click
End Sub
Sub PolygonDraw_Click
Dim a(5) As LatLng
a(0).Initialize(35.69726412, 51.42567158)
a(1).Initialize(35.69541694, 51.42766714)
a(2).Initialize(35.69313405, 51.42786026)
a(3).Initialize(35.69121706, 51.42382622)
a(4).Initialize(35.69167017, 51.42987728)
Dim l As List
l.Initialize
For i = 0 To 3
l.Clear
l.Add(a(i))
l.Add(a(i+1))
Dim PL As PolygonOptions
PL.Initialize
PL.AddPoints(l)
PL.StrokeColor = Colors.Red
gmap.AddMarker(a(i).Latitude, a(i).Longitude, i)
Dim GME As GoogleMapsExtras
GME.AddPolygon(gmap, PL)
Next
End Sub
Sub LM_locationchanged(locArg As Location)
Dim cp As CameraPosition
cp.Initialize(locArg.Latitude, locArg.Longitude, 14)
gmap.AnimateCamera(cp)
LM.stopGPSListening
End Sub
Sub JobDone (job As HttpJob)
If job.Success=True Then
If job.JobName="read" Then
ProgressDialogHide
label1.Text=ht2.GetString
End If
Else
ToastMessageShow("خطا در برقرای اتصال",False)
End If
End Sub
دريافت سورس
لینک ارسال
به اشتراک گذاری در سایت های دیگر
0 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.