Use a cookie to remember the last location viewed on the slippy map.

This commit is contained in:
Tom Hughes 2007-07-28 00:07:31 +00:00
parent 985047f18d
commit 10e13b8fea

View file

@ -14,6 +14,8 @@
<% lon = params['mlon'] %>
<% lat = params['mlat'] %>
<% zoom = params['zoom'] || '12' %>
<% elsif cookies.key?("location") %>
<% lon,lat,zoom = cookies["location"].value.first.split(",") %>
<% elsif @user and !@user.home_lon.nil? and !@user.home_lat.nil? %>
<% lon = @user.home_lon %>
<% lat = @user.home_lat %>
@ -73,6 +75,8 @@
var zoom = map.getZoom();
updatelinks(lonlat.lon, lonlat.lat, zoom);
document.cookie = "location=" + lonlat.lon + "," + lonlat.lat + "," + zoom;
}
function getStyle( el, property ) {