dojo.declare('app.views.SimulationsView', [ dijit._Widget, dijit._Templated ], { templateString: dojo.cache('app.views', 'Simulations/view.html'), title: 'View Simulation', closable: true, data: false, widgetsInTemplate: true, //...................... initSlider: function(results) { var _this = this; console.log('initialize time slider'); var timeLayer; dojo.forEach(results, function(result) { if(result.layer.id = 'Hospitals') { //not sure if this is the best layer to pull time extent from? timeLayer = result.layer; } }); var timeSlider = new esri.dijit.TimeSlider({ id: 'TimeSlider' + _this.data.id, style: "width: 100%;" }, _this.timeSliderDiv); _this.map.setTimeSlider(timeSlider); timeSlider.setThumbCount(1); dojo.connect(timeSlider, 'onTimeExtentChange', _this, _this.onTimeExtentChange); if(timeLayer && timeLayer.timeInfo) { var layerTimeExtent = timeLayer.timeInfo.timeExtent; timeSlider.createTimeStopsByTimeInterval(layerTimeExtent, 10, 'esriTimeUnitsMinutes'); timeSlider.setThumbMovingRate(2000); timeSlider.singleThumbAsTimeInstant(true); timeSlider.setLoop(true); timeSlider.startup(); } else { alert('Could not load simulation MapService layers. You may need to re-crunch this simulation.'); } }, //...................... });
Solved! Go to Solution.
dojoConfig = { baseUrl : './', modulePaths : { app : "js/app" } };
Any idea if this bug will be fixed in version 2.8?
I was able to un-minify the TimeSlider.js code and make the change myself actually. I couldn't bring myself to start destroying/creating timesliders on the fly like that. I updated the code and fixed the bug. I can post the code here if it is allowed for others experiencing this bug. Basically I just changed the hard-coded id to an attach-point.
dojoConfig = { baseUrl : './', modulePaths : { app : "js/app" } };