I have created an application using OpenLayers 3 that allows users to draw lines or points on a map and add tags to them.
While the existing functions in OL3 are helpful for drawing and modifying features, I found it challenging to select the items I drew without a snapping function.
Currently, OL3 only supports snapping for drawing and modifying features with certain interactions. However, I realized that by replacing ol.interaction.Draw with ol.interaction.Select, I could select the drawn items by clicking on points near them, although there was no snapping behavior with the mouse pointer.
My question is: how can I incorporate a select interaction with snapping functionality in OL3?
I have added some code snippets for further clarity.
You can view the additional details here: https://jsfiddle.net/keltpower0/sej6z2q4/1/
After drawing some lines, you must click directly on the line to select it. I am looking for a way to easily select lines with a snapping feature, where the cursor will automatically snap to the lines when moved close to them.