Closed BeebBenjamin closed 11 months ago
The second issue here is actually the lighting, the second windows light direction needs either separating or synchronising, this would be important when considering bodleian/archiox#11
This is blocked until we get more items up on PRD. Mirador won't let you add duplicate resources.
Above not true, can duplicate and object by clicking on the existing resource!
Symptoms are that the controls work with the first window but not the second. If you play with controls in the second window it affects the appearance of the controls in the first window, but doesn't update anything other than the colour gradient of the direction control.
The second overlay does spawn, but it spawns in the first window...
I've gotten this working, kind of. If you click the torch button in the second window first the add-overlay
event is triggered with the correct window-id for the location of the event. But if you click off and activate the first window then the event is triggered from the first window, even if you use the torch button in the second window.
Need to trigger the event always from the window the button lives in...
ThreeCanvas
needed it's own unique id...
Nearly working. Just need to fix a problem with layers not switching back on when windows resetting after adding a resource.
Need to find out how to implement redux-sagas in adding a event handler for Mirador's ADD_RESOURCE
action. Otherwise our composite layer is switched off after having the relight tool active but pressing Add Resource
.
I've figured out how to use sagas to trigger code on Mirador viewer events. In the main plug-in, you feed in reducers (if you need them) and sagas as follows:
function resourceAdded(action) {
console.log(action);
console.log("This is happening!")
if (action.type === ActionTypes.ADD_RESOURCE) {
try { console.log("Resource Added"); } catch (error) {
console.log(error);
}
}
}
// Worker saga will be fired on ADD_RESOURCE actions
function* rootSaga() {
yield takeEvery(
[
ActionTypes.ADD_RESOURCE
],
resourceAdded
)
}
export default [
{
saga: rootSaga,
target: 'OpenSeadragonViewer',
mapDispatchToProps: {
updateLayers: actions.updateLayers,
},
mapStateToProps: function mapStateToProps(state, _ref) {
const windowId = _ref.windowId;
return {
canvas: getCurrentCanvas(state, { windowId }),
window: getWindow(state, _ref),
};
},
mode: 'add',
component: Relight,
},
];
resourceAdded
is the wrong event trigger to use because canvas is not available. I have changed this to setCanvas
.
Need to figure out how to yield selectors from a loop...
Fixed. Waiting for PR #83
On QA
Still broken due to #84
Fixed
If we load another resource into Mirador via the add button, the 3D overlay doesn't work for the second window, it's black. Which suggests to me something is wrong with the camera coordinates, i.e. incorrect scoping.
If the resource is the same there are conflicts over the resources so I think I need to re-think the way we id them or apply ids to our components.