Ignore:
Timestamp:
Dec 14, 2011, 7:50:53 PM (13 years ago)
Author:
rick
Message:

Filter should be allowed to be manually set as well, cause I like to run somehow more advanced filters..

Location:
src/django_gheat/wlheatmap
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/django_gheat/wlheatmap/static/heatmap_extensions.js

    r9655 r9779  
    2626}
    2727
     28
    2829$(window).load(function() {
    2930  var signallayer = '';
     
    3132  var nodelist = new Array();
    3233
     34  function update_raw_filter() {
     35     $("#raw_filter").val(get_raw_filter());
     36  }
     37
    3338  /**
    3439   * Adds colourpicker for layer colour.
     
    4550    onSelect: function(dateValue, inst){
    4651      $("#end_date").datepicker("option", "minDate", dateValue);
     52      update_raw_filter();
    4753    }
    4854  });
    4955  $("#end_date").datepicker({
    50     dateFormat: "dd/mm/yy"
     56    dateFormat: "dd/mm/yy",
     57    onSelect: function(dateValue, inst){
     58      update_raw_filter();
     59    }
    5160  });
    5261
     
    6271  function update_sig_slider(min,max) {
    6372      $("#select_sig_value").text("Signal Strength: " + min + " - " + max);
     73      update_raw_filter();
    6474  };
    6575
     
    240250  $("#select_user").change(function(){
    241251    update_lname();
     252    update_raw_filter();
    242253  });
    243254  $("#select_dataset").change(function(){
    244255    update_lname();
     256    update_raw_filter();
    245257  });
    246258  $("#select_node").change(function(){
    247259    update_lname();
     260    update_raw_filter();
     261  });
     262  $("#colour").change(function(){
     263    update_raw_filter();
    248264  });
    249265
     
    316332  });
    317333
    318   /**
    319    * Adds a new layer when clicked.
    320    * Filters set by user are used as layer parameters.
    321    * Colour is either chosen or randomized.
    322    * Blank parameters are ignored.
    323    */
    324   $('#add_filter').click(function(){
    325     // get values from elements
     334  function get_raw_filter() {
    326335    user = $('#select_user option:selected').text();
    327336    dataset = $('#select_dataset option:selected').text();
     
    330339    end_date = $('#end_date').val();
    331340    colour = $("#colour").val();
    332     lname = $("#lname").val();
    333341
    334342    /**
     
    385393      colour = Math.floor(Math.random()*256)+','+Math.floor (Math.random()*256)+','+Math.floor(Math.random()*256);
    386394    }
    387     if (lname == ''){
    388       lname= 'Custom Filter';
    389     }
    390395
    391396    var min = $("#select_sig_slider").slider("values")[0];
    392397    var max = $("#select_sig_slider").slider("values")[1];
    393398    signal = '&signaal__gte=' + min + '&signaal__lte=' + max;
     399
     400    var raw_filter = "colour=" + colour + user + dataset + wlnode + start_date + end_date + signal
     401    return raw_filter;
     402  }
     403
     404  /**
     405   * Adds a new layer when clicked.
     406   * Filters set by user are used as layer parameters.
     407   * Colour is either chosen or randomized.
     408   * Blank parameters are ignored.
     409   */
     410  $('#add_filter').click(function(){
     411    // get values from elements
     412
     413    lname = $("#lname").val();
     414    if (lname == ''){
     415      lname= 'Custom Filter';
     416    }
    394417
    395418    // setting layer
     
    397420      initialize: function(name, options) {
    398421        var url = [
    399           "tile/${z}/${x},${y}.png?colour=" + colour + user + dataset + wlnode + start_date + end_date + signal
     422          "tile/${z}/${x},${y}.png?" + $("#raw_filter").val(),
    400423        ];
    401424        options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options);
  • src/django_gheat/wlheatmap/static/style.css

    r9583 r9779  
    7575#filter_text{
    7676  height:100%;
    77   width:570px;
     77  width:200px;
    7878  overflow:hidden;
    7979  float:left;
     
    8282#filter_list{
    8383  padding:5px;
    84   width:200px;
    8584  border-left: 1px solid #BA0000;
    8685  float:right;
  • src/django_gheat/wlheatmap/templates/home.html

    r9654 r9779  
    5050            <div id="select_sig_slider"></div>
    5151          </div>
     52          <input type="text" id="colour" name="colour"/> Colour<br /><br />
     53          <textarea rows="5" id="raw_filter" name="raw_filter" cols="50"></textarea><br /><br />
    5254          <input type="text" id="lname" name="lname" size="10"/> Filtername<br /><br />
    53           <input type="text" id="colour" name="colour"/> Colour<br /><br />
    54           <input type="button" id="add_filter" value="Add filter"/><br />
     55          <input type="button" id="add_filter" value="Add filter" /><br />
    5556        </form>
    5657      </div>
Note: See TracChangeset for help on using the changeset viewer.