diff --git a/static/index.html b/static/index.html
index 53c52c0..339571f 100644
--- a/static/index.html
+++ b/static/index.html
@@ -6906,7 +6906,10 @@
geofences.forEach(gf => {
const points = typeof gf.points === 'string' ? JSON.parse(gf.points) : gf.points;
- const latlngs = points.map(p => [p.lat, p.lng]);
+ // Handle both [lat, lng] arrays and {lat, lng} objects
+ const latlngs = points.map(p =>
+ Array.isArray(p) ? [p[0], p[1]] : [p.lat, p.lng]
+ );
const polygon = L.polygon(latlngs, {
color: gf.color || '#3388ff',
fillColor: gf.color || '#3388ff',