diff options
author | Jedidiah Broadbent <hello@jedidiah.eu> | 2013-08-05 11:15:45 +0100 |
---|---|---|
committer | Jedidiah Broadbent <hello@jedidiah.eu> | 2013-08-05 11:15:45 +0100 |
commit | 77a38bc1d61f3b9c7faa1855bc1721211fab36ab (patch) | |
tree | a2b121de186f3cad63d76d8dc3f9d77a05d5b6f7 /src/js/views/reports.js | |
parent | a19742511ccec2833bc4044b583d1b95b9ca8388 (diff) | |
parent | a9a3ed3f45571d319023e06a2134eb19cab64283 (diff) |
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet-mobile
Diffstat (limited to 'src/js/views/reports.js')
-rw-r--r-- | src/js/views/reports.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/js/views/reports.js b/src/js/views/reports.js index f68944d..3e58658 100644 --- a/src/js/views/reports.js +++ b/src/js/views/reports.js @@ -44,6 +44,22 @@ var el = $(e.target); var id = el.parents('li').attr('id'); FMS.currentDraft = FMS.allDrafts.get(id); + $('#drafts').hide(); + if ( FMS.currentDraft && FMS.currentDraft.get('lat') ) { + var coords = { latitude: FMS.currentDraft.get('lat'), longitude: FMS.currentDraft.get('lon') }; + fixmystreet.latitude = coords.latitude; + fixmystreet.longitude = coords.longitude; + + if ( fixmystreet.map ) { + var centre = new OpenLayers.LonLat( coords.longitude, coords.latitude ); + centre.transform( + new OpenLayers.Projection("EPSG:4326"), + fixmystreet.map.getProjectionObject() + ); + + fixmystreet.map.panTo(centre); + } + } this.navigate('around'); }, |