diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-05-29 11:54:23 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-05-29 11:57:10 +0200 |
commit | b39730245dfafe27eddeeffa2532a901c489beba (patch) | |
tree | 5081d2919a453f11fc9f940e82d75344d6e8531b | |
parent | 7b54448addd4eca66aff8b5d8f9e04ef7cbcd8fc (diff) | |
download | Chimère-b39730245dfafe27eddeeffa2532a901c489beba.tar.bz2 Chimère-b39730245dfafe27eddeeffa2532a901c489beba.zip |
Ability to set coordinates from live_lonlat (refs #335)
Integration of Raphaël Droz's work.
-rw-r--r-- | chimere/static/chimere/css/styles.css | 4 | ||||
-rw-r--r-- | chimere/templates/chimere/blocks/live_coordinates.html | 17 | ||||
-rw-r--r-- | chimere/widgets.py | 2 |
3 files changed, 17 insertions, 6 deletions
diff --git a/chimere/static/chimere/css/styles.css b/chimere/static/chimere/css/styles.css index c30d259..9d26b67 100644 --- a/chimere/static/chimere/css/styles.css +++ b/chimere/static/chimere/css/styles.css @@ -585,10 +585,6 @@ table.inline-table td input[type=file]{ width:260px; } -#live_lonlat { - display:none; -} - #live_lonlat p{ display:inline-table; } diff --git a/chimere/templates/chimere/blocks/live_coordinates.html b/chimere/templates/chimere/blocks/live_coordinates.html index 4ed4e6f..e2a6420 100644 --- a/chimere/templates/chimere/blocks/live_coordinates.html +++ b/chimere/templates/chimere/blocks/live_coordinates.html @@ -31,10 +31,25 @@ <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"}}); + 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); } + $('#live_latitude').change(function() { + var mylonlat = new OpenLayers.LonLat($('#live_longitude').val(), + $('#live_latitude').val()); + $("#map_edit").chimere("putEditMarker", + mylonlat.transform(EPSG_DISPLAY_PROJECTION, EPSG_PROJECTION), false); + $("#map_edit").chimere("settings").map.setCenter(mylonlat); + }); + $('#live_longitude').change(function() { + var mylonlat = new OpenLayers.LonLat($('#live_longitude').val(), + $('#live_latitude').val()); + $("#map_edit").chimere("putEditMarker", + mylonlat.transform(EPSG_DISPLAY_PROJECTION, EPSG_PROJECTION), false); + $("#map_edit").chimere("settings").map.setCenter(mylonlat); + }); </script> diff --git a/chimere/widgets.py b/chimere/widgets.py index 87f797a..c463b7d 100644 --- a/chimere/widgets.py +++ b/chimere/widgets.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2008-2012 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2008-2013 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as |