Identify for Experience Builder 1.14

1609
7
05-29-2024 09:22 AM

Identify for Experience Builder 1.14

This is an update to my previous Identify Widget to be compatible with Experience Builder 1.14. It is intended a replacement to the standard map popup and it is capable of being triggered by a map click or the included lightly modified Search Widget.

This version also fixes the previous versions dependency on setTimeout()* by adding another layer to the React tree specifically for waiting for the map layers to load and displaying a loading indicator. Results should render faster from a mouse click and on searches from a fast network and render more accurately if the network is running slow.

*I was not able to get rid of setTimeout() completely. It serves two functional roles in the widget. A one second timeout is called when a point comes in from the Search Widget. This allows for the map to start moving before setting the reactiveUtils to wait for the map to be still. Adjust this timeout if results from search are inaccurate or do not load. In the Identify.tsx, a .3 second timeout is called before passing the results to Results.tsx. This timeout allows for the data to be committed to memory before proceeding. Adjust this timeout if results are only loading the titles of the layer.

As in the previous version, you will need to find the widget_id  of the sidebar to make the auto-opening/closing work and put the widget_id of the Identify Widget into the Search Widget settings for the two widgets to interact.

Attachments
Comments
shodge_fsu
Occasional Contributor

This custom widget works great.  Just as advertised.  With some very minor editing to the results.tsx file we were able to drop the tabbed look and simply display all of the found data at one time, thus eliminating more clicks to see all of the results with just a scroll to see everything.

Many thanks to @JeffreyThompson2 

PLadd
by
Frequent Contributor

I know updates can break things.  I'm working with 11.3 and ExBdev 1.15.  I've incorporated the  Identify widget only (not the search) and all it does is close the sidebar.

I'm also confused about the widget ID.  If I poke around through the developer window in Chrome, it looks like the widget ID is 29 (and setting this makes the sidebar close).  But the image below says "This widget ID: 28" but if I use that, nothing happens when map-clicking.  Is this setup correctly or is it broken at 1.15?

PLadd_0-1722353774901.png

 

JeffreyThompson2
MVP Regular Contributor

@PLadd I am currently out on paternity leave and have not yet tested this widget in 1.15. I don't believe it should have broken. Make sure you are testing on Feature Layer. The id number in that box should be the id of the Sidebar Widget.

RichDeBell
Emerging Contributor

@JeffreyThompson2  Hello I am trying to deploy this to an EXB app in Enterprise 11.3. When it is loaded into EXB builder the identify widget throws an error "Cannot read properties of undefined(reading '__set_webpack_public_path__'). Look at the browser console I can see 404 errors for widget.js and setting.js. The folder path for 'dist' inside the widget is totally missing which make sense given it's trying to hit the following subpath from root domain (widgets/identify-custom/dist/runtime/widget.js). Looking at the original download file I can see this is missing there whereas with the seach widget which works does have the 'dist' directory. Am I missing something with the deployment process? Thank you

JeffreyThompson2
MVP Regular Contributor

@RichDeBell My Enterprise has not yet made the transition to 11, so I do not have any experience with doing an Enterprise deployment.

This code has not been complied by Webpack, so it does not have the dist folder. (The dist folder in the Search Widget should just be the ESRI code without my modifications.) I believe you need to first put these widgets into Developer Edition. Webpack should create the compiled code in the /client/dist/widgets folder. You should probably use the code from that folder in your Enterprise deployment. 

RichDeBell
Emerging Contributor

@JeffreyThompson2 OK thanks yes let me check into that

 

RichDeBell
Emerging Contributor

@JeffreyThompson2  I assume both Identify and Search need to be compiled separately and not just from the folder they both are contained in. I think that's the issue likely

Version history
Last update:
‎05-29-2024 09:22 AM
Updated by:
Contributors