Leaflet js and getting geojson file not working as expected. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Leaflet js and getting geojson file not working as expected. (/showthread.php?tid=81971) |
Leaflet js and getting geojson file not working as expected. - spreaderman - 05-28-2022 If I put the geojson file inline, it works fine. Here is a sample; Code: var geojson = { Above produced several makers on my map. However, if I try to read in a geojson file from /public/user_public/ski/data/drinkingwater.geojson as follows; Code: var japanGeoJSON = false; Above produces: Response {type: 'basic', url: 'https://development.example.com/user_public/ski/data/drinkingwater.geojson', redirected: false, status: 200, ok: true, …} "Invalid GeoJSON object." Wondering why this may be the case. RE: Leaflet js and getting geojson file not working as expected. - InsiteFX - 05-28-2022 Maybe this will help you out. MDN - Using the Fetch API |