Vue.Js & CesiumJS

Hello all,

I am confused about something and need help. On our website; we were using html and css. But now we want to use Vue.Js. What I’m wondering is, will we be able to use our cesium application with vue js with the same functions? In our application generally we are using cesiumTerrainProvider, cesiumViewer, cesium3DTileStyle etc.

Thank you,

Tolga.

The simplest answer is Yes, but it all comes down to how you’ve designed and developed your app. If it’s a plain vanilla JS app, then you have to convert it to Vue anyway, but Cesium as such can be used on the API level for any framework you’ve got out there. I’m using it with Angular which have some similarities to Vue. But the devil is in the details; why are you going to Vue, is it to create a better Cesium app, or is Vue used for the website and you just want to re-use what you’ve got now? Everything is possible, even reusing plain JS apps, but that’s a Vue question more than a Cesium one.

Cheers,

Alex

1 Like

Thanks for your answer Alex,

Yes, we want to use Vue.Js for our website and we just want to re-use that we’ve got. You are right this is actually Vue question but i just i wanted to know beforehand if I was going to encounter a potential problem during Vue implementation process.

I have been using Cesium in a Vue app for a couple months and I can confirm that it is perfectly doable. I cannot remind of any problem in the implementation process. There is also a vue-cesium project but I’ve never tried it. You might be interested in giving it a look though.

2 Likes

Hi, I am also concerned about using Cesium with Vue.js. And I cannot find any documentation about it other than some custom-written libraries. I want to learn how you use it actually just to give me a first understanding. If it’s okay, can you share some sample codes with me? Thanks in advance.

Sorry, I can’t share any code samples but it should not be very different than using Cesium with plain JS but you can take advantage of the features provided by Vue. I usually instanciate my Cesium Viewer in the mounted hook and keep a reference to it in my data. Then I can access it in all my methods.
I hope this helps a bit

1 Like