• Hi, is possible to store the currently (or typed) user location on a cookie, show that in the address field and search from this?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    Not by default. But, if you don’t mind editing the JS code, then I can point you where to make it store the searched location in a cookie, and check if one exists after the page is loaded?

    Thread Starter Filipe Coutinho

    (@zetaprime)

    That will be wonderfull, what I do?

    I tryed to search on Google something about this, but didn’t found nothing.

    Is possible to show the stored location on the search field?

    Thanks!!!

    Thread Starter Filipe Coutinho

    (@zetaprime)

    Still there my friend?

    Plugin Author Tijmen Smit

    (@tijmensmit)

    You can find lots of information on how to set and read a JS cookie on Google.

    The first time you should check if a cookie exists is probably on line 86, this is where we have determined a map exists on the page and the map is initialized. If a cookie exists then you can set the input field to the value from the cookie.

    Storing the last made search for the user is probably best done directly after the user clicked the search button. This happens inside this function.

    You can check the user input just before ‘return false’ ( line 645 ), and saved the entered input in a cookie for later user.

    After you have made the changes you will need to minify the JS file, and save it as wpsl-gmap.min.js in the same folder as the wpsl-gmap.js.

    The above is untested, but it should work.

    I am also interested in this. I will see if I can figure it out and post what I find.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Store location on cookie and search from there’ is closed to new replies.