JxMaps not drawing arrows at polyline

164 views Asked by At

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

1

There are 1 answers

1
Vitaly Eremenko On BEST ANSWER

Possibility to use built-in symbol paths was introduced in JxMaps version 1.2.2. You can download it from official product page: www.teamdev.com/jxmaps

You can add this kind of image using following code:

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

Thanks.