same as previous commit except added function to store lvector layer data in localStorage