This is probably a really basic question. I'm working with Leaflet trying to get some GeoJSON going. Everything works fine when I directly define a var as the GeoJSON I'm trying to display:
var censustracts = { "type": "FeatureCollection", ...That works great but fills up my script with coordinates and whatnot. The problem comes when I try to use the L.geoJson() function on the file itself. This throws an error:
var censustracts = L.geoJson("tractsedited.geojson").addTo(map);This is driving me nuts and I can't find anything about it anywhere. I know it's a noob question but I'd appreciate some advice.
أكثر...
var censustracts = { "type": "FeatureCollection", ...That works great but fills up my script with coordinates and whatnot. The problem comes when I try to use the L.geoJson() function on the file itself. This throws an error:
var censustracts = L.geoJson("tractsedited.geojson").addTo(map);This is driving me nuts and I can't find anything about it anywhere. I know it's a noob question but I'd appreciate some advice.
أكثر...