Bug? jGoogleMaps Error

Pedro Caldeira

Active Member
Licensed User
Longtime User
I Get an error just by running the example, after a few seconds I get the following Error.
I updated the java jdk to verion 1.8.0_121, and the error stopped for 2 hours, then it started again.
but this time just the main screen Error, and nothing in the log

Main Screen Error:

B4X:
Oops! something went Wrong.
This page didn't load Google Maps correctly. See the Javascript console for technical details.

But where can we see the javascript console here !? :(

Errors in Log (before update to last version of jdk, now I got the screen error and a clean log :) )
B4X:
Waiting for debugger to connect...
Program started.
Error occurred on line: 64 (Main)
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.objects.GoogleMapWrapper.MoveCamera(GoogleMapWrapper.java:219)
    at b4j.google.map.main._btnresetmap_action(main.java:161)
    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.shell.Shell.runMethod(Shell.java:612)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:226)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
    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:93)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
    at anywheresoftware.b4a.BA$2.run(BA.java:165)
    at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(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$148(WinApplication.java:191)
    at java.lang.Thread.run(Thread.java:745)
 

Matias Ferrer

Member
Licensed User
Longtime User
I have a similar error with the google maps.

It works 10 seconds and then it fails.

In my case the log is this.

Netscape.javascript.JSException:
ReferenceError: Can not find variable: loadMapLibrary
At com.sun.webkit.dom.JSObject.fwkMakeException (JSObject.java:128)
At com.sun.webkit.WebPage.twkExecuteScript (Native Method)
At com.sun.webkit.WebPage.executeScript (WebPage.java:1439)
At javafx.scene.web.WebEngine.executeScript (WebEngine.java:982)
At com.lynden.gmapsfx.javascript.JavaFxWebEngine.executeScript (JavaFxWebEngine.java:42)
At com.lynden.gmapsfx.GoogleMapView.initialiseScript (GoogleMapView.java:276)
At com.lynden.gmapsfx.GoogleMapView.access $ 0 (GoogleMapView.java:269)
At com.lynden.gmapsfx.GoogleMapView $ 1.changed (GoogleMapView.java:224)
At com.lynden.gmapsfx.GoogleMapView $ 1.changed (GoogleMapView.java:1)
At com.sun.javafx.binding.ExpressionHelper $ SingleChange.fireValueChangedEvent (ExpressionHelper.java:182)
At com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent (ExpressionHelper.java:81)
At javafx.beans.property.ReadOnlyObjectWrapper $ ReadOnlyPropertyImpl.fireValueChangedEvent (ReadOnlyObjectWrapper.java:176)
At javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent (ReadOnlyObjectWrapper.java:142)
At javafx.beans.property.ObjectPropertyBase.markInvalid (ObjectPropertyBase.java:112)
At javafx.beans.property.ObjectPropertyBase.set (ObjectPropertyBase.java:146)
At javafx.scene.web.WebEngine $ LoadWorker.updateState (WebEngine.java:1260)
At javafx.scene.web.WebEngine $ LoadWorker.dispatchLoadEvent (WebEngine.java:1371)
At javafx.scene.web.WebEngine $ LoadWorker.access $ 1200 (WebEngine.java:1253)
At javafx.scene.web.WebEngine $ PageLoadListener.dispatchLoadEvent (WebEngine.java:1240)
At com.sun.webkit.WebPage.fireLoadEvent (WebPage.java:2400)
At com.sun.webkit.WebPage.fwkFireLoadEvent (WebPage.java:2244)
At com.sun.webkit.network.URLLoader.twkDidFinishLoading (Native Method)
At com.sun.webkit.network.URLLoader.notifyDidFinishLoading (URLLoader.java:838)
At com.sun.webkit.network.URLLoader.lambda $ didFinishLoading $ 96 (URLLoader.java:829)
At com.sun.javafx.application.PlatformImpl.lambda $ null $ 173 (PlatformImpl.java:295)
At java.security.AccessController.doPrivileged (Native Method)
At com.sun.javafx.application.PlatformImpl.lambda $ runLater $ 174 (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 $ 148 (WinApplication.java:191)
At java.lang.Thread.run (Thread.java:745)



We are complicated Pedro.

Sorry, I did not want to open another post, because it is similar errors
 

Matias Ferrer

Member
Licensed User
Longtime User
Use GMap.Initialize2 and enter an API key.


Hi Erel,
I have tested 2 API key "Google Maps JavaScript API" and it still does not work.
There are no requests on the console.

I put these APIs in a JavaScript / Html and it works perfectly.

It may be that you are not taking the KEY library API ?, cache problems?

Regards,
 

Pedro Caldeira

Active Member
Licensed User
Longtime User
I need to update the lib also. Does it implement anything new, or its just to solve the error ?
My Application works fine as it is.
 

Matias Ferrer

Member
Licensed User
Longtime User
Please try the attached library (v1.60).

Update the library to version 1.60.
I still have the problem

I upload a gif so that they see in my case the error.
No log output

Error jGoogleMaps.gif
 

Pedro Caldeira

Active Member
Licensed User
Longtime User
after I logged in with the API Key it worked for a few hours, then started to get the error again :(
 

Artigala

Member
Licensed User
Longtime User
Dear Erel, Matias and Pedro,
I have got same problem.
I use a javascript API, the map appears 3 seconds, and ... "Oops! Something went wrong.
This page did not load Google Maps correctly. See the JavaScript console for technical details "

The log displayed: "Alert: Hide directions called" and "Alert: loadMapLibrary done".
 

Matias Ferrer

Member
Licensed User
Longtime User
Hello,
I have the same log as you.

I noticed something strange, every day from 9 pm UTC-03: 00 Buenos Aires works for a moment.
Then there is error.
Will we be using some Key share that reaches its limit after that time?

2017-03-30 18_20_31-GoogleMap - B4J.png

Regards,
 

Pedro Caldeira

Active Member
Licensed User
Longtime User
Matias, Now that you mention it.
My App, also works in the morning, didn't make note until what time though :)
 

vpires

Member
Licensed User
Longtime User
Hi Erel,

in libs 1.55 version, initialize2 is calling the wrong GoogleMapView constructor and by so ignoring the ApiKey parameter.
Using for example GoogleMapView(null,ApiKey) fixes it.

Bye
 

Matias Ferrer

Member
Licensed User
Longtime User
As I mentioned before. At the moment it is 10 pm UTC-03: 00 Buenos Aires.

The map looks perfect, without errors. After several minutes it is still working.

I still think that you are using a shared key API, which reaches the limit of daily queries in a few hours

2017-03-30 22_27_57-GoogleMap - B4J.png


Regards,
 

Matias Ferrer

Member
Licensed User
Longtime User
I have replaced the library with version 1.61.
Now I have no error.
I can see a request in console.developers, Google Maps JavaScript API ;)

I try in the afternoon and I will inform you

Thanks Erel & Everyone
 

Artigala

Member
Licensed User
Longtime User
Dear Erel,
ERRATUM :
It's ok for me with 1.61
I can see too a request in console.developers.
Thank you Erel !

I m sorry, but with v1.61, the error is still alive :(
I do not see any traffic or errors on my Google console (//console.developers.google.com).
 
Last edited:
Top