I have an application that allows the user to draw a freehand line on the earth’s surface. I’m using a CallbackProperty for the poistions property of a Entities polyline. At one point I had the polyline updating correctly for the very first time the line was being drawn. I’ve made some changes so that a new polyline is created for each line that is being drawn(instead of trying to reuse the polyline). Now, the polyline isn’t updated until the user releases the mouse button, which is the exact behavior I was seeing prior to using the CallbackProperty.
The temporartPoints array is being updated via a drawing behavior which is receiving events from cesium. Can anyone see anything wrong with the code that I have?
I created a sample sandcastle drawing application(attached) to try to understand the CallbackProperty a little better, and of course the application works as expected. The way I had written the application, I could only draw one line at a time. I was able to fix that issue by replacing the CallbackProperty with a copy of the current points array. This causes the line to disappear briefly which isn’t a big deal, but I was wondering if anyone could look at the application and make a suggestion on how to make any improvements.
This application is written almost exactly the same way as my drawing code. I’ve created a unminified version of our Cesium build, so that I can try to trace through what all is going on my application. Since this issue is dealing with mouse move debugging can be rather difficult. Are there any suggestions on how to or where to place some console trace info to help out?
Is there a way to remove a CallbackProperty and have the property value retain the current value? While the mouse is down, I need the line to be updated on mouse move, but as soon as the mouse up occurs the polyline’s positions property will be constant.
That’s what I’m currently doing, and that just causes the line to disappear for a couple of frames which is acceptable. I was just wondering if there was a way around visibility issue.