2

I have Google Map and a lot of markers. Is there possibility to add feature when user clicks on marker and Info Window shows up, that user has option to add that location to wishlist and associate that to either a user ID/cookie?

1 Answer 1

3

Absolutely. Simply save the info into an array. whether it be the marker object, the coordinates (so you can later recreate the marker), or a combination of both with extra information in your own object. I would go with a markup like geoJSON and save it into an array.

var mySavedMarkers = [];

mySavedMarkers.push(aMarker);

You can then send mySavedMarkers[] to the Database via Ajax, save it in session, cookie, file, or whatever you want.

2
  • Thank you. And what if the site is in WordPress? Commented Feb 3, 2012 at 17:22
  • I've never used WordPress, sorry. But if it allows you to do javascript, the same way.
    – CaptDragon
    Commented Feb 3, 2012 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.