added google search link
Browse files
app.py
CHANGED
@@ -23,24 +23,17 @@ def show_map(places_list):
|
|
23 |
attraction = place['attraction']
|
24 |
desc = place['description']
|
25 |
|
|
|
|
|
26 |
try:
|
27 |
locate = geolocator.geocode(f"{attraction}, {city}", timeout=10)
|
28 |
except:
|
29 |
locate = None
|
30 |
|
31 |
-
if locate is None:
|
32 |
-
try:
|
33 |
-
locate = geolocator.geocode(f"{city}", timeout=10)
|
34 |
-
except:
|
35 |
-
locate = None
|
36 |
-
|
37 |
-
if locate is None:
|
38 |
-
locate = geolocator.geocode("Dortmund, Germany", timeout=10)
|
39 |
-
|
40 |
if locate is not None:
|
41 |
if i == 0:
|
42 |
mymap = folium.Map(location=[locate.latitude, locate.longitude], zoom_start=10)
|
43 |
-
folium.Marker(location=[locate.latitude, locate.longitude], popup=folium.Popup(f"{attraction}: {desc}", max_width=200)).add_to(mymap)
|
44 |
i += 1
|
45 |
|
46 |
return mymap
|
|
|
23 |
attraction = place['attraction']
|
24 |
desc = place['description']
|
25 |
|
26 |
+
google_link = f"<a href='https://www.google.com/search?q={attraction}, {city}' target='_blank'><b>Learn more</b></a>"
|
27 |
+
|
28 |
try:
|
29 |
locate = geolocator.geocode(f"{attraction}, {city}", timeout=10)
|
30 |
except:
|
31 |
locate = None
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
if locate is not None:
|
34 |
if i == 0:
|
35 |
mymap = folium.Map(location=[locate.latitude, locate.longitude], zoom_start=10)
|
36 |
+
folium.Marker(location=[locate.latitude, locate.longitude], popup=folium.Popup(f"{attraction}: {desc} \n {google_link}", max_width=200)).add_to(mymap)
|
37 |
i += 1
|
38 |
|
39 |
return mymap
|