1

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

Fahim
  • 12,198
  • 5
  • 39
  • 57

2 Answers2

1

You can smooth the corners for example using these:

lineStyleBuilder.setLineJointType(LineJointType.LINE_JOINT_TYPE_ROUND);
lineStyleBuilder.setStretchFactor(2);
JaakL
  • 4,107
  • 5
  • 24
  • 37
  • this doesn't seems to be working . Check updated view with your mentioned changes http://grab.by/Lep6 – Fahim Oct 16 '15 at 07:00
  • The line with this styling in AdvancedMap3 example is nice, see https://dl.dropboxusercontent.com/u/3573333/public_web/device-2015-10-17-122122.png . Something seems to be wrong in your style building. – JaakL Oct 17 '15 at 09:26
  • what i shared in my question, is what i am using as a style... Please tell me what is wrong with it? – Fahim Oct 19 '15 at 04:59
1

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.

MarkT
  • 301
  • 2
  • 2