Hi, I don't know if this is interesting to you or if it's part of your plans...
In an app, I create many markers (hydrants), but to avoid overloading the map, depending on the zoom, I only make visible those within the visible map boundaries. For this, I need the Bounds function, and I also need the marker's visible property to not be read-only.
I'm not sure if I'm explaining myself correctly. I'll include an image and part of the code...
[CODE lang="b4x" title="Visible map boundaries..."]''' If GMap.IsReady = True Then
''' LatLngB = GMap.Bounds 'Visible region bounds
''' Log( "Norte " & LatLngB.NorthEast & " SUR " & LatLngB.SouthWest)
''' Dim DeltaX As Double = LatLngB.NorthEast.Lat - LatLngB.SouthWest.Lat
''' Dim DeltaY As Double = LatLngB.NorthEast.Longitude - LatLngB.SouthWest.Longitude
''' End If
'''
''' If newzoom <= 14 Then 'Con un zoom lejano, oculta todos los marcadores
''' Dim cursorHidra As ResultSet
'''' cursorHidra = SQL1.ExecQuery("SELECT rowid,idMarcador, identificador FROM markerHidra WHERE idMarcador <> 0")
'''' cursorHidra = SQL1.ExecQuery("SELECT rowid FROM hidrantes ")
''' cursorHidra = SQL1.ExecQuery("SELECT rowid FROM hidrantes")
''' Do While cursorHidra.NextRow
''' If MiHidrante(cursorHidra.GetString("rowid")).IsInitialized = True Then
''' MiHidrante(cursorHidra.GetString("rowid")).Visible = False
''' End If
''' Loop
''' cursorHidra.Close
''' End If
'''
'''
''' If newzoom > 14 Then
''' Dim cursorHidra As ResultSet
'''' (Y - " & LatLngB.SouthWest.Lat &") < "& DeltaX &" AND (X - "& LatLngB.SouthWest.Longitude &") <"& DeltaY &")"
'''' cursor = SQL1.ExecQuery("SELECT rowid,ID, X, Y, TIPO, POBLACION FROM hidrantes WHERE (Y - " & LatLngB.SouthWest.Lat &") < "& DeltaX &" AND (X - ("& LatLngB.SouthWest.Longitude &")) <"& DeltaY &"")
''' cursorHidra = SQL1.ExecQuery("SELECT rowid FROM hidrantes WHERE (Y - " & LatLngB.SouthWest.Latitude &") < "& DeltaX &" AND (X - ("& LatLngB.SouthWest.Longitude &")) <"& DeltaY)
'''
''' Do While cursorHidra.NextRow
''' If MiHidrante(cursorHidra.GetString("rowid")).IsInitialized = True Then
''' MiHidrante(cursorHidra.GetString("rowid")).Visible = True
''' End If
''' Loop
''' cursorHidra.Close
''' End If[/CODE]
Sorry, the markers are displayed too large...the image I'm using in this case is a 16x16 pixel PNG file. I've tried changing it to 8x8, but the result is the same...
View attachment 162633