summaryrefslogtreecommitdiff
path: root/chimere/templates
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2013-05-29 11:42:58 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2013-05-29 11:53:55 +0200
commit7b54448addd4eca66aff8b5d8f9e04ef7cbcd8fc (patch)
treee9af762ed9a8d19adc6e57701e726470d0d9eef0 /chimere/templates
parent57a43595d7ddb1e1581653eb8d2a71f3d2f192ab (diff)
downloadChimère-7b54448addd4eca66aff8b5d8f9e04ef7cbcd8fc.tar.bz2
Chimère-7b54448addd4eca66aff8b5d8f9e04ef7cbcd8fc.zip
Use a template to render PointChooser widget.
Integration of Raphaël Droz's work.
Diffstat (limited to 'chimere/templates')
-rw-r--r--chimere/templates/chimere/blocks/live_coordinates.html40
1 files changed, 40 insertions, 0 deletions
diff --git a/chimere/templates/chimere/blocks/live_coordinates.html b/chimere/templates/chimere/blocks/live_coordinates.html
new file mode 100644
index 0000000..4ed4e6f
--- /dev/null
+++ b/chimere/templates/chimere/blocks/live_coordinates.html
@@ -0,0 +1,40 @@
+<script type='text/javascript'>
+ 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];
+ chimere_init_options['dynamic_categories'] = false;
+ chimere_init_options['edition'] = true;
+ chimere_init_options["checked_categories"] = [];
+ if({{default_area}}) chimere_init_options['selected_map_layer'] = {{default_area}};
+</script>
+
+</div>
+
+
+<div id='map_edit'></div>
+<div id='live_lonlat'>
+ <p>
+ <label for='live_latitude'>{{lat}}</label>
+ <input type='texte' name='live_latitude' id='live_latitude' size='8' adisabled='true' value='{{value_y|stringformat:"f"}}'/>
+ </p>
+ <p>
+ <label for='live_longitude'>{{lon}}</label>
+ <input type='texte' name='live_longitude' id='live_longitude' size='8' adisabled='true' value='{{value_x|stringformat:"f"}}'/>
+ </p>
+ <input type='hidden' name='{{name}}' id='id_{{name}}' value='{{val}}'/>
+
+<script type="text/javascript">
+ $('#map_edit').chimere(chimere_init_options);
+ if({{isvalue}}) {
+ var mylonlat = new OpenLayers.LonLat({{value_x|stringformat:"f"}},{{value_y|stringformat:"f"}});
+ $("#map_edit").chimere(
+ "putEditMarker",
+ mylonlat.transform(EPSG_DISPLAY_PROJECTION, EPSG_PROJECTION),
+ true);
+ }
+</script>