|
POST
|
I get the Converting circular structure to JSON error when I create the feature layer, thislayer. Any ideas? Thank you.. var requestHandle = esriRequest({ "url": myurl, //I set the variable to a featureservice url "content": { "f": "json" }, "callbackParamName": "callback" }); myfields =requestHandle.then(this.requestSucceeded, this.requestFailed); var layerDefinition = { "geometryType": "esriGeometryPoint", "fields": myfields, "objectIdField": "OBJECTID", } var featureCollection = { layerDefinition: layerDefinition, featureSet: myfeatureSet //it's derived from a query }; var thislayer = new esri.layers.FeatureLayer(featureCollection, { id: "query layer", mode: FeatureLayer.MODE_SNAPSHOT, outFields:["*"]} ); this._openResultInAttributeTable(thislayer); }, requestSucceeded:function(response, io){ fields = array.map(response.fields); return fields; }, requestFailed: function(error, io){ console.log("got an error"); },
... View more
12-15-2015
05:53 PM
|
0
|
15
|
9623
|
|
POST
|
oops. I was looking at the getOutputfileds function instead of the _getLayerInfoWithRelationships function.
... View more
12-15-2015
04:15 PM
|
0
|
0
|
964
|
|
POST
|
Yes, but the layerdefinition is esearch is derived from the configuration file. In my case, there is no config file. I'm trying to dynamically develop the layerdefintion from the json similar to the process posted at: Request layer info | ArcGIS API for JavaScript but so far I seem to be missing something...
... View more
12-15-2015
01:54 PM
|
0
|
2
|
964
|
|
POST
|
Hello. The link you provided in your last post is not working. Can you post your solution? Thanks.
... View more
12-15-2015
01:11 PM
|
0
|
0
|
1389
|
|
POST
|
A question for featurecollection. If I want to use the layer definition of an existing feature layer that is on the map (same geometry, fields...) to define a new feature layer with a different featureSet, can I define the feature collection like: featureCollection = layerDefinition: <existing layer definition> featureSet: <new> ? Thank you.
... View more
12-14-2015
05:08 PM
|
0
|
4
|
4368
|
|
POST
|
Unfortunately, no. I tried in Chrome, IE and Firefox. Chorme and IE is completely blank. In firefox it just gives me the top and left menu but the content is blank as well.
... View more
12-14-2015
04:37 PM
|
0
|
7
|
4368
|
|
POST
|
Robert, I cannot access the fiddle you posted. It just gives me a blank screen in fiddle. Can you check or post the solution? Thanks.
... View more
12-14-2015
04:23 PM
|
0
|
9
|
4368
|
|
POST
|
Your reply to the original post, you suggested to create feature layer through a feature collection. What about creating a feature layer out of a features selection on a query at a feature layer? I tried it and it gives me an attribute table that is blank with no error messages. The function you posted above it expects a layer id and name to be passed on. So, I assigned an id and name to the featurelayer, however, the console.log, placed in the function , it returns undefined for the featurelayer.name but not for the id. Why? Thanks. var featureLayer = new FeatureLayer("https://map.dfg.ca.gov/arcgis/rest/services/Project_PAD/PAD/MapServer/0",{ mode: FeatureLayer.MODE_SELECTION, id: "myid", name: "myname", outFields:["*"]} ); myfeatureLayer.on("selection-complete", lang.hitch(this, function(){ this.selectInBuffer(myfeatureLayer.getSelectedFeatures()); })); var myquery = new Query(); myquery.geometry = resultEvent; myquery.returnGeometry = true; myquery.outFields = ["*"]; myquery.outSpatialReference = this.map.spatialReference; myquery.spatialRelationship = Query.SPATIAL_REL_INTERSECTS; //featureLayer.queryFeatures(myquery, this.selectInBuffer); var deferred = myfeatureLayer.selectFeatures(myquery, FeatureLayer.SELECTION_NEW); deferred.then(this._openResultInAttributeTable(myfeatureLayer)); })); _openResultInAttributeTable: function (currentLayer) { if (currentLayer != null){ console.log (currentLayer.name); } var aLayer = { ---------------------
... View more
12-10-2015
01:15 PM
|
0
|
1
|
1709
|
|
POST
|
Thank you. I must skipped reading it somewhere in the JS API docs.
... View more
12-09-2015
03:25 PM
|
0
|
1
|
1129
|
|
POST
|
I cannot get the order of the layers as setup in the config of the local layer widget to match the order on the layer list. The example below shows the layers order is different. Any idea why?
... View more
12-09-2015
02:54 PM
|
0
|
3
|
3546
|
|
POST
|
Thank you. As far as the fields, I previously changed feature layer url, but I forgot to change the outfields.
... View more
12-06-2015
02:52 PM
|
0
|
0
|
1308
|
|
POST
|
Thank you Robert. Actually, the resultEvent is a single geometry. Prior to that line resultEvent = evt[0] which is single element in the array, a signle geometry. Here is the complete code. I changed the line myquery.geometry = [resultEvent]; to myquery.geometry = resultEvent; since it is already an element of an array. The error I get now is the dojo.io.script error. Also, how can I insert the code in this forum with the line numbers? startup: function() { this.inherited(arguments); bufferGraphicsLayer = new GraphicsLayer(); bufferunit= GeometryService.UNIT_STATUTE_MILE; geodesicBuffer =new BufferParameters(); console.log('startup'); var pA= []; pA.push(new Point(-121.1012319, 38.956273, map.SpatialReference)); pA.push(new Point(-121.07462622, 38.90015662, map.SpatialReference)); myGraphicsLayer = new GraphicsLayer(); pLine=new Polyline(map.SpatialReference); pLine.addPath(pA); var lineSymbol = new SimpleLineSymbol( SimpleLineSymbol.STYLE_SOLID, new Color([255,0,0]), 4 ); this.map.graphics.clear(); gra=new Graphic(pLine, lineSymbol); myGraphicsLayer.add(gra); this.map.addLayer(myGraphicsLayer); var extent = new esri.geometry.Extent(-121.1012319, 38.956273, -121.07462622, 38.90015662, map.SpatialReference); extent=extent.expand(4.0); this.map.setExtent(extent); this.getthelinebuffer(); }, getthelinebuffer: function(){ mysymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_NONE, new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASHDOT, new Color([255,0,0]), 2), new Color([255,255,0,0.25])); var resultEvent; geodesicBuffer.distances = [1]; geodesicBuffer.geometries = [gra.geometry]; geodesicBuffer.unit = bufferunit; geodesicBuffer.outSpatialReference = this.map.spatialReference; geodesicBuffer.geodesic = true; geodesicBuffer.unionResults = true; esriConfig.defaults.geometryService.buffer(geodesicBuffer, lang.hitch(this, function (evt) { resultEvent = evt[0]; geodesicUserGraphic = new Graphic(Polygon, mysymbol); geodesicUserGraphic.geometry = resultEvent; geodesicUserGraphic.symbol = mysymbol; bufferGraphicsLayer.add(geodesicUserGraphic); })); this.map.addLayer(bufferGraphicsLayer); var featureLayer = new FeatureLayer("https://map.dfg.ca.gov/arcgis/rest/services/Project_PAD/PAD/MapServer/0"); var myquery = new Query(); myquery.geometry = resultEvent; myquery.returnGeometry=true; myquery.outFields=["school", "county"]; myquery.outSpatialReference= this.map.spatialReference; myquery.spatialRelationship = "esriSpatialRelIntersects"; featureLayer.queryFeatures(myquery, this.selectInBuffer); }, selectInBuffer:function(results){ var resultItems = []; var resultCount = results.features.length; for (var i = 0; i < resultCount; i++) { var featureAttributes = results.features.attributes; for (var attr in featureAttributes) { console.log(featureAttributes[attr]); } } },
... View more
12-06-2015
12:06 PM
|
0
|
2
|
1308
|
|
POST
|
This error consumed me some time and I can't see the problem that brings the wkid error. At first, a buffer is drawn around a line (identified as gra below), then I use the buffer polygon to capture any features from the feature service that are located within the buffer polygon. The buffer is drawn around the line, but the second query brings the error. Suggestions? Thank you. getthelinebuffer: function(){ mysymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_NONE, new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASHDOT, new Color([255,0,0]), 2), new Color([255,255,0,0.25])); var resultEvent; geodesicBuffer.distances = [1]; geodesicBuffer.geometries = [gra.geometry]; geodesicBuffer.unit = bufferunit; geodesicBuffer.outSpatialReference = this.map.spatialReference; geodesicBuffer.geodesic = true; geodesicBuffer.unionResults = true; esriConfig.defaults.geometryService.buffer(geodesicBuffer, lang.hitch(this, function (evt) { resultEvent = evt[0]; geodesicUserGraphic = new Graphic(Polygon, mysymbol); ------ })); geodesicUserGraphic.geometry = resultEvent; bufferGraphicsLayer.add(geodesicUserGraphic); })); this.map.addLayer(bufferGraphicsLayer); var featureLayer = new FeatureLayer("xxxxx/0"); var myquery = new Query(); myquery.geometry = [resultEvent]; myquery.returnGeometry=true; myquery.outFields=["X", "Y"]; myquery.spatialRelationship = "esriSpatialRelIntersects"; featureLayer.queryFeatures(myquery, this.selectInBuffer); }, selectInBuffer:function(){ ------ },
... View more
12-05-2015
11:38 PM
|
0
|
4
|
3771
|
|
POST
|
Robert, I noticed that the height is not included in your code, so I added it. However, I cannot modify the widget's height in the config.json. Can the height be modified? Also, can the widget be floated around after its initial location is set? Thank you. widget.js ---------- if(iconConfig.position.right){ iconConfig.panel.position.right = iconConfig.position.right; } if(iconConfig.position.height){ iconConfig.panel.position.height = iconConfig.position.height; } } ---------------- config.json: "position": { "left": 105, "top": 45, "relativeTo": "map", "width": 450, "height":300 },
... View more
11-29-2015
11:00 AM
|
0
|
0
|
2522
|
| 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
|