• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Problematy / goodmap / 28131466663

24 Jun 2026 09:41PM UTC coverage: 74.158%. First build
28131466663

Pull #365

github

web-flow
Merge 6f4f8c15d into 27cbf5bb0
Pull Request #365: refactor!: aligned with breaking changes on platzky

174 of 277 branches covered (62.82%)

Branch coverage included in aggregate %.

575 of 733 new or added lines in 26 files covered. (78.44%)

575 of 733 relevant lines covered (78.44%)

8.77 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

71.43
/frontend/src/components/Map/MapComponent.jsx
1
import React, { useState } from 'react';
2
import { MapContainer, TileLayer } from 'react-leaflet';
3
import Control from 'react-leaflet-custom-control';
4
import { LocationControl } from './components/LocationControl';
5
import { SuggestNewPointButton } from './components/SuggestNewPointButton';
6
import { LocationPermissionBanner } from './components/LocationPermissionBanner';
7
import { mapConfig } from './map.config';
8
import { CustomZoomControl } from './components/ZoomControl';
9
import MapAutocomplete from './components/MapAutocomplete';
10
import ListViewButton from './components/ListView';
11
import AccessibilityTable from './components/AccessibilityTable';
12
import SaveMapConfiguration from './components/SaveMapConfiguration';
13
import { AppToaster } from '../common/AppToaster';
14
import { Markers } from './components/Markers';
15
import { MapLoadingOverlay } from './components/MapLoadingOverlay';
16
import { LocationProvider, useLocation } from './context/LocationContext';
17
import { GoToLocation } from './components/GoToLocation';
18
import GlobalPlugins from '../../plugins/GlobalPlugins';
19

20
/**
21
 * Inner map component that uses the shared location context.
22
 */
23
const MapComponentInner = () => {
1✔
24
    const { userPosition } = useLocation();
3✔
25
    const [isListViewOpen, setIsListViewOpen] = useState(false);
3✔
26
    const [isMapLoading, setIsMapLoading] = useState(true);
3✔
27

28
    const handleListViewButtonClick = () => {
3✔
NEW
29
        setIsListViewOpen(true);
×
30
    };
31

32
    const handleMapLoadingChange = isLoading => {
3✔
33
        setIsMapLoading(isLoading);
3✔
34
    };
35

36
    if (isListViewOpen) {
3!
NEW
37
        return (
×
38
            <AccessibilityTable
39
                userPosition={userPosition}
40
                setIsAccessibilityTableOpen={setIsListViewOpen}
41
            />
42
        );
43
    }
44

45
    return (
3✔
46
        <div style={{ height: '100%', position: 'relative' }}>
47
            <AppToaster />
48
            <LocationPermissionBanner />
49
            <MapLoadingOverlay isLoading={isMapLoading} />
50
            <GlobalPlugins />
51
            <MapContainer
52
                center={mapConfig.initialMapCoordinates}
53
                zoom={mapConfig.initialMapZoom}
54
                scrollWheelZoom
55
                style={{ height: '100%' }}
56
                zoomControl={false}
57
            >
58
                <SaveMapConfiguration />
59
                <GoToLocation />
60
                <TileLayer
61
                    url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
62
                    attribution='&amp;copy <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors'
63
                    maxZoom={mapConfig.maxMapZoom}
64
                />
65
                {globalThis.FEATURE_FLAGS?.SHOW_SUGGEST_NEW_POINT_BUTTON && (
3!
66
                    <Control position="bottomright" prepend>
67
                        <SuggestNewPointButton />
68
                    </Control>
69
                )}
70
                <Markers onLoadingChange={handleMapLoadingChange} />
71
                <LocationControl />
72
                <CustomZoomControl position="topright" />
73
                {globalThis.FEATURE_FLAGS?.SHOW_ACCESSIBILITY_TABLE && (
3!
74
                    <ListViewButton onClick={handleListViewButtonClick} />
75
                )}
76
                {globalThis.FEATURE_FLAGS?.SHOW_SEARCH_BAR && <MapAutocomplete />}
3!
77
            </MapContainer>
78
        </div>
79
    );
80
};
81

82
/**
83
 * Main map component that renders an interactive Leaflet map with various controls and features.
84
 * Wraps the map with LocationProvider for shared geolocation state.
85
 *
86
 * @returns {React.ReactElement} MapContainer with markers and controls, or AccessibilityTable when list view is active
87
 */
88
export const MapComponent = () => {
1✔
89
    return (
1✔
90
        <LocationProvider>
91
            <MapComponentInner />
92
        </LocationProvider>
93
    );
94
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc