Changed behavior of "Look up with Map Services"
Removed the section that looked up by city, and country from the Map Services lookup for Google and Open Street Map. Resolves #9486
This commit is contained in:
parent
59bd9f040d
commit
0ae51c9522
@ -45,7 +45,6 @@ class GoogleMapService(MapService):
|
|||||||
def calc_url(self):
|
def calc_url(self):
|
||||||
""" Determine the url to use on maps.google.com
|
""" Determine the url to use on maps.google.com
|
||||||
Logic: use lat lon if present
|
Logic: use lat lon if present
|
||||||
otherwise use city and country if present
|
|
||||||
otherwise use description of the place
|
otherwise use description of the place
|
||||||
"""
|
"""
|
||||||
place = self._get_first_place()[0]
|
place = self._get_first_place()[0]
|
||||||
@ -55,13 +54,6 @@ class GoogleMapService(MapService):
|
|||||||
longitude)
|
longitude)
|
||||||
return
|
return
|
||||||
|
|
||||||
location = get_main_location(self.database, place)
|
|
||||||
city = location.get(PlaceType.CITY)
|
|
||||||
country = location.get(PlaceType.COUNTRY)
|
|
||||||
if city and country:
|
|
||||||
self.url = "http://maps.google.com/maps?q=%s,%s" % (city, country)
|
|
||||||
return
|
|
||||||
|
|
||||||
titledescr = place_displayer.display(self.database, place)
|
titledescr = place_displayer.display(self.database, place)
|
||||||
self.url = "http://maps.google.com/maps?q=%s" % \
|
self.url = "http://maps.google.com/maps?q=%s" % \
|
||||||
'+'.join(titledescr.split())
|
'+'.join(titledescr.split())
|
||||||
|
@ -46,8 +46,7 @@ class OpensStreetMapService(MapService):
|
|||||||
|
|
||||||
def calc_url(self):
|
def calc_url(self):
|
||||||
""" Determine the url to use
|
""" Determine the url to use
|
||||||
Logic: use lat lon if present
|
Logic: Use lat lon if present
|
||||||
otherwise use city and country if present
|
|
||||||
otherwise use description of the place
|
otherwise use description of the place
|
||||||
"""
|
"""
|
||||||
place = self._get_first_place()[0]
|
place = self._get_first_place()[0]
|
||||||
@ -58,14 +57,6 @@ class OpensStreetMapService(MapService):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
location = get_main_location(self.database, place)
|
|
||||||
city = location.get(PlaceType.CITY)
|
|
||||||
country = location.get(PlaceType.COUNTRY)
|
|
||||||
if city and country:
|
|
||||||
self.url = "http://nominatim.openstreetmap.org/"\
|
|
||||||
"search.php?q=%s%%2C%s" % (city, country)
|
|
||||||
return
|
|
||||||
|
|
||||||
titledescr = place_displayer.display(self.database, place)
|
titledescr = place_displayer.display(self.database, place)
|
||||||
self.url = "http://nominatim.openstreetmap.org/"\
|
self.url = "http://nominatim.openstreetmap.org/"\
|
||||||
"search.php?q=%s" % '+'.join(titledescr.split())
|
"search.php?q=%s" % '+'.join(titledescr.split())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user