Closed muhammadm closed 6 years ago
Trying to not have to wait for my data to load I was attempting to do the following ...
var geoLayer = L.Proj.geoJson(null, { pointToLayer: function (feature, latlng) {
});
$.getJSON("data.geojson", function (data) { geoLayer.addData(data); });
But it fails to work.
The only way I can get the Projection to work is to load the geojson in a variable and do an asych:false call.
var geojson $.ajax({ url: 'data.geojson', async: false, dataType: 'json', success: function (response) { geojson = response; $("#loading").hide(); } });
Then this works wonderfully: var geoLayer = L.Proj.geoJson(geojson, { pointToLayer: function (feature, latlng) { ......
Any work around?
This issue should have been closed by #77. Feel free to tell me if this is still an issue in latest Proj4Leaflet.
Trying to not have to wait for my data to load I was attempting to do the following ...
var geoLayer = L.Proj.geoJson(null, { pointToLayer: function (feature, latlng) {
});
$.getJSON("data.geojson", function (data) { geoLayer.addData(data); });
But it fails to work.
The only way I can get the Projection to work is to load the geojson in a variable and do an asych:false call.
Then this works wonderfully: var geoLayer = L.Proj.geoJson(geojson, { pointToLayer: function (feature, latlng) { ......
});
Any work around?