diff options
author | Struan Donald <struan@exo.org.uk> | 2013-06-21 13:52:57 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-06-21 13:52:57 +0100 |
commit | b41b9c7c6ebcc026aa90b88e7ca8f39b9057bddd (patch) | |
tree | e22f12ca4ca26c6952cd4f2db4f609693ac84c15 /www/js/views/around.js | |
parent | 914bc0b09ee87874d8d66f96747aacef5786d2a8 (diff) |
add reposition button that appears if map is dragged after location has been set
Diffstat (limited to 'www/js/views/around.js')
-rw-r--r-- | www/js/views/around.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/www/js/views/around.js b/www/js/views/around.js index 2b17ce6..057241e 100644 --- a/www/js/views/around.js +++ b/www/js/views/around.js @@ -16,6 +16,7 @@ 'vclick #cancel': 'onClickCancel', 'vclick #confirm': 'onClickReport', 'vclick #mark-here': 'onClickMark', + 'vclick #reposition': 'onClickReposition', 'vclick a.address': 'goAddress', 'submit #postcodeForm': 'search' }, @@ -179,7 +180,17 @@ } fixmystreet.bbox_strategy.activate(); fixmystreet.select_feature.activate(); - fixmystreet_activate_drag(); + }, + + onClickReposition: function(e) { + e.preventDefault(); + var lonlat = this.getCrossHairPosition(); + lonlat.transform( + new OpenLayers.Projection("EPSG:4326"), + fixmystreet.map.getProjectionObject() + ); + fixmystreet.markers.features[0].move(lonlat); + $('#reposition').hide(); }, onClickReport: function() { |