61 lines
2.2 KiB
PHP
61 lines
2.2 KiB
PHP
@extends('template.'.config('settings.template').'.content.master')
|
|
@section('head')
|
|
<title>{{$content->title}} | {{config('settings.name')}}</title>
|
|
<style>
|
|
#map {
|
|
height: 500px;
|
|
width: 100%;
|
|
}
|
|
</style>
|
|
@stop
|
|
@section('content')
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col">
|
|
<a href="{{url('/')}}"> ← Back</a>
|
|
<h1>{{$content->title}}</h1>
|
|
<p>{$content->description}</p>
|
|
<img src="{{$content->image}}" alt="">
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-8 g-0">
|
|
<div id="map"></div>
|
|
<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>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAKGJCCKvmWZl-L5bBF0uS5BWf0gN4ZkpI&callback=initMap&v=weekly" defer></script>
|
|
<script src="https://unpkg.com/@googlemaps/markerclusterer/dist/index.min.js"></script>
|
|
<script>
|
|
const contentUrl = "{{url('/api/contents/'.$content->id)}}";
|
|
const locationField = "location";
|
|
</script>
|
|
<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>
|
|
@stop |