Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using ol-util in Vue3 #1226

Open
JakobMiksch opened this issue Oct 26, 2023 · 2 comments
Open

Error using ol-util in Vue3 #1226

JakobMiksch opened this issue Oct 26, 2023 · 2 comments

Comments

@JakobMiksch
Copy link
Contributor

JakobMiksch commented Oct 26, 2023

When I use ol-util in a vanilla Vue3 app, I get this error:

image

It seems to be a problem with the dependency shpjs and maybe also in combination with vite . I could not find a solution yet.

How to reproduce:

Create a new Vue3 app

npm create vue@latest

Select this options:

image

install dependencies

npm i
npm i ol  @terrestris/ol-util

in App.vue add this to the <script> tag:

<script setup>
import HelloWorld from './components/HelloWorld.vue'
import TheWelcome from './components/TheWelcome.vue'
import {onMounted} from 'vue'
import TileWMS from 'ol/source/TileWMS'
import { LayerUtil } from '@terrestris/ol-util'


onMounted(() => {
   const wmsSource = new TileWMS()
   const result =  LayerUtil.isOlSourceTileWMS(wmsSource)
   console.log(result)
})

</script>

then run the app:

npm run dev

then the error from above should appear.

@JakobMiksch
Copy link
Contributor Author

a workaround is described here: calvinmetcalf/shapefile-js#200 (comment)

@dnlkoch
Copy link
Member

dnlkoch commented Nov 3, 2023

Thanks for the update @JakobMiksch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants