[TASK] Use Promises for GeoJSON
Allow ajax requests, single or list of objects
This commit is contained in:
parent
31d0209cc2
commit
2604b2b731
@ -82,7 +82,11 @@ define(['map/clientlayer', 'map/labellayer', 'map/button', 'leaflet', 'map/activ
|
||||
|
||||
if (config.geo) {
|
||||
[].forEach.call(config.geo, function (geo) {
|
||||
L.geoJSON(geo.json, geo.option).addTo(map);
|
||||
geo.json().then(function (result) {
|
||||
if (result) {
|
||||
L.geoJSON(result, geo.option).addTo(map);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user