diff options
author | Dave Arter <davea@mysociety.org> | 2016-07-19 15:56:26 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2016-09-06 15:05:09 +0100 |
commit | 6f82bb9e094d679d24a6286259e7652fd1304639 (patch) | |
tree | 82e1375a50daacd03750328a1bdaef7568a48d38 /web/js/map-wmts-zurich.js | |
parent | d3ce66d0add6754dd54624f1d35efc922054ce9b (diff) |
Add inspector report detail view
Users with the `report_inspect` permission can click a new 'inspect' button on a
report page to input more detailed problem information into a new form that
appears in a column alongside the report detail.
- Inspector data is stored in problem's 'extra' field
- Report category/state can be edited
- Location can be changed by dragging the pin or HTML5 geolocation
(Factored out Zurich admin pin drag into own function)
For mysociety/fixmystreetforcouncils#22
Diffstat (limited to 'web/js/map-wmts-zurich.js')
-rw-r--r-- | web/js/map-wmts-zurich.js | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/web/js/map-wmts-zurich.js b/web/js/map-wmts-zurich.js index fc1dfa08f..18a858064 100644 --- a/web/js/map-wmts-zurich.js +++ b/web/js/map-wmts-zurich.js @@ -114,33 +114,9 @@ fixmystreet.maps.matrix_ids = [ ]; (function() { - - function admin_drag() { - var drag = new OpenLayers.Control.DragFeature( fixmystreet.markers, { - onComplete: function(feature, e) { - var lonlat = feature.geometry.clone(); - lonlat.transform( - fixmystreet.map.getProjectionObject(), - new OpenLayers.Projection("EPSG:4326") - ); - if (window.confirm( 'Richtiger Ort?' ) ) { - // Store new co-ordinates - document.getElementById('fixmystreet.latitude').value = lonlat.y; - document.getElementById('fixmystreet.longitude').value = lonlat.x; - } else { - // Put it back - var lat = document.getElementById('fixmystreet.latitude').value; - var lon = document.getElementById('fixmystreet.longitude').value; - lonlat = new OpenLayers.LonLat(lon, lat).transform( - new OpenLayers.Projection("EPSG:4326"), - fixmystreet.map.getProjectionObject() - ); - fixmystreet.markers.features[0].move(lonlat); - } - } - } ); - fixmystreet.map.addControl( drag ); - drag.activate(); + function pin_dragged(lonlat) { + document.getElementById('fixmystreet.latitude').value = lonlat.y; + document.getElementById('fixmystreet.longitude').value = lonlat.x; } $(function(){ @@ -155,9 +131,9 @@ fixmystreet.maps.matrix_ids = [ /* Admin dragging of pin */ if (fixmystreet.page == 'admin') { if ($.browser.msie) { - $(window).load(admin_drag); + $(window).load(function() { fixmystreet.maps.admin_drag(pin_dragged, true); }); } else { - admin_drag(); + fixmystreet.maps.admin_drag(pin_dragged, true); } } }); |