{% extends 'base/layout.html' %} {% load static %} {% load lens %} {% load helpers %} {% block title %}World map{% endblock %} {% block head %} {{ block.super }} {% comment %} NetBox sends `Referrer-Policy: same-origin`, so the browser sends no Referer with a request to another origin, and OpenStreetMap's tile servers refuse every tile that arrives without one ("Referer is required"). This page alone relaxes it to the page's origin, which is all a tile server is told: never the path, the query or anything after the host. Set in the head, before the map's worker is started, which takes the policy of the page that starts it. {% endcomment %} {% include 'netbox_spatial_lens/inc/palette.html' %} {% endblock %} {% block content %}
{% comment %} The same control the floor has, over the same kind of choice. The legend under this map is also its filter, so the colouring decides what a reader can narrow to: with only site group to colour by, "show me everything still planned" could not be asked. {% endcomment %}
{% for o in overlays %} {{ o.label }} {% endfor %}
{% comment %} The lists hang under their own buttons rather than beside the map or below it. Beside it they cost a third of the width of the one drawing on the page that wants all of it, for reference read once in a while. Below it they were out of the corner of the eye you were using, and you lost the map to reach them. Under the button that opens them is where a reader looks, and the count stays on the button so the number the column was really conveying at a glance survives the panel being shut. Each carries a filter, because twenty-eight sites is already too many to read down, and ticks, because "these three" is the question you arrive with. {% endcomment %} {% include 'netbox_spatial_lens/inc/finder.html' with group='sites' key='nodeKey' noun='site' label='Sites' icon='map-marker-outline' rows=world.site_nodes row_template='netbox_spatial_lens/inc/finder_site.html' %} {% include 'netbox_spatial_lens/inc/finder.html' with group='circuits' key='linkId' noun='circuit' label='Circuits' icon='transit-connection-variant' rows=world.links row_template='netbox_spatial_lens/inc/finder_circuit.html' empty_text='No circuit has both ends recorded.' %} {% comment %} Empty until something is selected or a band is picked. The totals are in the stat strip and on the two buttons, and a third copy of them here said nothing new. {% endcomment %} {% include 'netbox_spatial_lens/inc/help.html' with text='Click a site to open it. Click a circuit to highlight it and its two ends. Sites and Circuits find by name and narrow the map to what you tick; tick one to trace it. Click legend bands to filter; you can pick several. Marker size is the rack count. Escape clears.' %}
{% if world.site_nodes %} {% include 'netbox_spatial_lens/inc/stats.html' with stats=world.stats %} {% comment %} One renderer: a MapLibre globe, drawn by world.js from the config at the foot of the page. The message covers the map until it is drawn, and stays with the reason when it cannot be: no WebGL, or MapLibre could not be loaded. The strip above, the legends and the finders work without the map. {% endcomment %}
Loading the map…
{% comment %} The legends sit on the drawing they explain rather than in a column beside it. They are controls, used constantly, so they stay in view; the lists they used to share a column with are not, and have moved behind the toolbar buttons. {% endcomment %}

{% if overlay %}{{ overlay.label }}{% else %}Legend{% endif %} sites

{% include 'netbox_spatial_lens/inc/legend.html' with legend=world.legend filter='sites' %}
{% if world.providers %}

Provider circuits

{% include 'netbox_spatial_lens/inc/legend.html' with legend=world.providers filter='circuits' %}
{% endif %}
{% else %}

No site has coordinates recorded, so there is nothing to place.

Set latitude and longitude on a site.

{% endif %}
{% if world.ungeocoded %} {% comment %} Named, not dropped. A map that quietly omits part of an estate is worse than no map, because it reads as complete. Below the map rather than in a finder, because this is the one list you are meant to read once and then act on by recording coordinates. {% endcomment %}

No coordinates {{ world.ungeocoded|length }}

{% for site in world.ungeocoded %}
{{ site|linkify }}
{% endfor %}
{% endif %} {{ map_config|json_script:"lens-map-config" }} {% endblock %}