forked from oyd/ozgurkon-2021-site
parent
39e6699fc4
commit
5119fe11e3
@ -1,9 +0,0 @@ |
||||
name: Centre de Congrès Pierre Baudis |
||||
description: >- |
||||
Le Centre de Congrès Pierre Baudis est un lieu d'échanges moderne, situé sur un emplacement privilégié, à proximité immédiate du centre de Toulouse et dans un environnement verdoyant. |
||||
address: 11 Espl. Compans Caffarelli, 31000 Toulouse |
||||
pointer: |
||||
latitude: 43.6110956 |
||||
longitude: 1.4332799 |
||||
zoom: 5 |
||||
mapCenter: 48,8 |
@ -0,0 +1,67 @@ |
||||
'use strict'; |
||||
|
||||
{ |
||||
let initCalled; |
||||
const callbackPromise = new Promise((r) => window.__initGoodMap = r); |
||||
|
||||
function loadGoogleMaps(apiKey) { |
||||
if (!initCalled) { |
||||
const script = document.createElement('script'); |
||||
script.src = 'https://maps.googleapis.com/maps/api/js?' + |
||||
(apiKey ? `key=${apiKey}&` : '') + |
||||
'callback=__initGoodMap'; |
||||
document.head.appendChild(script); |
||||
initCalled = true; |
||||
} |
||||
return callbackPromise; |
||||
} |
||||
|
||||
customElements.define('good-map', class extends HTMLElement { |
||||
static get observedAttributes() { |
||||
return ['api-key', 'zoom', 'latitude', 'longitude', 'map-options']; |
||||
} |
||||
|
||||
attributeChangedCallback(name, oldVal, val) { |
||||
switch (name) { |
||||
case 'api-key': |
||||
this.apiKey = val; |
||||
break; |
||||
case 'zoom': |
||||
case 'latitude': |
||||
case 'longitude': |
||||
this[name] = parseFloat(val); |
||||
break; |
||||
case 'map-options': |
||||
this.mapOptions = JSON.parse(val); |
||||
break |
||||
} |
||||
} |
||||
|
||||
constructor() { |
||||
super(); |
||||
|
||||
this.map = null; |
||||
this.apiKey = null; |
||||
this.zoom = null; |
||||
this.latitude = null; |
||||
this.longitude = null; |
||||
this.mapOptions = {}; |
||||
} |
||||
|
||||
connectedCallback() { |
||||
loadGoogleMaps(this.apiKey).then(() => { |
||||
if (!this.mapOptions.zoom) { |
||||
this.mapOptions.zoom = this.zoom || 0; |
||||
} |
||||
if (!this.mapOptions.center) { |
||||
this.mapOptions.center = { |
||||
lat: this.latitude || 0, |
||||
lng: this.longitude || 0 |
||||
}; |
||||
} |
||||
this.map = new google.maps.Map(this, this.mapOptions); |
||||
this.dispatchEvent(new CustomEvent('google-map-ready', { detail: this.map })); |
||||
}); |
||||
} |
||||
}); |
||||
} |
@ -1,16 +1,12 @@ |
||||
{{ define "main" }} |
||||
{{ .Content }} |
||||
|
||||
{{ range .Site.Data.team }} |
||||
<section> |
||||
<h2>{{ .title }}</h2> |
||||
|
||||
<ul class="members shuffle"> |
||||
{{ range (shuffle .members) }} |
||||
{{ range (shuffle .Site.Data.team) }} |
||||
<li>{{ partial "team.html" . }}</li> |
||||
{{ end }} |
||||
</ul> |
||||
</section> |
||||
{{ end }} |
||||
|
||||
{{ end }} |
Loading…
Reference in new issue