diff options
| author | Étienne Loks <etienne.loks@peacefrogs.net> | 2011-09-22 14:44:46 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2011-09-22 14:44:46 +0200 |
| commit | b1b0a4e43365b36cac23688c4db402e46e0b224a (patch) | |
| tree | 0ceef856fde0dce5baa0db8480f6d5813b9b0e9e /chimere/static | |
| parent | 7273d9b45e4908de4a9b8623ea1fa6e153eed33a (diff) | |
| download | Chimère-b1b0a4e43365b36cac23688c4db402e46e0b224a.tar.bz2 Chimère-b1b0a4e43365b36cac23688c4db402e46e0b224a.zip | |
Correct route shifting in edition (closes #304) + enlarge the edition map (closes #305)
Diffstat (limited to 'chimere/static')
| -rw-r--r-- | chimere/static/edit_route_map.js | 25 | ||||
| -rw-r--r-- | chimere/static/forms.css | 40 |
2 files changed, 53 insertions, 12 deletions
diff --git a/chimere/static/edit_route_map.js b/chimere/static/edit_route_map.js index a2d8bf1..11af258 100644 --- a/chimere/static/edit_route_map.js +++ b/chimere/static/edit_route_map.js @@ -20,6 +20,8 @@ See the file COPYING for details. var map; var currentControl; +var pathCreate; +var pathModify; /* availaible map layers */ var vectors = new OpenLayers.Layer.Vector("Vector Layer"); @@ -91,11 +93,10 @@ function updateForm(event) { /* path control */ var pathCreate = new OpenLayers.Control.DrawFeature(vectors, - OpenLayers.Handler.Path); + OpenLayers.Handler.Path); var currentControl = pathCreate; - var pathModify = new OpenLayers.Control.ModifyFeature(vectors, - {clickout:false, toggle:false}); + {clickout:false, toggle:false}); /* main initialisation function */ function init(){ @@ -126,16 +127,30 @@ function init(){ } } -function toggleDrawOn() { - currentControl.activate(); +function toggleDraw() { document.getElementById('draw-toggle-off').style.display = 'None'; document.getElementById('draw-or').style.display = 'None'; document.getElementById('upload').style.display = 'None'; + document.getElementById('map_edit').style.display = ''; + document.getElementById('help-route-create').style.display = 'block'; + init(); +} + +function toggleDrawOn() { + jQuery('#button-move-map').removeClass('toggle-button-active').addClass('toggle-button-inactive'); + jQuery('#button-draw-map').removeClass('toggle-button-inactive').addClass('toggle-button-active'); + currentControl.activate(); if (currentFeature){ pathModify.selectControl.select(currentFeature); } } +function toggleDrawOff() { + jQuery('#button-draw-map').removeClass('toggle-button-active').addClass('toggle-button-inactive'); + jQuery('#button-move-map').removeClass('toggle-button-inactive').addClass('toggle-button-active'); + currentControl.deactivate(); +} + function checkFields(){ if (!jQuery("#id_name").val() || !jQuery("#id_categories").val()){ diff --git a/chimere/static/forms.css b/chimere/static/forms.css index dea37f0..dd3fc21 100644 --- a/chimere/static/forms.css +++ b/chimere/static/forms.css @@ -1,16 +1,42 @@ /* colors definition */ -.toggle-button{ +.map_button .toggle-button-inactive{ color: #5b80b2; +background-color:#fff; +} + +.map_button .toggle-button-active, .toggle-button:hover{ +background-color: #5b80b2; +color:#fff; } + + /**/ #map_edit{ border: 1px solid black; -width:700px; -height:400px; -float:left; +width:100%; +height:500px; +} + + +.map_button{ +position:absolute; +z-index:1000; +text-align:center; +width:100%; +margin:0; +padding:0; +margin-top:10px; +} + +.map_button a{ +margin:8px; +padding:4px; +-moz-border-radius: 4px; +-webkit-border-radius: 4px; +border-radius: 4px; } #live_lonlat{ @@ -47,10 +73,9 @@ font-size:16px; } .help-route{ -width:700px; +width:98%; background-color:#EEF;; -margin: 10px 0px; -float:left; +margin: 10px 0; padding:0 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; @@ -59,6 +84,7 @@ border:1px solid grey; } #help-route-create{ +display:None } #help-route-modify{ |
