8
मैं एक GeoJSON फ़ाइल पास करना चाहते हैं JavaScript का उपयोग करके datatable बनाया करने के लिए, मैं फ़ाइल में स्तंभ नाम की पहचान के लिए .. असमर्थ मैं इस की कोशिश की है हूँ का उपयोग कर dyanamically DataTable को GeoJSON सरणी दर्रा कैसे ..जावास्क्रिप्ट
मेरे कोड इस तरह है,
<body>
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>fC.type</th>
<th>f.type</th>
<th>f.prop</th>
<th>f.geom.type</th>
<th>geometry.coordinates.0</th>
<th>geometry.coordinates.1</th>
</tr>
</thead>
</table>
</body>
$(document).ready(function() {
$('#example').dataTable({
"ajax":"data/json_file.json",
"processing":true,
"columns": [
{ "mData": "type" },
{ "mData": "features.type" },
{ "mData": "features.properties" },
{ "mData": "geometry.type" },
{ "mData": "geometry.coordinates.0" },
{ "mData": "geometry.coordinates.1" }
]
});
});
और GeoJSON फ़ाइल
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "LineString",
"coordinates": [
[
40.078125,
57.136239319177434
],
[
91.7578125,
58.99531118795094
]
]
}
}
]
}
My output is as shown in image
है
मैं इस कोशिश की ,, मैं एक त्रुटि, मिल गया "Uncaught TypeError: गुण अपरिभाषित की 'लंबाई' पढ़ा नहीं जा सकता"। – Priyanka