我如何放置一个点到点的p1
图像p2
?任何人都可以向我建议一种方法吗?
编辑:我按照这个例子,在 JMapViewer 中的两个地理点之间画线,在两个geoPoints
. 但是当我尝试删除MapPolygon
我首先创建的一个时,它不起作用,我不知道为什么。输入是正确的,相信我!
List<Coordinate> route = new ArrayList<Coordinate>(Arrays.asList(one, two, two));
List<MapPolygon> lista=cartina.getMapPolygonList();
MapPolygon arrow=new MapPolygonImpl(route);
cartina.removeMapPolygon(arrow);
编辑:我这样做:
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));
}