ReferenceError: results is not defined timeExtent = results[0].layer.timeInfo.timeExtent;
dynaLayer1 = new ArcGISDynamicMapServiceLayer("http://webgisdevint1/arcgis/rest/services/Alex_Try/TimeawareAcres/MapServer", {}); map.on("layers-add-result", initSlider); function initSlider(reults) { var timeSlider = new TimeSlider({ style: "width: 100%;" }, dom.byId("timeSliderDiv")); map.setTimeSlider(timeSlider); var timeExtent = new TimeExtent(); timeSlider.setThumbCount(1); timeExtent = results[0].layer.timeInfo.timeExtent; timeSlider.createTimeStopsByTimeInterval(timeExtent, 1, "esriTimeUnitsDays"); timeSlider.setThumbMovingRate(2000); timeSlider.singleThumbAsTimeInstant(true); timeSlider.startup(); connect.connect(timeSlider, "onTimeExtentChange", function(timeExtent) { dom.byId("details").innerHTML = dojo.string.substitute("${endTime}", timeExtent, function(val) { return dojo.date.locale.format(val, { selector: 'date', datePattern: 'MMMM yyyy' }); }); }); } map.on('layers-add-result', function (evt) { var layerInfo = arrayUtils.map(evt.layers, function (layer, index) { return {layer:layer.layer, title:layer.layer.name}; }); if (layerInfo.length > 0) { var legendDijit = new Legend({ map: map, layerInfos: layerInfo }, "legendDiv"); legendDijit.startup(); } }); map.addLayers([dynaLayer1]);
<div class="timeWindow"> <div id="timeSliderWin" class="shadow"> <div id="title"> Surface of the World </div> <div id="subTitle"> Month by Month </div> <div id="details"> December 2003 </div> <div id="timeSliderDiv" style="width:100%;height:100%;"> </div> </div> </div>
function initSlider(reults) { ... timeExtent = results[0].layer.timeInfo.timeExtent;
Alex,
Did you get this to work? I have the same problem and don't see a typo.
Thanks
PS: Got the type: function initSlider(reults)