[OpenLayers-Users] SingleFile.js - small improvement in RegExp of function _getScriptLocation

Andreas Neumann a.neumann at carto.net
Mon Feb 14 11:51:53 EST 2011


 Hi,

 While trying to optimize OpenLayers for deployment I noticed that 
 OpenLayers fails if the file is named OpenLayers.js.gz instead of just 
 OpenLayers.js

 It is simple to fix:

 In file SingleFile.js, in function _getScriptLocation change:

 old:
 var r = new RegExp("(^|(.*?\\/))(OpenLayers\.js)(\\?|$)"),
             s = document.getElementsByTagName('script'),
             src, m, l = "";

 new:
 var r = new RegExp("(^|(.*?\\/))(OpenLayers\.js)(\.gz)*(\\?|$)"),
             s = document.getElementsByTagName('script'),
             src, m, l = "";

 note the additional '(\.gz)*'

 Could this be included in trunk so one can use either OpenLayers.js or 
 OpenLayers.js.gz?

 see ticket http://trac.osgeo.org/openlayers/ticket/3060

 Thanks,
 Andreas


 --
 Andreas Neumann
 Böschacherstrasse 10A
 8624 Grüt (Gossau ZH)
 Switzerland


More information about the Users mailing list