mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
world map
This commit is contained in:
@@ -38,7 +38,17 @@ class MeetupTable extends Component
|
|||||||
'id' => $meetup->id,
|
'id' => $meetup->id,
|
||||||
'name' => $meetup->name,
|
'name' => $meetup->name,
|
||||||
'coords' => [$meetup->city->latitude, $meetup->city->longitude],
|
'coords' => [$meetup->city->latitude, $meetup->city->longitude],
|
||||||
|
]),
|
||||||
|
'allMarkers' => Meetup::query()
|
||||||
|
->with([
|
||||||
|
'city.country',
|
||||||
])
|
])
|
||||||
|
->get()
|
||||||
|
->map(fn($meetup) => [
|
||||||
|
'id' => $meetup->id,
|
||||||
|
'name' => $meetup->name,
|
||||||
|
'coords' => [$meetup->city->latitude, $meetup->city->longitude],
|
||||||
|
]),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1
public/vendor/jvector/maps/world-mill.js
vendored
Normal file
1
public/vendor/jvector/maps/world-mill.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -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/world-mill.js') }}"></script>
|
||||||
<script src="{{ asset('vendor/jvector/maps/europe-merc.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>
|
||||||
|
|||||||
@@ -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/world-mill.js') }}"></script>
|
||||||
<script src="{{ asset('vendor/jvector/maps/europe-merc.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>
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
x-data="{
|
x-data="{
|
||||||
init() {
|
init() {
|
||||||
let markers = {{ Js::from($markers) }};
|
let markers = {{ Js::from($markers) }};
|
||||||
console.log(markers);
|
|
||||||
|
|
||||||
$('#map').vectorMap({
|
$('#map').vectorMap({
|
||||||
zoomButtons : false,
|
zoomButtons : false,
|
||||||
@@ -52,6 +51,43 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10 space-y-4" id="table">
|
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10 space-y-4" id="table">
|
||||||
<livewire:tables.meetup-table :country="$country->code"/>
|
<livewire:tables.meetup-table :country="$country->code"/>
|
||||||
|
|
||||||
|
<div
|
||||||
|
wire:ignore
|
||||||
|
class="w-full flex justify-center"
|
||||||
|
x-data="{
|
||||||
|
init() {
|
||||||
|
let markers = {{ Js::from($allMarkers) }};
|
||||||
|
|
||||||
|
$('#mapworld').vectorMap({
|
||||||
|
zoomButtons : false,
|
||||||
|
zoomOnScroll: true,
|
||||||
|
map: 'world_mill',
|
||||||
|
backgroundColor: 'transparent',
|
||||||
|
markers: markers.map(function(h){ return {name: h.name, latLng: h.coords} }),
|
||||||
|
{{-- onMarkerClick: function(event, index) {--}}
|
||||||
|
{{-- $wire.call('filterByMarker', markers[index].id)--}}
|
||||||
|
{{-- },--}}
|
||||||
|
markerStyle: {
|
||||||
|
initial: {
|
||||||
|
image: '{{ asset('img/btc.png') }}',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
regionStyle: {
|
||||||
|
initial: {
|
||||||
|
fill: '#151515'
|
||||||
|
},
|
||||||
|
hover: {
|
||||||
|
'fill-opacity': 1,
|
||||||
|
cursor: 'default'
|
||||||
|
},
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<div id="mapworld" style="width: 100%; height: 400px"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
{{-- FOOTER --}}
|
{{-- FOOTER --}}
|
||||||
|
|||||||
Reference in New Issue
Block a user