PlottingPanel.Include.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.*/
  2. (function () {
  3. var ctx='./supermap/examples'
  4. var r = new RegExp("(^|(.*?\\/))(PlottingPanel.Include\.js)(\\?|$)"),
  5. s = document.getElementsByTagName('script'), targetScript;
  6. for (var i = 0; i < s.length; i++) {
  7. var src = s[i].getAttribute('src');
  8. if (src) {
  9. var m = src.match(r);
  10. if (m) {
  11. targetScript = s[i];
  12. break;
  13. }
  14. }
  15. }
  16. function inputScript(url) {
  17. var script = '<script type="text/javascript" src="' + url + '"><' + '/script>';
  18. document.writeln(script);
  19. }
  20. function inputCSS(url) {
  21. // var css = '<link rel="stylesheet" href="' + url + '">';
  22. // document.writeln(css);
  23. }
  24. function inArray(arr, item) {
  25. for (i in arr) {
  26. if (arr[i] == item) {
  27. return true;
  28. }
  29. }
  30. return false;
  31. }
  32. //加载类库资源文件
  33. function load() {
  34. var includes = (targetScript.getAttribute('include') || "").split(",");
  35. var excludes = (targetScript.getAttribute('exclude') || "").split(",");
  36. if (inArray(includes, 'PlotPanel')) {
  37. inputScript(ctx+"/js/plottingPanel/PlotPanel.js");
  38. }
  39. if (inArray(includes, 'StylePanel')) {
  40. inputScript(ctx+"/js/plottingPanel/customEditor/ColorpickerEditor.js");
  41. inputScript(ctx+"/js/plottingPanel/PublicStyleFunction.js");
  42. inputScript(ctx+"/js/plottingPanel/StylePanel.js");
  43. }
  44. if (inArray(includes, 'SMLInfosPanel')) {
  45. inputScript(ctx+"/js/plottingPanel/SMLInfosPanel.js");
  46. }
  47. if (inArray(includes, 'iPortalStylePanel')) {
  48. inputScript(ctx+"/js/plottingPanel/iPortalStylePanel.js");
  49. }
  50. }
  51. load();
  52. })();