Fixed js error in destroypolylines