Select to view content in your preferred language

Display results from a query in a text box

1046
6
Jump to solution
01-24-2023 03:30 AM
KARIMLABIDI
Frequent Contributor

Hello everybody,

I looking for displaying results from a query to a new box in my map. The user could see the box and could expand it if he wants.

All I find on internet is how to make a query and display the results on the map. I just want to get some attributes and display it. I don't want graphics.

I found this post https://stackoverflow.com/questions/42062363/display-attribute-value-from-arcgis-layer-to-html-textb... but it was in 2017!

Thank you for your help!

0 Kudos
1 Solution

Accepted Solutions
Sage_Wall
Esri Contributor

Just updated that codepen by adding an expand widget :D.  Hope it helps

https://codepen.io/sagewall/pen/OJwvWMb

View solution in original post

6 Replies
Egge-Jan_Pollé
MVP Regular Contributor

Hi,

The example you are referring to on stackoverflow has been created with the legacy ArcGIS API for JavaScript 3.x. I can imagine that you would prefer to use the (new) ArcGIS Maps SDK for JavaScript 4.x.

Can you please explain us a little more what it is that you want to accomplish?

Are you not just looking for a Popup?

The Popup widget allows users to view content from feature attributes.

There are several samples available on how to use a Popup, e.g. Custom popup content.

HTH,

Egge-Jan

0 Kudos
Sage_Wall
Esri Contributor

Hi @KARIMLABIDI , If popups don't fit your use case you can always execute the query and then add the results to your HTML markup.  You can see a very simple example of doing that here: https://codepen.io/sagewall/pen/OJwvWMb

KARIMLABIDI
Frequent Contributor

Thank you @Sage_Wall , it's like that! I will take some time to test and I tell you if it 's ok

0 Kudos
KARIMLABIDI
Frequent Contributor

I would like to do something like that https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=popup-editaction with the results in the expand block.

0 Kudos
Sage_Wall
Esri Contributor

Just updated that codepen by adding an expand widget :D.  Hope it helps

https://codepen.io/sagewall/pen/OJwvWMb

KARIMLABIDI
Frequent Contributor

Thank you ,it works like a charm!

0 Kudos