diff options
Diffstat (limited to 'chimere/static/edit_route_map.js')
| -rw-r--r-- | chimere/static/edit_route_map.js | 25 | 
1 files changed, 20 insertions, 5 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()){  | 
