diff options
author | Matthew Somerville <matthew@mysociety.org> | 2013-02-21 12:31:17 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-02-21 12:31:17 +0000 |
commit | e2bf144a6aaa19779fc55a04081a3c269b9d0f81 (patch) | |
tree | 00318d801d35948938743608252fccd2d1b4e585 /web/js/map-wmts-zurich.js | |
parent | eb0c0d42f3596c5dc21e9bcdcc02a4008a541c34 (diff) | |
parent | f8a8948ddb790e7e7593d538c55a3a278fbf3973 (diff) |
Merge remote branch 'origin/zurich'
(locale ignored, will rerun .po extraction after to get all changes.)
Conflicts:
locale/FixMyStreet.po
locale/cy_GB.UTF-8/LC_MESSAGES/EmptyHomes.po
locale/de_CH.UTF-8/LC_MESSAGES/FixMyStreet.po
locale/nb_NO.UTF-8/LC_MESSAGES/FixMyStreet.po
locale/nn_NO.UTF-8/LC_MESSAGES/FixMyStreet.po
templates/web/fixmystreet/report/banner.html
templates/web/zurich/faq/faq-de-ch.html
Diffstat (limited to 'web/js/map-wmts-zurich.js')
-rw-r--r-- | web/js/map-wmts-zurich.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/web/js/map-wmts-zurich.js b/web/js/map-wmts-zurich.js index 682c62f39..9fed68b8a 100644 --- a/web/js/map-wmts-zurich.js +++ b/web/js/map-wmts-zurich.js @@ -2,6 +2,34 @@ * Maps for FMZ using Zurich council's WMTS tile server */ +function fixmystreet_zurich_admin_drag() { + var admin_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( admin_drag ); + admin_drag.activate(); +} + $(function(){ $('#map_layer_toggle').toggle(function(){ $(this).text('Luftbild'); @@ -10,6 +38,15 @@ $(function(){ $(this).text('Stadtplan'); fixmystreet.map.setBaseLayer(fixmystreet.map.layers[0]); }); + + /* Admin dragging of pin */ + if (fixmystreet.page == 'admin') { + if ($.browser.msie) { + $(window).load(fixmystreet_zurich_admin_drag); + } else { + fixmystreet_zurich_admin_drag(); + } + } }); /* @@ -34,6 +71,11 @@ $(function(){ fixmystreet.controls.push( new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) ); } + /* Linking back to around from report page, keeping track of map moves */ + if ( fixmystreet.page == 'report' ) { + fixmystreet.controls.push( new OpenLayers.Control.PermalinkFMS('key-tool-problems-nearby', '/around') ); + } + fixmystreet.map_type = OpenLayers.Layer.WMTS; // Set DPI - default is 72 |