Select to view content in your preferred language

Custom navigationClass

630
1
06-24-2010 09:20 AM
BradUmbaugh
New Contributor
Hi all,

I'd like to implement a custom Navigation class to use as a navigationClass on a Map object.  Unfortunately, the existing Navigation class requires an slider:mx.controls.sliderClasses.Slider skin part; I'd like to create a navigation class that uses a slider:spark.components.supportClasses.SliderBase skin part instead.

Is there a specification of the interface that a custom navigationClass must implement, or at least a list of the events it must broadcast to correctly work with a Map class?

Any help is appreciated.

Thanks,
Brad
Tags (2)
0 Kudos
1 Reply
DasaPaddock
Esri Regular Contributor
The navigationClass is only expected to be a UIComponent. It has no requirements. If it has a "map" property, the Map will set itself on it.

The slider is not a required skin part:
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/components/Navigation.html#SkinPartSummary

You could just create a custom skin where you've removed the mx:VSlider and added a Spark slider and then call hostComponet.map.level = slider.value when the slider changes.

If you don't want to put this logic in the skin, you could extend the Navigation component, add your own skin part and override partAdded()/partRemoved() and then set this new class as the Map's navigationClass.

You'll also want to listen for extent changes on the map and do something like this:
slider.value = event.lod.level;
0 Kudos