Ralph Parkhurst

Member
Licensed User
Longtime User
The demo has started to work again, but with only some of the tiles partially appearing...

Screenshot 2025-03-15 122323.png

I am starting to think it might be a server issue. I will try again later...
 

aminoacid

Active Member
Licensed User
Longtime User

Yes. Now I remember having a similar issue a while ago using Leaflet with OSM in a JavaScript webapp. Unfortunately I don't remember how I resolved it - but I do remember that it was very easy to do.
 

aminoacid

Active Member
Licensed User
Longtime User
Once thing I really like about OpenMaps as compared to GoogleMaps is that the Gulf of Mexico is still the Gulf of Mexico (although they did fold a bit and put Gulf of America in parens below it)

Sorry, but I just had to point that out!!
 

aminoacid

Active Member
Licensed User
Longtime User
I'm pretty sure it can be set in Leaflet. So maybe @Star-Dust could consider including that in a future version.
The great news is that maps are working again here - must have simply been a tile server issue somewhere

Yes... I'm looking for an old project where we did just that. If I manage to find it, I'll post it here. But it will probably have to be included in the library.
 

Star-Dust

Expert
Licensed User
Longtime User
Good morning,

Please don't crowd the thread otherwise I can't distinguish useful things for development. I go into translation and sometimes I take a long time to understand what it is written, it would be useful to me if you write in the need.

When the map does not appear it could be OpenMaps that blocks the IP.
If by clicking on this link the image does not appear then you have a problem with the Internet, the site is not reachable. If the image appears then OpenMaps has limited the IP, change IP or use a proxy and you will see everything again as before.


 

Ralph Parkhurst

Member
Licensed User
Longtime User
Good morning - I see an image of a Blue square. Should I change IP address?
I will be sure not to crowd the thread.
 

Star-Dust

Expert
Licensed User
Longtime User

To replace AsPane, in any case openamaps must be inserted in a layout, it could be in the main. And then you use this code to release it from Main and hook it in any panel
B4X:
GMap.mBase.RemoveViewFromParent
Form1.RootPane.AddNode(GMap.mBase,10,10,100,100)


If you don't want to insert it in the main. Create a layout, call it 'Openampas' and put the view anchored to the corners
Then with this code you will get the base to add to your panel.
B4X:
Private Sub AsPane As B4XView
    Dim Pn As B4XView
    Pn.LoadLayout("openampas")
    Return Pn.GetView(0)
End Sub
'---- CODE ---
    Form1.RootPane.AddNode(AsPane,10,10,100,100)
 

Ralph Parkhurst

Member
Licensed User
Longtime User
I still cannot get a map to display anymore. As this is a problem that only I am having, so I'm go to abandon it for now. As @Star-Dust correctly points out, it is not relevant to others here.
UPDATE: This was automatically resolved after 24 hours had elapsed. I guess I was 'blocked' for hammering the tile server too hard during my extensive testing.
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
osm if it receives too many requests at the same time to avoid overcrowding it blocks the requests. next week i will see if using different maps is better
 

javiers

Active Member
Licensed User
Longtime User
Something similar is happening to me today. This morning no problems, now: sometimes the program crashes, other times the map is blank.
 

Star-Dust

Expert
Licensed User
Longtime User
I did not understand point 3
 

Ralph Parkhurst

Member
Licensed User
Longtime User
I did not understand point 3
Here's an example to help explain it better:
If you zoom all the way out, you see many views of the world.
Scroll left (or right) a lot, then zoom back in.
The Gmap_MouseMove event now reports incorrect longitude values.
 

Star-Dust

Expert
Licensed User
Longtime User
  • Upate release 1.06
    • Added method: RedrawAllObj, ClearMap, EditingCircle, updateCircleRadius
    • Added new TypeMap: MAP_TYPE_ESI, MAP_TYPE_CARTO - As an alternative to OSM tiles if they don't appear
    • Update example
 

Star-Dust

Expert
Licensed User
Longtime User
Version 1.07 that will be released in the next few days will no longer beta but will be the first full version.

I thank everyone who has donated. Those who have donated more than €30 will receive a copy of the sources of version 1.07
 

javiers

Active Member
Licensed User
Longtime User
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...

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

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...

 
Last edited:

aminoacid

Active Member
Licensed User
Longtime User
Would love to see the capability to add a label to a marker by implementing SetMarkerLabel, RemoveMarkerLabel, GetMarkerLabel in OpenMapsExt

In leaflet you could use L.tooltip to create a standalone label instead of binding it to a marker. That would be the same as adding a label to a marker that is always visible:

B4X:
var tooltip = L.tooltip()
    .setLatLng(latlng)
    .setContent('A sweet static label!')
    .addTo(map);


 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
  • Release 1.07
    • Added method: LoadKML, SaveKML
    • Removed Hyperlinks, Preserved Maps Elements after change Map_Type
    • Fix bugs
    • The algorithm reconstructed for the modification of the polygons, polylines and rims
    • Update OpenMaps Demo
 

javiers

Active Member
Licensed User
Longtime User
Hi, I can't remove some markers from the map. For example, I create them like this...


Create markers...:
Sub CargaHidrantes
    Private MiHidrante(10)  As Marker
    
    MiHidrante(0) = OMaps.AddMarker2(pt(48.8575703, 2.292737).lat, pt(48.8575703, 2.292737).lng, "Hidrante" , File.GetUri(File.DirAssets,"H.png"))
    MiHidrante(1) = OMaps.AddMarker2(pt(48.8561703, 2.293637).lat, pt(48.8561703, 2.293637).lng, "Hidrante" , File.GetUri(File.DirAssets,"H.png"))
    MiHidrante(3) = OMaps.AddMarker2(pt(48.8561703, 2.291837).lat,pt(48.8561703, 2.291837).lng, "Hidrante" , File.GetUri(File.DirAssets,"H.png"))


End Sub

When I change the camera position and the zoom is less than 14, I use the following code to delete them... but it doesn't!

B4X:
Private Sub OMaps_CameraChange (CamPosition As CameraPosition)
    LabelLat.Text=CamPosition.lat
    LabelLon.Text=CamPosition.lNG
    LabelZoom.Text=CamPosition.Zoom
    
    If OMaps.Zoom < 14 Then
        For i=0 To 3

            If MiHidrante(i).IsInitialized = True Then
                Log(i)
                OMaps.RemoveMarker(MiHidrante(i))
            End If
        Next
    End If
End Sub
 

Attachments

  • demo.jpg
    251.2 KB · Views: 8

Star-Dust

Expert
Licensed User
Longtime User
Yes it is a bug, known.

When you insert the Markers you must put a pause of at least 20 milliseconds between one and the other especially when it is inside a cycle so that in its internal table all the marks are inserted correctly. subsequently the deletion will happen as expected.

The bug will be solved in the next versions