Skip to content

Commit

Permalink
Add optional importUrl to Shapefile signature
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlukerice committed May 13, 2015
1 parent c3bbcab commit cf27e7e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions leaflet.shpfile.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
L.Shapefile =L.GeoJSON.extend({
initialize: function (file, options) {
initialize: function (file, options, importUrl) {
if(typeof cw !== 'undefined'){
if (typeof importUrl === 'undefined') {
importUrl = 'shp.js';
}
this.worker = cw(function(data,cb){
importScripts('shp.js');
importScripts(importUrl);
shp(data).then(cb);
});
}
Expand Down Expand Up @@ -33,6 +36,6 @@ L.Shapefile =L.GeoJSON.extend({
}
});

L.shapefile= function(a,b){
return new L.Shapefile(a,b);
L.shapefile= function(a,b,c){
return new L.Shapefile(a,b,c);
}

0 comments on commit cf27e7e

Please sign in to comment.