|
|
|
@ -24,6 +24,7 @@ from collections import defaultdict
|
|
|
|
|
|
|
|
|
|
|
|
from flask import Blueprint, render_template, request, url_for, redirect
|
|
|
|
from flask import Blueprint, render_template, request, url_for, redirect
|
|
|
|
import folium
|
|
|
|
import folium
|
|
|
|
|
|
|
|
from folium.plugins import MarkerCluster
|
|
|
|
from pymongo import ASCENDING
|
|
|
|
from pymongo import ASCENDING
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -191,6 +192,8 @@ def geolocalisation():
|
|
|
|
actes=plaintext_response(search, actecol, prince_bigram))
|
|
|
|
actes=plaintext_response(search, actecol, prince_bigram))
|
|
|
|
|
|
|
|
|
|
|
|
m = folium.Map(location=[46.603354, 1.888334], zoom_start=6)
|
|
|
|
m = folium.Map(location=[46.603354, 1.888334], zoom_start=6)
|
|
|
|
|
|
|
|
marker_cluster = MarkerCluster().add_to(m)
|
|
|
|
|
|
|
|
|
|
|
|
markers = defaultdict(list)
|
|
|
|
markers = defaultdict(list)
|
|
|
|
|
|
|
|
|
|
|
|
for result in actecol.find():
|
|
|
|
for result in actecol.find():
|
|
|
|
@ -218,7 +221,8 @@ def geolocalisation():
|
|
|
|
location=[latitude, longitude],
|
|
|
|
location=[latitude, longitude],
|
|
|
|
popup=popup,
|
|
|
|
popup=popup,
|
|
|
|
icon=folium.Icon(color='lightgray', icon="circle", prefix='fa')
|
|
|
|
icon=folium.Icon(color='lightgray', icon="circle", prefix='fa')
|
|
|
|
).add_to(m)
|
|
|
|
).add_to(marker_cluster)
|
|
|
|
|
|
|
|
# to remove marker_cluster : .add_to(m)
|
|
|
|
|
|
|
|
|
|
|
|
geolocalisation = m._repr_html_()
|
|
|
|
geolocalisation = m._repr_html_()
|
|
|
|
return render_template("map.html", geolocalisation=geolocalisation)
|
|
|
|
return render_template("map.html", geolocalisation=geolocalisation)
|
|
|
|
|