|
POST
|
When at first, I perform a buffer query the results of the query are added to a new custom feature layer. The attribute table adds the new feature layer at a new tab. Then, when I remove the feature layer (map.removeLayer([feat layer]), the attribute table refreshes by removing the new tab. When I attempt to call same query again, the attribute table does not add the feature layer any more. However, the I can see the features are selected on the map. Also, on the layer list, I can see the new feature layer is added and I can view the attribute table with the new tab by selecting "open attribute table". I am using web appbuilder 1.3 Did anyone experience this behavior? Thanks.
... View more
01-12-2016
02:47 PM
|
0
|
6
|
3742
|
|
POST
|
Sorry, the problem, persist. I also have to apologize, that after my first posting I introduced the array mylayer to see if I needed to push the layer into an array. So going back to the first posting, the problem persist either way. The question is that if console.log can show the layer name as a string without the indexOf, why do we need to try to convert it to a string per your suggestion? THANK YOU for your time. array.forEach(this.map.graphicsLayerIds, function(layerId) { var layer = this.map.getLayer(layerId); if((layer.name).indexOf("Buffer") > -1){ console.log(layer.name); } }, this); array.forEach(this.map.graphicsLayerIds, function(layerId) { var layer = this.map.getLayer(layerId); if(layer.name.toString().indexOf("Buffer") > -1){ console.log(layer.name); } }, this);
... View more
01-07-2016
11:26 AM
|
0
|
1
|
1416
|
|
POST
|
Thank Robert. But I got the same error: array.forEach(this.map.graphicsLayerIds, function(layerId) {
layer = this.map.getLayer(layerId);
mylayer.push(layer);
}, this);
for(j=0;j<mylayer.length; j++){
if(layer.name.toString().indexOf("Buffer") > -1){
console.log(mylayer.name);
}
}
... View more
01-07-2016
10:57 AM
|
0
|
3
|
1416
|
|
POST
|
This is a rather bizarre behavior when I use the indexof to find layer names that contain "Buffer". So by running this: array.forEach(this.map.graphicsLayerIds, function(layerId) {
var layer = this.map.getLayer(layerId);
console.log(layer.name);
}, this); I get this output: I modified it to capture only the layer names containing "Buffer", so I run this: array.forEach(this.map.graphicsLayerIds, function(layerId) {
var layer = this.map.getLayer(layerId);
if((layer.name).indexOf("Buffer") > -1){
console.log(layer.name);
}
}, this); and I get this: meaning that the layer is undefined!!! Ideas? Thank you.
... View more
01-07-2016
10:46 AM
|
0
|
5
|
2615
|
|
POST
|
I haven't got to it yet. I got distracted to other duties. Will let you know when I do so.
... View more
12-30-2015
03:02 PM
|
0
|
0
|
2614
|
|
POST
|
For the FeatureTable there is an easy way to click on feature on the map and it highlights the table row for the selected feature on the table. simply use featuretable.enableLayerClick=true on this example: ArcGIS API for JavaScript Sandbox just enter on line 104 myTable.enableLayerClick=true; and any feature you click on the map, you can see the highlighted row. Here is my question. The Attribute table that is used in wab, is not declared as FeatureTable. So, to get the highlighted row after you click a feature on map, you will have to compare the evt and the records on the grid, and once a match is made use grid.rows.setOverRow Am I see it right? Thank you.
... View more
12-22-2015
04:20 PM
|
0
|
7
|
5236
|
|
POST
|
I just copied the code you gave me and I got this. This is bizarre. One of the screenshot (see below), shows the first tab with the field names and the second tab without the field names. So, I placed in the "theselectInBuffer" a console.log and it was called twice, and hence calling the attribute table twice. selectInBuffer: function (results) { array.map(results, lang.hitch(this, function(feature){ this.thelayer.add(feature); })); console.log("sign1"); this._openResultInAttributeTable(this.thelayer); }, output:
... View more
12-21-2015
04:36 PM
|
0
|
2
|
1798
|
|
POST
|
yes, i agree. Thank you for you kind words and your time. I have an observation. The selectInBuffer is called twice, creating two tabs on the Attribute table, one is with the field names and one one without it. Thank you again.
... View more
12-21-2015
03:14 PM
|
0
|
4
|
1798
|
|
POST
|
Ok. Here you go. The ultimate goal is to pass on the thislayer to the _openResultInAttributeTable so it can publish the table with the query results. As you can see from the line 276, the layer has the layer name, however the _openResultInAttributeTable cannot access it. The second issue is how to pass on the featureSet of the quesry results to the feature collection. When I including it it causes the Converting circular structure to JSON error. Thank you.
... View more
12-21-2015
11:01 AM
|
0
|
6
|
3951
|
|
POST
|
Ok. I didn't want to post a long script. I will create a smaller version of it and test it again. If still has problems, I will post it Thank you for your commitment helping others.
... View more
12-18-2015
10:03 AM
|
0
|
8
|
3951
|
|
POST
|
Sorry to drag it on, but it is confusing. Why do I need to assign a name to the layerinfo when it already has it? I verified it by using the code below. So by declaring layerDefinition: layerInfo, in the featurecollection the name should be passed on as well since I will use the same layerinfo for the new featurelayer as the myurl. However it is not passed on when a featurelayer is created using that feature collection. What am I missing here? Thank you for your patience. esriRequest({ url: myurl, content: { f: 'json' }, handleAs: 'json', callbackParamName: 'callback' }).then(lang.hitch(this, function (layerInfo) { console.log(layerInfo.name); //name is printed in console }
... View more
12-17-2015
09:19 PM
|
0
|
10
|
3951
|
|
POST
|
Thank you. It seems that the featureSet was causing the error. But how do I define the new layer based on the query selection. By defining the featureSet: null then the selection is null. Also, when I pass on thislayer to the _openResultInAttributeTable function, I get the error that it cannot read the 'name' of undefined even though the currentlayer is not null! _openResultInAttributeTable: function (currentLayer) { var aLayer = { layerObject: currentLayer, title: currentLayer.name, id: currentLayer.id, getLayerObject: function () { var def = new Deferred(); if (this.layerObject) { def.resolve(this.layerObject); } else { def.reject("layerObject is null"); ------------ ---------
... View more
12-17-2015
01:44 PM
|
0
|
12
|
3951
|
|
POST
|
I modified it but still get the same error. mapServiceUrl= <map service>; var requestHandle = esriRequest({ "url": dojo.replace("{0}/layers",[mapServiceUrl]), "content": { "f": "json" }, "callbackParamName": "callback" }); requestHandle.then(lang.hitch(this, function(response){ dojo.forEach(response.layers, function(layerInfo) { console.log(layerInfo); //checking layer name if(layerInfo.fields) { dojo.forEach(layerInfo.fields, function(fieldInfo) { console.log(fieldInfo); //checking fields }); } myfields =layerInfo.fields; }); })); var featureCollection = { "layerDefinition": null, "featureSet": { "features": [], "geometryType": "esriGeometryPoint" } }; layerDefinition = { "geometryType": "esriGeometryPoint", "objectIdField": "ObjectID", "field": [myfields] }; var featureCollection = { layerDefinition: layerDefinition, featureSet: featureSet }; var thislayer = new esri.layers.FeatureLayer(featureCollection); },
... View more
12-17-2015
12:15 PM
|
0
|
14
|
3951
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-09-2026 12:44 PM | |
| 1 | 06-08-2026 12:12 PM | |
| 1 | 06-19-2025 10:13 PM | |
| 3 | 02-06-2026 10:44 AM | |
| 1 | 01-08-2026 12:50 PM |
| Online Status |
Offline
|
| Date Last Visited |
07-21-2026
09:01 AM
|