I tried to modify the sample code Histogram Time Slider ArcGIS API for JavaScript from AMD to Legacy style. However, I found the histogram was not shown in the bottom in the application (link listed below). I am wondering if you could provide valuable opinions on the application. I am not sure if the Histogram Time slider not supported in DoJo <1.8
The Histogram time slider application based on Legacy style http://maps.nmt.edu/JSTest/Histogram/Histogram_Legacy.html
1 Answer 1
Two corrections needed here
The legacy event name is onUpdateEnd, not update-end
When initializing the Histogram Slide, pass it sliderElem, not dojo.byId("bottom-div")
You should be good then!
More explanation on the 2nd step: The bottom-div element is already registered with Dojo. It is a Dojo ContentPane so it can't be used for another Dojo Widget. So we have to construct an element inside bottom-div. Otherwise you will see an error in console like this
Tried to register widget with id==bottom-div but that id is already registered(...)
I saw in your code that you have already constructed the element in the variable sliderElem. And also saw it being used in the Esri sample.
http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=widget_histogram_time_slider
-
Thank you for the valuable opinions. I am new in JavaScript. I have followed your instructions. First, I have changed the event name from update-end to onUpdateEnd. However, could you provide more information on the point 2, in the source code, line 82 and 97, I can see dojo.byId("bottom-div"). Could you provide more detailed information on these two lines? Many thanks, Hankuser3320249– user33202492015年12月18日 18:38:01 +00:00Commented Dec 18, 2015 at 18:38
-
I just tried to replace the dojo.byId("bottom-div") in the line 97. Wow! And then I can see the Histogram. I appreciate your opinions. If possible, could you share how you tell the error in the line 97 and provide the suggestion "pass it sliderElem, not dojo.byId("bottom-div")" Many thanks,<br> Hankuser3320249– user33202492015年12月18日 18:52:04 +00:00Commented Dec 18, 2015 at 18:52
-
updated my answer with explanationAamir Suleman– Aamir Suleman2015年12月18日 21:01:10 +00:00Commented Dec 18, 2015 at 21:01