I have a program that displays this path when I give it two points shown by the red marker.
I wanted to create a barrier on that road so I added this code
Polygon po=new Polygon(); Point p1=new Point(4102363.9071817156,857772.619643); Point p2=new Point(4102416.5557467686,857799.2401230272); Point p3=new Point(4102436.1589281,857744.31787604); po.startPath(p1); po.lineTo(p2); po.lineTo(p3); Graphic ba_gr=new Graphic(po,null); NAFeaturesAsFeature na=new NAFeaturesAsFeature(); na.addFeature(ba_gr); params.setPolygonBarriers(na);
params is my RouteParameters
On my previous code but my program still shows be the previous path. Did I miss something when creating the barriers?
The polygon is in this position,
I tried it on another program.