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

OneBusAway / wayfinder / 23437333528

23 Mar 2026 12:27PM UTC coverage: 80.028%. First build
23437333528

Pull #425

github

web-flow
Merge b81179df2 into 2da4aa8ba
Pull Request #425: refactor(LocationButton): replace manual event listener with idiomatic Svelte pattern

1789 of 1981 branches covered (90.31%)

Branch coverage included in aggregate %.

0 of 1 new or added line in 1 file covered. (0.0%)

11326 of 14407 relevant lines covered (78.61%)

4.4 hits per line

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

0.0
/src/lib/LocationButton/LocationButton.svelte
1
<script>
×
2
        import { FontAwesomeIcon } from '@fortawesome/svelte-fontawesome';
3
        import { faLocationCrosshairs } from '@fortawesome/free-solid-svg-icons';
4
        import { t } from 'svelte-i18n';
5

6
        let { handleLocationObtained } = $props();
7

8
        function handleClick() {
×
9
                if (!navigator.geolocation) {
×
10
                        alert('Geolocation is not supported by this browser.');
×
11
                        return;
12
                }
13

14
                navigator.geolocation.getCurrentPosition(
×
15
                        (position) => {
×
16
                                const { latitude, longitude } = position.coords;
×
17
                                handleLocationObtained(latitude, longitude);
×
18
                        },
19
                        () => {
20
                                alert('Unable to retrieve your location.');
×
21
                        }
22
                );
23
        }
24
</script>
25

26
<button
NEW
27
        onclick={handleClick}
×
28
        class="custom-map-control-button"
29
        aria-label={$t('map.find_my_location')}
×
30
>
31
        <FontAwesomeIcon icon={faLocationCrosshairs} />
×
32
</button>
33

34
<style>
35
        .custom-map-control-button {
36
                background-color: #fff;
37
                border: 0;
38
                border-radius: 2px;
39
                box-shadow: 0 1px 4px -1px rgba(0, 0, 0, 0.3);
40
                margin: 10px;
41
                padding: 0 0.3em;
42
                font-size: 25px;
43
                color: #666;
44
                overflow: hidden;
45
                height: 40px;
46
                cursor: pointer;
47
                position: absolute;
48
                bottom: 4em;
49
                right: 0;
50
                z-index: 5;
51
        }
52
        .custom-map-control-button:hover {
53
                background: rgb(235, 235, 235);
54
                color: black;
55
        }
56
</style>
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