[TASK] Use Promises for GeoJSON

Allow ajax requests, single or list of objects
This commit is contained in:
Xaver Maierhofer 2018-10-07 16:39:07 +02:00 committed by GitHub
parent 31d0209cc2
commit 2604b2b731
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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);
}
});
});
}