Skip to content

Commit

Permalink
ugly hack to accept script location
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinmetcalf committed May 22, 2015
1 parent 8c69a68 commit 478969a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions leaflet.shpfile.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
L.Shapefile =L.GeoJSON.extend({
initialize: function (file, options, importUrl) {
if(typeof cw !== 'undefined'){
this.worker = cw(function(data,cb){
importScripts(importUrl || 'shp.js');
shp(data).then(cb);
});
importUrl = importUrl || 'shp.js';
this.worker = cw(new Function('data', 'cb', 'importScripts("' + importUrl + '");shp(data).then(cb);'));
}
L.GeoJSON.prototype.initialize.call(this,{features:[]},options);
this.addFileData(file);
Expand Down

0 comments on commit 478969a

Please sign in to comment.