[OpenLayers-Users] OpenLayers undefined error, in 2.13.1?

Jeff Dege jeff.dege at korterra.com
Tue Nov 12 12:40:44 PST 2013


We have a number of ASP.NET websites that use OpenLayers to display maps. We've built some custom controls to use on some of these maps.

We initially built this stuff using OpenLayers 2.8, and we've updated it to 2.11, and it's been working fine.

I'm currently tasked with bringing it forward to 2.13.1, and I'm running into an odd error.

We're getting "'OpenLayers' is undefined" errors, when loading the JavaScript files for our custom controls.

These files are being loaded by ASP.NET's IScriptControl.GetScriptReferences() mechanism. (Most of the OpenLayers examples put all of the script includes directly in the markup - we cannot do that because which maps and which layers and which controls are enabled on a page is dependent on which customer is logging in to the site, so the decision as to what to include has to be programmatically controlled in the code-behind).

Understand, we've made no changes except to load OpenLayers.js 2.13.1 instead of OpenLayers.js 2.11.

Have there been changes in 2.12 or 2.13 or 2.13.1 that would change the visibility of the OpenLayers namespace? Or changed the point in the page lifecycle at which it is initialized?


More information about the Users mailing list