Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
[TASK] Use Promises for GeoJSON
Browse files Browse the repository at this point in the history
Allow ajax requests, single or list of objects
  • Loading branch information
xf- authored Oct 7, 2018
1 parent 31d0209 commit 2604b2b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
});
}

Expand Down

0 comments on commit 2604b2b

Please sign in to comment.