I have a Google Maps interface on my website which allows people to drop and place various custom markers etc.
Is there any way of allowing people to save these? or for them to be copied onto a unique link in the website that the user can access?
You can also use localStorage with JSON to keep objects in the user's device. You can try this code:
var whatYouWhantToKeep={};
whatYouWhantToKeep.position.lat=marker.getPosition().lat;
whatYouWhantToKeep.position.lng=marker.getPosition().lng;
whatYouWhantToKeep.icon=yourIcon.src;
localStorage.setItem ('aSpecialKey', JSON.stringify(whatYouWhantToKeep));
And after get what you wanted to keep with your key:
var whatYouWhantToKeep = JSON.parse (localStorage.getItem ('aSpecialKey'));
You have to use JSON because localStorage accept only strings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With