WorldWideTelescope / wwt-web-client

The WorldWide Telescope web client lets you explore the universe in your browser.
https://worldwidetelescope.org/webclient/
MIT License
105 stars 35 forks source link

Error when trying to navigate to a specific planet under collections #274

Open astrofrog opened 4 years ago

astrofrog commented 4 years ago

To reproduce:

Nothing happens and the console includes the following error:

angular.js:13920 TypeError: d.get_camParams is not a function
    at Object.h [as clickThumb] (wwtwebclient.min.js?v=5.3.66:6)
    at m.a.clickThumb (wwtwebclient.min.js?v=5.3.66:9)
    at fn (eval at compile (angular.min.js:1), <anonymous>:4:314)
    at b (angular.js:15906)
    at e (angular.js:25885)
    at m.$eval (angular.js:17682)
    at m.$apply (angular.js:17782)
    at HTMLDivElement.<anonymous> (angular.js:25890)
    at HTMLDivElement.dispatch (jquery-2.1.4.min.js:3)
    at HTMLDivElement.r.handle (jquery-2.1.4.min.js:3)
pkgw commented 4 years ago

The problem is in clickThumb in factories/ThumbList.js. The item being clicked is an ImageSet with DataSetType = "Planet" and ReferenceFrame = "Jupiter", and when lookAt = "Sky" the existing logic doesn't handle the necessary state transition.

Looks like there's also an issue where the logic in util.getIsPlanet is incorrect — testing for get_rotation is basically a test for whether the item is an Imageset instance, which is not the right thing to check.

<ImageSet Generic="False" DataSetType="Planet" BandPass="Visible" 
  Url="http://r{S:1}.ortho.tiles.virtualearth.net/tiles/wts0000000121{Q}?g=131" TileLevels="4" 
  WidthFactor="1" Sparse="False" Rotation="0" QuadTreeMap="0123" Projection="Toast" 
  Name="Jupiter" FileType=".png" CenterY="0" CenterX="0" BottomsUp="False" StockSet="False" 
  ElevationModel="False" OffsetX="0" OffsetY="0" BaseTileLevel="0" BaseDegreesPerTile="180"  
  MeanRadius='71492000' ReferenceFrame='Jupiter'>
  <Credits>Image Courtesy NASA/JPL/Space Science Institute</Credits>
  <CreditsUrl>http://photojournal.jpl.nasa.gov/catalog/PIA07782</CreditsUrl>
  <ThumbnailUrl>http://www.worldwidetelescope.org/wwtweb/thumbnail.aspx?name=jupiter</ThumbnailUrl>
</ImageSet>