Closed mtabdar closed 7 years ago
Nope, its not a bug, its just a limitation of the widget. It uses Feature layer "clicks" to do the query. I do have an example of it working with dynamic layers though, but it works a little differently. It uses the identify popup to display the table instead. Would that meet your needs?
Thanks. In fact it is exactly what i want but i cannot do it! I used your samples just changed the urls to my own. Then i set identify to show relation tables it workd fine for "petrolium" (why is it not petroleum?) which is feature layer but couldndo the same for timekansas which is dynamic. I also changed petroleum to dynamic and the identify stopped showing relation table.!!?
Does the identify show up at all? Or are there error messages?
Yes identify shows regular identify values and no errors just some svg.js errors which are not related to this.
Off the top of my head, it sounds llike your layer id might not match up with your identify layer id.
In viewer.js (or main cmv config file), what is:
layer.type
layer.options.id
layer.url
(not the fulll url, but whether its /MapServer/0
or /Maperver
or /Mapserver/1
etcIn identify.js config file, what is:
For example, I have a dynamic layer:
{
id: 'assets',
type: 'dynamic',
url: '/arcgis/rest/services/internal/assets/MapServer',
title: 'Assets and Utilities',
options: {
id: 'assets'
},
layerControlLayerInfos: {
expanded: true
}
}
and my identifies info looks like this:
identifies: {
assets: {
25: {
title: 'Street Segmenet {cid}',
content: factory([{
title: 'History',
objectIdField: 'OBJECTID',
relationshipId: 4,
url: '/arcgis/rest/services/internal/assets/MapServer/25',
columns: [{
field: 'Operation'
}, {
field: 'op_year',
label: 'Year'
}]
}])
},
}
}
Similarly, for feature layers, the only thing you'd need to change is this in viewer.js:
{
id: 'assets',
type: 'feature',
url: '/arcgis/rest/services/internal/assets/MapServer/25',
title: 'Assets and Utilities',
options: {
outFields: '*',
id: 'assets'
},
layerControlLayerInfos: {
expanded: true
}
},
Yes you are right. When i checked and corrected sublayer id's and relation id's i could see the related records in identify for dynamic layer. Thanks. Though i have 2 problems
There's a fix for number 1, it is a bug in the identify widget: https://github.com/cmv/cmv-app/pull/706
For number 2, it might be helpful for you to look at the network logs when you do the identify. Then you can see what query is being passed to the server, and what it is returning as a response.
thanks. 1- i think you are right about "layer with id =0" because i encountered some other issues with it (label layers for example) but unfortunately i couldn't understand if there is a fix available or the root of the problem is identified and you are trying to fix it? 2- again you are right and i should investigate more about it. thanks a lot for the help.
The problem is identified, but has not been included in cmv-app yet. The only change that needs to happen is in gis/dijit/Identify.js https://github.com/cmv/cmv-app/blob/64b0a2fbdc07fcb7652cc8d75aac205729a341a2/viewer/js/gis/dijit/Identify.js#L400
This fix is now in the cmv develop branch. You should be able to download the latest version and have this issue resolved.
Hi Thanks for the amazing widgets espcially the relation table. It is fantastic but i couldn't use it with my dynamic layers. is it a bug or i am doing something wrong?