0

I wanted to upgrade to the latest to use some nice new features. I am using ExtJS so I have to use a bundle with ol global variable. I followed this step to create it but it uses Parcel. I also tried Rollup, Webpack, and Browserify with no success. When using their bundles, I get the following error:

Uncaught ReferenceError: ol is not defined

This is because I want to use it in a code like this:

  const map = new ol.Map({
    target: 'map',
    layers: [
      new ol.layer.Tile({
        source: new ol.source.OSM()
      })
    ],
    view: new ol.View({
      center: [0, 0],
      zoom: 0
    })
  });

Is there any other way of getting a bundle that does not use imports?

wondim
  • 697
  • 15
  • 29
  • See https://openlayers.org/en/latest/doc/quickstart.html There are also downloadable dist.zip files https://github.com/openlayers/openlayers/releases so you can host your own. – Mike Sep 06 '20 at 10:38
  • I am looking for the master version. The latest release does not have the feature I am looking for: `WebGLPoints`. I tried https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/master/build/ol.js and https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/latest/build/ol.js . They both don't have it. It is available in master though: https://github.com/openlayers/openlayers/blob/main/src/ol/layer/WebGLPoints.js – wondim Sep 06 '20 at 12:46
  • 2
    WebGLPoints has been available since v6.0.0 but as it is set as "experimental" it is not included in the API documentation or full build. – Mike Sep 06 '20 at 13:11
  • Thank you for the information @Mike – wondim Sep 07 '20 at 22:49

0 Answers0