|
POST
|
I assume it is impossible in WAB to import directly from url of zipped shapefile(s) into my scene. So I had to download the zip into my PC, and I developed custom widget to import from zip file in my PC into my 3D scene. Michael
... View more
09-09-2020
11:36 PM
|
0
|
0
|
1208
|
|
POST
|
What worked for me - I developed 2 custom widgets - The first - uses my FME workspace in my FME cloud to convert Autocad DWG file to zip file that contains all the shapefiles, and the widget downloads this zip. The second - imports a zip file (from my PC) containing one or more shapefiles, into the 3D scene. Michael
... View more
09-09-2020
11:31 PM
|
0
|
0
|
1418
|
|
POST
|
Found that lang.hitch can't return a Promise. Michael
... View more
09-09-2020
11:22 PM
|
0
|
0
|
3541
|
|
POST
|
Solved it. However, it was long ago, and I don't remember now. Michael
... View more
09-09-2020
11:21 PM
|
0
|
0
|
2293
|
|
POST
|
Dear Robert Scheitlin, GISP, Thank you! it works! Please, can you help me know if one of the other options could also be implemented: Apply FeatureTable to one feature? Apply FeatureTable after definitionExpression, but after displaying the table (with one feature), show all features on scene? Is it possible to create featureLayer from query results? How? I tried using next code, to create thepopupTemplate manually, but the div has not been included in thepopuptamplate. How can I correct it so that the popup will contain the div? featureLayer.popupTemplate = { "title": `${layerTitle} - ${featureLayer.fields.length} fields`, "content": featurePointed => { let idName = featureLayer.fields[0].name; let idValue = featurePointed.graphic.attributes[idName]; const query = featureLayer.createQuery(); query.where = `${idName} = ${idValue}`; query.outFields = ['*']; query.returnGeometry = false; ofekUtils.log(`idName: "${idName}", idValue: "${idValue}"`); //featureLayer.definitionExpression = query.where; featureLayer.queryFeatures(query) .then(result => { resultAsText = JSON.stringify(result); console.log(resultAsText); let p = result.features[0].attributes; let dvContainer = document.createElement("div"); let dvTable = document.createElement("div"); dvContainer.setAttribute("class", "container"); dvTable.setAttribute("id", "tableDiv"); dvTable.style.height = `240px`; dvContainer.appendChild(dvTable); for (let key in p) { if (p.hasOwnProperty(key)) { let row = document.createElement('li'); row.textContent = `${key} -- ${p[key]}`; dvTable.appendChild(row); } } return dvContainer; }) .catch(er => alert('Error executing query to get types ' + er)); } };
... View more
09-08-2020
12:11 PM
|
1
|
0
|
2678
|
|
POST
|
Dear Robert Scheitlin, GISP, That example "knows" all field names. I need this popup for my "AddShapefile" custom widget. I elaborated in my other question that somehow, I don't know why, the shapefile is added to the scene, but the default pop-up is NOT opened (is there a solution?) So I am forced to CREATE a popupTemplate... As the widget code knows NOTHING about field names, I am forced to create popupTemplate that will act similar to the default popupTemplate without knowing a-priory the field names. So, that example you pointed is not relevant. I tried to use FeatureTable widget, but it displaye the whole attribute table, whilst I need only for the pointed feature... I tried to implement definitionExpression, then the FeatureTable displayed only for the pointed feature, but all other features has been eliminated from the scene... I tried to query the layer in order to get the attributes of the single pointed feature, but then I need to create FeatureLayer from the result in order to activate the FeatureTable on it, but I don't know how to create FeatureLayer from the result... So my question remains - How to display a table of all field values for a pointed feature (like the default popupTemplate)? Please help me since I'm stuck... Michael
... View more
09-08-2020
07:49 AM
|
0
|
2
|
2678
|
|
POST
|
Dear Robert Scheitlin, GISP, no one has yet replied to this wuestion, can you help, please? Michael
... View more
09-08-2020
01:39 AM
|
0
|
1
|
1458
|
|
POST
|
Dear Robert Scheitlin, GISP, no one has replied yet to this question. Can you help, please? Michael
... View more
09-08-2020
01:38 AM
|
0
|
4
|
2678
|
|
POST
|
From my (3D) custom widget in WAB Developer Edition 2.17, I need to define featureLayer popupTemplate that will display a table of the field names and field values, very much like the default popup (e.g. when I click on a feature). The reason is that I need to "immitate" esri default popupTemplate. I will appreciate help. I tried: featureLayer.popupTemplate = { "title": `${layerTitle}`, "content": featurePointed => { const dv = document.createElement("div"); let num = featureLayer.fields.length; dv.style.height = `${num * 20}px`; featureLayer.fields.forEach(field => { let row = document.createElement('li'); row.feature = featurePointed; row.textContent = `Name: ${field.name} Value: ${featurePointed.graphic.attributes[field.name]}`; dv.appendChild(row); }); return dv; } }; But the values are all "undefined", I want it to be sorted by name, and this is yet not a table.... I saw in esri Featurelayer doc, that by setting Popup.defaultPopupTemplateEnabled = true I can enable the default popup, but I don't know how to do it. note: See also my other question Help will be greatly appreciated. Michael
... View more
09-07-2020
08:16 AM
|
0
|
5
|
2773
|
|
POST
|
I created WAB 2.17 3D custom widget to add zipped shapefile. Its code is exactly as in sandbox of esri Javascript API 4.16 code example Create a FeatureLayer from a shapefile. It runs OK and I see the added shapefile both in the 3D scene and in "Layer List" widget. My questions: If I run esri example or if I copy esri code example into an independent web app, then when I click on an added feature, a pop-up is opened, as expacted. But - In my WAB, I have a serious problem - When I click on an added feature, no pop-up is opened. I attach the relevant part from my Widget.js which is exactly as in esri example. I tried to manually define a feature layer popupTemplate, then I see it, but I have not succeeded to immitate the esri default templatePopup - see my other question I don't understand why the default popup does not appear and the manual popup do appear. I don't understand the comment in line 171 in the example, since anyway with esri example, the popup is opened by click. Does the comment mean that this is the place if I want to write code that changes the pop-up template? The above is a great "show stopper" problem for me. Help will be greatly appreciated, Michael
... View more
09-07-2020
05:47 AM
|
0
|
2
|
1513
|
|
POST
|
I’ll look tomorrow morning. I also remember there is “item.js” file. I’ll look also in it to understand how the change stems from the code.
... View more
09-03-2020
01:42 PM
|
1
|
0
|
1971
|
|
POST
|
Where is the customization code? I have not seen it inside LayerList widget. What am I not seeing?
... View more
09-03-2020
11:24 AM
|
0
|
2
|
1971
|
|
POST
|
For API 4.16, 3D Layer List widget has 2 different looks: In Sample Code - LayerList widget In Web AppBuilder (Developer Edition) Both use same widget - "esri/widgets/LayerList", so how I see 2 totally different looks? Attached is screenshots showing the 2 different lloks. Michael
... View more
09-03-2020
09:48 AM
|
0
|
4
|
2008
|
|
POST
|
Dear Robert Scheitlin, GISP, I'm happy to tell you that I solved it myself. I debugged Layer List widget and found it expects layer to have a title. So I added title when constructing the feature layer of the shapefile. Michael
... View more
09-03-2020
04:49 AM
|
1
|
0
|
1421
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-13-2026 04:27 AM | |
| 1 | 12-15-2024 12:09 AM | |
| 1 | 08-01-2024 03:45 AM | |
| 1 | 01-04-2024 04:00 AM | |
| 1 | 03-28-2024 01:25 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-13-2026
04:26 AM
|