mirror of
https://github.com/cds-astro/aladin-lite.git
synced 2025-12-12 07:40:26 -08:00
fix filterFn on footprints in catalogs: #301
This commit is contained in:
@@ -33,10 +33,16 @@ var myFilterFunction = function(source) {
|
||||
return color>colorThreshold;
|
||||
}
|
||||
|
||||
aladin = A.aladin('#aladin-lite-div', {target: 'M 81', fov: 0.5, survey: 'CDS/P/SDSS9/color'});
|
||||
var cat = A.catalogFromSimbad('M 81', 0.25, {onClick: 'showTable', verbosity: 3, filter: myFilterFunction});
|
||||
aladin.addCatalog(cat);
|
||||
aladin = A.aladin('#aladin-lite-div', {target: 'M 81', fov: 0.5, survey: 'CDS/P/SDSS9/color'});
|
||||
var cat = A.catalogFromSimbad('M 81', 0.25, {
|
||||
shape: (s) => {
|
||||
return A.circle(s.ra, s.dec, 0.003, {lineWidth: 3});
|
||||
},
|
||||
onClick: 'showTable', verbosity: 3, filter: myFilterFunction
|
||||
});
|
||||
|
||||
aladin.addCatalog(cat);
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -1063,9 +1063,20 @@ export let Catalog = (function () {
|
||||
var f;
|
||||
for (let k = 0; k < this.footprints.length; k++) {
|
||||
f = this.footprints[k];
|
||||
|
||||
if (this.filterFn && f.source) {
|
||||
if(!this.filterFn(f.source)) {
|
||||
f.hide()
|
||||
} else {
|
||||
f.show()
|
||||
|
||||
f.draw(ctx, this.view);
|
||||
f.source.tooSmallFootprint = f.isTooSmall();
|
||||
f.draw(ctx, this.view);
|
||||
f.source.tooSmallFootprint = f.isTooSmall();
|
||||
}
|
||||
} else {
|
||||
f.draw(ctx, this.view);
|
||||
f.source.tooSmallFootprint = f.isTooSmall();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user