How to use ol-ext with nuxt?
See original GitHub issueI’m trying to use vuelayers in a nuxt application. I have created a plugin like this:
import Vue from 'vue'
import VueLayers from 'vuelayers'
Vue.use(VueLayers)
Now, I want to use the strategy for loadingBBox
loadingStrategyFactory () {
// VueLayers.olExt available only in UMD build
// in ES build it should be imported explicitly from 'vuelayers/lib/ol-ext'
return loadingBBox
},
But when I do this:
<script>
import {loadingBBox} from 'vuelayers/lib/ol-ext'
export default {
I get an error: Unexpected token export.
What’s the correct way?
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Installation - Nuxt
Another way to get started with Nuxt is to use CodeSandbox which is a great way for quickly playing around with Nuxt and/or...
Read more >Nuxt - The Intuitive Vue Framework
Build your next Vue.js application with confidence using Nuxt. An open source framework making web development simple and powerful.
Read more >Content made easy for Vue developers · Nuxt Content
Take advantage of Nuxt 3 features: Vue 3, Auto-imports, Vite and Nitro server. File-based CMS. Write your content in Markdown, YML, CSV or...
Read more >Configuration - Nuxt
You will still need to install the required loader if you need to use them. Style Extensions. You can omit the file extension...
Read more >Commands and Deployment - Nuxt
Use it for Node.js hosting like Heroku, Digital Ocean, etc. target: static. nuxt dev - Launch the development server. nuxt ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, you are right. In that case you see you load only part of the layer. Then when you move the map, this will trigger new load with the new view bbox and etc.
My solution to using ol-ext was to use
require
in the method where I needed it:Don`t know if this is best practice or not but it works.