1

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

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Dec 18, 2015 at 16:48

1 Answer 1

3

Two corrections needed here

  1. The legacy event name is onUpdateEnd, not update-end

  2. 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

answered Dec 18, 2015 at 18:12
3
  • 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, Hank Commented 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> Hank Commented Dec 18, 2015 at 18:52
  • updated my answer with explanation Commented Dec 18, 2015 at 21:01

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.