Smooth curved turns with Line Control Nutiteq SDK

68 Views Asked by At

I am trying to draw a line on the map with curve edges using the following code

LineStyleBuilder lineStyleBuilder = new LineStyleBuilder();
                    lineStyleBuilder.setColor(new Color(0xFF01579B));
                    lineStyleBuilder.setWidth(8);
                    // Add second line to the second layer.
                    route = new Line(linePoses, lineStyleBuilder.buildStyle());
                    route.setMetaDataElement("ClickText", "Line nr 2");
                    vectorDataSource1.add(route);

https://github.com/nutiteq/hellomap3d-android/blob/master/com.nutiteq.advancedmap3/src/com/nutiteq/advancedmap3/Overlays2DActivity.java

I am using the same code as mentioned in the sample code of the nutiteq but some how i am not getting the smooth curve at the edges.

enter image description here

2

There are 2 best solutions below

0
MarkT On BEST ANSWER

There was a bug in SDK 3.x versions prior to 3.2.1RC that produced similar artefacts as in your image. It only happened if the line string contained duplicate consecutive vertices. This was fixed in 3.2.1RC.

3
JaakL On

You can smooth the corners for example using these:

lineStyleBuilder.setLineJointType(LineJointType.LINE_JOINT_TYPE_ROUND);
lineStyleBuilder.setStretchFactor(2);