Reusable Accessible Mapping Platform

API Docs for: 3.0.0
Show:

File: src\js\RAMP\RAMP-starter.js

  1. /*global location, $, document */
  2.  
  3. /**
  4. *
  5. *
  6. * @module RAMP
  7. */
  8.  
  9. /**
  10. * RAMPStarter class.
  11. * Performs initial configuration of the dojo config object specifying path to the RAMP modules, detecting locale, and loading the {{#crossLink "Bootstrapper"}}{{/crossLink}} module.
  12. * pipe the locale to dojo.
  13. *
  14. * @class RAMPStarter
  15. * @static
  16. */
  17.  
  18. //required to get draw bar to show in French
  19. var RAMP,
  20. jsFolderPath = "js/",
  21. pathname = location.pathname.replace(/\/[^/]+$/, "") + "/",
  22. htmlNode = $("html"),
  23. dojoConfig;
  24.  
  25. /**
  26. * RAMP global class.
  27. * A general globally available class to hold any RAMP global data. Currently houses any plugins which are not loaded via AMD.
  28. *
  29. * @class RAMP
  30. */
  31. RAMP = {
  32. plugins: {
  33. featureInfoParser: {}
  34. }
  35. };
  36.  
  37. dojoConfig = {
  38. parseOnLoad: false,
  39. locale: htmlNode.attr("lang"),
  40. async: true,
  41. packages: [
  42. {
  43. name: "ramp",
  44. location: pathname + jsFolderPath + "RAMP/Modules"
  45. },
  46. {
  47. name: "utils",
  48. location: pathname + jsFolderPath + "RAMP/Utils"
  49. },
  50. {
  51. name: "tools",
  52. location: pathname + jsFolderPath + "RAMP/Tools/"
  53. }
  54. ],
  55. fullPluginPath: pathname + jsFolderPath + 'plugins/'
  56. };
  57.  
  58. $(document).ready(function () {
  59. "use strict";
  60. // when loading js file this way, it will NOT show up in the debug panel in Firebug
  61. /*$.getScript(pathname + jsFolderPath + state + "RAMP/bootstrapper.js",
  62. function( data, textStatus, jqxhr ) {
  63. console.log( jqxhr.status ); // 200
  64. });*/
  65.  
  66. // when loading js file this way, it will show up in the debug panel in Firebug
  67. var head = document.getElementsByTagName('head')[0],
  68. script = document.createElement('script');
  69. script.type = 'text/javascript';
  70. script.src = pathname + jsFolderPath + "RAMP/bootstrapper.js";
  71. head.appendChild(script);
  72. });