I am would like to develop a simple OpenLayers (7) application to show GeoJSON delivered from the same server. I have experience with JS, especially the older OL versions but have hit a wall since the introduction of npm and vite development environment model.

My principle dev server is PHP/Apache where I serve data. I've tried a simple page running on npm and accessing the apache data but am running into CORS problems. I can't port everything to vine/npm because I don't really know what I'm doing and am not convinced this is the only development option, surely?

I am a geomatic engineer, with web experience (pre JS dominance) and have tried over the last few years to learn a bit of npm, vite etc, specifically for OpenLayers but am simply not making sufficient progress.

Is there not precompiled .js and .css files (CDN?) to allow me to develop using traditional techniques. I don't care if these files are 20kB or 20 MB.

My alterternative is to continue to use my old OpenLayers 3 .css and .js files.

  • 1
    There is a cdn version available on jsdelivr and available for download openlayers.org/download
    – Mike
    Nov 24 at 16:43
  • Up to v4.6.5 there was also ol-debug.js available to help in debugging, starting with 5.0 this was removed, no more classic JS debugging.
    – TomazicM
    Nov 24 at 18:10
  • Thanks - didn't see that on the download page! Still struggling to use loaded JS though.. eg: "Uncaught ReferenceError: VectorSource is not defined" when trying to create OL instances. Will keep trying! Nov 24 at 18:28
  • 1
    Edit your question and add sample of code you are trying to use. See gis.stackexchange.com/questions/310482/…
    – TomazicM
    Nov 24 at 18:41


Browse other questions tagged or ask your own question.