Facebook
From Edgy Pheasant, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 227
  1. private void deleteOldLine(LatLng oldLatLonPoint) {
  2.         Polyline line1 = null;
  3.         for(Polyline line : lines){
  4.             if((line.getPoints().get(0).longitude == oldLatLonPoint.longitude && line.getPoints().get(0).latitude == oldLatLonPoint.latitude) ||
  5.                     (line.getPoints().get(1).longitude == oldLatLonPoint.longitude && line.getPoints().get(1).latitude == oldLatLonPoint.latitude)){
  6.  
  7.                 if(line1 == null){
  8.                     line1 = line;
  9.                 }
  10.             }
  11.         }
  12.         if(line1 != null){
  13.             lines.remove(line1);
  14.             line1.remove();
  15.         }
  16.  
  17.     }