I’m trying to use OpenLayers library with RequireJS.
The problem is, OpenLayers keeps being “undefined” even though it’s listed as the only dependency for my module:
define(['OpenLayers'],function (OpenLayers) {
console.log(OpenLayers);
});
this will print “undefined”.
If I substitute the OpenLayers with jquery (both .js files are in the same folder), it will not be undefined any more.
So why is OpenLayers not loaded by RequireJS?
This code worked for me: