summaryrefslogtreecommitdiff
path: root/chimere/widgets.py
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/widgets.py')
-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