Opened 14 years ago
Closed 14 years ago
#21 closed defect (fixed)
local search from modRana not working in Australia
Reported by: | Martin Kolman | Owned by: | Martin Kolman |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | gps | Version: | |
Keywords: | Cc: |
Description
local search from modRana not working in Australia
- using the same query from maps.google.com works
- is the local search API broken ?
- is the - in coordinates causing problems ?
Attachments (2)
Change History (8)
comment:1 Changed 14 years ago by
Status: | new → assigned |
---|
comment:2 Changed 14 years ago by
comment:3 Changed 14 years ago by
Actually I've tracked this down. The google API does not like negative latitudes (although it's fine with negative longitudes!). Solution is to convert coordinates from -11.11111, 11.1111 to 11.1111S, 11.1111E type format. Here's a patch for mod_search.py which does that:
187c187,198 < sufix = " near %f,%f" % (lat,lon) ---
# Google api does not like negative latitudes, so convert numeric lat/long to # xxxxxN, xxxxxE type format instead if lat < 0:
latstring = str(-lat) + "S"
else :
latstring = str(lat) + "N"
if lon < 0:
lonstring = str(-lon) + "W"
else :
lonstring = str(lon) + "E"
sufix = " near %s,%s" % (latstring,lonstring)
comment:4 Changed 14 years ago by
I've just attached version 2 of the patch - this one returns to using a similiar method as was originally used, but instead of using "xxx near lat, long", the query is changed to "xxx loc:lat,long". This works reliably for australia, and works in more cases then the original patch.
comment:5 Changed 14 years ago by
Thanks for the patches ! I have just integrated the V2 one, and a quick search for pizza in the Melbourne area is finally returning some results :)
BTW, sorry for not responding to your comments earlier. I unfortunately don't yet have a new comment notification in this bugtracker, but it should working soon.
comment:6 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I'd like to have a go fixing this, but I'm unfamiliar with the modrana code. Can you give me some pointers of places to start tracking this one down?
Cheers!