fix: resolve MapLibre worker rendering regression by configuring custom worker and updating geometry type filters

This commit is contained in:
Hamza-Ayed
2026-09-24 18:49:40 +03:00
parent 043cd052b6
commit cb91e5f0de
6 changed files with 497 additions and 274 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ export class AdminGuard implements CanActivate {
throw new UnauthorizedException('Tenant not found in request');
}
if (tenant.plan !== TenantPlan.ENTERPRISE && tenant.role !== TenantRole.ADMIN) {
if (tenant.plan !== TenantPlan.ENTERPRISE && tenant.role !== 'ADMIN') {
throw new ForbiddenException('Admin access required. Your tenant must have an ENTERPRISE plan or ADMIN clearance.');
}
+3 -3
View File
@@ -198,7 +198,7 @@ const MapComponent: React.FC<MapProps> = ({
id: 'los-line',
type: 'line',
source: 'los-source',
filter: ['==', '$type', 'LineString'],
filter: ['==', ['geometry-type'], 'LineString'],
layout: { 'line-cap': 'round', 'line-join': 'round' },
paint: {
'line-color': '#f59e0b',
@@ -211,7 +211,7 @@ const MapComponent: React.FC<MapProps> = ({
id: 'los-points',
type: 'circle',
source: 'los-source',
filter: ['==', '$type', 'Point'],
filter: ['==', ['geometry-type'], 'Point'],
paint: {
'circle-radius': 8,
'circle-color': [
@@ -230,7 +230,7 @@ const MapComponent: React.FC<MapProps> = ({
id: 'los-labels',
type: 'symbol',
source: 'los-source',
filter: ['==', '$type', 'Point'],
filter: ['==', ['geometry-type'], 'Point'],
layout: {
'text-field': ['get', 'label'],
'text-size': 12,
+1 -1
View File
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react'
import ReactDOM from 'react-dom/client'
import maplibregl from 'maplibre-gl'
import maplibregl from './utils/maplibreWorker'
import App from './App.tsx'
import CompareView from './pages/CompareView'
import IntelligenceDashboard from './pages/IntelligenceDashboard'
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
import maplibregl from 'maplibre-gl';
import workerUrl from 'maplibre-gl/dist/maplibre-gl-csp-worker.js?url';
// MapLibre 5 serializes its embedded worker from functions. Vite's class-field
// transform injects __publicField outside those functions, leaving GeoJSON
// workers with an undefined helper. Serve the matching standalone worker as an
// untransformed asset in both development and production, before any map exists.
maplibregl.setWorkerUrl(workerUrl);
export default maplibregl;