POST
|
We use .NET and SQL server on the web map application. Not sure about how Oracle works with ESRI JavaScript. We use query(Intersect) to select feature. The following is the sample code. Our application is more complex and I delete some code so the code below may not run well. You might get some idea on some steps. function queryGraphic(geometry, count) { //step 1: query polygon var queryTask1 = new QueryTask("https://...../MapServer/0"); var query1 = new Query(); query1.returnGeometry = true; query1.outFields = ["*"]; //query1.outFields = ["Id","BuildingName", "BuildingNumber", "EntityName"]; query1.geometry = geometry; query1.spatialRelationship = Query.SPATIAL_REL_INTERSECTS; queryTask1.execute(query1); //console.log("geometry query1 " + JSON.stringify(geometry)); queryTask1.on("complete", function (event1) { var fset1 = event1.featureSet; var queryFeatures = fset1.features; var queryGeometrySet = []; var countyFeatureLayer = new FeatureLayer("https://...../MapServer/1", { mode: FeatureLayer.MODE_SELECTION, outFields: ["*"], infoTemplate: infoTemplate}); //user draw polygon countyFeatureLayer.selectFeatures(query1, FeatureLayer.SELECTION_NEW); //console.log("countyFeatureLayer " + countyFeatureLayer); //step 2: change symbology and add ID to list for (var i = 0; i < queryFeatures.length; i++) { var graphic1 = queryFeatures; if (graphic1.geometry.type == "polygon") { //add feature is polygon var querySymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255, 0, 0]), 2), new Color([255, 0, 0, 0.5])); } else { //features are points var querySymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE, 9, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([26, 26, 26]), 1), new Color([26, 163, 255, 0.95])); } //get Id id = graphic1.attributes.Id; console.log("point feature id " + id); } var layerGraphics = new Graphic(graphic1.geometry, querySymbol, infoTemplate); map.graphics.add(layerGraphics); queryGeometrySet.push(graphic1.geometry); console.log("graphic1 " + JSON.stringify(graphic1)); } }
... View more
08-22-2018
07:33 AM
|
1
|
1
|
847
|
POST
|
Mark, It has not been figured out yet. I see the similar question in the other community(below). No answer either. If you find out the solution, please share with us. Thanks. https://community.esri.com/groups/web-app-builder-custom-widgets
... View more
05-03-2018
10:57 AM
|
0
|
0
|
578
|
POST
|
Robert, Yes, this is the problem. Thank you for solving my issue. I thought it was some reference or variable problems, never check console.log. I am kind of new to custom-widget. The forum is very helpful. By reading questions in the forum, I found the way to show query results in attribute table by using SelectFeatures. Much appreciated! Best, Helen
... View more
03-19-2018
08:32 AM
|
0
|
0
|
404
|
POST
|
Robert, I add var countyFeatureLayer; But it can not remove the undefined error. I do not need to define var in my Sandbox code , which runs well with no error. Though the error does not impact my result, I can receive correct results. But I would like to fix the error. I wonder if you have any suggestions. My widget code (zipped) is attached in the previous message. Thanks, Helen
... View more
03-16-2018
01:47 PM
|
0
|
1
|
404
|
POST
|
My widget code runs well with the correct result. But I see the reference error in Console Window – it says countyFeatureLayer is not defined. My widget is to show the query result in Attribute table. I use two queries – the first query is to check if the drawbox-polygon is inside the state boundary. The second query is to intersect with countyFeatureLayer to get the county attribute info. Reading questions in the forum, I use SelectFeatures and show the query result in attribute table. I define countyFeatureLayer in postCreate. In _onDrawComplete function, I just countyFeatureLayer.selectFeatures. My code does not have the error before using SelectFeatures. Also, I checked my reference, which is same as my sandbox code. I do not know why I get the reference error. See the screenshot. I also attach my widget zip files. Thanks, Helen
... View more
03-15-2018
07:35 AM
|
0
|
4
|
443
|
POST
|
Robert, Thank you very much for the help. You are right and it works now. I should give it try by using -- this.gp.execute(params, lang.hitch(this, this.getDriveTimePolys)) Best, Helen
... View more
03-01-2018
12:21 PM
|
0
|
0
|
235
|
POST
|
I am creating a widget by using GP service. My code works fine in Sandbox. When I move into the widget, the first part of running Geoprocessor is fine and I can see the feature result in Console Window, but my last part - the graphic result cannot show in the map. The error message says “this.map.graphics is undefined”. I attach my widget code and sandbox code. My widget code is to open the widget then the GP starts. I wonder how to make the GP result shows in the map. Thanks, Helen
... View more
03-01-2018
07:48 AM
|
0
|
2
|
305
|
POST
|
I would like to create a theme that has two widget-controllers so some widgets can be in a header area and some widgets in a sidebar area. My two widget-controllers (as the HeaderController and SidebarController) can individually work well. When I tried to merge them together, it appears the problem of double the existing widgets (See the screenshot). I wonder if it is possible to create two widget-controllers in one theme. If so, how to make two controllers contain different widgets within two panels. To make the desired layout, I also tried to customize Tab Theme and moved Search widget in the header area, which is getting what we want (See the second screenshot attached). But I cannot add more widgets in the header area. I think it would be nice to add two widget-controllers in a theme to make the desire layout. I wonder if this would be possible. I attach my zip files for HeaderController and SidebarController. Thanks, Helen
... View more
02-21-2018
08:46 AM
|
1
|
3
|
962
|
POST
|
Robert, Thank you for providing the useful information. Your answer also helps me to understand the structure of other sample widgets. Very appreciated! Helen P.S. I would like to attach my widget.html so the future user can have all the files for draw box and query.
... View more
02-01-2018
06:52 AM
|
0
|
0
|
308
|
POST
|
Robert, I’d appreciate your great help. I did click “Mark Correct”. I wonder if you have a chance to explain “.own()” in your code. I see .own() can use inside both postCreate and startup in other code samples. Thanks, Helen
... View more
01-31-2018
12:55 PM
|
0
|
2
|
308
|
POST
|
Thanks for the helpful code. After I add the dependency 'dojo/_base/lang', the widget works very well! Very appreciated! this.own(on(this.drawBox, 'DrawEnd', lang.hitch(this, this._onDrawComplete))); is very powerful! It makes the connection between the Draw-box with my query. I think lang.hitch is kindly like function/event. What does “own” means and why puts “own” inside postCreate? I found some information below for “own” but do not fully understand. --most of the things that you define inside .own() are getting correctly removed once the widget itself is destroyed. Using .own() prevents memory leaks in your app.
... View more
01-31-2018
08:45 AM
|
0
|
0
|
308
|
POST
|
I am developing a Validation Widget that can tell if the free-drawn-polygon is inside the state boundary or not. I have the ArcGIS JavaScript code which run well in the Sandbox. The code is to use button-click to draw a polygon, and pass the polygon geometry into a query, then check the length of result. See the sandbox code (works) attached. In the widget.js, I have added the jimu/dijit/DrawBox in the widget. I cannot figure out passing the drawn-polygon created by the DrawBox into my query. I tried the code attached and the error message showed “geometry null” and “queryTask.execute is not a function”. I am new to WAB and would appreciate some suggestions. The widget.js (not working) is attached. Additionally, I know the WAB has a Query Widget. I look at the widget.js, which uses dojo/query, instead of esri/tasks/query. I wonder if I need to replace with dojo/query to make my widget run. Thanks, Helen
... View more
01-30-2018
08:39 AM
|
0
|
16
|
1505
|
POST
|
R: One Building with one texture Thank you for providing the solution. I use the first method and it works. I am happy to see my buildings with different textures. I knew the Attribute Connection Editor for the real Height, which is the numerical value. I did not know before it can connect with string type of value. That is great! I can put more attributes stored in attribute table. Thanks, Helen P.S. I cannot log into the account and send my reply. So I email you.
... View more
05-05-2016
10:47 AM
|
1
|
0
|
781
|
POST
|
Thanks for your reply. I have footprints’ attribute table that contacts texture names and building names. I think your solution is correct and I am looking for the connection between texture names and building names. Can you provide the sample code? The following is my answers to your questions. Yes, I use footprint polygon to extrude buildings I am currently using CGA rules. But I also explored Python a bit and my Python code can only extrude grey buildings. I can go either CGA rules or Python codes. I wrote my CGA rule. I attach the image for a part of my CGA code . I am using one image for one façade right now. And I think this way can reduce the file size to publish online. It would be nice if the code can create a building with two facades as some real buildings have two or three different facades.
... View more
04-29-2016
02:02 PM
|
0
|
2
|
781
|
Title | Kudos | Posted |
---|---|---|
1 | 08-22-2018 07:33 AM | |
1 | 02-21-2018 08:46 AM | |
1 | 05-05-2016 10:47 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|