Hello,
first time I use `leafleft.js` and `json` to populate a map with some markers.
Since I can only export `json` and not `geojson` from an array of data from the website I am working on, I am
using leaflet-layerJSON to upload to leaftlet's maps the coordinates.
My current code is
var map = new L.Map('map', {scrollWheelZoom: false}).setView([46.4620, 11.3540], 10);
map.addLayer(new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'));
var jsonLayer = new L.LayerJSON({url: Kirby.url('/api/luoghi')});
map.addLayer(jsonLayer);
where `Kirby.url` stands for the baseUrl of the website's current page.
Also, I am linking to a `json` page and not to a `json` file, if that might be relevant.
The `json` page output all the markers coordinates like so
[{ "title": "Biblioteca di Laives", "loc": [46.428279, 11.340092] }, { "title": "Centro Trevi Bolzano", "loc": [46.49583, 11.352416] }, { "title": "Biblioteca di Egna", "loc": [46.314294, 11.272767] }]
If I change the order of the `json`, the map correctly prints the first (and only) element.
What am I missing?
Thanks,
André