diff --git a/resources/css/app.css b/resources/css/app.css index d9af480..7113f1e 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -255,16 +255,6 @@ body { border-top: none; } -.leaflet-popup { - max-width: 85vw; - max-height: 85vh; - min-width: 60vw; -} - -.leaflet-popup-content { - width: auto !important; -} - .popup__image, .popup__video { width: auto; @@ -340,10 +330,6 @@ body { margin-right: 1em; } - .leaflet-popup { - min-width: 350px; - } - .popup__image, .popup__video { max-width: 100%; diff --git a/resources/views/tracker.blade.php b/resources/views/tracker.blade.php index ce9a09a..4477020 100644 --- a/resources/views/tracker.blade.php +++ b/resources/views/tracker.blade.php @@ -76,7 +76,6 @@ @php $colour = 180 * ( 1.0 - ( ( $idx ) / ( count($trip->locations) ) ) ); @endphp color: 'rgb({{ $colour }}, {{ $colour }}, {{ $colour }})', weight: 5, - //color: 'rgba(62, 62, 62, {{ ( $idx - 0.5) / (count($trip->locations) - 0.5 ) }})' }).addTo(map); @endfor @@ -147,30 +146,36 @@ @endforeach @endif ]); - @if ($trip->is_active) map.zoomOut(2.5); @endif + @if ($trip->is_active) map.zoomOut(1); @endif - /* - * Add the current location marker. - * - * If this goes before the `fitBounds()`, it ends up uncentered. - */ - var currLocationMarker = L.icon({ - iconUrl: 'images/current-location-icon.png', - iconSize: [30, 45], - }); + @if($trip->is_active) + /* + * Add the current location marker. + * + * If this goes before the `fitBounds()`, it ends up uncentered. + */ + var currLocationMarker = L.icon({ + iconUrl: 'images/current-location-icon.png', + iconSize: [30, 45], + }); - var currLocation = L.marker( - [{{ end($trip->locations)->latitude }}, {{ end($trip->locations)->longitude }}], - { - icon: currLocationMarker - } - ).addTo(map).setZIndexOffset(1000); - @if($trip->is_active) currLocation.bindPopup('
Current location
').openPopup(); @endif + var currLocation = L.marker( + [{{ end($trip->locations)->latitude }}, {{ end($trip->locations)->longitude }}], + { + icon: currLocationMarker + } + ).addTo(map) + + currLocation.bindPopup('Current location
', { + width: "400px" + }).openPopup(); + @endif /* * Changes the currently-selected popup. */ function toggleCheckin(isOpen, checkinId) { + currLocation.removeFrom(map); if (isOpen) { const checkins = document.querySelectorAll('details');