|
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
|
1214
|
|
POST
|
Thank you. I must skipped reading it somewhere in the JS API docs.
... View more
12-09-2015
03:25 PM
|
0
|
1
|
741
|
|
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
|
3158
|
|
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
|
860
|
|
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
|
860
|
|
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
|
3323
|
|
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
|
1943
|
|
POST
|
Fantastic! Thank you!. Otherwise, the widget as setup by the default foldable theme looks like a side panel.
... View more
11-20-2015
09:30 AM
|
0
|
0
|
1943
|
|
POST
|
Yes, that's correct. Sorry for not been clear. I thought the code provided showing the widget under the widgetpool would indicate its type. Thank you.
... View more
11-20-2015
08:43 AM
|
0
|
3
|
1943
|
|
POST
|
Thank you Robert. Yes, I can do that for an on-screen widget. My question is for the foldable theme only and for on-panel widgets. The code shows the widget is under the widget pool block. I am trying to manage the size and location of a on panel widget that is on the foldable theme. I can change the on-panel widget location and size on other themes. Is anything in the documentation that refers to these limitations for this theme? Thank you.
... View more
11-20-2015
08:27 AM
|
0
|
5
|
1943
|
|
POST
|
This question was asked before, last year by another user, of how to change the size of an on-panel foldable widget and got no working answer. Hopefully, someone has a suggestion. I tried to modified the config.json, but it seems the theme overrides it "widgetPool": { "panel": { "uri": "themes/FoldableTheme/panels/FoldablePanel/Panel", ---------- ----------- } }, "widgets": [ { ----------- -------- { "label": "mywidget", "uri": "widgets/mywidget/Widget", "position": { "left": 55, "top": 45, "height":300 }, "index": 3 }]}, and I tried the panel manager var pm = PanelManager.getInstance().getPanelById(this.id + '_panel'); pm.resize({h:300}); and it still doesn't work. Can we change location and size of the widget in the foldable theme?
... View more
11-19-2015
02:02 PM
|
0
|
7
|
5601
|
|
POST
|
This question was asked before, last year, of how change the size of an on-panel foldable widget and got no working answer. Hopefully, someone has a suggestion. I tried to modified the config.json, but it seems the theme overrides it "widgetPool": { "panel": { "uri": "themes/FoldableTheme/panels/FoldablePanel/Panel", ---------- ----------- } }, "widgets": [ { ----------- -------- { "label": "mywidget", "uri": "widgets/mywidget/Widget", "position": { "left": 55, "top": 45, "height":300 }, "index": 3 }]}, and I tried the panel manager var pm = PanelManager.getInstance().getPanelById(this.id + '_panel'); pm.resize({h:300}); and it still doesn't work. Can we change location and size of the widget in the foldable theme?
... View more
11-19-2015
01:14 PM
|
0
|
0
|
2383
|
|
POST
|
Thank you. How do I access the labels assigned for the context menu of a graphic? I tried ctxMenuForGraphics.MenuItem.label[0] but it doesn't work. I notice that when you assigned a menu to a graphic A and then a bigger graphic B with its own menu covers graphic A, even if you remove the graphic B later, the menu A will be changed to the one that graphic B had. Strange and I am trying to keep the menu for graphics A unchanged.
... View more
11-18-2015
02:57 PM
|
0
|
1
|
762
|
|
POST
|
I noticed that inside the click function of a context menu I don't have access to the map object or call a new function outside the context menu. Are these limitations for the context menus? for the script below, I get these errors.... Cannot read property 'addLayer' of undefined this.myfunction is not a function --------- ctxMenuForGraphics = new Menu({}); ctxMenuForGraphics.addChild(new MenuItem( { label: "something", onClick: function () { this.map.addLayer(xxx); this.myfunction(); } })); ctxMenuForGraphics.startup(); -------- }, myfunction: function(){ ---- }, -----------
... View more
11-18-2015
11:37 AM
|
0
|
3
|
3486
|
|
POST
|
Thank you Robert. I was hoping for the mouse-over. I guess we cannot replicate all flex functions to dojo and vice versa.
... View more
11-18-2015
10:37 AM
|
0
|
0
|
584
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 2 weeks ago | |
| 1 | 3 weeks ago | |
| 1 | 10-22-2025 03:33 PM | |
| 1 | 06-27-2025 11:29 AM |
| Online Status |
Offline
|
| Date Last Visited |
Tuesday
|