mirror of
https://github.com/KeymonSoft/Guna_Preventa_BAT.git
synced 2026-04-19 13:49:18 +00:00
6.03.01
se agrega la parte de las encuestas y se corrige los indicadores
This commit is contained in:
@@ -115,6 +115,120 @@ Sub Activity_Create(FirstTime As Boolean)
|
||||
End Sub
|
||||
|
||||
Sub MapFragment1_Ready
|
||||
' Log("ENTRANDO MapFragment1_Ready")
|
||||
' gmap = MapFragment1.GetMap
|
||||
' gmap.IsInitialized
|
||||
' 'todos= 1
|
||||
' 'permisos
|
||||
'
|
||||
' rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
|
||||
' Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
|
||||
' gmap.MyLocationEnabled = Result
|
||||
'
|
||||
' Dim JavaMapsObject As JavaObject
|
||||
' JavaMapsObject = gmap.GetUiSettings
|
||||
' JavaMapsObject.RunMethod("setMapToolbarEnabled", Array As Object(True))
|
||||
' '''''''----------------------------MARKER AZUL - POR VISITAR
|
||||
' If azul = 1 Or todos = 1 Then
|
||||
' c.IsInitialized
|
||||
' c=skmt.ExecQuery("select CAT_CL_CODIGO,CAT_CL_NOMBRE,CAT_CL_LAT,CAT_CL_LONG from kmt_info3 where gestion = 0 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0 and CAT_CL_LAT <> ' ' and CAT_CL_LONG <> ' ' ")
|
||||
' skmt.Initialize(ruta,"kmt.db", True)
|
||||
' If c.RowCount > 0 Then
|
||||
' For i = 0 To c.RowCount - 1
|
||||
' c.Position = i
|
||||
'' Log(i&"|"&c.GetString("CAT_CL_LAT")&"|")
|
||||
' LatitudRu = 0
|
||||
' If c.GetString("CAT_CL_LAT") <> "" Then LatitudRu = c.GetString("CAT_CL_LAT")
|
||||
' LongitudRU = 0
|
||||
' If c.GetString("CAT_CL_LONG") <> "" Then LongitudRU = c.GetString("CAT_CL_LONG")
|
||||
' CODIGO=c.GetString("CAT_CL_CODIGO")
|
||||
' Tienda= c.GetString("CAT_CL_NOMBRE")
|
||||
' MARK_AZUL = gmap.AddMarker2(LatitudRu, LongitudRU, CODIGO, gmap.HUE_BLUE)
|
||||
' MARK_AZUL.Snippet = Tienda
|
||||
' Next
|
||||
' End If
|
||||
' c .Close
|
||||
'' Log("4")
|
||||
'
|
||||
' If MARK_AZUL.IsInitialized Then LIST_AZUL.Add(MARK_AZUL)
|
||||
' End If
|
||||
' '''''''----------------------------MARKER VERDE - VENTA
|
||||
' If verde =1 Or todos = 1 Then
|
||||
' c2.IsInitialized
|
||||
' c2=skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT from kmt_info3 where gestion = 2 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0")
|
||||
' For i = 0 To c2.RowCount -1
|
||||
' c2.Position = i
|
||||
' LongitudRU = c2.GetString("CAT_CL_LONG")
|
||||
' LatitudRu = c2.GetString("CAT_CL_LAT")
|
||||
' CODIGO=c2.GetString("CAT_CL_CODIGO")
|
||||
' Tienda= c2.GetString("CAT_CL_NOMBRE")
|
||||
' MARK_VERDE = gmap.AddMarker2(LatitudRu, LongitudRU, CODIGO, gmap.HUE_GREEN)
|
||||
' MARK_VERDE.Snippet = Tienda
|
||||
' Next
|
||||
' Else
|
||||
' If verde =1 Or todos = 1 Then
|
||||
' c2.IsInitialized
|
||||
' c2=skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT from kmt_info3 where gestion = 2 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0")
|
||||
' For i = 0 To c2.RowCount -1
|
||||
' c2.Position = i
|
||||
' LongitudRU = c2.GetString("CAT_CL_LONG")
|
||||
' LatitudRu = c2.GetString("CAT_CL_LAT")
|
||||
' CODIGO=c2.GetString("CAT_CL_CODIGO")
|
||||
' Tienda= c2.GetString("CAT_CL_NOMBRE")
|
||||
' MARK_VERDE = gmap.AddMarker2(LatitudRu, LongitudRU, CODIGO, gmap.HUE_GREEN)
|
||||
' MARK_VERDE.Snippet = Tienda
|
||||
' Next
|
||||
' c2 .Close
|
||||
' If MARK_VERDE.IsInitialized Then LIST_VERDE.Add(MARK_VERDE)
|
||||
' End If
|
||||
' End If
|
||||
'' '''''''----------------------------MARKER ROJO - NO VENTA
|
||||
'
|
||||
' If rojo =1 Or todos = 1 Then
|
||||
' c3.IsInitialized
|
||||
' c3=skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT from kmt_info3 where gestion = 3 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0")
|
||||
' For i = 0 To c3.RowCount -1
|
||||
' c3.Position = i
|
||||
' LongitudRU = c3.GetDouble("CAT_CL_LONG")
|
||||
' LatitudRu = c3.GetDouble("CAT_CL_LAT")
|
||||
' CODIGO=c3.GetString("CAT_CL_CODIGO")
|
||||
' Tienda= c3.GetString("CAT_CL_NOMBRE")
|
||||
' MARK_ROJO = gmap.AddMarker2(LatitudRu, LongitudRU, CODIGO, gmap.HUE_RED)
|
||||
' MARK_ROJO.Snippet = Tienda
|
||||
' Next
|
||||
' Else
|
||||
' If rojo =1 Or todos = 1 Then
|
||||
' c3.IsInitialized
|
||||
' c3=skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT from kmt_info3 where gestion = 3 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0")
|
||||
' For i = 0 To c3.RowCount -1
|
||||
' c3.Position = i
|
||||
' LongitudRU = c3.GetDouble("CAT_CL_LONG")
|
||||
' LatitudRu = c3.GetDouble("CAT_CL_LAT")
|
||||
' CODIGO=c3.GetString("CAT_CL_CODIGO")
|
||||
' Tienda= c3.GetString("CAT_CL_NOMBRE")
|
||||
' MARK_ROJO = gmap.AddMarker2(LatitudRu, LongitudRU, CODIGO, gmap.HUE_RED)
|
||||
' MARK_ROJO.Snippet = Tienda
|
||||
' Next
|
||||
' If MARK_ROJO.IsInitialized Then LIST_ROJO.Add(MARK_ROJO)
|
||||
' c3.Close
|
||||
' End If
|
||||
' End If
|
||||
' ''------------------------------
|
||||
'
|
||||
'' MARK_CEDIS = gmap.AddMarker3("19.3961802","-99.0784293","CEDIS", LoadBitmap(File.DirAssets, "marker-azul-0.png"))
|
||||
'' If MARK_VERDE.Visible Or MARK_ROJO.Visible Then
|
||||
'' MARK_CEDIS.Remove
|
||||
'' End If
|
||||
' Dim aa As CameraPosition
|
||||
' aa.Initialize(LatitudRu,LongitudRU,15)''' RECOMENDABLE CAMBIAR A 10 PARA QUE SE VEAN MAS MARCADORES
|
||||
' gmap.AnimateCamera(aa)
|
||||
'
|
||||
' '''''---------------------- ESTO ES PARA LOS CLICK EN LAS VENTANAS D INFORMACION-----------
|
||||
' Dim OnInfoWindowClickListener1 As OnInfoWindowClickListener
|
||||
' OnInfoWindowClickListener1.Initialize("OnInfoWindowClickListener1")
|
||||
' GoogleMapEXTRA.SetOnInfoWindowClickListener(gmap, OnInfoWindowClickListener1)
|
||||
|
||||
|
||||
Log("ENTRANDO MapFragment1_Ready")
|
||||
gmap = MapFragment1.GetMap
|
||||
gmap.IsInitialized
|
||||
@@ -124,18 +238,20 @@ Sub MapFragment1_Ready
|
||||
rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
|
||||
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
|
||||
gmap.MyLocationEnabled = Result
|
||||
|
||||
|
||||
Dim JavaMapsObject As JavaObject
|
||||
JavaMapsObject = gmap.GetUiSettings
|
||||
JavaMapsObject.RunMethod("setMapToolbarEnabled", Array As Object(True))
|
||||
'''''''----------------------------MARKER AZUL - POR VISITAR
|
||||
If azul = 1 Or todos = 1 Then
|
||||
If azul = 1 Or todos = 1 Then
|
||||
c.IsInitialized
|
||||
c=skmt.ExecQuery("select CAT_CL_CODIGO,CAT_CL_NOMBRE,CAT_CL_LAT,CAT_CL_LONG from kmt_info3 where gestion = 0 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0 and CAT_CL_LAT <> ' ' and CAT_CL_LONG <> ' ' ")
|
||||
skmt.Initialize(ruta,"kmt.db", True)
|
||||
c=skmt.ExecQuery("select CAT_CL_CODIGO,CAT_CL_NOMBRE,CAT_CL_LAT,CAT_CL_LONG,CAT_CL_ORDENVISITA from kmt_info3 where gestion = 0 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0 and CAT_CL_LAT <> ' ' and CAT_CL_LONG <> ' ' ")
|
||||
' skmt.Initialize(ruta,"kmt.db", True)
|
||||
Log($"============== Resultados = ${c.RowCount}"$)
|
||||
If c.RowCount > 0 Then
|
||||
For i = 0 To c.RowCount - 1
|
||||
c.Position = i
|
||||
' Log($"|${c.GetString("CAT_CL_LONG")}|${c.GetString("CAT_CL_LAT")}|"$)
|
||||
' Log(i&"|"&c.GetString("CAT_CL_LAT")&"|")
|
||||
LatitudRu = 0
|
||||
If c.GetString("CAT_CL_LAT") <> "" Then LatitudRu = c.GetString("CAT_CL_LAT")
|
||||
@@ -143,75 +259,90 @@ Sub MapFragment1_Ready
|
||||
If c.GetString("CAT_CL_LONG") <> "" Then LongitudRU = c.GetString("CAT_CL_LONG")
|
||||
CODIGO=c.GetString("CAT_CL_CODIGO")
|
||||
Tienda= c.GetString("CAT_CL_NOMBRE")
|
||||
MARK_AZUL = gmap.AddMarker2(LatitudRu, LongitudRU, CODIGO, gmap.HUE_BLUE)
|
||||
NumSerie=c.GetInt("CAT_CL_ORDENVISITA")
|
||||
' MARK_AZUL = gmap.AddMarker3(LatitudRu,LongitudRU,CODIGO, LoadBitmap(File.DirAssets, "marker-azul-" & NumSerie &".png"))
|
||||
MARK_AZUL = gmap.AddMarker3(LatitudRu,LongitudRU,CODIGO, Subs.CreateBitmapWithNumber(LoadBitmap(File.DirAssets, "marker-azul.png"), NumSerie))
|
||||
MARK_AZUL.Snippet = Tienda
|
||||
Next
|
||||
End If
|
||||
c .Close
|
||||
' Log("4")
|
||||
|
||||
If MARK_AZUL.IsInitialized Then LIST_AZUL.Add(MARK_AZUL)
|
||||
End If
|
||||
'''''''----------------------------MARKER VERDE - VENTA
|
||||
If verde =1 Or todos = 1 Then
|
||||
If verde = 1 Or todos = 1 Then
|
||||
c2.IsInitialized
|
||||
c2=skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT from kmt_info3 where gestion = 2 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0")
|
||||
c2=skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT,CAT_CL_ORDENVISITA from kmt_info3 where gestion = 2 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0")
|
||||
Log($"============== Resultados = ${c2.RowCount}"$)
|
||||
For i = 0 To c2.RowCount -1
|
||||
c2.Position = i
|
||||
LongitudRU = c2.GetString("CAT_CL_LONG")
|
||||
LatitudRu = c2.GetString("CAT_CL_LAT")
|
||||
CODIGO=c2.GetString("CAT_CL_CODIGO")
|
||||
Tienda= c2.GetString("CAT_CL_NOMBRE")
|
||||
MARK_VERDE = gmap.AddMarker2(LatitudRu, LongitudRU, CODIGO, gmap.HUE_GREEN)
|
||||
MARK_VERDE.Snippet = Tienda
|
||||
Next
|
||||
Else
|
||||
If verde =1 Or todos = 1 Then
|
||||
c2.IsInitialized
|
||||
c2=skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT from kmt_info3 where gestion = 2 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0")
|
||||
For i = 0 To c2.RowCount -1
|
||||
c2.Position = i
|
||||
' Log($"|${c2.GetString("CAT_CL_LONG")}|${c2.GetString("CAT_CL_LAT")}|"$)
|
||||
If IsNumber(c2.GetString("CAT_CL_LONG")) Then
|
||||
LongitudRU = c2.GetString("CAT_CL_LONG")
|
||||
LatitudRu = c2.GetString("CAT_CL_LAT")
|
||||
CODIGO=c2.GetString("CAT_CL_CODIGO")
|
||||
Tienda= c2.GetString("CAT_CL_NOMBRE")
|
||||
MARK_VERDE = gmap.AddMarker2(LatitudRu, LongitudRU, CODIGO, gmap.HUE_GREEN)
|
||||
NumSerie=c2.GetInt("CAT_CL_ORDENVISITA")
|
||||
' MARK_VERDE = gmap.AddMarker3(LatitudRu,LongitudRU,CODIGO,LoadBitmap(File.DirAssets, "marker-verde-"&NumSerie&".png"))
|
||||
MARK_VERDE = gmap.AddMarker3(LatitudRu,LongitudRU,CODIGO, Subs.CreateBitmapWithNumber(LoadBitmap(File.DirAssets, "marker-verde.png"), NumSerie))
|
||||
MARK_VERDE.Snippet = Tienda
|
||||
Next
|
||||
c2 .Close
|
||||
If MARK_VERDE.IsInitialized Then LIST_VERDE.Add(MARK_VERDE)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
' Else
|
||||
' If verde = 1 Or todos = 1 Then
|
||||
' c2.IsInitialized
|
||||
' c2=skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT from kmt_info where gestion = 2 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0")
|
||||
' Log($"============== Resultados = ${c2.RowCount}"$)
|
||||
' For i = 0 To c2.RowCount -1
|
||||
' c2.Position = i
|
||||
'' Log($"|${c2.GetString("CAT_CL_LONG")}|${c2.GetString("CAT_CL_LAT")}|"$)
|
||||
' LongitudRU = c2.GetString("CAT_CL_LONG")
|
||||
' LatitudRu = c2.GetString("CAT_CL_LAT")
|
||||
' CODIGO=c2.GetString("CAT_CL_CODIGO")
|
||||
' Tienda= c2.GetString("CAT_CL_NOMBRE")
|
||||
' MARK_VERDE = gmap.AddMarker2(LatitudRu,LongitudRU,CODIGO,gmap.HUE_GREEN)
|
||||
' MARK_VERDE.Snippet = Tienda
|
||||
' Next
|
||||
' c2 .Close
|
||||
' If MARK_VERDE.IsInitialized Then LIST_VERDE.Add(MARK_VERDE)
|
||||
' End If
|
||||
End If
|
||||
' '''''''----------------------------MARKER ROJO - NO VENTA
|
||||
|
||||
If rojo =1 Or todos = 1 Then
|
||||
If rojo = 1 Or todos = 1 Then
|
||||
c3.IsInitialized
|
||||
c3=skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT from kmt_info3 where gestion = 3 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0")
|
||||
c3=skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT,CAT_CL_ORDENVISITA from kmt_info3 where gestion = 3 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0")
|
||||
Log($"============== Resultados = ${c3.RowCount}"$)
|
||||
For i = 0 To c3.RowCount -1
|
||||
c3.Position = i
|
||||
' Log($"|${c3.GetString("CAT_CL_LONG")}|${c3.GetString("CAT_CL_LAT")}|"$)
|
||||
LongitudRU = c3.GetDouble("CAT_CL_LONG")
|
||||
LatitudRu = c3.GetDouble("CAT_CL_LAT")
|
||||
CODIGO=c3.GetString("CAT_CL_CODIGO")
|
||||
Tienda= c3.GetString("CAT_CL_NOMBRE")
|
||||
MARK_ROJO = gmap.AddMarker2(LatitudRu, LongitudRU, CODIGO, gmap.HUE_RED)
|
||||
NumSerie=c3.GetInt("CAT_CL_ORDENVISITA")
|
||||
' MARK_ROJO = gmap.AddMarker3(LatitudRu,LongitudRU,CODIGO,LoadBitmap(File.DirAssets, "marker-rojo-"&NumSerie&".png"))
|
||||
MARK_ROJO = gmap.AddMarker3(LatitudRu,LongitudRU,CODIGO, Subs.CreateBitmapWithNumber(LoadBitmap(File.DirAssets, "marker-rojo.png"), NumSerie))
|
||||
MARK_ROJO.Snippet = Tienda
|
||||
Next
|
||||
Else
|
||||
If rojo =1 Or todos = 1 Then
|
||||
c3.IsInitialized
|
||||
c3=skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT from kmt_info3 where gestion = 3 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0")
|
||||
For i = 0 To c3.RowCount -1
|
||||
c3.Position = i
|
||||
LongitudRU = c3.GetDouble("CAT_CL_LONG")
|
||||
LatitudRu = c3.GetDouble("CAT_CL_LAT")
|
||||
CODIGO=c3.GetString("CAT_CL_CODIGO")
|
||||
Tienda= c3.GetString("CAT_CL_NOMBRE")
|
||||
MARK_ROJO = gmap.AddMarker2(LatitudRu, LongitudRU, CODIGO, gmap.HUE_RED)
|
||||
MARK_ROJO.Snippet = Tienda
|
||||
Next
|
||||
If MARK_ROJO.IsInitialized Then LIST_ROJO.Add(MARK_ROJO)
|
||||
c3.Close
|
||||
End If
|
||||
' Else
|
||||
' If rojo = 1 Or todos = 1 Then
|
||||
' c3.IsInitialized
|
||||
' c3=skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT from kmt_info where gestion = 3 and CAT_CL_LAT is not null and CAT_CL_LONG is not null and CAT_CL_LAT <> 0 and CAT_CL_LONG <> 0")
|
||||
' Log($"============== Resultados = ${c3.RowCount}"$)
|
||||
' For i = 0 To c3.RowCount -1
|
||||
' c3.Position = i
|
||||
'' Log($"|${c3.GetString("CAT_CL_LONG")}|${c3.GetString("CAT_CL_LAT")}|"$)
|
||||
' LongitudRU = c3.GetDouble("CAT_CL_LONG")
|
||||
' LatitudRu = c3.GetDouble("CAT_CL_LAT")
|
||||
' CODIGO=c3.GetString("CAT_CL_CODIGO")
|
||||
' Tienda= c3.GetString("CAT_CL_NOMBRE")
|
||||
' MARK_ROJO = gmap.AddMarker2(LatitudRu,LongitudRU,Tienda, gmap.HUE_RED)
|
||||
' MARK_ROJO.Snippet = Tienda
|
||||
' Next
|
||||
' If MARK_ROJO.IsInitialized Then LIST_ROJO.Add(MARK_ROJO)
|
||||
' c3.Close
|
||||
' End If
|
||||
End If
|
||||
''------------------------------
|
||||
|
||||
@@ -228,6 +359,7 @@ Sub MapFragment1_Ready
|
||||
OnInfoWindowClickListener1.Initialize("OnInfoWindowClickListener1")
|
||||
GoogleMapEXTRA.SetOnInfoWindowClickListener(gmap, OnInfoWindowClickListener1)
|
||||
|
||||
|
||||
End Sub
|
||||
'
|
||||
''''-------------------------- PRUEBA CON MARKER _CLICK
|
||||
|
||||
Reference in New Issue
Block a user