Select to view content in your preferred language

Creating Dropdowns That Point to a Particular Location/ Feature Layer

905
4
Jump to solution
04-06-2017 06:58 AM
SarojThapa1
Frequent Contributor

In my web app, I have 5 different boundaries as a feature layer. Each boundary layer represents a geographical location, for instance, I have a specific region of Birmingham, Philadelphia, North Carolina. I want to create dropdowns where if I select Birmingham, the map zooms into the boundary (feature layer) of Birmingham. I am using ArcGIS API for JavaScript 3.x. I looked at the sample of DataAdapterFeatureLayer but could not figure it out. 

What would be the possible easy ways to achieve that?

Thanks,

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Saroj,

   You don't need anything that complex. When you create your menu and a click event for each menuitem the click event will just look at the menu label and based on that set the maps extent to some predefined extent geometry for your locations (pretty simple).

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Emeritus

Saroj,

   Not exactly what you are asking for but have you looked at the bookmark dijit?

https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=widget_bookmarks_editable 

0 Kudos
SarojThapa1
Frequent Contributor

Hi Robert. I looked at this sample before. I would prefer dropdowns to this bookmark_dijit. I was wondering if I could use html5 geolocoation api on top of js api and point each dropdown to a particular lat,long.

Thank you. 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Saroj,

   You don't need anything that complex. When you create your menu and a click event for each menuitem the click event will just look at the menu label and based on that set the maps extent to some predefined extent geometry for your locations (pretty simple).

SarojThapa1
Frequent Contributor

Thank you Robert. Looks like I can get it done with simple html and javascript.

0 Kudos