feat(web): implement configurable facility geofence boundary lock on leaflet map (#114) - #143
Merged
Merged
Conversation
…nd IncidentEditForm
…leaflet map - Define SOCAR Aliaga / STAR Refinery operational bounding box coordinates in MapBoundsDto - Implement setMapBoundaryLock JS interop in leafletMap.js with rigid viscosity (1.0) and minZoom constraints - Expose SetMapBoundaryLockAsync via IMapService and MapService in Blazor client - Add 'Lock Map to Facility Boundary' preference toggle to MapSettingsSection.razor with LocalStorage persistence - Add quick-toggle control item to MapControlOverlay.razor on live operator map page - Automatically apply facility geofence lock on LeafletMap.razor initial render based on user preferences - Fix EF Core collection replacement concurrency exception in UpdateIncidentCommandHandler and add regression test Closes #114 Ref: SDDC-78
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Jira / Task Reference
web | backend📝 Summary of Changes
Implements a configurable facility geofence boundary lock for the interactive Leaflet GIS map in the Dispatch Operator Web Panel. This feature restricts the map viewport to the defined coordinates of the SOCAR Aliağa / STAR Refinery plant boundaries, preventing operators from panning outside operational zones while providing a preference toggle to enable or disable the constraint dynamically.
Leaflet JS Interop (
leafletMap.js):SOCAR_FACILITY_BOUNDS) encompassing the SOCAR Aliağa / STAR Refinery complex ([38.7650, 26.8900]to[38.8350, 26.9750]).setMapBoundaryLock(enabled, customBounds)applyingmap.setMaxBounds(bounds)withmaxBoundsViscosity = 1.0(rigid elasticity) andminZoom = 13.panInsideBounds) if the viewport was outside plant borders upon activation.map) and settings preview mini-map (pickerMap).Blazor Service Bridge (
IMapService/MapService.cs/MapBoundsDto.cs):MapBoundsDtofor strongly-typed coordinate transfer.Task SetMapBoundaryLockAsync(bool enabled, MapBoundsDto? customBounds = null)across the map service bridge.Operator Settings & UI Controls (
MapSettingsSection.razor&MapControlOverlay.razor):.sd-switchinMapSettingsSection.razor.UserPreferencesDto.LockMapToFacilityBoundaryin LocalStorage.MapControlOverlay.razorso operators can toggle boundary constraints directly from/map./mapinitial render viaLeafletMap.razor.Backend Concurrency Fix (
UpdateIncidentCommandHandler.cs):DbUpdateConcurrencyExceptionwhen updating incident media attachments by explicitly managing_context.IncidentMedia.RemoveandAdd.UpdateIncidentAuthorizationTests.cs.🏷️ Type of Change
🧪 Testing & Verification
Automated Tests
dotnet test(130 tests passing, 0 failures)dotnet build clients/web/SocarDispatch.Web/SocarDispatch.Web.csproj(0 errors, 0 warnings)Manual Test Steps
/settingsand toggle "Lock Map to Facility Boundary" switch. Verify mini-map viewport locks to STAR Refinery bounds and choice persists across page refreshes./map. Verify viewport is constrained to Aliağa Peninsula / STAR Refinery coordinates when boundary lock is active.maxBoundsViscosity = 1.0).minZoom = 13constraint blocks zoom-out beyond plant scale.Map Layersoverlay panel; verify viewport can freely pan regional map.📋 Pre-Merge Checklist
.envexclusions).In Review.Closes #114
Ref: SDDC-78