I have a bit of code in a 3D SceneView for a draw-line tool that has worked fine until the 4.6 release. It basically grabs the map point when the user clicks on the map, and creates a line starting at that point, and adds each subsequently clicked point to the 'paths' property of the line until the user double clicks to end the process. The line is added to the map as a graphic.
After 4.6, however, I can't get the polyline.insertPoint() function to work, or any of the polyline functions for that matter. I threw together a jsbin that illustrates a similar problem: here. You have to open dev tools to see the results. I used the getPoint() function to keep it a bit simpler, but it throws an error that line.getPoint() is not a function (getPoint() documentation).
tldr: polyline.insertPoint(path index, point index, point) is not adding anything to the 'paths' property of the line I pass in
Any ideas whats going on here? Am I missing something?
Any help is much appreciated. Cheers
Andrew,
I think the place you were using the polyline before was autocasting. Your code in the JSBin is just creating a basic object and not a Polyline that is why the getPoint is not a function. You need to use new Polyline: