District Lookup Widget?

3121
14
10-26-2018 07:21 AM
AlejandraEspinosa
New Contributor II

I am working on ArcGIS Online and have added the district lookup widget to the app, but every time an address is searched and the function runs it says "Could not find the point associated with the polygon". How do I get rid of this error so that the widget works without this pop-up window?

0 Kudos
14 Replies
AdrianWelsh
MVP Honored Contributor

Alejandra,

Just to make sure, have you gone through setting up the search settings as according to this document:

District Lookup widget—Web AppBuilder for ArcGIS | ArcGIS 

In the Search Settings section of the widget configuration, specify the following options:

  • Select layer—Click Set to define layers. In the dialog box, define the following parameters:
    • Select polygon layer
    • Select point layer related to polygon layer
  • Set location button—Enabling this parameter causes the Set location button to appear next to the search box. Click the Set location button, and click the map to set the search location. If you don't enable this parameter, clicking the map will automatically set the location.
  • Select symbol to highlight polygon—Select the display symbol, color, transparency, outline color, and outline width to be used to highlight the polygon.
  • Address or location symbol—Select and adjust the symbol of the address or location symbol.
  • Select color to highlight point—Define the color used to highlight the point symbol.
Note:
The widget uses the pop-up defined in the map on the Information tab. You can enable one or both layers to have pop-ups. Whatever is defined will be displayed on the Information tab.
AlejandraEspinosa
New Contributor II

I have followed the instructions accordingly and the same window continues to appear. I believe I am making an error when creating a relationship so I am working on creating a primary and foreign key to provide a relationship between my polygon and the points that are within them.

Do you know of any helpful python scripting to create for loops?

http://cggis.maps.arcgis.com/home/item.html?id=8cd5ed6698604262916222933890d478 

0 Kudos
AdrianWelsh
MVP Honored Contributor

Do you have a specific question on For Loops?

ForLoop - Python Wiki 

If so, it might be best to ask in a separate thread.

0 Kudos
Stella-MarisAgu
New Contributor III

Please were you able to solve this problem. I am having the same issue. I loaded my data using the local govt model but am getting the error could not find the point associated with the polygon. Please can anyone help point out what I am missing. I can see the the districts polygon ie the elem, middle and senior high boundaries but the error pops up each time I put an address in the search button. Thank you

0 Kudos
AlejandraEspinosa
New Contributor II

I was unable to entirely figure out how to properly work the widget, but found another solution that might help.

All I wanted was the selected information (Address, City, Zip Code, trash days, garbage days, etc.) to be shown in a pop up and to be directed to the location when an address is input in the search bar.

1) Instead you can create a spatial join between your classes before downloading them online.

2)  Create Web App, navigate to Widget and click the edit (pencil) in the Search Widget.

3) In the top left click add search source, then feature layer and select the layer which has your spatial join and click ok.

4) Still in the Search widget edit, click on the pencil next to Search Fields and narrow down to your preferred searches. 

5) In the bottom left make sure that the "Show pop-up when the feature or location is found" is enabled and click ok.

6) In the search bar click the arrow next to it and select your layer instead of the ArcGIS Service, type an address to test if the pop-up and search are correct.

This should show you a pin of the location and a pop-up of the information you selected.

  •  I no longer received the pop-up error using the district widget once I created a relationship using new fields that I added to the attribute table, Based off the points within the polygons run the select by location tool and create new fields in your attribute table based on those selected records, create a relationship between your new fields.

This is how I got rid up of the pop-up, but still could not get the widget to do what I wanted so I tried the solution above that worked best for me.

Stella-MarisAgu
New Contributor III

Thank you very much for your quick reply. I appreciate. I will try that to see if  the error message stops. I am thinking it has to do with the relationship class but I used the local govt model to load data. 

Sent from Yahoo Mail for iPhone

0 Kudos
AllisonMuise1
Occasional Contributor III

Hi Stella,

Could you share the URL to your service? If I can see what your layer looks like I can offer some suggestions.

-Allison

0 Kudos
Stella-MarisAgu1
New Contributor II

ArcGIS Web Application 

Hi Allison

Here is the Link above. Let me know if you are able to view it. I dont know if i was missing a field that was supposed to be in both shapefiles. As soon as you zoom to the search location it produces the error. Thanks for taking a look.

Stella

0 Kudos
AllisonMuise1
Occasional Contributor III

Hi Stella-Maris,

The only attributes that are populated on your features are the facility and district names. This means that the fields used to connect each facility to a district are blank, and therefore there is no way for the widget to know which results to return.

I believe that, for these layers, the Facility ID fields are used in the relationship. There is a field with this name in the Districts layer and in each of the facility layers. Populate these fields so that the value for each facility matches the value for each district, then try the app again.

As an example, you can look at the layer used in the Try It Live version of the School Locator solution to see how we've populated those fields with sample data: http://statelocaltryit.maps.arcgis.com/home/item.html?id=1d92269976c2413e9e1186a6f2e80b77 

Allison