Brendan Weinstein
12/29/2024, 8:28 PMBrendan Weinstein
12/29/2024, 8:28 PMmapboxgl.accessToken = "my-access-token"
I've tried a bunch of different variations of the below
@file:JsModule("mapbox-gl")
package com.basebeta.map
external object mapboxgl : JsAny {
var accessToken: String
}
but each one results in a runtime uncaught WebAssembly.ExceptionBrendan Weinstein
12/29/2024, 8:35 PMSupports ES modules only. There is no analog of the @JsNonModule annotation. Provides its exports as properties on the default object. Allows exporting package-level functions only.
ephemient
12/29/2024, 8:37 PM@JsNonModule
, I haven't used mapbox but I'd expect
@JsModule("mapbox-gl")
external var accessToken: JsString
as the docs make it look like a direct exportBrendan Weinstein
12/29/2024, 8:39 PMBrendan Weinstein
12/29/2024, 8:46 PMindex.html
and then defined the below for interop
external object mapboxgl {
var accessToken: JsString
}
Was able to execute
mapboxgl.accessToken = "my-access-token".toJsString()
and confirm that the token was populated correctly with console.log(mapboxgl.accessToken)
in chrome debugger