diff options
author | Struan Donald <struan@exo.org.uk> | 2013-06-27 17:19:08 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-06-28 09:44:03 +0100 |
commit | 790200dfc6c43109f136c69962e309977034ee1c (patch) | |
tree | eb51f40104809a0713b8e6b0b4110ba0d44774f0 /www/js | |
parent | 2bf5b5a58865becde0e1741e18bb4bcb700aaa2a (diff) |
use the position of the marker rather than crosshairs to set report location
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/views/around.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/www/js/views/around.js b/www/js/views/around.js index 844a984..1eac541 100644 --- a/www/js/views/around.js +++ b/www/js/views/around.js @@ -225,7 +225,7 @@ onClickReport: function(e) { e.preventDefault(); - var position = this.getCrossHairPosition(); + var position = this.getMarkerPosition(); if ( FMS.isOffline ) { this.stopListening(FMS.locator); @@ -361,6 +361,18 @@ return position; }, + getMarkerPosition: function() { + var marker = fixmystreet.report_location.features[0].geometry; + + var position = new OpenLayers.LonLat( marker.x, marker.y ); + position.transform( + fixmystreet.map.getProjectionObject(), + new OpenLayers.Projection("EPSG:4326") + ); + + return position; + }, + projectCoords: function( coords ) { var centre = new OpenLayers.LonLat( coords.longitude, coords.latitude ); centre.transform( |