I’m trying to change polyline positions dynamically,
i added billboard and polyline with billboardcollection and polylinecollection
the billboard position is [100,200],
there is two polyline connect with this billboard
polyline one position [[100,200],[105,205],[110,210]]
polyline two position [[97,84],[100,200]]
my operation logic has three step
first step: mouse left down to pick billboard
second step: change billboard position and two polyline first or last positions coordinate dynamic with mouse move
final step: mouse left up to get final position with billboard and polylines
here is my core logic to handle mouse move event to update positions
i just change the first or last item on a new polyline cartesian3Arr deepcloned from original polyline postions. not change the positions length
but sometimes when i drag billboard then move mouse i got this error
and there is another question is that sometimes after i dragging billboard, all positions has been changed but all polyline is disappear, when i dragging billboard again, the polyline display again
Thanks for your post an apologies for the slow response.
Thanks for providing a clear description of the problem you encountered. Could you go one step further by preparing an example that reproduces the issue using our sandcastle tool https://sandcastle.cesium.com/ ? This will make it much easier for us to understand what is precisely happening and come up with a solution.
Thanks for following up by creating a sandcastle example.
The error indicates that the way you are changing the position of the point on the polyline is causing problems because the size of the data is changing such that it no longer fits within the buffer that is used to pass its position info to the renderer. As an alternative, when the polyline position is edited, could you do an operation where you basically remove the old polyline from the collection and add a new one with the new positions?
Hi @Luke_McKinstry
I tried the approach you suggested and it can be implemented, but changing it in my business scenario is very complicated because it involves other things as well
I don’t quite understand why changing one element of a coordinate array would cause a change in the size of the coordinates, because I haven’t changed the length of the array.
And it’s an occasional issue that doesn’t happen every time