Skip to content

Commit

Permalink
cross origin
Browse files Browse the repository at this point in the history
  • Loading branch information
Calvin Metcalf committed Aug 8, 2013
1 parent e7aad12 commit ed79325
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@
var m = L.map('map').setView([ 42.09618442380296, -71.5045166015625],8);
var watercolor = L.tileLayer('http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.jpg',{attribution:'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> &mdash; Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'}).addTo(m);

var shpfile = new L.Shapefile('congress.zip');
var shpfile = new L.Shapefile('congress.zip',{onEachFeature:function(feature, layer) {
if (feature.properties) {
layer.bindPopup(Object.keys(feature.properties).map(function(k){
return k + ": " + feature.properties[k] ;
}).join("<br />"),{maxHeight:200});
}
}});
shpfile.addTo(m);
</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion leaflet.shpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ L.Shapefile =L.GeoJSON.extend({
return self.addData(file);
}
if(self.worker){
self.worker.data(file).then(function(data){
self.worker.data(cw.makeUrl(file)).then(function(data){
self.addData(data);
});
}else{
Expand Down

0 comments on commit ed79325

Please sign in to comment.