1

using JxMaps (Java Swing) I draw a polyline. This works fine. Now I'd like to add arrwos to the lines. Anyone having an idea whats wrong with my code?

...
Symbol icon = new Symbol();
icon.setPath("google.maps.SymbolPath.FORWARD_CLOSED_ARROW");

IconSequence iconSequence = new IconSequence();
iconSequence.setIcon(icon);
iconSequence.setOffset("100%");

options.setIcons(new IconSequence[]{iconSequence});

// Applying ALL options to the polyline
polyline.setOptions(options);

No Arrows appear

If I look at the Google Maps API, it looks very similiar:

// var lineSymbol = {
//        path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW
//
// new google.maps.Polyline({
//icons: [{
//   icon: lineSymbol,
//            offset: '100%'
//}],

Thanks

4

1 回答 1

2

JxMaps 1.2.2 版中引入了使用内置符号路径的可能性。您可以从官方产品页面下载:www.teamdev.com/jxmaps

您可以使用以下代码添加这种图像:

Symbol icon = new Symbol();
icon.setPath(StandardSymbol.BACKWARD_CLOSED_ARROW);

谢谢。

于 2017-01-24T16:32:16.297 回答