Hello 😃
I'm building a Properties listing page and it has to have an SVG map with markers on the locations of the properties.
The properties will be added through a CMS so users need to be able to set the property's location on the map by dragging the marker on it.
What i'm not sure is how I can save the location of the draggable object in the onDragEnd function so I can use it to position the marker on the map when the user edits the property page in the CMS on a later date and eventually position all markers on the map in the front end.
I have created a sample code pen. Since I cant give you access to the CMS, I added two maps in the code pen sample. The first one has the draggable object and the second is to achieve the positioning of the marker based on the dragged position in the first map. If you can show me a way of mirroring the position of the dragged marker into the the second map it would be really appreciated.
In my implementation, I will save save the position of the dragged marker in an input field so I can use it later on.
As a note: although the map has a fixed with in the pen, in the CMS and in the front end, its size will differ based on screen size. Aspect ratio should be the same though.
If anyone could help, it would be really appreciated.
Thank you!