Skip to content

Commit

Permalink
Merge pull request #55 from argonavt11/gh-pages
Browse files Browse the repository at this point in the history
Add event error (use catch)
  • Loading branch information
calvinmetcalf authored Dec 12, 2018
2 parents d4f3577 + b3c309a commit aeec6e4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions leaflet.shpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ L.Shapefile = L.GeoJSON.extend({
shp(file).then(function(data) {
self.addData(data);
self.fire('data:loaded');
});
}).catch(function(err) {
self.fire('data:error', err);
})
return this;
}
var promise;
Expand All @@ -49,7 +51,9 @@ L.Shapefile = L.GeoJSON.extend({
self.addData(data);
self.fire('data:loaded');
self.worker.close();
});
}).catch(function(err) {
self.fire('data:error', err);
})
return this;
}
});
Expand Down

0 comments on commit aeec6e4

Please sign in to comment.