-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading Map without loadMapApi() #235
Comments
I'm also having a problem with using I've found that I can directly load the Maps API by including the <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"
async defer></script> |
Hello, |
Thanks. I hope to be able to apply this as well.
…On 16 Jan,17, at 04:58, aouskaroui ***@***.***> wrote:
Hello,
I had the same problem once. I thought it was something with the GWT panels or the resize functions, so I tried many kinds of panels and the MapWidget.triggerResize() method but nothing worked for me.
Finally, I figured out that the map needs some time to load (until getting the Ajax callbacks answers) so I put the draw() method within a Timer instance and the problem was resolved.
Here is a snap of the way I did it:
Timer timer = new Timer() {
@OverRide
public void run() {
draw();
setContent(mapWidget);
}
};
timer.schedule(4000);
}
�
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Okay. If you're using the loadMapApi() method, you just have to call it inside the Timer run() like I did, but instead the draw() method. |
Hello again, actually there are some differences between testing on local and on a web server. For me, MapWidget.triggerResize() resolved the problem described by "dpdearing" above. |
Hello everyone,
Thank you for this great Gwt library !
I'm a beginner in GWT and I'm having some questions:
Is it possible to run the Map without calling the loadMapApi() method ?
Actually, when I call loadMapApi(), the Map loads fine for a first sight but it doesn't provide any interaction. It means that all buttons, markers or whatever I put on it are shown in the map but they don't really work !
Otherwise, when I just call the draw() method, without calling loadMapApi(), the map loads fine and all buttons, markers are interacting. The problem is when I want to add the AutoComplete text box. I get this error "Cannot read property 'Autocomplete' of undefined".
However, when I call loadMapApi(), I don't get that error. The map loads fine with the Autocomplete box on it, but there is no interaction. I just get a good looking frozen Map ! I don't know if there is a problem with the Thread or something. I just copied the provided code with no change.
The text was updated successfully, but these errors were encountered: