Skip to content

Commit

Permalink
Merge pull request #28 from tboch/hips-catalogue-filtering
Browse files Browse the repository at this point in the history
Hips catalogue filtering
  • Loading branch information
tboch authored Jan 24, 2020
2 parents 2b4918c + 8d55e86 commit 8dc5eca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/js/ProgressiveCat.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ ProgressiveCat = (function() {
this.selectSize = this.sourceSize + 2;
this.selectionColor = '#00ff00'; // TODO: to be merged with Catalog

// allows for filtering of sources
this.filterFn = options.filter || undefined; // TODO: do the same for catalog


this.onClick = options.onClick || undefined; // TODO: inherit from catalog

Expand Down Expand Up @@ -359,14 +362,21 @@ ProgressiveCat = (function() {
if (! sources) {
return;
}
var s;
for (var k=0, len = sources.length; k<len; k++) {
cds.Catalog.drawSource(this, sources[k], ctx, projection, frame, width, height, largestDim, zoomFactor);
s = sources[k];
if (!this.filterFn || this.filterFn(s)) {
cds.Catalog.drawSource(this, s, ctx, projection, frame, width, height, largestDim, zoomFactor);
}
}
for (var k=0, len = sources.length; k<len; k++) {
if (! sources[k].isSelected) {
s = sources[k];
if (! s.isSelected) {
continue;
}
cds.Catalog.drawSourceSelection(this, sources[k], ctx);
if (!this.filterFn || this.filterFn(s)) {
cds.Catalog.drawSourceSelection(this, s, ctx);
}
}
},

Expand Down
2 changes: 2 additions & 0 deletions src/js/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -1873,6 +1873,8 @@ View = (function() {
var overlay;
var canvas=this.catalogCanvas;
var ctx = canvas.getContext("2d");
// this makes footprint selection easier as the catch-zone is larger
ctx.lineWidth = 6;

if (this.overlays) {
for (var k=0; k<this.overlays.length; k++) {
Expand Down

0 comments on commit 8dc5eca

Please sign in to comment.