Here is my code :
/**
* map.ts
*/
// @deno-types="./libs/@types/geojson/index.d.ts"
// @deno-types="./libs/@types/mapbox-gl/index.d.ts"
mapboxgl.accessToken = "toto";
var map = new mapboxgl.Map({
container: 'map', // container id
style: 'mapbox://styles/mapbox/streets-v11', // style URL
center: [-74.5, 40], // starting position [lng, lat]
zoom: 9 // starting zoom
});
But even if i have imported the definition of mapbox with
// @deno-types="./libs/@types/geojson/index.d.ts"
// @deno-types="./libs/@types/mapbox-gl/index.d.ts"
I have the error :
error: TS2304 [ERROR]: Cannot find name 'mapboxgl'.
mapboxgl.accessToken = "toto";
~~~~~~~~
at file:///home/bussiere/Workspace/testdeno2/map.ts:9:1
TS2304 [ERROR]: Cannot find name 'mapboxgl'.
var map = new mapboxgl.Map({
~~~~~~~~
at file:///home/bussiere/Workspace/testdeno2/map.ts:11:15
Found 2 errors.
How to import correctly the definition in a way that i could be able to use the name and the definitions.
here is the github : https://github.com/bussiere/testdeno2
Edit :
here is the uncaught error :
error: Uncaught (in promise) RuntimeError: unreachable
at <anonymous> (wasm://wasm/00247702:1:336403)
at <anonymous> (wasm://wasm/00247702:1:341096)
at <anonymous> (wasm://wasm/00247702:1:339419)
at <anonymous> (wasm://wasm/00247702:1:339781)
at <anonymous> (wasm://wasm/00247702:1:336272)
at <anonymous> (wasm://wasm/00247702:1:268321)
at minify (wasm://wasm/00247702:1:253183)
at minify (https://deno.land/x/minifier@v1.1.1/wasm.js:98:14)
at minify (https://deno.land/x/minifier@v1.1.1/mod.ts:27:10)
at https://deno.land/x/minifier@v1.1.1/cli.ts:53:3
Regards