Make the getScriptLocation function work with mobile & light builds and any other extended OpenLayers script naming convention

This commit is contained in:
Matt Priour
2012-03-05 19:53:35 -06:00
parent d5da1130b5
commit 405a2225e8

View File

@@ -25,7 +25,7 @@ var OpenLayers = {
* {String} Path to this script * {String} Path to this script
*/ */
_getScriptLocation: (function() { _getScriptLocation: (function() {
var r = new RegExp("(^|(.*?\\/))(OpenLayers\.js)(\\?|$)"), var r = new RegExp("(^|(.*?\\/))(OpenLayers.*?\.js)(\\?|$)"),
s = document.getElementsByTagName('script'), s = document.getElementsByTagName('script'),
src, m, l = ""; src, m, l = "";
for(var i=0, len=s.length; i<len; i++) { for(var i=0, len=s.length; i<len; i++) {