pkvenu

Set Tick Count for ever 15 minutes in Time Slider

Discussion created by pkvenu on Mar 8, 2011
Hi ,

  I am using a time slider. I need to set the tick count of the time slider for every 15 minutes but not able to acheive it.

Attached the code below. Can you help me out to acheive it.

var map = this;
        timeSlider = new esri.dijit.TimeSlider({style: "width:300px;"},dojo.byId("timeSliderDiv"));
        map.setTimeSlider(timeSlider);
        var timeExtent = new esri.TimeExtent();
        timeExtent.startTime = new Date("1/4/2011 00:15:00 AM");
        timeExtent.endTime = new Date("1/4/2011 11:45:00 PM");
        //timeExtent.endTime = new Date("1/3/2011 8:00:00 PM");
//         timeExtent.startTime = new Date("01/03/2011 06:00:00 UTC");
//       timeExtent.endTime = new Date("01/03/2011 12:15:00 UTC");
        timeSlider.setThumbCount(1);
        //timeSlider.createTimeStopsByTimeInterval(timeExtent,15,'esriTimeUnitsMinutes');
        timeSlider.createTimeStopsByTimeInterval(timeExtent,15,esri.layers.TimeInfo.UNIT_HOURS);
       
        timeSlider.singleThumbAsTimeInstant(true);
        timeSlider.setThumbIndexes([0,1]);
        timeSlider.setThumbMovingRate(2000);
        timeSlider.setTickCount(dojo.date.difference(timeExtent.startTime,timeExtent.endTime,"hour"));


Thanks,
Pawan

Outcomes