Add executable icon to header area

813
3
01-16-2013 05:00 AM
LuciHawkins
Occasional Contributor III
Currently I have a widget that allows users to display certain map layouts.  All it basically does is turn layers on/off programmatically based up which map they want to see (see graphic).  I would like to have three icons instead of the widget on the Header.  ie:  "Zoning Map", "Flood Map", " City Map" that would essentially do the same thing when the icon was clicked.  Is this a possibility?

[ATTACH=CONFIG]20761[/ATTACH]

Thank you in advance!

Luci
Tags (2)
0 Kudos
3 Replies
JacobBoyle
Occasional Contributor III
esri has this in the local government site:

http://resources.arcgis.com/en/help/localgovernment/10.1/

it looks like it might do what you want to do with a bit of adaptation.
0 Kudos
LuciHawkins
Occasional Contributor III
Good Afternoon,

I looked at the different apps and I couldnt find what I am looking for.  On a side note, we have been waiting to upgrade to 10.1 so we can do advanced printing, etc.  Our new server should be here in a month or so and we will be upgrading then.  Maybe at that time we can implement some of the newer stuff. 

I have created a web page with three icons that allow users to begin flexviewer with different config.xml files.  That was the first method I tried in controlling which map layers were visible, but it is only good upon startup.  They didnt really like that.  So, I added the widget where users click on the widget icon which opens up a widget window with three buttons.  Depending on which of the three button they choose, layers are turned on/off programmatically.  They dont really like that either.  They are afraid people will not know to click on the icon. 

So, I just want those three buttons on the header instead of wrapped up in a widget.  I am not a programmer by schooling, so I am hacking my way through and trying to learn the proper methods as time allows. 🙂

Thanks!

Luci
0 Kudos
DanJensen
Occasional Contributor
Here is some code I use to turn on and off map services. 
var lyrObject:Object=new Object;
lyrObject.label = msName;
  
var msIndex:int=map.layerIds.indexOf(msName);
     
lyrObject.id=msIndex.toString();
lyrObject.layer=map.layers[msIndex]; 
lyrObject.visible=true;
AppEvent.dispatch(AppEvent.MAP_LAYER_VISIBLE, lyrObject);

Where msName is the value of the label property when you added the layer to config.xml.
To turn a layer off change .visible to false.

Watch the video for creating custom widget if you haven't yet and create a custom widget to turn on and off the map services as desired using code like this.  Set it up so you can configure the msName.

Good Luck,
-Dan
0 Kudos