How I can put an image that goes from point p1
to point p2
? Anyone can suggest a way to me?
Edit: I follow this example, Draw Line between two Geo Points in JMapViewer, to draw a path between two geoPoints
. But when I try to delete a MapPolygon
, that I created first, it's not work and I don't know why. The input is correct, trust me!
List<Coordinate> route = new ArrayList<Coordinate>(Arrays.asList(one, two, two));
List<MapPolygon> lista=cartina.getMapPolygonList();
MapPolygon arrow=new MapPolygonImpl(route);
cartina.removeMapPolygon(arrow);
Edit: I do this:
private Coordinate one;
private Coordinate two;
public ExampleClass(Coordinate one, Coordinate two) {
this.one=one;
this.two=two;
}
public method (){ //click button
List<Coordinate> route = new ArrayList<Coordinate>(Arrays.asList(one, two, two));
map.addMapPolygon(new MapPolygonImpl(route));
}
public methodB(){// click anothe button
List<Coordinate> route = new ArrayList<Coordinate>(Arrays.asList(one, two, two));
map.removeMapPolygon()(new MapPolygonImpl(route));
}