I am trying to add dummy markers of german companies in Leaflet map using separate geoJSON file, but each time Mozilla returns a non well formed error.
I have tried the solutions proposed in this topic concerning MIME error: "not well-formed" error in Firefox when loading JSON file with XMLHttpRequest
https://forum.jquery.com/topic/firefox-error-on-valid-local-json-load-not-well-formed
But nothing changed. There are a lot of topic about server problems but I'm still in local. I didn't found other people using leaflet and geojson with this problem.
I also tried with a HTML link:
<link rel="points" type= "application/json" href="assets/js/mess/german_company.geojson">
And use this link in my js file:
//dummy data markers
$.getJSON($('link[rel="points"]').attr("href"), function(data){
var markers = L.geoJson(data, {
onEachFeature: function (feature, layer){
layer.addEventListener("click", function(){
var result = document.getElementById("result");
result.innerHTML = feature.properties.Company + "<br/>Sales: " + feature.properties.Sales + " €<br/>Margin: " + feature.properties.Margin + " €";
});
}}).addTo(map);
With this method, the map is displayed with the markers, so it works, but I've still this "not well formed" error and I think this causes error with other plugin I use (leaflet.markercluster works but the markers still appear when I zoom out, markers cannot be hide with leaflet removeLayer function)
Anyone have an idea to solve this "not well formed" error? Thanks!