loadCAD.js 558 B

123456789101112131415161718192021222324252627282930
  1. !function() {
  2. let point, dire
  3. window.cad = {
  4. setSign: function(p, d) {
  5. point = p
  6. dire = d
  7. }
  8. }
  9. $.ajax({
  10. method: 'GET',
  11. url: '/SuperCad/data/' + window.number + '/results/floor.json',
  12. success(data) {
  13. var $layer = document.querySelector('#cad')
  14. window.cad = structureCAD({
  15. data: data,
  16. layer: $layer,
  17. edit: false
  18. });
  19. if (point && dire) {
  20. window.cad.setSign(point, dire)
  21. }
  22. },
  23. error(e) {
  24. console.error(JSON.parse(e.responseText))
  25. }
  26. })
  27. }()