Update public source
This commit is contained in:
@@ -12,6 +12,7 @@ from reports.utils import (
|
||||
format_datetime as format_report_datetime,
|
||||
)
|
||||
from reports.map_popups import build_standard_popup
|
||||
from reports.map_service import get_map_style_url
|
||||
|
||||
def esc(value):
|
||||
|
||||
@@ -408,7 +409,7 @@ const map = new maplibregl.Map({
|
||||
container: "map",
|
||||
|
||||
style:
|
||||
"http://127.0.0.1:8080/styles/server-map/style.json",
|
||||
__MAP_STYLE_URL__,
|
||||
|
||||
center: [
|
||||
30.32,
|
||||
@@ -1181,6 +1182,11 @@ window.setTimeout(
|
||||
marker_js,
|
||||
)
|
||||
|
||||
map_html = map_html.replace(
|
||||
"__MAP_STYLE_URL__",
|
||||
json.dumps(get_map_style_url()),
|
||||
)
|
||||
|
||||
return map_html
|
||||
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ from reports.template import (
|
||||
page_end,
|
||||
)
|
||||
from reports.map_popups import build_standard_popup
|
||||
from reports.map_service import get_map_style_url
|
||||
|
||||
def esc(value):
|
||||
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({{
|
||||
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],
|
||||
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,
|
||||
)
|
||||
from reports.map_popups import build_standard_popup
|
||||
|
||||
MAP_STYLE_URL = (
|
||||
"http://127.0.0.1:8080/styles/server-map/style.json"
|
||||
)
|
||||
from reports.map_service import get_map_style_url
|
||||
|
||||
|
||||
# ============================================================
|
||||
@@ -2020,7 +2017,7 @@ def render_search_page(
|
||||
)
|
||||
).replace(
|
||||
"{map_style}",
|
||||
MAP_STYLE_URL
|
||||
json.dumps(get_map_style_url())
|
||||
)
|
||||
|
||||
html += page_end()
|
||||
|
||||
@@ -39,6 +39,7 @@ from reports.template import (
|
||||
ReportContext,
|
||||
)
|
||||
from reports.map_popups import build_standard_popup
|
||||
from reports.map_service import get_map_style_url
|
||||
|
||||
# ============================================================
|
||||
# Helpers
|
||||
@@ -865,7 +866,7 @@ const map = new maplibregl.Map({
|
||||
|
||||
style:
|
||||
|
||||
"http://127.0.0.1:8080/styles/server-map/style.json",
|
||||
__MAP_STYLE_URL__,
|
||||
|
||||
center: [
|
||||
|
||||
@@ -2672,6 +2673,11 @@ Session folder:
|
||||
|
||||
html += page_end()
|
||||
|
||||
html = html.replace(
|
||||
"__MAP_STYLE_URL__",
|
||||
json.dumps(get_map_style_url()),
|
||||
)
|
||||
|
||||
return html
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ from reports.access_points import (
|
||||
load_access_points,
|
||||
)
|
||||
from reports.map_popups import build_standard_popup
|
||||
from reports.map_service import get_map_style_url
|
||||
from reports.template import (
|
||||
ReportContext,
|
||||
card,
|
||||
@@ -216,7 +217,7 @@ const map = new maplibregl.Map({
|
||||
container: "map",
|
||||
|
||||
style:
|
||||
"http://127.0.0.1:8080/styles/server-map/style.json",
|
||||
__MAP_STYLE_URL__,
|
||||
|
||||
center: [
|
||||
30.32,
|
||||
@@ -671,6 +672,11 @@ window.setTimeout(
|
||||
marker_js,
|
||||
)
|
||||
|
||||
map_html = map_html.replace(
|
||||
"__MAP_STYLE_URL__",
|
||||
json.dumps(get_map_style_url()),
|
||||
)
|
||||
|
||||
return map_html
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user