mirror of
https://github.com/KeymonSoft/ADM.git
synced 2026-04-17 19:36:18 +00:00
- VERSION 5.08.31
- Se modificó el codigo de MAPA_RUTAS para que muestre bien los marcadores
This commit is contained in:
@@ -208,7 +208,7 @@ Sub MapFragment1_Ready
|
||||
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
|
||||
@@ -219,7 +219,7 @@ Sub MapFragment1_Ready
|
||||
'''''''----------------------------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_info 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 <> ' ' and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1")
|
||||
c=skmt.ExecQuery("select CAT_CL_CODIGO, CAT_CL_NOMBRE, CAT_CL_LAT, CAT_CL_LONG from kmt_info 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 <> ' ' and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1")
|
||||
' skmt.Initialize(ruta,"kmt.db", True)
|
||||
Log($"============== Resultados = ${c.RowCount}"$)
|
||||
If c.RowCount > 0 Then
|
||||
@@ -227,88 +227,119 @@ Sub MapFragment1_Ready
|
||||
c.Position = i
|
||||
' Log($"|${c.GetString("CAT_CL_LONG")}|${c.GetString("CAT_CL_LAT")}|"$)
|
||||
' Log(i&"|"&c.GetString("CAT_CL_LAT")&"|")
|
||||
LatitudRu = 0
|
||||
Log(c.GetString("CAT_CL_CODIGO")&" "& c.GetString("CAT_CL_LAT"))
|
||||
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
|
||||
' LatitudRu = 0
|
||||
If c.GetString("CAT_CL_LAT") = Null Or c.GetString("CAT_CL_LAT") = "null" Or c.GetString("CAT_CL_LAT") = "NULL" _
|
||||
Or c.GetString("CAT_CL_LONG") = Null Or c.GetString("CAT_CL_LONG") = "null" Or c.GetString("CAT_CL_LONG") = "NULL" _
|
||||
Then
|
||||
ToastMessageShow($"Tienda con coordenadas incorrectas (${c.GetString("CAT_CL_CODIGO")})"$, False)
|
||||
Else
|
||||
Log(c.GetString("CAT_CL_CODIGO")&" "& c.GetString("CAT_CL_LAT")&", "&c.GetString("CAT_CL_LAT"))
|
||||
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
|
||||
Log(LatitudRu & "," & LongitudRU)
|
||||
End If
|
||||
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_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 and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1 UNION select CAT_CL_CODIGO, CAT_CL_NOMBRE,CAT_CL_LONG,CAT_CL_LAT from kmt_info2 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 and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1")
|
||||
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 and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1 UNION select CAT_CL_CODIGO, CAT_CL_NOMBRE, CAT_CL_LONG, CAT_CL_LAT from kmt_info2 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 and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1")
|
||||
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")}|"$)
|
||||
If IsNumber(c2.GetString("CAT_CL_LONG")) Then
|
||||
If c2.GetString("CAT_CL_LAT") = Null Or c2.GetString("CAT_CL_LAT") = "null" Or c2.GetString("CAT_CL_LAT") = "NULL" _
|
||||
Or c2.GetString("CAT_CL_LONG") = Null Or c2.GetString("CAT_CL_LONG") = "null" Or c2.GetString("CAT_CL_LONG") = "NULL" _
|
||||
Then
|
||||
ToastMessageShow($"Tienda con coordenadas incorrectas (${c.GetString("CAT_CL_CODIGO")})"$, False)
|
||||
Else
|
||||
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
|
||||
Log(LatitudRu & "," & LongitudRU)
|
||||
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 and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1")
|
||||
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 and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1")
|
||||
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
|
||||
If c2.GetString("CAT_CL_LAT") = Null Or c2.GetString("CAT_CL_LAT") = "null" Or c2.GetString("CAT_CL_LAT") = "NULL" _
|
||||
Or c2.GetString("CAT_CL_LONG") = Null Or c2.GetString("CAT_CL_LONG") = "null" Or c2.GetString("CAT_CL_LONG") = "NULL" _
|
||||
Then
|
||||
ToastMessageShow($"Tienda con coordenadas incorrectas (${c.GetString("CAT_CL_CODIGO")})"$, False)
|
||||
Else
|
||||
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
|
||||
Log(LatitudRu & "," & LongitudRU)
|
||||
End If
|
||||
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_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 and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1")
|
||||
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 and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1")
|
||||
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)
|
||||
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_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 and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1")
|
||||
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")}|"$)
|
||||
If c3.GetString("CAT_CL_LAT") = Null Or c3.GetString("CAT_CL_LAT") = "null" Or c3.GetString("CAT_CL_LAT") = "NULL" _
|
||||
Or c3.GetString("CAT_CL_LONG") = Null Or c3.GetString("CAT_CL_LONG") = "null" Or c3.GetString("CAT_CL_LONG") = "NULL" _
|
||||
Then
|
||||
ToastMessageShow($"Tienda con coordenadas incorrectas (${c.GetString("CAT_CL_CODIGO")})"$, False)
|
||||
Else
|
||||
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
|
||||
Log(LatitudRu & "," & LongitudRU)
|
||||
End If
|
||||
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_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 and CAT_CL_CODIGO <> 0 and CAT_CL_CODIGO <> 1")
|
||||
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")}|"$)
|
||||
If c3.GetString("CAT_CL_LAT") = Null Or c3.GetString("CAT_CL_LAT") = "null" Or c3.GetString("CAT_CL_LAT") = "NULL" _
|
||||
Or c3.GetString("CAT_CL_LONG") = Null Or c3.GetString("CAT_CL_LONG") = "null" Or c3.GetString("CAT_CL_LONG") = "NULL" _
|
||||
Then
|
||||
ToastMessageShow($"Tienda con coordenadas incorrectas (${c.GetString("CAT_CL_CODIGO")})"$, False)
|
||||
Else
|
||||
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)
|
||||
Log(LatitudRu & "," & LongitudRU)
|
||||
MARK_ROJO.Snippet = Tienda
|
||||
End If
|
||||
Next
|
||||
If MARK_ROJO.IsInitialized Then LIST_ROJO.Add(MARK_ROJO)
|
||||
c3.Close
|
||||
@@ -320,7 +351,7 @@ Sub MapFragment1_Ready
|
||||
' If MARK_VERDE.Visible Or MARK_ROJO.Visible Then
|
||||
' MARK_CEDIS.Remove
|
||||
' End If
|
||||
' Log("Centramos camara " & LatitudRu & ", " & LongitudRU)
|
||||
Log("Centramos camara " & LatitudRu & ", " & LongitudRU)
|
||||
Dim aa As CameraPosition
|
||||
aa.Initialize(LatitudRu, LongitudRU, 15) ''' RECOMENDABLE CAMBIAR A 10 PARA QUE SE VEAN MAS MARCADORES
|
||||
gmap.AnimateCamera(aa)
|
||||
|
||||
Reference in New Issue
Block a user