Jump to content
Search Community

Manolis G

Members
  • Posts

    3
  • Joined

  • Last visited

Manolis G's Achievements

  1. Thanks @mvaneijgen This worked like charm!
  2. Hi @mvaneijgen and thank you for looking into it. I think you were right in your first message. I cant use getBoundingClientRect as this is relevant to the viewport. That's why I tried to calculate the percentages in my initial code so it's relevant to the parent. But then I couldn't use these values to position the second marker. I tried using your suggestion getBBox() but i keep getting the same coordinates even after moving the marker: https://codepen.io/Manolis-Giouvanakis/pen/qBwbpRj Your pen although it works ok in the browser as both maps are there at the same time, I'm afraid i cant use it to save the location and load the marker later on as the viewport may be different so it will place the marker on the map based on its position in the previous screen. Hope this makes sense. Any other suggestions would be more than welcome and appreciated!
  3. 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!
×
×
  • Create New...