@@ -149,12 +149,23 @@ function toAngle(d, radianToDegree) {
149149export function getRowCenterWorldPt ( tableOrId ) {
150150 const tbl = getTableModel ( tableOrId ) ;
151151 if ( ! tbl ) return ;
152- const cenCol = findTableCenterColumns ( tbl ) ;
152+ const cenCol = findTableCenterColumns ( tbl , true ) ;
153153 if ( ! cenCol ) return ;
154154 const { lonCol, latCol, csys} = cenCol ;
155- const rad = isTableUsingRadians ( tbl , [ lonCol , latCol ] ) ;
156- const lon = toAngle ( getCellValue ( tbl , tbl . highlightedRow , lonCol ) , rad ) ;
157- const lat = toAngle ( getCellValue ( tbl , tbl . highlightedRow , latCol ) , rad ) ;
155+
156+ let lon ;
157+ let lat ;
158+
159+ if ( lonCol === latCol ) {
160+ const latlonAry = getCellValue ( tbl , tbl . highlightedRow , lonCol ) ;
161+ lon = toAngle ( latlonAry [ 0 ] , false ) ;
162+ lat = toAngle ( latlonAry [ 1 ] , false ) ;
163+ }
164+ else {
165+ const rad = isTableUsingRadians ( tbl , [ lonCol , latCol ] ) ;
166+ lon = toAngle ( getCellValue ( tbl , tbl . highlightedRow , lonCol ) , rad ) ;
167+ lat = toAngle ( getCellValue ( tbl , tbl . highlightedRow , latCol ) , rad ) ;
168+ }
158169 if ( isNaN ( lon ) || isNaN ( lat ) ) return ;
159170 return makeAnyPt ( lon , lat , csys || CoordinateSys . EQ_J2000 ) ;
160171}
0 commit comments