B4J Question jGoogle Maps 2.01

Philip Prins

Active Member
Licensed User
Longtime User
I think Google changed something again:
1740144478768.png


No imagery here notice.

I followed all the steps in the previous update , JDK 19.0.02

Can anyone check if it still works on their side?

Regards
Philip
 

aminoacid

Active Member
Licensed User
Longtime User
Same problem here. I happened to be running a program using Google Maps since yesterday. It was displaying the map properly until just now when I restarted the program to see if I encounter the same issue. Sure enough I get the same results as you. What a pain!
 
Upvote 0

Ralph Parkhurst

Member
Licensed User
Longtime User
No imagery here notice.
You are not alone - I have the same problem here. I wonder if the GoogleMaps Javascript API update 3.60.1 released yesterday has something to do with it. More accurately, I suspect that API 3.56 is no longer supported.
 
Last edited:
Upvote 0

aminoacid

Active Member
Licensed User
Longtime User
You are not alone - I have the same problem here. I wonder if the GoogleMaps Javascript API update 3.60.1 released yesterday has something to do with it. More accurately, I suspect that API 3.56 is no longer supported.

I think you're right. I would assume that the jGoogleMaps Library would need to be updated.
 
Upvote 0

aminoacid

Active Member
Licensed User
Longtime User
I found an old example that actually works! What's surprising is that it complies and runs under Java8 and an API key is not necessary. It is using the latest jGoogleMaps v2.01 library and compiled with B4J v10.0

I have not had a chance to figure out why it works while the other programs based on the latest demo code do not, but I am attaching it here in case anyone is interested and would like to take a look at it. Perhaps it may give us a clue as to what's really going on.
 

Attachments

  • GoogleMapsDemo.zip
    228.9 KB · Views: 42
Upvote 0

Ralph Parkhurst

Member
Licensed User
Longtime User
Thanks and well identified @aminoacid. I suspect you are on to something here, because it indeed does work, although map tiles are displayed very slowly.

I confirm I am using B4J v10.0, jGoogleMaps Lib 2.01 and JDK 8u441. I do recall this 2018 demo/example (see here: Share My Creation by Klaus) because I used some of his ideas in my application.
 
Last edited:
Upvote 0

Ralph Parkhurst

Member
Licensed User
Longtime User
Here is how I managed to temporarily get around the Google Maps 2.01 issue in my own B4J application:

1. Switch to Java8 by downloading JDK 8u441 from the link provided above by @aminoacid and selecting the javac.exe in Configure Paths.
2. Add one line in gmap_ready event: gmap.MapType=gmap.MAP_TYPE_SATELLITE to select Satellite map when the map loads.
3. Add one line in AppStart event: options.MapTypeControl = False to stop users from selecting anything other than satellite maps
4. Compile in Release Mode.

Run the executable JAR file result.jar and it works!

Limitations:
a) Only Satellite maps are supported
b) Map drawing seems slower than before
c) I don't yet know how to build result.jar into a standalone package - the Build Standalone Package button gives an error "Java 11+ is required".

Whilst this cannot be regarded an effective solution, it has given me some breathing space and gives my customers a workaround for the moment.

Thanks @aminoacid for finding this workaround.

EDIT: Having now installed this on seven Windows PCs (all using Win11 Pro), I regret to report that this technique only worked sometimes (4 out of the 7).
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The problem is in JavaFX WebView.
The previous workaround was to explicitly set the maps SDK version to 3.56, as it fails with 3.57. 3.56 is no longer available.

And hopefully they will fix it soon: https://bugs.openjdk.org/browse/JDK...plugin.system.issuetabpanels:comment-tabpanel
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
As has been explained, the new versions of the API use webgGL that are not supported by webView.
You can use the alternative to webView, but very complicated, you can interface the browser (this already tried and functional) or as a third possibility to use a trick ...

Browser
1740344042528.png


trick

1740343821387.png
 
Last edited:
Upvote 0

aminoacid

Active Member
Licensed User
Longtime User
I agree and also remain in hope. However the evidence suggests JavaFX Webview is no longer being maintained.

Are there other ways to display a map within B4J?

I am seriously considering investigating the use of Leaflet instead of GoogleMaps. It does not have all these limitations of GoogleMaps and also supports other maps such as OSM, ESRI, Nat Geographic, USGS, and even GoogleMaps. There is an old library posted here but it is dated and does not support all the features of Leaflet:


But it's a good start. And I've played around with B4XMAP and even though it seems a bit limited for my needs it's pretty good:

 
Upvote 0

Ralph Parkhurst

Member
Licensed User
Longtime User
It is maintained. We see improvements in each release of Java.
Thank you Erel - that is indeed encouraging and you have lifted my spirits immensely! When I saw the words "I wrote Kevin Rushford (no answer)" and "the webview is not getting any attention for improvements" (both posted by someone else) I just assumed the worst.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
We have been expecting a webView update for more than six months, but unfortunately it is still not available.

My library that uses an external browser is almost complete, I stopped only because the problem had been temporarily solved by setting the bees to version 3.56. Unfortunately an external browser is complicated to manage so it is not an optimal solution.

It is possible to get the maps in image format from the Googlemaps but a lot of work should be done to have all the rest of the characteristics (rectangles, lines, circles, markers, coding and decoding GPS addresses and coordinates, etc.)

I have been transformed my apps into Webapp and I have no problem.

For the desktop version I am trying alternatives to WebView. The simplest would be JXBrowser but it is expensive, so I'm testing Jcef, it seems to work but here too it takes a lot of work to take it to B4J .. for the moment the experiments seem to work.

1740422870201.png
 
Upvote 0
Top