Skip to content

Commit

Permalink
Tiled datatypes now checked for MaxTileCoord before loading source.
Browse files Browse the repository at this point in the history
This makes it possible to load in all the meta data needed to display a
tiled data type without having to call a source data type to get the
MaxPoint information. It also means that the source doesn't even have to
exist, which will be the case with many of the tile sources that are
generated from external systems.
  • Loading branch information
neomorphic committed Nov 11, 2015
1 parent 7fa970e commit a385ca9
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions js/components/TileMapArea.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,18 +504,29 @@ var TileMapArea = React.createClass({
// doesn't exist, then we are out of luck as we can't predict the
// extent of the data set.
if (dataIsTiled) {
var source = tileData.Extended.Source;
ServerStore.state.api.node({
uuid: uuid,
endpoint: source + '/info',
callback: function(infoData) {
gScaleData = infoData;
createTileViewer(gScaleData, tileData);
},
error: function() {
ErrorActions.update(new Error('There was a problem loading the meta information from ' + source + '. Please make sure that you have loaded it into dvid.'));
}
});
if (!tileData.Extended.MaxTileCoord) {
var source = tileData.Extended.Source;
ServerStore.state.api.node({
uuid: uuid,
endpoint: source + '/info',
callback: function(infoData) {
gScaleData = infoData;
createTileViewer(gScaleData, tileData);
},
error: function() {
ErrorActions.update(new Error('There was a problem loading the meta information from ' + source + '. Please make sure that you have loaded it into dvid.'));
}
});
}
else {
gScaleData.Extended.MaxPoint = gScaleData.Extended.MaxTileCoord.map(function(n) {
return n * gScaleData.Extended.Levels[0].TileSize[0];
});
gScaleData.Extended.MinPoint = gScaleData.Extended.MinTileCoord.map(function(n) {
return n * gScaleData.Extended.Levels[0].TileSize[0];
});
createTileViewer(gScaleData, tileData);
}
}
else {
createTileViewer(gScaleData, tileData);
Expand Down

0 comments on commit a385ca9

Please sign in to comment.