Select to view content in your preferred language

Select by attribute

7032
7
09-20-2012 07:21 AM
MatthewFoster
Emerging Contributor
Hi - I have two questions:

1. How can I do a 'select by attribute' in an ArcGIS Online map that I created and then pan/zoom to that point/polygon and potentially display only that point/polygon?
2. Is there a way in the legend to _easily_ display or hide polygons based on an attribute

Background: i have a simple map in which there is one shapefile that I uploaded of several (overlapping) polygons representing focal regions.  i would like to set it up so that a user could decide they only want to see one of those polygons, or to be able to search for one of the polygons based on the name.  Do I need to 'explode' the original shapefile into dozens of single polygon shapefiles and then upload all of those for this to work?

Thanks very much

Matt
Tags (2)
0 Kudos
7 Replies
MikeMinami
Esri Notable Contributor
The ability is not supported out-of-the-box. You could write a custom application to do so, however. Check out the JavaScript API. There are lots of samples you can look at.

http://help.arcgis.com/en/webapi/javascript/arcgis/index.html

Thanks,

Mike
0 Kudos
MatthewFoster
Emerging Contributor
Thanks Mike.  Those look like potential solutions though i don't know how to program in JavaScript.  I was hoping there was something out-of-the-box. 

Best,
matt
0 Kudos
JonathanQuinn
Esri Notable Contributor
Do you have a subscription for ArcGIS Online?  You can create feature services from your data, which will create a service URL.  You can then use the ArcGIS Flex Viewer, (a web client that uses an application builder, so you don't need any programming experience), add your service using the service URL by signing into ArcGIS Online through the builder and use the Query or Search widget to zoom to features you select.  I'm not sure how your second question would work with the Flex Viewer, though.
0 Kudos
MatthewFoster
Emerging Contributor
Thanks Jonathon, this sounds quite promising and gets to the issue of my question #1.  I will try it out today or tomorrow.  As for question #2 - this stems from having a single shapefile with multiple overlapping polygons, and I would love to be able to have a person say they want to see polygon X and see that without all of the overlapping polygons also appearing on the map.  The only way I've gotten around that to date is to 'explode' the shapefile and create multiple shapes each composed of a single polygon.  Then a user can click on and off the various layers that had been simply separate records in a shapefile.  Thanks again.

Matt
0 Kudos
JonathanQuinn
Esri Notable Contributor
That doesn't sound like it's possible in ArcGIS Online, but definition strings are possible through the Flex Viewer.  They aren't dynamic though; whatever you set in the Flex Viewer is set for the application.  A user won't be able to change the query dynamically.  Your workaround is probably your best bet, as the same approach can be used in the application.
0 Kudos
RamizelLegada
Deactivated User
you mean programmatically? or manually?

if manually i can help you but if its programmatically what programming language and/or application are you using?
0 Kudos
WillHughes1
Frequent Contributor
Why is this NOT in the Javascript API Samples?

Isn't a Select by Attribute tool such a basic task, e.g. search a road name, search an id, search a city name.

I took a stab at it and got this to sortof work. Problem is that the result set has to be > 1 in order for the zoom to selected to work.

http://forums.arcgis.com/threads/77925-QueryTask-and-Zoom-to-Result?p=321366&posted=1#post321366

Will
0 Kudos