Update public source
This commit is contained in:
@@ -12,6 +12,7 @@ from reports.utils import (
|
|||||||
format_datetime as format_report_datetime,
|
format_datetime as format_report_datetime,
|
||||||
)
|
)
|
||||||
from reports.map_popups import build_standard_popup
|
from reports.map_popups import build_standard_popup
|
||||||
|
from reports.map_service import get_map_style_url
|
||||||
|
|
||||||
def esc(value):
|
def esc(value):
|
||||||
|
|
||||||
@@ -408,7 +409,7 @@ const map = new maplibregl.Map({
|
|||||||
container: "map",
|
container: "map",
|
||||||
|
|
||||||
style:
|
style:
|
||||||
"http://127.0.0.1:8080/styles/server-map/style.json",
|
__MAP_STYLE_URL__,
|
||||||
|
|
||||||
center: [
|
center: [
|
||||||
30.32,
|
30.32,
|
||||||
@@ -1181,6 +1182,11 @@ window.setTimeout(
|
|||||||
marker_js,
|
marker_js,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
map_html = map_html.replace(
|
||||||
|
"__MAP_STYLE_URL__",
|
||||||
|
json.dumps(get_map_style_url()),
|
||||||
|
)
|
||||||
|
|
||||||
return map_html
|
return map_html
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ from reports.template import (
|
|||||||
page_end,
|
page_end,
|
||||||
)
|
)
|
||||||
from reports.map_popups import build_standard_popup
|
from reports.map_popups import build_standard_popup
|
||||||
|
from reports.map_service import get_map_style_url
|
||||||
|
|
||||||
def esc(value):
|
def esc(value):
|
||||||
return html.escape("" if value is None else str(value), quote=True)
|
return html.escape("" if value is None else str(value), quote=True)
|
||||||
@@ -932,7 +933,7 @@ def render_map(geojson, context, title):
|
|||||||
|
|
||||||
const map = new maplibregl.Map({{
|
const map = new maplibregl.Map({{
|
||||||
container: "access-point-history-map",
|
container: "access-point-history-map",
|
||||||
style: "http://127.0.0.1:8080/styles/server-map/style.json",
|
style: {json.dumps(get_map_style_url())},
|
||||||
center: [30.32, 59.93],
|
center: [30.32, 59.93],
|
||||||
zoom: 5
|
zoom: 5
|
||||||
}});
|
}});
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
"""
|
||||||
|
Centralized map service configuration.
|
||||||
|
"""
|
||||||
|
|
||||||
|
MAP_STYLE_URL = (
|
||||||
|
"http://127.0.0.1:8080/styles/server-map/style.json"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def get_map_style_url():
|
||||||
|
return MAP_STYLE_URL
|
||||||
+2
-5
@@ -15,10 +15,7 @@ from reports.utils import (
|
|||||||
format_datetime as format_report_datetime,
|
format_datetime as format_report_datetime,
|
||||||
)
|
)
|
||||||
from reports.map_popups import build_standard_popup
|
from reports.map_popups import build_standard_popup
|
||||||
|
from reports.map_service import get_map_style_url
|
||||||
MAP_STYLE_URL = (
|
|
||||||
"http://127.0.0.1:8080/styles/server-map/style.json"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
@@ -2020,7 +2017,7 @@ def render_search_page(
|
|||||||
)
|
)
|
||||||
).replace(
|
).replace(
|
||||||
"{map_style}",
|
"{map_style}",
|
||||||
MAP_STYLE_URL
|
json.dumps(get_map_style_url())
|
||||||
)
|
)
|
||||||
|
|
||||||
html += page_end()
|
html += page_end()
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ from reports.template import (
|
|||||||
ReportContext,
|
ReportContext,
|
||||||
)
|
)
|
||||||
from reports.map_popups import build_standard_popup
|
from reports.map_popups import build_standard_popup
|
||||||
|
from reports.map_service import get_map_style_url
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Helpers
|
# Helpers
|
||||||
@@ -865,7 +866,7 @@ const map = new maplibregl.Map({
|
|||||||
|
|
||||||
style:
|
style:
|
||||||
|
|
||||||
"http://127.0.0.1:8080/styles/server-map/style.json",
|
__MAP_STYLE_URL__,
|
||||||
|
|
||||||
center: [
|
center: [
|
||||||
|
|
||||||
@@ -2672,6 +2673,11 @@ Session folder:
|
|||||||
|
|
||||||
html += page_end()
|
html += page_end()
|
||||||
|
|
||||||
|
html = html.replace(
|
||||||
|
"__MAP_STYLE_URL__",
|
||||||
|
json.dumps(get_map_style_url()),
|
||||||
|
)
|
||||||
|
|
||||||
return html
|
return html
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ from reports.access_points import (
|
|||||||
load_access_points,
|
load_access_points,
|
||||||
)
|
)
|
||||||
from reports.map_popups import build_standard_popup
|
from reports.map_popups import build_standard_popup
|
||||||
|
from reports.map_service import get_map_style_url
|
||||||
from reports.template import (
|
from reports.template import (
|
||||||
ReportContext,
|
ReportContext,
|
||||||
card,
|
card,
|
||||||
@@ -216,7 +217,7 @@ const map = new maplibregl.Map({
|
|||||||
container: "map",
|
container: "map",
|
||||||
|
|
||||||
style:
|
style:
|
||||||
"http://127.0.0.1:8080/styles/server-map/style.json",
|
__MAP_STYLE_URL__,
|
||||||
|
|
||||||
center: [
|
center: [
|
||||||
30.32,
|
30.32,
|
||||||
@@ -671,6 +672,11 @@ window.setTimeout(
|
|||||||
marker_js,
|
marker_js,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
map_html = map_html.replace(
|
||||||
|
"__MAP_STYLE_URL__",
|
||||||
|
json.dumps(get_map_style_url()),
|
||||||
|
)
|
||||||
|
|
||||||
return map_html
|
return map_html
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user