Results from query made with other fields are populated on Leaflet:
var myMap = L.map("mapid", {zoomControl: false});
L.tileLayer('https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', {maxZoom: 18 }).addTo(myMap); myMap.setView([-34, 151], 12);
var markers = [
{% for journal in queryset %}
L.marker([{{ journal.latitude }}, {{ journal.longitude }}]),
{% endfor %}
]
var group = L.featureGroup(markers).addTo(myMap);
I now want the results populated by where the user places Leaflet's boundary box, but I'm bewildered on how to do that. I've got GDAL installed, have converted the long / lat cols to a spatial col in Postgis with ADD COLUMN geom geometry(Point, 4326) GENERATED ALWAYS AS (ST_SetSRID(ST_MakePoint("longitude", "latitude"), 4326)) STORED
, added geom = models.PointField(blank=True, null=True)
to models.py, but am lost on where to go from here.
This seems the most authoritative tutorial on the topic but I'm totally lost when he gets to views and talks of a generic class based view / list views / Django Rest Framework. Is there a dumbed down explanation somewhere? I feel like an idiot.
Unsure if relevant but the table isn't managed by Django.