Does anybody has already tried to load Google maps...
# javascript
g
Does anybody has already tried to load Google maps and call its API from a kotlin/JS module?
b
Do you have any issue with it? I think I saw some examples/questions about it. Unfortunately, I can’t find them now.
g
The problem is that the loading is done by google map itself. https://developers.google.com/maps/documentation/javascript/tutorial#Loading_the_Maps_API For the moment I just used this approach that wait for the complete loading of maps: https://stackoverflow.com/a/38627705/231174
But I’m only using js(‘’) calls and dynamic types where I would prefer to use a typed API and kotlin code.
b
What is actually problem with async loading?
g
It’s really hard to find doc or examples on how to integrate with existing libraries. What are the normal ways of doing it, for each type of module (commonJS, AMD, … ) For example, this tutorial on webgl makes use of the library gl-matrix that has some modules like m4. https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Adding_2D_content_to_a_WebGL_context
How do you make it working with kotlin? JsModule + JsNonModule (confusing naming by the way) with requirejs or commonjs? I don’t find any example in kotlin-examples.