I'm looking for an example of a map that allows users to only show certain results? Say like all the restaurants, bars, or both in the area

625
4
Jump to solution
07-30-2014 01:43 PM
RobertErickson
New Contributor

So we are making a map that allows users to search for certain results depending on what they check. Say bars or restaurants but it also needs to be able to select multiple items and display them. I'm having trouble finding any examples on the sample page. Would anyone have a good location for me to start researching?

0 Kudos
1 Solution

Accepted Solutions
AlicePence
Occasional Contributor II

These are both really cheesy example but they show how to toggle on and off layers and check multiple boxes.

Toggle layer visibility | ArcGIS API for JavaScript

Dynamically create layer list | ArcGIS API for JavaScript

Hope this helps.

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus

Robert,

   I would start with the "Manage result from multiple queries" sample. Manage results from multiple queries | ArcGIS API for JavaScript‌ That sample shows how to query multiple layers of a mapservice for the same geometry. Then you just have to decide how that search geometry is going to be defined (like the current extent of the map) and how the user will specify which layers get queried (like though a list that allows for multiple selections).

0 Kudos
AlicePence
Occasional Contributor II

These are both really cheesy example but they show how to toggle on and off layers and check multiple boxes.

Toggle layer visibility | ArcGIS API for JavaScript

Dynamically create layer list | ArcGIS API for JavaScript

Hope this helps.

0 Kudos
Noah-Sager
Esri Regular Contributor

We've got some new sample applications coming down the pipeline on GitHub, check out our quickstart app:

Esri/quickstart-map-js

There is one specific new sample that you might find interesting, the Find Places by Category sample:

       Find Places by Category

These are just some good jumping-off points, feel free to peruse our entire JavaScript samples library:

      JavaScript Samples

Regards,

-Noah

KenBuja
MVP Esteemed Contributor

Have you thought of using one of the Story Map templates to do something like that? One of the templates is the Shortlist, which is used in several example to show highlighted features in an area. You would have to provide this information in the webmaps used to power the story map.

0 Kudos