Select to view content in your preferred language

Near Me Widget question #2

163
3
Tuesday
TerrySteege
Emerging Contributor

Does anyone have an idea on how I can use the Near Me widget with two different layers?  I would like to use a layer that is going to be the territory, called Layer#1 for example.   I would like to search inside of Layer#1 for items in a different layer called Layer#2.  If the user chooses a near me location outside of the territory, (Layer#1) they would get a response stating that is not a valid search location.

Thank you in advance for any ideas.  I have a feeling I need to be setting this up in the Map and not in EB but I have no clue at this point.  I did see one example of this and the area outside of Layer#1 was grayed out and I would be great with that, just don't know how to do it.

Terry

I am including a map I saw that had this functionality.  I did reach out but have not gotten a response as of yet, so I wanted to see if anyone here had any ideas.

0 Kudos
3 Replies
VenkataKondepati
Occasional Contributor

Easiest (no-code): use Zone Lookup Instant App

  • Web map with Layer#1 (territory) + Layer#2 (targets).

  • Zone Lookup → set Zone layer = Layer#1, “Layers to show in zone” = Layer#2.

  • Turn on “Mask outside zone / gray out outside” and “Show message when address not in a zone.”

  • Result: users click/tap; if outside territory → friendly “not a valid location” message.

Experience Builder (Near Me) setup

  • Keep Near Me searching Layer#2.

  • Add a Query (or Filter) against Layer#1 that runs on map click (point buffer = 0) with Intersects.

  • If the Query returns 0 features, show an Alert/Text (“Outside territory”) and don’t run Near Me.

  • If ≥1, let Near Me execute; optionally add a mask layer in the web map (big rectangle minus territories) to gray out outside.

TerrySteege
Emerging Contributor

Thank you so much @VenkataKondepati  for your reply, unfortunately I have to use the "Experience Builder (Near Me) setup" as I have other functions the Near Me widget preforms for the end user.

  • I do have the Near me looking at Layer#2
  • To clarify, I need to add a Query Widget to the project correct, or is that a SQL query I build in the Map's Action - Message action - Add a trigger section?
  • To make a "map click" event happen, would that be a trigger or an Arcade script.  Sorry I am pretty new to this and have had to muddle along to get this far.
  • Thank you I was able to get the Mask layer to work so that helps too.
0 Kudos
AzizaParveen1
Esri Contributor

Hi @TerrySteege 

If I understand your workflow correctly, you are looking to get results from Layer 2 that are intersected with Layer 1.

For example, I have a School district layer and a school layer. I would like to find all the schools within a particular school district.

In this type scenario, you can use multiple options, I have mentioned just two in here but you can also accomplish the same workflow using Filter, Query, List and other widgets as @VenkataKondepati mentioned.

Run Near Me when a feature is selected on the map

  • Add Near Me,
  • Add a Proximity analysis on School layer.
  • Change default buffer distance to 0
  • From General tab, add some transparency to the sketch color
  • Click on the map widget and from the action tab
  • Add a trigger > Record selection changes > Near me > Set location
  • Save and publish.
  • Now launch the app and Click on a School District in the map and notice that Near Me run the analysis on School layer.
  • Example app: https://experience.arcgis.com/experience/09cea0a9538f42ab9d41001c51a05b88?draft=true

Search a School district in the search widget and return all the schools within that district

  • Add Near Me,
  • Add a Proximity analysis on School layer.
  • Change default buffer distance to 0
  • From General tab, add some transparency to the sketch color
  • Add search widget
  • Configure search widget to search on School district layer only
  • Expand search Results section and make sure Auto select the first result is checked.
  • Click on the Action tab of the Search widget
  • And in the Record selection changes message action, click Add action > Near me >Set location.
  •  Save and publish.
  •  Now search for Indian Prairie School District 204 in the search widget and notice that Near Me returns schools that are within the Indian Prairie School District.
  • Example app: https://experience.arcgis.com/experience/a2ec5a30877640bc8489210e62c71cdb?draft=true