Closed mgiraldo closed 5 years ago
ok i figured it out! just in case anyone needs it (need to follow #43 first) this is my code now, a bit more streamlined because the plugin takes care of most of that (i'm using a maptiler map):
<template>
<no-ssr>
<mapbox
access-token=""
:map-options="{
center: [-122.420679, 37.772537],
zoom: 13,
style:
'https://api.maptiler.com/maps/basic/style.json?key=MY_KEY'
}"
@map-init="mapInited"
@map-load="mapLoaded"
>
</mapbox>
</no-ssr>
</template>
export default {
methods: {
mapInited(map) {
console.log('inited', map)
},
mapLoaded(map) {
console.log('loaded', map)
}
}
}
i already tried what is described in #43 and #32 and am trying to get to a simple hello world example using nuxt.
this is what i did:
mapbox-gl
andvue-mapbox-gl
(withyarn add mapbox-gl mapbox-gl-vue
)pages/test.vue
which contains the following template (i want to display stamen rastertiles):the
mapInited
event gets called but not themapLoaded
. i only see an empty map with controls:any idea what i am missing?