In my Extension I have an ID from this.viewer.getSelection()
array, eg 1234.
I've tried to get properties from this:
this.viewer.getProperties(1234,function(data) {console.log(data);},function(e1,e2) {console.log("ERROR:",e1,e2);})
But I see the error:
Properties failed to load since model does not exist
Updated question: How to get properties of multiple selected objects synchronously ?
Under the hood, the viewer.getProperties method calls viewer.model.getProperties , and as the error message states, viewer.model
is not available when the method is called. Note that there could be several different reasons for such scenario:
viewer.getProperties
is called on a different instance of viewer (which does not have any model loaded)viewer.getProperties
is called before the model has been loadedviewer.getProperties
is called after the model has been unloaded
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.