Guest User

Untitled

a guest
Jan 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.2.0/leaflet.css" type="text/css" crossorigin="">
  6. <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.2.0/leaflet.js" crossorigin=""></script>
  7. <script src="json-to-table.js"></script>
  8. <link rel="stylesheet" href="style6.css" type="text/css">
  9.  
  10. <script type="text/javascript">
  11. function loadJSON(path, success, error){
  12. var xhr = new XMLHttpRequest();
  13. xhr.onreadystatechange = function(){
  14. if (xhr.readyState === XMLHttpRequest.DONE) {
  15. if (xhr.status === 200) {
  16. if (success)
  17. success(JSON.parse(xhr.responseText));
  18. } else {
  19. if (error)
  20. error(xhr);
  21. }
  22. }
  23. };
  24.  
  25. xhr.open("GET", path, true);
  26. xhr.send();
  27. }
  28.  
  29. function init() {
  30. loadJSON('ResGarbThursLines.geojson', function(data) {
  31. var joinToTable = ConvertJsonToTable(JSON.stringify(data), 'jsonTable');
  32. console.log(typeof data);
  33. },
  34. function(xhr) { console.error(xhr);
  35. }
  36. );
  37.  
  38. </script>
  39. </head>
  40. <body onload="init()">
  41. <table id='jsonTabele'></table>
  42. </body>
  43. </html>
Add Comment
Please, Sign In to add comment