Giter Club home page Giter Club logo

Comments (5)

dpdearing avatar dpdearing commented on August 17, 2024

I'm also having a problem with using LoadApi.go()...if that's what you mean (although not the same problem that you describe). My issue is that the map does not appear when first loaded and doesn't show up until resizing the browser window. Anyway, I'll share what seems to work for me.

I've found that I can directly load the Maps API by including the <script> tag from the Google Maps API tutorial in my html page. I'm not sure if there's a race condition with determining if onModuleLoad happens before the script finishes loading. Might need to leave out the async attribute.

<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"
    async defer></script>

from gwt-maps-v3-api.

aouskaroui avatar aouskaroui commented on August 17, 2024

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);
}

from gwt-maps-v3-api.

treethinker avatar treethinker commented on August 17, 2024

from gwt-maps-v3-api.

aouskaroui avatar aouskaroui commented on August 17, 2024

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.
Please let me know if it fix the issue...

from gwt-maps-v3-api.

aouskaroui avatar aouskaroui commented on August 17, 2024

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.

from gwt-maps-v3-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.