Ignore:
Timestamp:
May 13, 2011, 12:23:52 PM (14 years ago)
Author:
dennisw
Message:

Having doubts about the way the query is being serialized.

File:
1 edited

Legend:

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

    r9190 r9196  
    2121        map.events.register('click', map, GetMousePos);
    2222        function GetMousePos(pos) {
    23                 var pixbuffer = 100;
    24                 var sw = map.getLonLatFromPixel(new OpenLayers.Pixel(pos.xy.x+pixbuffer,pos.xy.y-pixbuffer));
    25                 var ne = map.getLonLatFromPixel(new OpenLayers.Pixel(pos.xy.x-pixbuffer,pos.xy.y+pixbuffer));
    26                 var pointsw = OpenLayers.Layer.SphericalMercator.inverseMercator(sw.lon, sw.lat);
    27                 var pointne = OpenLayers.Layer.SphericalMercator.inverseMercator(ne.lon, ne.lat);
    28                 getNodeList(pointsw, pointne);
     23                var pix = map.getLonLatFromPixel(new OpenLayers.Pixel(pos.xy.x,pos.xy.y));
     24                var mousepos = OpenLayers.Layer.SphericalMercator.inverseMercator(pix.lon, pix.lat);
     25                var zoomlevel = map.getZoom();
     26                getNodeList(zoom, mousepos);
    2927        }
    3028
     
    4947}
    5048
    51 function getNodeList(sw, ne){
     49function getNodeList(zoomlevel, mousepos){
    5250  var nodelist;
    5351  if (window.XMLHttpRequest){
     
    6260  nodelist.onreadystatechange=function(){
    6361    if (nodelist.readyState==4 && nodelist.status==200){
    64       txt=nodelist.responseText
     62      txt=nodelist.responseText;
    6563      document.getElementById('nodelist').innerHTML=txt;
    6664    }
    6765  }
    6866
    69   nodelist.open("GET","/website/nodelist/" + sw.lat + "," + sw.lon + "," + ne.lat + "," + ne.lon,true);
     67  nodelist.open("GET","/website/nodelist/" + zoomlevel + "," + mousepos.lat + "," + mousepos.lon,true);
    7068  nodelist.send();
    7169}
Note: See TracChangeset for help on using the changeset viewer.