Select to view content in your preferred language

Create a buffer based on user defined distance and select features on a map

266
3
Jump to solution
06-14-2024 11:34 AM
SRJS4
by
New Contributor III

I am trying to create a buffer to select features on a map, I want to have a text box, where user can put in distance in miles and when clicked on map, it creates a buffer around that point, with that distance and selects features within the buffer.

I have a codepen sample
https://codepen.io/Jodhpur1/pen/qBGVKdg

where a buffer is created when clicked on the map and features selected within that buffer, but the distance for the buffer is coded to 10 miles.

Thanks in advance for your help

0 Kudos
1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor
3 Replies
MatthewDriscoll
MVP Alum

You just need to create an element that when an event happens, like value entered or a button clicked, it passes that value into the part where you have the 10 miles coded.   

Here is an example of something similar I have done.   Example Link

 

UndralBatsukh
Esri Regular Contributor

Here is your codepen updated: https://codepen.io/U_B_U/pen/KKLZLMa?editors=1000

SRJS4
by
New Contributor III

Thank you @UndralBatsukh  for updating the code

0 Kudos