summaryrefslogtreecommitdiff
path: root/chimere
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2012-05-24 20:16:50 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2012-05-24 20:17:03 +0200
commit929c5474cde863f85e4c683144d103773cc9d9c2 (patch)
treeb7bb0258a0da2c908156485da70f5a1f4de6cef4 /chimere
parent4e851d59c8a8dbd227c3699c7982bb07c86c8b9f (diff)
downloadChimère-929c5474cde863f85e4c683144d103773cc9d9c2.tar.bz2
Chimère-929c5474cde863f85e4c683144d103773cc9d9c2.zip
Fix bad JS initialisation in administration
Diffstat (limited to 'chimere')
-rw-r--r--chimere/widgets.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/chimere/widgets.py b/chimere/widgets.py
index da4ff26..7209102 100644
--- a/chimere/widgets.py
+++ b/chimere/widgets.py
@@ -149,6 +149,8 @@ class PointChooserWidget(forms.TextInput):
OpenLayers.ImgPath = '%schimere/img/';
var EPSG_DISPLAY_PROJECTION = epsg_display_projection = new OpenLayers.Projection('EPSG:%s');
var EPSG_PROJECTION = epsg_projection = new OpenLayers.Projection('EPSG:%s');
+ var CENTER_LONLAT = centerLonLat = new OpenLayers.LonLat%s.transform(epsg_display_projection, epsg_projection);
+ var DEFAULT_ZOOM = %s;
var chimere_init_options = {};
chimere_init_options["default_icon"] = new OpenLayers.Icon('%schimere/img/marker-green.png', new OpenLayers.Size(21, 25), new OpenLayers.Pixel(-(21/2), -25));
chimere_init_options["map_layers"] = [%s];
@@ -156,8 +158,9 @@ class PointChooserWidget(forms.TextInput):
chimere_init_options['edition'] = true;
chimere_init_options["checked_categories"] = [];
""" % (settings.STATIC_URL, settings.CHIMERE_EPSG_DISPLAY_PROJECTION,
- settings.CHIMERE_EPSG_PROJECTION, settings.STATIC_URL,
- ", ".join(map_layers))
+ settings.CHIMERE_EPSG_PROJECTION, settings.CHIMERE_DEFAULT_CENTER,
+ settings.CHIMERE_DEFAULT_ZOOM, settings.STATIC_URL,
+ ", ".join(map_layers))
#TODO: manage area
tpl = u"<script type='text/javascript'><!--\n"\
u"%s// !--></script>\n" % js
@@ -222,6 +225,8 @@ class RouteChooserWidget(forms.TextInput):
OpenLayers.ImgPath = '%schimere/img/';
var EPSG_DISPLAY_PROJECTION = epsg_display_projection = new OpenLayers.Projection('EPSG:%s');
var EPSG_PROJECTION = epsg_projection = new OpenLayers.Projection('EPSG:%s');
+ var CENTER_LONLAT = centerLonLat = new OpenLayers.LonLat%s.transform(epsg_display_projection, epsg_projection);
+ var DEFAULT_ZOOM = %s;
var chimere_init_options = {};
chimere_init_options["map_layers"] = [%s];
chimere_init_options['dynamic_categories'] = false;
@@ -229,8 +234,8 @@ class RouteChooserWidget(forms.TextInput):
chimere_init_options['edition_type_is_route'] = true;
chimere_init_options["checked_categories"] = [];
""" % (settings.STATIC_URL, settings.CHIMERE_EPSG_DISPLAY_PROJECTION,
- settings.CHIMERE_EPSG_PROJECTION,
- ", ".join(map_layers))
+ settings.CHIMERE_EPSG_PROJECTION, settings.CHIMERE_DEFAULT_CENTER,
+ settings.CHIMERE_DEFAULT_ZOOM, ", ".join(map_layers))
tpl = u"<script type='text/javascript'><!--\n"\
u"%s// !--></script>\n" % js
#TODO: manage area