SingleFile.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for
  2. * full list of contributors). Published under the Clear BSD license.
  3. * See http://svn.openlayers.org/trunk/openlayers/license.txt for the
  4. * full text of the license. */
  5. var OpenLayers = {
  6. /**
  7. * Constant: VERSION_NUMBER
  8. */
  9. VERSION_NUMBER: "Release 2.11",
  10. /**
  11. * Constant: singleFile
  12. * TODO: remove this in 3.0 when we stop supporting build profiles that
  13. * include OpenLayers.js
  14. */
  15. singleFile: true,
  16. /**
  17. * Method: _getScriptLocation
  18. * Return the path to this script. This is also implemented in
  19. * OpenLayers.js
  20. *
  21. * Returns:
  22. * {String} Path to this script
  23. */
  24. _getScriptLocation: (function() {
  25. var r = new RegExp("(^|(.*?\\/))(OpenLayers\.js)(\\?|$)"),
  26. s = document.getElementsByTagName('script'),
  27. src, m, l = "";
  28. for(var i=0, len=s.length; i<len; i++) {
  29. src = s[i].getAttribute('src');
  30. if(src) {
  31. var m = src.match(r);
  32. if(m) {
  33. l = m[1];
  34. break;
  35. }
  36. }
  37. }
  38. return (function() { return l; });
  39. })()
  40. };