Select to view content in your preferred language

Change Cursor Over Zoom Slider

503
3
04-16-2010 09:50 AM
JoshObrecht
Regular Contributor
I am trying to change the cursor when it goes over the zoom slider.  Is this possible or is the zoom slider directly a part of the map and has to use the cursor associated with the map?

Thanks.
Tags (2)
0 Kudos
3 Replies
CristianJonhson
Emerging Contributor
Hello, did u discover how to solve this problem? Can u give us a feedback about that?

Thanks in advance,
Cristiano Benato.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Guys,

    This is not to hard to do but you will have to extend the navigation class to do it.

add this code as a mxml component called MyNavigation.as. It has to be in a com/esri/ags/samples folder.

package com.esri.ags.samples
{
    import com.esri.ags.controls.Navigation;
    
    import flash.events.Event;
    import flash.events.MouseEvent;
    import mx.managers.CursorManager;

    public class MyNavigation extends Navigation
    {
     [Embed(source="assets/images/cursors/draw_cursor.png")]
  private var lineCursor:Class;
   
        public function MyNavigation()
        {
            navigationSliderClass = MyNavigationSlider;
        }
        
        override protected function initializationComplete():void
        {
         this.addEventListener(MouseEvent.MOUSE_OVER, setCur);
         this.addEventListener(MouseEvent.MOUSE_OUT, remCur);
        }
        
        private function setCur(evt:Event):void
        {
         CursorManager.setCursor(lineCursor,1);
        }
        
        private function remCur(evt:Event):void
        {
         CursorManager.removeCursor(CursorManager.currentCursorID);
        }
    }
}


Then where your map component is make it look like this.
<esri:Map id="map" navigationClass="com.esri.ags.samples.MyNavigation">
0 Kudos
CristianJonhson
Emerging Contributor
Thanks for your answer Robert...

Att.,
Cristiano Benato.
0 Kudos