[Vuejs]-Can' t display a vector layer using openlayer 6

1👍

Just copy the data folder and inside files into dist folder.

This problem happens because your application can’t find the data folder. npm run start serve your application build (dist folder) on localhost:1234. The question is “Is there any data folder in localhost:1234 ?” or “Can I access my data via localhost:1234/data ?”.

To solve this problem as mention above you need to copy the whole data folder into the dist folder.

0👍

In vue.js I moved the data folder to the public folder and the correct relative path is url: '../data/pays.geojson'.I deployed the application with netlify and it works.
Thank you for your answers which helped me to find the solution.

Leave a comment