|
POST
|
Dear Majdoleen, I got confused, and I'd appreciate it if you elaborate on the way you are going. In addition, in case it could help - I elaborate here on my way: I have succeeded to accomplish my task, by developing 2 independent widgets in the Web AppBuilder - "Convert DWG" custom widget - Displays explorer dialog to choose DWG in the PC and then uses my Fme Cloud to convert from DWG into zipped shapefile which the user downloads to his PC. This widget code is based on FME web app code example FME Server Playground - Upload File In Session. Important: transformation from DWG to shapefile (translating coordinates from Israel TM into geographic coordinates) succeeded in FME Workbanch but failed in cloud (they had some bug in the the cloud linux). I opened question in FME cloud community and got necessary help from an FME expert "Add Shapefile" custom widget - Displays explorer dialog to choose zipped shapefile in the PC, adding it to the 3D map. This widget is based on ESRI web app code example Create a FeatureLayer from a shapefile. I had to split into 2 independent widgets, since Win10 disables any "communication" between my web app and the explorer "save file" dialog (I could possibly upload from FME zip url into my Amazon S3 cloud [complicated, have not tried such thing yet], and add to the map by specifying Amazon S3 url of zipped shapefile, but I failed in adding to the map by Amazon S3 url of the zip) It makes sense, since the 2nd widget could be used independently to add several existing zipped shapefiles to the 3D map. I already saw that my task is not completed yet - I need additional development efforts in at least the next 2 areas: My current DWG is simple and includes only lines. Maybe I'll have to improve for more complicated DWG, especially if it has things beyond the 3 geometries (Points, Lines and Plolygons), especially colors. I'll have to continue to see that the final 3D map could be either saved with all the added data, and/or how can the user remove some of the added shapefiles, if he wants to. Michael
... View more
08-18-2020
09:35 PM
|
0
|
0
|
6470
|
|
POST
|
In my custom widget html I have: <buton class="esri-button"> <form enctype="multipart/form-data" method="POST" data-dojo-attach-point="uploadForm"> <input type="file" name="file" accept=".zip,.rar,.7zip" data-dojo-attach-point="inFile" /> </form> </buton> in my widget (startup or onOpen) I have: on(this.uploadForm, "change", lang.hitch(this, function (event) { ... })); It works fine, but if I activates it second time on SAME input file, the code inside the "on" callback is not entered at all... I assume it's since the "change" event has not occurred since it remembers the previous file. Am I right? Can I detect it and present a warning (either by html or by javascript)? Help will be greatly appreciated, Michael
... View more
08-18-2020
05:34 AM
|
0
|
4
|
19298
|
|
POST
|
Dear Robert, please see my question at ArcGIS REST API: Generate - how to use it without html form. Thanks, Michael
... View more
08-17-2020
08:56 PM
|
0
|
0
|
1996
|
|
POST
|
Dear Robert Scheitlin, GISP - I suceeded in developing Web AppBuilder (Developer Edition) 2.16 custom widget to add zipped shapefile to 3D scene by adapting code example: Create a FeatureLayer from a shapefile. The example uses the next code: var params = { name: name, targetSR: view.spatialReference, maxRecordCount: 1000, enforceInputFileSizeLimit: true, enforceOutputJsonSizeLimit: true }; // generalize features to 10 meters for better performance params.generalize = true; params.maxAllowableOffset = 10; params.reducePrecision = true; params.numberOfDigitsAfterDecimal = 0; var myContent = { filetype: "shapefile", publishParameters: JSON.stringify(params), f: "json" }; request(portalUrl + "/sharing/rest/content/features/generate", { query: myContent, body: document.getElementById("uploadForm"), responseType: "json" }) I will appreciate explanations for the next few questions: I want to better understand the option capabilities that "params" give me. If I want to give my file by "sourceUrl" parameter (instead of using the html form), e.g. for using url of zip file in my Amazon S3 cloud, how do I exacly specify it and its accompanying parameters? because no matter how I try, I get error: "'Unable to generate features -- itemid', 'sourceUrl' or 'text' must be specified." Where can I see clear and elaborated documentation and examples of all the possible parameters of this API? since ArcGIS REST API - Generate has NO DOCUMENTATION of the parameters "query", "body", "sourceUrl", and the documentation that exists there is far from being enough (I can't know whether to use "type" or "filetype", I totally can't understand what does "text" and how to use it, etc.) - it is just superficial and tells me nothing clear what to do. Help will be greatly appreciated, Michael
... View more
08-17-2020
10:15 AM
|
0
|
3
|
2325
|
|
POST
|
Currently, besides esri excellent documentation, tutorials and code examples, I know only of 2 books that are wholly dedicated to API version 4: 1. Introducing Arcgis API 4 for JavaScript: Turn Awesome Maps Into Awesome Apps, by Rene Rubalcava, from 2017 2. Learn GIS Programming with ArcGIS for Javascript API 4.x and ArcGIS Online, by Hussein Nasser, from 2018-2019, which instructs you step by step in building an engaging web map application, that works on mobile or the web. My opinion is that both books are good. Their methodologies differ - Rene's book is a general introduction, whilst Hussein's book focuses on taking you by hand, developing a whole 2D web application which runs on server in your pc (he presents IIS or Node, but you can use also simple http-server). I found also that API version 4 is presented also in single chapter scope, at the end of next 2 books: 1. Chapter 10 (last chapter) of Getting to Know Web GIS - fourth edition, by Pinde Fu, from 2020 2. The appendix of Building Web and Mobile ArcGIS Server Applications with JavaScript - Second Edition, from 2017 Michael
... View more
08-17-2020
04:11 AM
|
1
|
0
|
1582
|
|
POST
|
Dear Majdoleen Awadallah, Today when I'm trying search how to import from my fme cloud url containing zipped shapefile into my 3D Scene, I saw in Create a FeatureLayer from a shapefile a code examplle which uses Generate to generate features from a CSV file, shapefile, or GeoJson file. Maybe this example could help you? I'm currently am trying to see if this example can help me. Michael
... View more
08-13-2020
07:14 AM
|
4
|
2
|
5003
|
|
POST
|
I adapted the code in FME Server Playground - Upload File In Session into my ESRI Web AppBuilder custom-widget javascript code, and after uploading input file to my FME cloud and running the cloud workspace, all by javascript alone, the returned json has the url of the result zipped shapefile. Now I want to import the zipped shapefile into my 3D scene, with minimum manual user operations, but mainly by the javascript code. My questions: Can I import the url directly to my scene? Is there some "magic" javascript code to download it by my web application without displaying explorer download dialog to the user? And that my javascript will know the downloaded path? Perhaps by "fetch" (which I am not familiar to)? If yes, how? Next code snippet displays an explorer download dialog to the user, but how can I set a promise to know WHEN the user finished? either by cancelling or approving the download, and what is the final path and name of the downloaded zip, since the user can change things in the explorer download dialog? and since I don't know how to "connect" to the explorer download dialog box? let a = document.createElement("a"); a.style = "display: none"; a.href = obj.zipUrl;a.click(); After my widget javascript code has the path to the ziped shapefile in the PC, since it's my first time of doing such thing - I will appreciate to get links/code examples how to import it into the Scene. I now learning the example in Create a FeatureLayer from a shapefile, but are there preferred documents/links or code examples to learn from? I'll greatly appreciate help how to do it. Michael
... View more
08-13-2020
04:32 AM
|
0
|
1
|
1267
|
|
POST
|
Dear Carlos, I appreciate you very much for your explanations and code examples! I’ll learn from them. Meantime, today I have implemented by javascript promises, using class-scope “that” as you suggested, and avoiding lang.hitch, and the promises work perfect! Only, part of the functions called by “that.funcname” lose the “this” inside of them, so I use the class-scope “that” inside them, and I don’t yet know the reason of that different behavior. Can you enlighten my eyes? Now that I read your reply, I have to: Check your “Lang.hitch” example, and if it works, I’ll have to set a version of my code with “Lang.hitch” and debug. Maybe because my func calls are between 2 different classes, the “Lang.hitch” has not returned promise? I’ll check. Check version of my code with “Deferred” to see I know to use it. I indeed saw that esri code uses “Deferred” much much more than regular javascript promises, so in order to better understand esri code, it makes sense to use “Deferred”. Indeed my application is recommended to use mainly on Chrome, so the fact that “Deferred” runs on more browsers is not critical, but of course it has to be taken in account, since in case another browser is needed, avoidIng using 2 versions side by side is important, as you pointed out. So, after creating version of my code using “Deferred”, I’ll have to decide which to use. I assume that javascript promises code is simpler, but I’ll compare after I have also “Deferred” version. Thank you very much for introducing me to “Deferred” and to the differences between it to javascript promises, for the clear code examples of “Deferred” and of “Lang.hitch” with javascript promises. You helped me very much in learning that area, and the idea of class-wide “that” helped me very much. With appreciation, Michael
... View more
08-12-2020
12:17 PM
|
1
|
1
|
3480
|
|
POST
|
Indeed I know nothing about Geocortex and Cityworks - Maybe they are perfect to be used by the customers of the company you work in and develop on those systems. I can only suggest that you ask in the esri community whether someone is familiar with those 2 systems and can help with your code mission (a question per system or one for both). I assume what I wrote here is trivial, but maybe it'll help. Michael
... View more
08-12-2020
05:44 AM
|
4
|
0
|
5003
|
|
POST
|
I chose to use fme cloud for the transformation between formats and coordinate systems. I based on the code example in FME Server Playground - Upload File In Session. I adapted that code to function as an independent web app with my fme cloud, and it works perfect. Now, I'm in midst of adapting the code to function in my custom widget, and I'm in midst of developing/debugging. I've posted my problems in Do javascript promises work well with lang.hitch? I'd appreciate help/hints from someone that has already done this, and I'll report here when I succeed. Michael
... View more
08-12-2020
01:26 AM
|
0
|
1
|
1397
|
|
POST
|
Dear Carlos, Thank you very much for the example code. I came to a conclusion that lang.hitch can't return regular javascript promise. So currently I'm using regular javascript promises, and I bypass the lang.hitch by using "that = this". I'll update when I succeed (or have more problems...). May I ask some questions, please? Am I right that lang.hitch can't return regular javascript promise? or am I missing something? I had problems with regular javascript promises, and expected help concerning them, but your code example uses "Deferred". Is there a serious reason to prefer "Deferred" upon regular javascript promises? Is "Deferred" more capable than regular javascript promises, or does it fit better into widgets? Michael
... View more
08-12-2020
01:15 AM
|
0
|
0
|
3480
|
|
POST
|
Dear Ken, Only tomorrow I will be by my PC, so I’ll try to explain: I have custom widget and 2 classes (each in a file). in the widget I want to do chain calls (with then) to several funcs from one class. A func in the 2nd class calls function from 3rd class which in turn calls another async func in same 3rd class which returns promise. Funcs in 2nd class could chain other funcs in the 2nd classs, using then. And in all of this, I have to use Lang.hitch in order to keep tracking “this”. I get errors complaining that the promise result is not defined, specially in “catch”. It seems also that if I call the “chained” function within same 2nd class with lang.hitch, then I get error that “this.<funcname> is not known. Tomorrow I’ll be able to send code. (what I am trying to do, is to adapt the code exampleFME Server Playground to be a custom widget, so that the user will need only to choose the input file, but all other operations like getting info from workspace and uploading the input file and doing transformation, all will be done automatically one after the other by promises, where I don’t need all the html don element stuff. Thanks for your willingness to help, Michael
... View more
08-11-2020
01:13 PM
|
2
|
0
|
3480
|
|
POST
|
I am developing custom widget for esri Web AppBuilder 2.16 (I have not yet upgraded to 2.17). Seems as if lang.hitch spoils working with promises. What to do? Is there a solution? some code examples? Help will be greatly appreciated, Michael
... View more
08-11-2020
07:19 AM
|
1
|
7
|
3642
|
|
POST
|
Many thanks, Robert, for enlightening my eyes! Michael
... View more
08-10-2020
09:06 AM
|
0
|
0
|
1978
|
|
POST
|
I know nothing concerning geocortex, and Cityworks application. I'm pretty newbie to this area (learned few month on ArcGis Pro, and works 2.5 months on building custom widgets on esri Web AppBuilder. The approach I'm using - the company I work in, decided to supply to their customers web applications built with esri Web AppBuilder, and I'm developing custom widgets to add needed useful features. Now I'm within developing custom widget for inserting Autocad DWG file into a Scene, nad have not yet completed it. I'll get the zip of the shape file from fme cloud, but I have not yet implemented how to put it inside the Scene. I have not yet managed with json maps... If I may suggest - I suggest that you split your problems, and ask specific and focused questions in the relevant communities. Create a specific question per problem, so that e.g. the esri or fme programmers that scan the communities will get clear understanding from each question's title. If to think "top down" - I can't evaluate if the whole approach you are following is the preferred one or not - I understand that there are several companies supplying solutions - geocortex, Cityworks, and of course esri. I have not the knowledge to understand which way to go. Perhaps you ask also about which "top" approach is the preferred one? Perhaps you are a only little step from your goal and all you need is some help from Cityworks experts? P.S. Maybe as FME serves to convert between many formats, besides Citywoks experts, also FME people will know which format is applicable to be displayed in Cityworks. Sorry I don't know to help more, Michael
... View more
08-10-2020
05:15 AM
|
4
|
5
|
5003
|
| 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
|