In the Nearby app, how to get the location of the point clicked on?

105
1
2 weeks ago
Labels (1)
BrianpMoran
New Contributor

Using the Nearby App, I looking to get the location of the pin, the latitude and longitude of the point clicked on. 

0 Kudos
1 Reply
KellyHutchins
Esri Frequent Contributor

What do you want to do with that location?  There is an undocumented option to add the app center point if you are using the "search extent" option.  This will add a link to the no results, pre results or post results text. You can test this out using the following steps: 

  1. Open the config experience for Nearby or Lookup
  2. Go to the Text config section where you can define the no results, pre results and post results messages.
  3. Click the edit button to open the text editor and enter the source mode by pressing the "Source" button.
  4. Add a link (you could also do this via the link button but you'll still have to edit the source). Here's an example where we have the app url and append the center url param.
    <a href="https://www.arcgis.com/apps/instant/nearby/index.html?appid=705b775322e2400b9ebcaf8e2820e759&{center}" target="_blank">Link to app center</a>

In the example above the crucial bit is the {center} value. The {center} placeholder will be replaced with the map's center point. You can use find the same way by specifying {find}.
Note that in the example above we add center to the url by adding an ampersand in front of it. This is needed to ensure the parameter is added to the url. In this example we use & because the url already has a first url param added via the question mark. The "operators" section of this article explains when to use ? vs & if you aren't familiar with these options.
https://help.alchemer.com/help/url-variables#:~:text=%2D%20The%20question%20mark%20identifies%20the,....

Currently we support params for center and find.

 

0 Kudos