Ignore:
Timestamp:
Jun 17, 2011, 2:31:59 PM (13 years ago)
Author:
dennisw
Message:

Permalink button works. Resets everything though since it refreshes the page. Layers are displayed in the url which doesn't work for custom layers (since they are reset).

Location:
src/django_gheat/website/static
Files:
3 edited

Legend:

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

    r9264 r9269  
    22function init(){
    33
    4   var lat   = 52.14068;
    5   var lon   = 4.48319;
    6   var zoom  = 16;
     4  var lat = getURLParameter('lat');
     5  var lon = getURLParameter('lon');
     6  var zoom = getURLParameter('zoom');
     7
     8  if(lat=='null' || lon=='null' || zoom=='null'){
     9    var lat   = 52.14068;
     10    var lon   = 4.48319;
     11    var zoom  = 16;
     12  }
    713  var projection_wgs = new OpenLayers.Projection("EPSG:4326"); // WGS 1984
    814
  • src/django_gheat/website/static/heatmap_extensions.js

    r9267 r9269  
    11// Uses zoomlevel and mouseposition to call the nodelist.py view. View returns nodes in json format which is read and printed in document element.
    2 function getNodeList(zoomlevel, mousepos) {
     2function getNodeList(zoomlevel, mousepos){
    33  $.getJSON("/website/nodelist/" + zoomlevel + "," + mousepos.lat + "," + mousepos.lon,
    4     function(json) {
     4    function(json){
    55      content = 'Wireless Leiden nodes on mouseposition:<br /><b>';
    66      $.each(json, function(i,json){
     
    1010      $("#node_list").html(content);
    1111    }
     12  );
     13}
     14
     15// Right way to get url parameters?: http://stackoverflow.com/questions/1403888/get-url-parameter-with-jquery/1404100#1404100
     16function getURLParameter(name) {
     17  return decodeURI(
     18    (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
    1219  );
    1320}
  • src/django_gheat/website/static/style.css

    r9266 r9269  
    9595  left:50%;
    9696  margin-left:-150px;
    97   bottom:30px;
     97  bottom:25px;
    9898  height:8px;
    9999  width:300px;
Note: See TracChangeset for help on using the changeset viewer.