As many currently know Googlemaps' Webapi do not work correctly on the webview because the latest versions use webgl

I decided to do a new library that uses OpenMap and Leaflet with the same methods and events of the Googlemaps bookshop. I also created a second OpenMapext class that adds some Googlemapsext commands to maintain compatibility and minimize changes to the existing code. The code we used with GMAPS with Javaobject to obtain extra functions is no longer usable. Tested with Java 19,

jSD_OpenMaps

Author:
Star-Dust
Version: 1.09
  • CameraPosition
    • Functions:
      • Class_Globals As String
      • Initialize (Lat As Double, Lng As Double, Zoom As Float) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • Target As String
      • ToString As String
    • Properties:
      • Lat As Double [read only]
      • Lng As Double [read only]
      • Zoom As Float [read only]
  • LatLng
    • Fields:
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • Latitude As Double
      • Longitude As Double
    • Functions:
      • Initialize
        Inizializza i campi al loro valore predefinito.
  • MapCircle
    • Functions:
      • Class_Globals As String
      • Initialize (vCenter As LatLng, vRadius As Double, Visble As Boolean, id As String, WebView As JavaObject) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
    • Properties:
      • Center As LatLng [read only]
      • ID As String [read only]
      • Radius As Double [read only]
      • Visible As Boolean
  • MapInfoWindow
    • Functions:
      • Class_Globals As String
      • Initialize (vContent As String, vPosition As LatLng, ID As String) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
    • Properties:
      • Content As String [read only]
      • ID As String [read only]
      • Position As LatLng [read only]
  • MapLabel
    • Functions:
      • Class_Globals As String
      • Initialize (vPosition As LatLng, vText As String, vPermanent As Boolean, vID As String, WebView As JavaObject) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
    • Properties:
      • ID As String [read only]
      • Permanent As Boolean [read only]
      • Position As LatLng [read only]
      • Text As String
  • MapPolygon
    • Functions:
      • Class_Globals As String
      • Initialize (Visble As Boolean, ID As String, Point As List, WebView As JavaObject) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
    • Properties:
      • FillColor As Paint [read only]
      • ID As String [read only]
      • LineColor As Paint [read only]
      • LineWidth As Int [read only]
      • Points As List [read only]
        List of LatLng
      • Visible As Boolean
  • MapPolyline
    • Functions:
      • Class_Globals As String
      • Initialize (Visble As Boolean, ID As String, Point As List, WebView As JavaObject) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
    • Properties:
      • ID As String [read only]
      • LineColor As Paint [read only]
      • LineWidth As Int [read only]
      • Points As List [read only]
        List of LatLng
      • Visible As Boolean
  • Marker
    • Functions:
      • Class_Globals As String
      • CreateLabel (Text As String) As String
        Create Label on Marker
      • Initialize (vPosition As LatLng, vTitle As String, vIconUri As String, vVisible As Boolean, vID As String, WebView As JavaObject) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • UpdateLabel (Text As String) As String
        Set Text empty for remove
    • Properties:
      • Draggable
      • IconUri As String [read only]
      • IconUrl As String [read only]
      • ID As String [read only]
      • Position As LatLng [read only]
      • Title As String [read only]
      • Visible As Boolean
  • OpenMaps
    • Events:
      • CameraChange (CamPosition As CameraPosition)
      • CircleClick (SelectedCircle As MapCircle)
      • Click (Point As LatLng)
      • MarkerClick (SelectedMarker As Marker)
      • MouseMove (Point As LatLng)
      • PolygonClick (SelectedPolygon As MapPolygon)
      • PolylineClick (SelectedPolyline As MapPolyline)
      • Ready
      • RightClick (Point As LatLng)
    • Fields:
      • MAP_TYPE_CARTO As Int
      • MAP_TYPE_ESI As Int
      • MAP_TYPE_HYBRID As Int
      • MAP_TYPE_NORMAL As Int
      • MAP_TYPE_SATELLITE As Int
      • MAP_TYPE_TERRAIN As Int
      • mBase As B4XView
      • Tag As Object
    • Functions:
      • AddCircle (ll As LatLng, Radius As Double, StrokeWidth As Float, StrokeColor As Paint, FillColor As Paint, Opacity As Double) As MapCircle
        Adds a circle To the map.
        Center - Position of the circle center.
        Radius - Circle radius.
        StrokeWidth - Stroke width.
        StrokeColor - Stroke color.
        FillColor - Inner color.
        Opacity - Inner color opacity. Value between 0 To 1.
      • AddInfoWindow (Content As String, Position As LatLng) As MapInfoWindow
        Opens an info window with the given HTML content at the specified position.
      • AddInfoWindow2 (Content As String, Position As LatLng, MaxWidth As Int) As MapInfoWindow
        Opens an info window with the given HTML content at the specified position. It cannot be larger than MaxWidth (in pixels).
      • AddMarker (Lat As Double, Lng As Double, Title As String) As Marker
        Adds a marker to the map.
      • AddMarker2 (Lat As Double, Lng As Double, Title As String, IconUri As String) As Marker
        Adds a marker To the map with a custom icon.
        The IconUri must point To an online image Or an image from the assets folder.
        In the later Case the custom icon will only appear in Release mode.
        Example:
        <code>gmap.AddMarker2(10, 10, "This is a test", _
        File.GetUri(File.DirAssets, "SomeIcon.png"))</code>
      • AddPolygon (Points As List, StrokeWidth As Float, StrokeColor As Paint, FillColor As Paint, Opacity As Double) As MapPolygon
        Adds a polygon To the map.
        Points - A list Or Array of LatLng points.
        es. array(array(41.90, 12.49),array(41.80, 12.50),array(41.85, 12.60))
        StrokeWidth - Stroke width.
        StrokeColor - Stroke color.
        FillColor - Inner color.
        Opacity - Inner color opacity. Value between 0 To 1.
      • AddPolyline (Points As List, StrokeWidth As Float, StrokeColor As Paint) As MapPolyline
        Adds a polyline To the map.
        Points - A list Or Array of LatLng points.
        Width - Line width.
        Color - Line color.
        CloseInfoWindow (InfoWindow As InfoWindow)
        Closes the specified info window.
      • AllVisibleMapObjects As String
      • CameraPosition As CameraPosition
        Returns the current camera position.
      • Class_Globals As String
      • ClearMap As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • EditConfigure (Offset As Double, Tollerance As Int) As String
      • EditingActive As Boolean
      • EditingCircle (Circle As MapCircle, Active As Boolean) As Boolean
      • EditingPolygon (Polygon As MapPolygon, Active As Boolean) As Boolean
        If an element is already in editing, it is not possible to edit another at the same time.
        Dim Success As Boolean = OpenMap.EditingPolygon(Polygon,True)
      • EditingPolyline (Polyline As MapPolyline, Active As Boolean) As Boolean
      • filterVisibleMapObjects As String
        Makes only the objects visible inside the visible map (Bounds)
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • IsReady As Boolean
      • LatLonToXY (ll As LatLng) As Double()
      • LoadMKL (Path As String, FileName As String) As Map
        Return Map as Object
        Key is ID , Value is Object (Marker,MapPolygon,MapPolyline)
        <code>ObjectMap = OpenMap.LoadMKL(Path, FileName)</code>
      • MapLoaded As Boolean
      • MessageToPanel (Text As String) As String
      • MoveCamera (cp As CameraPosition) As String
      • MoveCamera2 (ll As LatLng) As String
      • PanelOff As String
      • PanelOn As String
      • RedrawAllObj As String
      • RemoveCircle (vCircle As MapCircle) As String
        Removes the specified circle from the map.
      • RemoveInfoWindow (InfoWindow As MapInfoWindow) As String
      • RemoveMarker (vMarker As Marker) As String
        Removes the specified marker from the map.
      • RemovePolygon (vPolygon As MapPolygon) As String
        Removes the specified polygon from the map.
      • RemovePolyline (vPolyline As MapPolyline) As String
        Removes the specified polyline from the map.
      • SaveKML (MapObj As Map, Path As String, FileName As String) As String
      • updateCircleRadius (id As String, Radius As Double) As String
        NewPoint as List of LatLng
      • visibleObject (ID As String, Visible As Boolean) As String
        es. OpenMap.visibleObject(Polygon.ID)
      • WebView1_LocationChanged (Location As String)
      • ww As JavaObject
      • XYToLatLng (x As Double, y As Double) As LatLng
    • Properties:
      • MapBound As Map [read only]
        Return bound in map format:
        {"northEast":{"lat":45.123,"lon":12.456},"southWest":{"lat":40.987,"lon":10.321}}
        Dim Bound As Map = OMaps.MapBound
      • MapType
        get or set the zoom level.
      • NumberOfElements As Int [read only]
        Number Of Elements added
      • Zoom As Int
        Sets the zoom level.
  • OpenMapsExt
    • Functions:
      • AddressToLatLon (address As String) As ResumableSub
        <code>wait for (GMapExt.AddressToLatLon("Address number, City")) COMPLETE (ll as LatLng)</code>
      • Class_Globals As String
      • GetBearing (Point1 As LatLng, Point2 As LatLng) As Double
        Returns the bearing between two points, from point1 to point2- not exist
      • GetCircleIsDraggable (Cricle As MapCircle) As Boolean
      • GetDistance (Point1 As LatLng, Point2 As LatLng) As Double
        Returns the distance between two points in meters
      • GetMarkerIsDraggable (Mk As Marker) As Boolean
      • GetMarkerLabel (m As Marker) As String
        not available
      • GetMarkerPosition (m As Marker) As LatLng
        Returns the marker position as LatLng Object
      • GetMarkerTitle (m As Marker) As String
        Returns the title of a marker as string
      • GetPolygonIsDraggable (Polygon As MapPolygon) As Boolean
      • GetPolylineIsDraggable (Polyline As MapPolyline) As Boolean
      • Initialize (OpenMap As OpenMaps) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • LatLonToAddress (lat As Double, lon As Double) As ResumableSub
      • LatLonToXY (ll As LatLng) As Double()
        Returns the screen coordiantes for the given LatLng coordinates
      • LatLonToXY2 (ll As LatLng) As Double()
      • RemoveMarkerLabel (m As Marker) As String
        not available
        Removes the Marker Label for the given Marker
      • SetCircleDraggable (C As MapCircle, Draggable As Boolean) As String
        Sets the circle draggable property
      • SetGeodesic (shape As JavaObject) As String
        Sets a polygon or polyline to geodesic points - not exist
      • SetMarkerClickable (m As Marker, Clickable As Boolean) As String
        Always clickable - not necessary
        Sets the marker clickable property
      • SetMarkerDraggable (m As Marker, Draggable As Boolean) As String
        Sets the marker draggable property
      • SetMarkerIcon (m As Marker, URL As String) As String
        not available
      • SetMarkerLabel (m As Marker, Text As String, Color As String, TextSize As Double) As String
        not available
        Sets a MarkerLabel with the given values.
        Posible color values.
      • SetMarkerLabel2 (m As Marker, Text As String, Color As String, BackgroundColor As String, TextSize As Double) As String
        not available
      • SetMarkerOrigin (m As Marker, X As Double, y As Double) As String
        not available
        Sets the marker origin 'doesn't work!!!
      • SetPolygonClickable (pg As MapPolygon, Clickable As Boolean) As String
        Always clickable - not necessary
        Sets the polygon clickable property 'doesn't work!!!
      • SetPolygonDraggable (Polygon As MapPolygon, Draggable As Boolean) As String
        Sets the polygon draggable property
      • SetPolylineDraggable (Polyline As MapPolyline, Draggable As Boolean) As String
        Sets the polyline draggable property
      • XYToLatLng (x As Double, y As Double) As LatLng
        Returns the Lat/Lng coordinates for the given screen coordinates 'doesn't work!!!


  • 1.01
    • Added on OpenMapsExt: SetCircleDraggable, SetPolygonDraggable, SetPolylineDraggable
  • 1.02
    • Coordinated renewal after movement for circle, polygon and polyline
    • Update example
  • 1.03
    • Removal of lateral sliding bars
    • Additions EditingPolygon and EdgingPolyline Method to change the points
    • Added VisibleObject method to view or hide an object (markatore, circle, polygon, polyline)
    • Add the PanelOn and PanelOff functions to make a communication panel appear or hide
    • Added MessageToPanel method to send messages to the communication panel
  • 1.04
    • Fix bugs
    • Added method GetMarkerIsDraggable, GetCircleIsDraggable, GetPolygonIsDraggable, GetPolylineIsDraggable
    • Added method: EditingPolyline, EditingPolygon and function EditingActive
  • 1.05
    • Fix Bugs and update Demo
  • 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
  • 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
  • 1.08
    • Added getMapBound, filterVisibleMapObjects, AllVisibleMapObjects, NumberOfElements
    • Added Label on Marker
  • 1.09
    • Fix bugs for LoadKML, AddMarker, AddCircle, AddPolygon, AddPolyline
    • Correct LatLng class field (Lat to Latitude, Lng to Longitude)
    • Update Sample
  • 1.10
    • Added method UpdatePolyline, UpdatePolygon
 

Attachments

  • jSD_OpenMaps 1.09.zip
    56.1 KB · Views: 2
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
I don't believe it but it works 🎆🎆


  • Reselase1.03
    • Removal of lateral sliding bars
    • Additions EditingPolygon and EdgingPolyline Method to change the points
    • Added VisibleObject method to view or hide an object (markatore, circle, polygon, polyline)
    • Add the PanelOn and PanelOff functions to make a communication panel appear or hide
    • Added MessageToPanel method to send messages to the communication panel

edit-ezgif.com-optimize.gif
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
  • Release ver. 1.04
    • Fix bugs
    • Added method GetMarkerIsDraggable, GetCircleIsDraggable, GetPolygonIsDraggable, GetPolylineIsDraggable
    • Added method: EditingPolyline, EditingPolygon and function EditingActive

I have created a new more complete demo and you can find it in post #3. This demo will be updated with new features that will be added in future releases.

Editing polygon points and polylines are currently in beta and may present problems. You can create your own editing function from outside the library.
 

Star-Dust

Expert
Licensed User
Longtime User
Hi, maybe this isn't the right time (I see you're still fine-tuning the libraries), but if you could draw lines, polylines, and polygons directly on the map, that would be great! Similar to GoogleMapsDemo by Klaus

I, for one, don't know how that code works, and I have no idea how to adapt it...

It's a proposal, although I understand other priorities come first...

Thanks again for all your efforts
you find the example you were talking about in post no.3
 

rboeck

Well-Known Member
Licensed User
Longtime User
you find the example you were talking about in post no.3
Congratulations for what you have created in this short time! Maybe i have found a small problem: My java files are not in c:\program files; your sample only works, if i copy my java in this path.
 

Star-Dust

Expert
Licensed User
Longtime User
Congratulations for what you have created in this short time! Maybe i have found a small problem: My java files are not in c:\program files; your sample only works, if i copy my java in this path.
you simply have to put the command #JavaCompilerPath as a remark or delete in the source mail Page
 

javiers

Active Member
Licensed User
Longtime User
Hi, I don't see the text in the message panel, for example, when creating a polyline...

1741946913110.png
 

javiers

Active Member
Licensed User
Longtime User
You send the messages using the Open map library with the MesageToPanel method
That's right. I understand that when you're creating a polyline, the panel displays the text "Click the right mouse button to finish"...

B4X:
Private Sub CheckBoxEdit_CheckedChange(Checked As Boolean)
    Select LabelType.Text
        Case "Marker"
            OMapsExt.SetMarkerDraggable(ObjSelected,Checked)
        Case "Circle"
            'OMaps.EditingCircle(ObjSelected,Checked)
        Case "Polygon"
            OMaps.PanelOn
            OMaps.MessageToPanel("Click the right mouse button to finish")
            OMaps.EditingPolygon(ObjSelected,Checked)
        Case "Polyline"
            OMaps.PanelOn
            OMaps.MessageToPanel("Click the right mouse button to finish")
            OMaps.EditingPolyline(ObjSelected,Checked)
    End Select
End Sub
 

Star-Dust

Expert
Licensed User
Longtime User
That's right. I understand that when you're creating a polyline, the panel displays the text "Click the right mouse button to finish"...
Update 1.05
  • Fix Bugs and update Demo
 

aminoacid

Active Member
Licensed User
Longtime User
Now that's a good idea :)
I've done likewise.

So have I -

Transaction ID 8LK34585YC837001K


Looks great so far :):) Thanks!

Some questions:

1. Any plans to add "gmap.AsPane" so we can load the map dynamically into a panel ?

Pane1.AddNode(gmap.AsPane, 0, 0, -1, -1)

2. And also to display an Info window when a marker is clicked ( I understand that JavaObject is not supported, but can there be a work-around ?)

B4X:
Private Sub ShowInfoWindow (Marker As Marker, Map As GoogleMap)
    If MarkerInfos.ContainsKey(Marker) Then
        Dim info As JavaObject = MarkerInfos.Get(Marker)
        Dim jMap As JavaObject = Map
        jMap = jMap.GetField("map")
        info.RunMethod("open", Array (jMap, Marker))
    End If
End Sub

Private Sub CloseInfoWindow (Marker As Marker)
    If MarkerInfos.ContainsKey(Marker) Then
        Dim info As JavaObject = MarkerInfos.Get(Marker)
        info.RunMethod("close", Null)
    End If
End Sub


Private Sub AttachInfoWindow (Marker As Marker, Text As String)
    Dim InfoWindow As JavaObject
    InfoWindow.InitializeNewInstance("com.lynden.gmapsfx.javascript.object.InfoWindow", Null)
    InfoWindow.RunMethod("setContent", Array (Text))
    MarkerInfos.Put(Marker, InfoWindow)
End Sub
 

Star-Dust

Expert
Licensed User
Longtime User
So have I -

Transaction ID 8LK34585YC837001K


Looks great so far :):) Thanks!

Some questions:

1. Any plans to add "gmap.AsPane" so we can load the map dynamically into a panel ?

Pane1.AddNode(gmap.AsPane, 0, 0, -1, -1)

2. And also to display an Info window when a marker is clicked ( I understand that JavaObject is not supported, but can there be a work-around ?)

Thanks for your donation it is very useful.

AsPane you can replace it with mBase. You remove it from the parent and add it in the panel.

Explain to me better the question of the marker that I did not understand well
 

javiers

Active Member
Licensed User
Longtime User
Update 1.05
  • Fix Bugs and update Demo
Thank you! You're really doing a fantastic job!
I'm looking forward to using the Save and Open buttons. I understand they'll allow us to save map elements and restore them. Thanks again!
 

Star-Dust

Expert
Licensed User
Longtime User
Thank you! You're really doing a fantastic job!
I'm looking forward to using the Save and Open buttons. I understand they'll allow us to save map elements and restore them. Thanks again!
They anointed the KML standard to save so as to be comparable with Google Earth and Google My Maps
 

javiers

Active Member
Licensed User
Longtime User
They anointed the KML standard to save so as to be comparable with Google Earth and Google My Maps
Is it possible, when creating an element (marker, polyline, or polygon), to save the data to a database at that time? This way, the element could be accessed via code and edited/deleted... without having to save a KML file each time, with all the elements... I don't know if I'm right, but I'm sure the path(s) you propose will allow it to be done!
 

Ralph Parkhurst

Member
Licensed User
Longtime User
  • 1.05 Fix Bugs and update Demo
Your library continues to impress me, Star-Dust. It is extremely stable, and my B4J app is using it very effectively—thanks to your exceptional effort.

I have received valuable end-user feedback and would like to suggest three improvements for future consideration:
  1. Remove Hyperlinks in the Attribution Panel
    In the bottom-right corner of the map display, there is an attribution panel partially shown. Could you remove the hyperlinks to Leaflet and Google? When users click on them, it can lead to unpredictable results.
  2. Preserve Map Elements When Changing the Base Layer
    Currently, when a user switches the map’s base layer (Normal, Terrain, Satellite, or Hybrid), all existing polygons and markers disappear. Would it be possible to place these elements on a separate layer so that they remain visible when the base layer changes?
  3. Restrict Excessive Panning to Prevent Unrealistic Longitudes
    Users can pan too far left or right, resulting in excessively large longitude values. Could you implement a limit to prevent map panning beyond a reasonable longitude range?
Thank you again for your outstanding work—your library has been invaluable to my project!
 

Star-Dust

Expert
Licensed User
Longtime User
Thanks, it seems to be stable.

I took notes from your observations, I have a agenda full of improvements to add so there is patience but I will try to make all the necessary changes. If I need further explanations on your observations I will contact you
 

aminoacid

Active Member
Licensed User
Longtime User
Thanks for your donation it is very useful.

AsPane you can replace it with mBase. You remove it from the parent and add it in the panel.

So I am converting my existing GoogleMaps Application to OpenMaps. Right now in my GoogleMaps Application I have:

Private Pane1 As Pane
Pane1.AddNode(gmap.AsPane, 0, 0, -1, -1) 'Add Map to Panel

Since "AsPane" is not supported in OpenMaps, I replace it with "mBase" as you suggest:

Pane1.AddNode(gmap.mBase, 0, 0, -1, -1) 'Add Map to Panel

But I get the following error on the above line:

B4X:
WARNING: package com.sun.javafx.embed.swing.oldimpl not in javafx.swing
Waiting for debugger to connect...
Program started.
Read Configuration File Success
Error occurred on line: 200 (Main)
java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "obj" is null
    at java.base/java.lang.reflect.Method.invoke(Method.java:570)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:578)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
    at b4j.google.map.main.start(main.java:38)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
    at java.base/java.lang.Thread.run(Thread.java:1589)
 

Ralph Parkhurst

Member
Licensed User
Longtime User
I'm not sure if I'm alone, but this morning I can no longer get maps displayed, on either my app or the demo app. Is anyone else having this trouble?
If I didn't know better, it looks like I've been blocked by OSM or maybe by my ISP. Perhaps I exceeded the tile limit during my extensive testing???

Changing IP address didn't help. Is anyone else having this trouble?
 

aminoacid

Active Member
Licensed User
Longtime User
I'm not sure if I'm alone, but this morning I can no longer get maps displayed, on either my app or the demo app. Is anyone else having this trouble?
If I didn't know better, it looks like I've been blocked by OSM or maybe by my ISP. Perhaps I exceeded the tile limit during my extensive testing???

Changing IP address didn't help. Is anyone else having this trouble?

I just tried the demo and the map loads fine. I have noticed that OpenMaps at times will take a little longer to load, but that is typical with OSM which I believe @stardust is using. As far as I know, there is no tile limit and I have used OSM before.
 

Ralph Parkhurst

Member
Licensed User
Longtime User
I just tried the demo and the map loads fine. I have noticed that OpenMaps at time will take a little longer to load, but that is typical with OSM which I believe @stardust is using. As far as I know, there is no tile limit and I have used OSM before.
Well that is good news - it might only be a localized issue.

I also wondered if the HTTP User-Agent was set incorrectly causing me to be blocked. I read on the OSM tile usage policy here that:
  • Faking another app’s User-Agent WILL get you blocked. Using a library’s default User-Agent is NOT recommended as they may be blocked if another user of the library is misusing it. If a device automatically sends an X-Requested-With header with an application specific Application ID, this will be considered an acceptable substitute for the HTTP User-Agent, although we still recommend setting a valid HTTP User-Agent for the application.
In any case I will investigate if it possible to specify the user-agent, as I think it is set to null at the moment.
 
Top