For WAB (Developer Edition) 2.17, I modified the standard 3D "LayerList" widget,
ading a button to display attribute table of layer by opening a custom widget which uses the code from
FeatureTable widget with popup interaction
to display the attribute table within that widget which serves as a "popup".
For some layers it displays the attribute table OK,
but for some other layers it displays only the first line with the field names,
but the whole table is not displayed, so the features data is missing.
Note: the regular popup, activated by clicking the features on the sceneView, works OK,
so this is some problem using the code of the FeatureTable widget from the above example.
The error message I get is
init.js:115 [esri.core.Accessor] Accessor#set Assigning an instance of 'esri.layers.SceneLayer' which is not a subclass of 'esri.layers.FeatureLayer'
I get also a second message:
SceneLayer queries are not available without associated feature layer
Help will be greatly appreciated.
Michael
Solved! Go to Solution.
Michael,
So it sounds like what you are sending to the FeatureTables layer property is not what it expects sometimes. You should evaluate the layers typeof and if it is a SceneLayer then get the url property and create a FeatureLayer from the url then feed that to the FeatureTable.
Michael,
So it sounds like what you are sending to the FeatureTables layer property is not what it expects sometimes. You should evaluate the layers typeof and if it is a SceneLayer then get the url property and create a FeatureLayer from the url then feed that to the FeatureTable.
Thanks Robert Scheitlin, GISP,
only please instruct me (links?) how to
I get the layer in the LayerList widget.
Michael
Dear Robert Scheitlin, GISP,
Thank you, but I'm afraid that javascript typeof does not know between sceneLayer and featureLayer. It only checks for javascript types.
So I still don't know how can I check if it's a SceneLayer or FeatureLayer?
Additionally, I apologize that as I'm relatively new to GIS, I need know -
Thanks,
Michael
Michael,
Your make this way to complicated by overthinking things. A Scene layer is just another layer type. It has a URL thus that url can be used in a FeatureLayer constructor. JS API layer objects have a type property that can be used to evaluate the type of object it is.
I am not an expert on your exact scenario I am only providing a suggestion to get past your error about the layer being a scene layer.
I actually don't understand why it is have an error like that but it is likely due to the fact that FeatureTable is clearing indicated that it is still in beta release.
Dear Robert Scheitlin, GISP,
I'm reading now in esri documents.
I understand that Only point, building, and 3D object scene layer types do have an associated feature layer.
So how can I detect by javascript if the sceneLayer is answering this condition?
Michael