krtko
06/07/2018, 6:21 PMUncaught ReferenceError: google is not defined
. Is there a way to remove kotlin's safety check for external JS?Roman Artemev [JB]
06/08/2018, 10:36 AMkrtko
06/08/2018, 6:11 PMkrtko
06/08/2018, 6:38 PMRoman Artemev [JB]
06/08/2018, 6:45 PMkrtko
06/08/2018, 7:05 PM@file:JsQualifier("google.maps")
package org.something
import org.w3c.dom.HTMLElement
@JsName("Map")
external class GoogleMap(htmlElement: HTMLElement, options: dynamic)
krtko
06/08/2018, 7:08 PMRoman Artemev [JB]
06/09/2018, 10:35 AM@JsName("google")
external object Google {
@JsName("maps")
object Maps {
@JsName("Map")
interface GoogleMap {
}
}
}
inline fun Google.Maps.GoogleMap(htmlElement: HTMLElement, options: dynamic): Google.Maps.GoogleMap {
return js("new google.maps.Map(htmlElement, options)").unsafeCast<Google.Maps.GoogleMap>()
}
Could you please try this code. Here we define inline function which looks like constructor but takes in the account async loading.krtko
06/11/2018, 5:23 PM