Skip to content

Commit

Permalink
Merge pull request opencadc#2 from at88mph/master
Browse files Browse the repository at this point in the history
Options to support non auto navigation to selected row.
  • Loading branch information
at88mph authored Sep 12, 2016
2 parents 7ed1d83 + eeac7cf commit 3446d9e
Showing 1 changed file with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@
$toggleSelector.data("open", $toggleSelector.html());
$toggleSelector.html($toggleSelector.data("close"));
},
aladin_options: {}, // Specific options for AladinLite.
renderedRowsOnly: true,
footprintFieldID: "footprint",
raFieldID: "ra",
decFieldID: "dec",
fovFieldID: "fov",
colour: "orange",
navigateToSelected: true,
highlightColour: "yellow",
/**
* Perform further calculations on the FOV before setting it. Useful
Expand Down Expand Up @@ -147,7 +149,7 @@

_self.viewer = _viewer;
_self.grid = _viewer.getGrid();
_self.aladin = A.aladin(inputs.targetSelector);
_self.aladin = A.aladin(inputs.targetSelector, inputs.aladin_options);
_self.aladinOverlay =
A.graphicOverlay({color: inputs.colour, lineWidth: 3});
_self.DEC = _defaults.coords.slice(0);
Expand Down Expand Up @@ -378,7 +380,6 @@
if ((raValue != null) && ($.trim(raValue) != "") && (decValue != null)
&& ($.trim(decValue) != ""))
{
_self.aladin.gotoRaDec(raValue, decValue);
var selectedFootprint =
sanitizeFootprint(_dataRow[_self.footprintFieldID]);

Expand All @@ -387,15 +388,20 @@
_self.currentFootprint.addFootprints(
_self.aladin.createFootprintsFromSTCS(selectedFootprint));

var fovValue = _dataRow[_self.fovFieldID];
if (fovValue != null)
if (inputs.navigateToSelected === true)
{
if (inputs.afterFOVCalculation != null)
_self.aladin.gotoRaDec(raValue, decValue);

var fovValue = _dataRow[_self.fovFieldID];
if (fovValue != null)
{
fovValue = inputs.afterFOVCalculation(fovValue);
}
if (inputs.afterFOVCalculation != null)
{
fovValue = inputs.afterFOVCalculation(fovValue);
}

_self.aladin.setFoV(fovValue);
_self.aladin.setFoV(fovValue);
}
}
}
else
Expand Down

0 comments on commit 3446d9e

Please sign in to comment.