summaryrefslogtreecommitdiff
path: root/chimere/static
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2012-05-08 12:20:09 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2012-05-08 12:20:09 +0200
commit3f1bcfe051af8e97b1cb6553df84dc20f395da32 (patch)
treed0c222fdcd80a23ff41485a6544266f33bc4afac /chimere/static
parent4028d3de920bfdcc9cc038521109314cdbe66ab6 (diff)
downloadChimère-3f1bcfe051af8e97b1cb6553df84dc20f395da32.tar.bz2
Chimère-3f1bcfe051af8e97b1cb6553df84dc20f395da32.zip
Better management of default areas - Fix the extent save
Diffstat (limited to 'chimere/static')
-rw-r--r--chimere/static/chimere/js/jquery.chimere.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/chimere/static/chimere/js/jquery.chimere.js b/chimere/static/chimere/js/jquery.chimere.js
index 3c1e321..0853557 100644
--- a/chimere/static/chimere/js/jquery.chimere.js
+++ b/chimere/static/chimere/js/jquery.chimere.js
@@ -179,7 +179,9 @@ See the file COPYING for details.
/* if not zoom to the extent in cookies */
else if (!methods.zoomToCurrentExtent(settings.map)){
/* if no extent in cookies zoom to default */
- settings.map.setCenter(CENTER_LONLAT, DEFAULT_ZOOM);
+ if(CENTER_LONLAT && DEFAULT_ZOOM){
+ settings.map.setCenter(CENTER_LONLAT, DEFAULT_ZOOM);
+ }
}
if (!settings.edition){
methods.loadCategories();
@@ -592,6 +594,14 @@ See the file COPYING for details.
/*zoom to the route*/
var bounds = settings.layerVectors.getDataExtent();
if (bounds) settings.map.zoomToExtent(bounds);
+ },
+ saveExtent: function(){
+ var extent_key = 'MAP_EXTENT';
+ //if (area_name){ extent_key = extent_key + '_' + area_name; }
+ var extent = settings.map.getExtent().transform(EPSG_PROJECTION,
+ EPSG_DISPLAY_PROJECTION);
+ document.cookie = extent_key + "=" + extent.toArray().join('_')
+ + ';path="/"';
}
}; // End of public methods
var helpers = {
@@ -701,7 +711,7 @@ See the file COPYING for details.
for (var i=0; i < cookies.length; i++){
var items = cookies[i].split('=');
key = items[0].split(' ').join('');
- if (key == extent_key){
+ if (key == extent_key && !map_extent){
map_extent = items[1].split('_');
}
}