is there anyway i can save the map position and zoom a user sets on the google map on my site so when they refresh the page it will load the map to their last position and zoom level?

i thought about possibly saving the map co-ordinates and zoom level in a session variable but im not 100% sure how i would update the session variable each time the map was moved/zoomed?

i think i know how i can get the session variable back into the map, its just getting it to update the variable?

    ok i have managed to get the Google Maps API to load the map based on the session variables but thinking properly i know that Javascript can't directly modify the session variables without reloading the page, so how could i pass the variables to the session?

    would it be best to use Javascript to redirect after X mins but specify the lat/long and zoom in hidden form fields?

    or pass the variable in the url?

      You could use an AJAX call via JavaScript to a PHP script to modify the session variable as desired.

        Write a Reply...