Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.2.0/leaflet.css" type="text/css" crossorigin="">
- <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.2.0/leaflet.js" crossorigin=""></script>
- <script src="json-to-table.js"></script>
- <link rel="stylesheet" href="style6.css" type="text/css">
- <script type="text/javascript">
- function loadJSON(path, success, error){
- var xhr = new XMLHttpRequest();
- xhr.onreadystatechange = function(){
- if (xhr.readyState === XMLHttpRequest.DONE) {
- if (xhr.status === 200) {
- if (success)
- success(JSON.parse(xhr.responseText));
- } else {
- if (error)
- error(xhr);
- }
- }
- };
- xhr.open("GET", path, true);
- xhr.send();
- }
- function init() {
- loadJSON('ResGarbThursLines.geojson', function(data) {
- var joinToTable = ConvertJsonToTable(JSON.stringify(data), 'jsonTable');
- console.log(typeof data);
- },
- function(xhr) { console.error(xhr);
- }
- );
- </script>
- </head>
- <body onload="init()">
- <table id='jsonTabele'></table>
- </body>
- </html>
Add Comment
Please, Sign In to add comment