Same Json file for Datables and Leaflet (format issue)
Same Json file for Datables and Leaflet (format issue)
I am attempting to use the same Json file with data to be loaded in both Leaflet and Datatables. Eventually it will be a single application with both displays.
I have them working correctly using separate Json files with the same data. The only difference between them is that Leaflet seems to require that the GeoJson file begin with an object declaration var NAME = {
in the Json file before any data; this will load in the L.geoJson(NAME,...
function correctly. I can't make this file work with Datatables.
I have also tried to declare an object using ($.getJSON) and passing it on to Leaflet, but apparently it will not take it.
Here are both the sites, very simple:
Leaflet map: http://educacaoaberta.org/pub/nead.html
Datables: http://educacaoaberta.org/pub/data.html
This seems like a simple problem, any suggestions?
Answers
Oddly enough, the offending script was:
<script src="libraries/jquery/jquery-2.1.3.min.js"></script>
in the file that is loaded in the<div>
by jquery (datatables.html
). Removed it, and it worked.