Changeset 9316


Ignore:
Timestamp:
Jun 30, 2011, 3:26:19 PM (13 years ago)
Author:
dennisw
Message:

Set Leiden as center of map.
Layerswitcher categories can be toggled now. Small changes to css.

Location:
src/django_gheat/website
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/django_gheat/website/static/heatmap.js

    r9302 r9316  
    1111
    1212  if(lat=='null' || lon=='null' || zoom=='null'){
    13     var lat   = 52.14068;
    14     var lon   = 4.48319;
    15     var zoom  = 16;
     13    var lat   = 52.15514;
     14    var lon   = 4.48959;
     15    var zoom  = 13;
    1616  }
    1717  var projection_wgs = new OpenLayers.Projection("EPSG:4326"); // WGS 1984
  • src/django_gheat/website/static/heatmap_extensions.js

    r9302 r9316  
    6868    stop: function(event, sig){
    6969      signallayer = map.getLayersByName('signallayer');
    70       console.log(signallayer[0]);
    7170      signallayer[0].setUrl("/website/tile/${z}/${x},${y}.png?colour=250,250,0&signaal__gte=" + sig.values[0] + "&signaal__lte=" + sig.values[1]);
    7271      signallayer[0].redraw();
     
    144143
    145144  /**
     145   * Toggles layerswitcher visibility.
     146   * On 'off', toggler shows a '+'.
     147   * On 'on', toggler shows a '-'.
     148   */
     149  $("#cat_hide").live("click", function(){
     150    cat = $(this).parent('div').next('p').children('span')
     151    cat.toggle();
     152    if(cat.is(":visible")){
     153      //FIXME: images are getting loaded the hard way. Replace '/static/'. '{{ STATIC_URL }}' doesn't seem to work here.
     154      $(this).css('background-image', "url(/static/img/up.png)");
     155    }
     156    else{
     157      $(this).css('background-image', "url(/static/img/down.png)");
     158    }
     159  });
     160
     161  /**
    146162   * Fastest?
    147163   * http://stackoverflow.com/questions/170986/what-is-the-best-way-to-add-options-to-a-select-from-an-array-with-jquery
     
    153169        userlist.push(json.gebruiker);
    154170        $.each(json.meetrondje, function(m, meetrondje){
    155           console.log(meetrondje.datum);
    156171          $("#select_dataset").append($("<option/>").attr({"class":json.gebruiker, "value":meetrondje.naam}).text(meetrondje.naam));
    157172          $.each(meetrondje.nodes, function(n, nodes){
  • src/django_gheat/website/static/style.css

    r9302 r9316  
    102102  position:absolute;
    103103  right:-2px;
    104   top:100px;
     104  top:50px;
    105105  width:200px;
    106   bottom:100px;
     106  max-height:80%;
    107107  background-color:#FFF;
    108108  border:2px solid #BA0000;
     
    117117  top:0px;
    118118  background-color:#BA0000;
    119   padding-left:5px;
     119  padding-left:0px;
    120120  padding-right:5px;
    121121  font-size:18px;
     
    123123}
    124124
     125#cat_container{
     126
     127}
     128
    125129#layer_switcher_toggle{
    126130  position:absolute;
    127131  right:-2px;
    128   top:101px;
     132  top:51px;
    129133  width:17px;
    130134  height:17px;
     
    146150  float:left;
    147151}
     152
     153#cat_hide{
     154  margin-top:4px;
     155  margin-left:4px;
     156  padding-left:-4px;
     157  padding-top:-10px;
     158  width:10px;
     159  height:10px;
     160  border:1px solid #000;
     161  float:left;
     162  background:url(img/up.png) no-repeat top left;
     163  color:#000;
     164  font-size:13px;
     165  text-align:center;
     166}
     167
    148168
    149169#sig_slider{
  • src/django_gheat/website/templates/home.html

    r9297 r9316  
    5959  </div>
    6060  <div id="layer_switcher">
    61     <div id="layer_switcher_cat">
    62       <input type=checkbox id=togglecat class=default checked />
    63       Default layers
     61    <div id="cat_container">
     62      <div id="layer_switcher_cat">
     63        <div id="cat_hide"></div>
     64        <input type=checkbox id=togglecat class=default checked />Default layers
     65      </div>
     66      <p><span id="default"></span></p>
    6467    </div>
    65     <p><span id="default"></span><p>
    66     <div id="layer_switcher_cat">
    67       <input type=checkbox id=togglecat class=node checked />
    68       Nodes <a style="margin-top:4px;font-size:10px;float:right;" id="node_filter">(Add all nodes)</a>
     68    <div id="cat_container">
     69      <div id="layer_switcher_cat">
     70        <div id="cat_hide"></div>
     71        <input type=checkbox id=togglecat class=node checked />Nodes
     72        <a style="margin-top:4px;font-size:10px;float:right;" id="node_filter">(Add all nodes)</a>
     73      </div>
     74      <p><span id="node"></span></p>
    6975    </div>
    70     <p><span id="node"></span><p>
    71     <div id="layer_switcher_cat">
    72       <input type=checkbox id=togglecat class=user checked />
    73       Users <a style="margin-top:4px;font-size:10px;float:right;" id="user_filter">(Add all users)</a>
     76    <div id="cat_container">
     77      <div id="layer_switcher_cat">
     78        <div id="cat_hide"></div>
     79        <input type=checkbox id=togglecat class=user checked />Users
     80        <a style="margin-top:4px;font-size:10px;float:right;" id="user_filter">(Add all users)</a>
     81      </div>
     82      <p><span id="user"></span></p>
    7483    </div>
    75     <p><span id="user"></span><P>
    76     <div id="layer_switcher_cat">
    77       <input type=checkbox id=togglecat class=custom checked />
    78       Custom filters
    79     </div><p><span id="custom"></span><p>
     84    <div id="cat_container">
     85      <div id="layer_switcher_cat">
     86        <div id="cat_hide"></div>
     87        <input type=checkbox id=togglecat class=custom checked />Custom filters
     88      </div><p><span id="custom"></span></p>
     89    </div>
    8090  </div>
    8191</body>
Note: See TracChangeset for help on using the changeset viewer.