maps-theme/content/contents/default.blade.php

60 lines
2.1 KiB
PHP
Raw Normal View History

2023-05-15 19:30:18 +00:00
@extends('template.'.config('settings.template').'.content.master')
2023-05-15 19:57:14 +00:00
@section('head')
<title>{{$content->title}} | {{config('settings.name')}}</title>
<style>
#map {
2023-05-16 11:42:14 +00:00
height: 500px;
2023-05-15 19:57:14 +00:00
width: 100%;
}
</style>
@stop
2023-05-15 19:30:18 +00:00
@section('content')
2023-05-16 11:42:14 +00:00
<div class="container">
<div class="row">
<div class="col">
<a href="{{url('/')}}"> Back</a>
<h1>{{$content->title}}</h1>
2023-05-23 05:02:35 +00:00
<!-- <p>{{-- $content->description --}}</p> -->
2023-06-30 18:52:45 +00:00
<img src="{{$content->image}}" class="img-fluid" alt="">
2023-05-16 11:42:14 +00:00
</div>
</div>
<div class="row">
<div class="col-8 g-0">
<div id="map"></div>
2023-05-17 19:16:49 +00:00
<div id="marker-window" class="d-none">
<h5 id="firstHeading" class="firstHeading">$title</h5>
<div id="bodyContent">
<p>$description</p>
<a data-href="$path">Details</a>
</div>
</div>
2023-05-16 11:42:14 +00:00
</div>
</div>
</div>
2023-05-15 19:57:14 +00:00
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAKGJCCKvmWZl-L5bBF0uS5BWf0gN4ZkpI&callback=initMap&v=weekly" defer></script>
<script>
2023-05-17 19:16:49 +00:00
const contentUrl = "{{url('/api/contents/'.$content->id)}}";
2023-06-06 11:19:28 +00:00
const locationField = "{{config('settings.location_field')}}";
2023-05-15 19:30:18 +00:00
</script>
2023-05-18 17:14:55 +00:00
<script>
function initMap() {
let item = {!! json_encode($content) !!};
const map = new google.maps.Map(document.getElementById("map"), {
zoom: 8,
center: { lat: parseFloat(item.location.lat), lng: parseFloat(item.location.lng) },
streetViewControl: false,
mapTypeControl: false,
fullscreenControl: false,
});
let marker = new google.maps.Marker({
position: { lat: parseFloat(item.location.lat), lng: parseFloat(item.location.lng) },
map: map,
title: item.title,
optimized: false,
});
}
window.initMap = initMap;
</script>
2023-05-15 19:57:14 +00:00
@stop