map for events

This commit is contained in:
Benjamin Takats
2022-12-15 19:47:21 +01:00
parent ca5b74d072
commit b9cb4f8999
5 changed files with 28 additions and 22 deletions

View File

@@ -28,8 +28,11 @@ class BitcoinEventTable extends Component
->with([ ->with([
'venue.city.country', 'venue.city.country',
]) ])
->where(fn($query) => $query
->whereHas('venue.city.country', ->whereHas('venue.city.country',
fn($query) => $query->where('countries.code', $this->country->code)) fn($query) => $query->where('code', $this->country->code))
->orWhere('show_worldwide', true)
)
->get() ->get()
->map(fn($event) => [ ->map(fn($event) => [
'id' => $event->id, 'id' => $event->id,

File diff suppressed because one or more lines are too long

View File

@@ -15,6 +15,7 @@
media="screen"/> media="screen"/>
<script src="https://unpkg.com/jquery"></script> <script src="https://unpkg.com/jquery"></script>
<script src="{{ asset('vendor/jvector/jquery-jvectormap-2.0.5.min.js') }}"></script> <script src="{{ asset('vendor/jvector/jquery-jvectormap-2.0.5.min.js') }}"></script>
<script src="{{ asset('vendor/jvector/maps/europe-merc.js') }}"></script>
<script src="{{ asset('vendor/jvector/maps/de.js') }}"></script> <script src="{{ asset('vendor/jvector/maps/de.js') }}"></script>
<script src="{{ asset('vendor/jvector/maps/at.js') }}"></script> <script src="{{ asset('vendor/jvector/maps/at.js') }}"></script>
<script src="{{ asset('vendor/jvector/maps/ch.js') }}"></script> <script src="{{ asset('vendor/jvector/maps/ch.js') }}"></script>

View File

@@ -15,6 +15,7 @@
media="screen"/> media="screen"/>
<script src="https://unpkg.com/jquery"></script> <script src="https://unpkg.com/jquery"></script>
<script src="{{ asset('vendor/jvector/jquery-jvectormap-2.0.5.min.js') }}"></script> <script src="{{ asset('vendor/jvector/jquery-jvectormap-2.0.5.min.js') }}"></script>
<script src="{{ asset('vendor/jvector/maps/europe-merc.js') }}"></script>
<script src="{{ asset('vendor/jvector/maps/de.js') }}"></script> <script src="{{ asset('vendor/jvector/maps/de.js') }}"></script>
<script src="{{ asset('vendor/jvector/maps/at.js') }}"></script> <script src="{{ asset('vendor/jvector/maps/at.js') }}"></script>
<script src="{{ asset('vendor/jvector/maps/ch.js') }}"></script> <script src="{{ asset('vendor/jvector/maps/ch.js') }}"></script>

View File

@@ -86,7 +86,7 @@
$('#map').vectorMap({ $('#map').vectorMap({
zoomButtons : false, zoomButtons : false,
zoomOnScroll: true, zoomOnScroll: true,
map: '{{ $country->code }}_merc', map: 'europe_merc',
backgroundColor: 'transparent', backgroundColor: 'transparent',
markers: markers.map(function(h){ return {name: h.name, latLng: h.coords} }), markers: markers.map(function(h){ return {name: h.name, latLng: h.coords} }),
onMarkerClick: function(event, index) { onMarkerClick: function(event, index) {
@@ -110,7 +110,7 @@
} }
}" }"
> >
<div id="map" style="width: 100%; height: 400px"></div> <div id="map" style="width: 100%; height: 800px"></div>
</div> </div>
</div> </div>
</div> </div>