Changeset 1a03bb7 in osmose-frontend


Ignore:
Timestamp:
Mar 17, 2013 12:22:25 PM (7 years ago)
Author:
Frédéric Rodrigo <frodrigo@…>
Branches:
master
Children:
00c0193
Parents:
a300c14
Message:

Support country param on map and heatmap

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • map.py

    ra300c14 r1a03bb7  
    6767               "source": '', 
    6868               "class":  '', 
    69                "username":   '', 
     69               "username": '', 
     70               "country": '', 
    7071             } 
    7172 
     
    7475            params[p] = request.cookies.get("last_" + p) 
    7576 
    76     for p in ["lat", "lon", "zoom", "item", "useDevItem", "level", "source", "username", "class"]: 
     77    for p in ["lat", "lon", "zoom", "item", "useDevItem", "level", "source", "username", "class", "country"]: 
    7778        if request.params.get(p, default=None): 
    7879            params[p] = request.params.get(p) 
     
    153154 
    154155    return template('map/index', categories=categories, lat=params["lat"], lon=params["lon"], zoom=params["zoom"], 
    155         source=params["source"], username=params["username"], classs=params["class"], 
     156        source=params["source"], username=params["username"], classs=params["class"], country=params["country"], 
    156157        levels=levels, level_selected=level_selected, active_items=active_items, useDevItem=params["useDevItem"], urls=urls, helps=helps, delay=delay, 
    157158        allowed_languages=allowed_languages, translate=utils.translator(lang), 
     
    190191 
    191192    join, where = query._build_param(params.bbox, params.source, params.item, params.level, params.username, params.classs, params.country, params.useDevItem, params.status) 
     193    join = join.replace("%", "%%") 
     194    where = where.replace("%", "%%") 
    192195 
    193196    COUNT=32 
  • static/map/map.js

    r274d24b r1a03bb7  
    443443        "&item=" + ch + 
    444444        "&useDevItem=" + document.myform.useDevItem.value + 
     445        "&country=" + document.myform.country.value + 
    445446        "&level=" + document.myform.level.value; 
    446447    pois.loadText(poisParams); 
     
    453454            "&item=" + ch + 
    454455            "&useDevItem=" + document.myform.useDevItem.value + 
     456            "&country=" + document.myform.country.value + 
    455457            "&level=" + document.myform.level.value; 
    456458        var url = "heat/${z}/${x}/${y}.png" + params; 
  • tools/query.py

    r274d24b r1a03bb7  
    131131    if country: 
    132132        if country[-1] == "*": 
    133             country = country[:-2] + "%" 
    134         where.append("dynpoi_source.comment LIKE '%%%s'" % ("-" + country)) 
     133            country = country[:-1] + "%" 
     134        where.append("dynpoi_source.comment LIKE '%%%s'" % country) 
    135135 
    136136    if not status in ("done", "false") and useDevItem == True: 
  • views/map/index.tpl

    r274d24b r1a03bb7  
    4545  <input type='hidden' name='useDevItem' value='{{useDevItem}}'> 
    4646  <input type='hidden' name='username' value='{{username}}'> 
     47  <input type='hidden' name='country' value='{{country}}'> 
    4748    <div id="need_zoom">{{_("no bubbles at this zoom factor")}}</div> 
    4849    <div id="action_links"> 
Note: See TracChangeset for help on using the changeset viewer.