mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
vector maps coordinates added
This commit is contained in:
54
app/Console/Commands/Database/ImportGithubMeetups.php
Normal file
54
app/Console/Commands/Database/ImportGithubMeetups.php
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands\Database;
|
||||||
|
|
||||||
|
use App\Models\City;
|
||||||
|
use App\Models\Country;
|
||||||
|
use App\Models\Meetup;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
class ImportGithubMeetups extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'import:meetups';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Command description';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$meetups = json_decode(file_get_contents(config_path('meetups/github.json')), true, 512, JSON_THROW_ON_ERROR);
|
||||||
|
|
||||||
|
foreach ($meetups as $meetup) {
|
||||||
|
$city = City::updateOrCreate([
|
||||||
|
'name' => $meetup['city'],
|
||||||
|
], [
|
||||||
|
'country_id' => Country::firstOrCreate([
|
||||||
|
'code' => str($meetup['country'])
|
||||||
|
->lower()
|
||||||
|
->toString()
|
||||||
|
], ['name' => $meetup['country']])->id,
|
||||||
|
'longitude' => $meetup['longitude'],
|
||||||
|
'latitude' => $meetup['latitude'],
|
||||||
|
]);
|
||||||
|
$meetup = Meetup::updateOrCreate(
|
||||||
|
['name' => $meetup['name']],
|
||||||
|
[
|
||||||
|
'city_id' => $city->id,
|
||||||
|
'link' => $meetup['url'],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Command::SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,13 +3,29 @@
|
|||||||
namespace App\Http\Livewire\Meetup;
|
namespace App\Http\Livewire\Meetup;
|
||||||
|
|
||||||
use App\Models\Country;
|
use App\Models\Country;
|
||||||
|
use App\Models\Meetup;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
class MeetupTable extends Component
|
class MeetupTable extends Component
|
||||||
{
|
{
|
||||||
public Country $country;
|
public Country $country;
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
return view('livewire.meetup.meetup-table');
|
// let markers = [{name: 'VAK', coords: [50.0091294, 9.0371812], status: 'closed', offsets: [0, 2]}];
|
||||||
|
|
||||||
|
return view('livewire.meetup.meetup-table', [
|
||||||
|
'markers' => Meetup::query()
|
||||||
|
->with([
|
||||||
|
'city.country',
|
||||||
|
])
|
||||||
|
->whereHas('city.country',
|
||||||
|
fn($query) => $query->where('countries.code', $this->country->code))
|
||||||
|
->get()
|
||||||
|
->map(fn($meetup) => [
|
||||||
|
'name' => $meetup->name,
|
||||||
|
'coords' => [$meetup->city->latitude, $meetup->city->longitude],
|
||||||
|
])
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1351
config/meetups/github.json
Normal file
1351
config/meetups/github.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
public/img/btc.png
Normal file
BIN
public/img/btc.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
@@ -43,7 +43,8 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{--<div class="flex items-center justify-end mt-4">
|
@if(app()->environment('local'))
|
||||||
|
<div class="flex items-center justify-end mt-4">
|
||||||
|
|
||||||
@if (Route::has('password.request'))
|
@if (Route::has('password.request'))
|
||||||
<a class="underline text-sm text-gray-600 hover:text-gray-900"
|
<a class="underline text-sm text-gray-600 hover:text-gray-900"
|
||||||
@@ -56,7 +57,8 @@
|
|||||||
{{ __('Log in') }}
|
{{ __('Log in') }}
|
||||||
</x-jet-button>
|
</x-jet-button>
|
||||||
|
|
||||||
</div>--}}
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
<div class="flex items-center justify-left mt-4">
|
<div class="flex items-center justify-left mt-4">
|
||||||
<x-button href="{{ route('auth.ln') }}" primary icon="lightning-bolt">LNURL-Auth</x-button>
|
<x-button href="{{ route('auth.ln') }}" primary icon="lightning-bolt">LNURL-Auth</x-button>
|
||||||
|
|||||||
@@ -37,7 +37,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{--<div class="flex items-center justify-end mt-4">
|
@if(app()->environment('local'))
|
||||||
|
<div class="flex items-center justify-end mt-4">
|
||||||
|
|
||||||
<x-button icon="login" secondary class="ml-4" wire:click="switchToEmailLogin">
|
<x-button icon="login" secondary class="ml-4" wire:click="switchToEmailLogin">
|
||||||
{{ __('E-Mail login') }}
|
{{ __('E-Mail login') }}
|
||||||
@@ -47,7 +48,8 @@
|
|||||||
{{ __('E-Mail Registrierung') }}
|
{{ __('E-Mail Registrierung') }}
|
||||||
</x-button>
|
</x-button>
|
||||||
|
|
||||||
</div>--}}
|
</div>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div wire:poll="checkAuth" wire:key="checkAuth"></div>
|
<div wire:poll="checkAuth" wire:key="checkAuth"></div>
|
||||||
</x-jet-authentication-card>
|
</x-jet-authentication-card>
|
||||||
|
|||||||
@@ -7,14 +7,20 @@
|
|||||||
class="w-full flex justify-center"
|
class="w-full flex justify-center"
|
||||||
x-data="{
|
x-data="{
|
||||||
init() {
|
init() {
|
||||||
let markers = [{name: 'VAK', coords: [50.0091294, 9.0371812], status: 'closed', offsets: [0, 2]}];
|
let markers = {{ Js::from($markers) }};
|
||||||
|
console.log(markers);
|
||||||
|
|
||||||
$('#map').vectorMap({
|
$('#map').vectorMap({
|
||||||
zoomButtons : false,
|
zoomButtons : false,
|
||||||
zoomOnScroll: false,
|
zoomOnScroll: true,
|
||||||
map: '{{ $country->code }}_merc',
|
map: '{{ $country->code }}_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} }),
|
||||||
|
markerStyle: {
|
||||||
|
initial: {
|
||||||
|
image: '{{ asset('img/btc.png') }}',
|
||||||
|
}
|
||||||
|
},
|
||||||
regionStyle: {
|
regionStyle: {
|
||||||
initial: {
|
initial: {
|
||||||
fill: '#151515'
|
fill: '#151515'
|
||||||
|
|||||||
Reference in New Issue
Block a user