B4J Question jGoogleMaps Version 1.82 problem

Rudolf Messer

New Member
Licensed User
I have used jGoogleMaps Version 1.25 with B4J Version 6.51 successfully for a long time. Now I want to move to the actual B4J Version 8.50 and the actual jGoogleMaps Version 1.82 and get an error. To analyse the problem I have startet the actual GoogleMapsExample and get the same error. After starting the map shows up, but within a second it disappears. After using the "Reset Map"-Button the program terminates.
In the java console I can read:
---
Alert: loadMapLibrary
mapLibraryLoaded!
Alert: !!!mapLibraryLoaded!!!

main._btnresetmap_action (java line: 109)
java.lang.NullPointerException
at com.lynden.gmapsfx.javascript.object.GoogleMap.internalGetZoom(GoogleMap.java:76)
at com.lynden.gmapsfx.javascript.object.GoogleMap.zoomProperty(GoogleMap.java:93)
at com.lynden.gmapsfx.javascript.object.GoogleMap.setZoom(GoogleMap.java:68)
at anywheresoftware.b4j.googlemaps.GoogleMapWrapper.MoveCamera(GoogleMapWrapper.java:239)
at b4j.google.map.main._btnresetmap_action(main.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.BA$1.run(BA.java:216)
at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$4(WinApplication.java:186)
at java.lang.Thread.run(Unknown Source)
---
I used a valid API Key and Java Version 1.8.0_231.

Any Idea to solve the problem?
Thanks,

R
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Rudolf Messer

New Member
Licensed User
The GoogleMapsExample doesn't work ! I used to the actual B4J Version 8.50 and the actual jGoogleMaps Version 1.82 and Java Version 1.8.0_261 and gmap.Initialize2 with my API Key.
The programm windows opens correctly, the map is visible for a second then it disappears, a grey background is shown with the text
"Hoppla! Ein Fehler ist aufgetreten.
Google Maps wurde auf dieser Seite nicht richtig geladen. Technische Details dazu entnimmst du der JavaScript-Konsole."
After pressing the Reset Map Button, the program terminates with

Alert: loadMapLibrary
mapLibraryLoaded!
Alert: !!!mapLibraryLoaded!!!
main._btnresetmap_action (java line: 109)
java.lang.NullPointerException
at com.lynden.gmapsfx.javascript.object.GoogleMap.internalGetZoom(GoogleMap.java:76)
at com.lynden.gmapsfx.javascript.object.GoogleMap.zoomProperty(GoogleMap.java:93)
at com.lynden.gmapsfx.javascript.object.GoogleMap.setZoom(GoogleMap.java:68)
at anywheresoftware.b4j.googlemaps.GoogleMapWrapper.MoveCamera(GoogleMapWrapper.java:239)
at b4j.google.map.main._btnresetmap_action(main.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.BA$1.run(BA.java:216)
at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$4(WinApplication.java:186)
at java.lang.Thread.run(Thread.java:748)

Thanks for your help,
R
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I've just tried it and it works fine here..

If I set a wrong key I get this message:

1597656015121.png


I guess that your key is wrong.
 
Upvote 0

Rudolf Messer

New Member
Licensed User
Now it works, thank you very much. The reason was that I have reused the API Key from my Android App development. It is important to get another key by choosing "Map Java Script API".
Unfortunately the map is now covered by the message "For development purposes only". When I try to install the billing, my VISA card is not accepted although I have no problems to buy an app in the Play Store.
 
Upvote 0
Top