Clean up old assets
This commit is contained in:
parent
8cfded9232
commit
bcabf94741
45 changed files with 24 additions and 1127 deletions
6
resources/css-2023/app.css
vendored
6
resources/css-2023/app.css
vendored
|
|
@ -1,6 +0,0 @@
|
|||
@import "variables.css";
|
||||
@import "fonts.css";
|
||||
@import "layout.css";
|
||||
@import "colours.css";
|
||||
@import "code.css";
|
||||
@import "content.css";
|
||||
3
resources/css-2023/posse.css
vendored
3
resources/css-2023/posse.css
vendored
|
|
@ -1,3 +0,0 @@
|
|||
.p-bridgy-twitter-content {
|
||||
display: none;
|
||||
}
|
||||
22
resources/css-2023/variables.css
vendored
22
resources/css-2023/variables.css
vendored
|
|
@ -1,22 +0,0 @@
|
|||
:root {
|
||||
/* Font Family */
|
||||
--font-family-headings: "Archer SSm A", "Archer SSm B", serif;
|
||||
--font-family-body: "Verlag A", "Verlag B", sans-serif;
|
||||
--font-family-monospace: "Operator Mono SSm A", "Operator Mono SSm B", monospace;
|
||||
|
||||
/* Font Size */
|
||||
--font-size-sm: 0.75rem; /* 12px */
|
||||
--font-size-base: 1rem; /* 16px, base */
|
||||
--font-size-md: 1.25rem; /* 20px */
|
||||
--font-size-lg: 1.5rem; /* 24px */
|
||||
--font-size-xl: 1.75rem; /* 28px */
|
||||
--font-size-xxl: 2rem; /* 32px */
|
||||
--font-size-xxxl: 2.25rem; /* 36px */
|
||||
|
||||
/* Colours */
|
||||
--color-primary: oklch(36.8% 0.1 125.505);
|
||||
--color-secondary: oklch(96.3% 0.1 125.505);
|
||||
--color-link: oklch(48.09% 0.146 241.41);
|
||||
--color-link-visited: oklch(70.44% 0.21 304.41);
|
||||
--color-primary-shadow: oklch(19.56% 0.054 125.505 / 40%);
|
||||
}
|
||||
10
resources/css/app.css
vendored
10
resources/css/app.css
vendored
|
|
@ -1,6 +1,6 @@
|
|||
@import "variables.css";
|
||||
@import "base.css";
|
||||
@import "layout/main.css";
|
||||
@import "link-style.css";
|
||||
@import "posse.css";
|
||||
@import "user-profiles.css";
|
||||
@import "fonts.css";
|
||||
@import "layout.css";
|
||||
@import "colours.css";
|
||||
@import "code.css";
|
||||
@import "content.css";
|
||||
|
|
|
|||
36
resources/css/base.css
vendored
36
resources/css/base.css
vendored
|
|
@ -1,36 +0,0 @@
|
|||
body {
|
||||
font-family: var(--font-stack-body);
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-size: 2rem;
|
||||
background-color: var(--color-background);
|
||||
color: var(--color-paragraph);
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-family: var(--font-stack-headings);
|
||||
font-style: normal;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
pre,
|
||||
code {
|
||||
font-family: var(--font-stack-monospace);
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--color-highlight);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.h-feed > .note,
|
||||
.h-feed > .h-entry {
|
||||
margin-top: 4rem;
|
||||
}
|
||||
3
resources/css/code.css
vendored
Normal file
3
resources/css/code.css
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
.hljs {
|
||||
border-radius: .5rem;
|
||||
}
|
||||
18
resources/css/colours.css
vendored
Normal file
18
resources/css/colours.css
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
body {
|
||||
background-color: var(--color-secondary);
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--color-link);
|
||||
|
||||
&:visited {
|
||||
color: var(--color-link-visited);
|
||||
}
|
||||
}
|
||||
|
||||
#site-header {
|
||||
& a:visited {
|
||||
color: var(--color-link);
|
||||
}
|
||||
}
|
||||
36
resources/css/content.css
vendored
Normal file
36
resources/css/content.css
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
@import "posse.css";
|
||||
@import "h-card.css";
|
||||
|
||||
.h-entry {
|
||||
border-inline-start: 1px solid var(--color-primary);
|
||||
padding-inline-start: .5rem;
|
||||
|
||||
& .reply-to {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
& .post-info {
|
||||
& a {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
& .note-metadata {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 1rem;
|
||||
|
||||
& .syndication-links {
|
||||
flex-flow: row wrap;
|
||||
|
||||
& a {
|
||||
text-decoration: none;
|
||||
|
||||
& svg {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
17
resources/css/fonts.css
vendored
Normal file
17
resources/css/fonts.css
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
body {
|
||||
font-family: var(--font-family-body);
|
||||
font-size: var(--font-size-md);
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: var(--font-family-monospace);
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-family: var(--font-family-headings);
|
||||
}
|
||||
32
resources/css/h-card.css
vendored
Normal file
32
resources/css/h-card.css
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
.h-card {
|
||||
& .hovercard {
|
||||
display: none;
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
padding: 1rem;
|
||||
border-radius: 1rem;
|
||||
box-shadow: 0 .5rem .5rem .5rem var(--color-primary-shadow);
|
||||
background-color: var(--color-secondary);
|
||||
width: fit-content;
|
||||
transition: opacity 0.5s ease-in-out;
|
||||
opacity: 0;
|
||||
flex-direction: column;
|
||||
gap: .5rem;
|
||||
|
||||
& .u-photo {
|
||||
max-width: 6rem;
|
||||
}
|
||||
|
||||
& .social-icon {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
& .hovercard {
|
||||
display: flex;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
25
resources/css/layout.css
vendored
Normal file
25
resources/css/layout.css
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: 5vw 1fr 5vw;
|
||||
grid-template-rows: min-content 1fr min-content;
|
||||
row-gap: 1rem;
|
||||
}
|
||||
|
||||
#site-header {
|
||||
grid-column: 2 / 3;
|
||||
grid-row: 1 / 2;
|
||||
}
|
||||
|
||||
main {
|
||||
grid-column: 2 / 3;
|
||||
grid-row: 2 / 3;
|
||||
}
|
||||
|
||||
footer {
|
||||
grid-column: 2 / 3;
|
||||
grid-row: 3 / 4;
|
||||
|
||||
& .iwc-logo {
|
||||
max-width: 85vw;
|
||||
}
|
||||
}
|
||||
125
resources/css/layout/main.css
vendored
125
resources/css/layout/main.css
vendored
|
|
@ -1,125 +0,0 @@
|
|||
body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 699px) {
|
||||
main {
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 700px) {
|
||||
main {
|
||||
max-width: 700px;
|
||||
}
|
||||
|
||||
main > .note,
|
||||
main > .h-entry {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
main img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
main .h-entry:first-child > .bookmark-link {
|
||||
padding-top: 2rem;
|
||||
}
|
||||
|
||||
.note {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.note-metadata {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.note .client {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.note .syndication-links svg {
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
}
|
||||
|
||||
.note > .e-content > .naked-link .u-photo {
|
||||
margin: 2rem 0;
|
||||
}
|
||||
|
||||
article header > h1 {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.post-info {
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
justify-content: space-evenly;
|
||||
max-width: 90vw;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.personal-bio {
|
||||
padding: 0 2rem;
|
||||
}
|
||||
|
||||
footer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 699px) {
|
||||
input {
|
||||
max-width: 95vw;
|
||||
}
|
||||
}
|
||||
|
||||
.iwc-logo {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 699px) {
|
||||
footer {
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
#top-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
#top-header h1 {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
nav {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
nav a {
|
||||
margin: 0 0.5rem;
|
||||
}
|
||||
7
resources/css/link-style.css
vendored
7
resources/css/link-style.css
vendored
|
|
@ -1,7 +0,0 @@
|
|||
.post-info a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.syndication-links .u-syndication {
|
||||
text-decoration: none;
|
||||
}
|
||||
1
resources/css/posse.css
vendored
1
resources/css/posse.css
vendored
|
|
@ -1,4 +1,3 @@
|
|||
.p-bridgy-facebook-content,
|
||||
.p-bridgy-twitter-content {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
|||
3
resources/css/user-profiles.css
vendored
3
resources/css/user-profiles.css
vendored
|
|
@ -1,3 +0,0 @@
|
|||
.hovercard {
|
||||
display: none;
|
||||
}
|
||||
34
resources/css/variables.css
vendored
34
resources/css/variables.css
vendored
|
|
@ -1,20 +1,22 @@
|
|||
:root {
|
||||
/* fonts */
|
||||
--font-stack-body: "Whitney SSm A", "Whitney SSm B", sans-serif;
|
||||
--font-stack-headings: "Quarto A", "Quarto B", serif;
|
||||
--font-stack-monospace: "Operator Mono SSm A", "Operator Mono SSm B", monospace;
|
||||
/* Font Family */
|
||||
--font-family-headings: "Archer SSm A", "Archer SSm B", serif;
|
||||
--font-family-body: "Verlag A", "Verlag B", sans-serif;
|
||||
--font-family-monospace: "Operator Mono SSm A", "Operator Mono SSm B", monospace;
|
||||
|
||||
/* colours */
|
||||
--color-background: #004643;
|
||||
--color-headline: #fffffe;
|
||||
--color-paragraph: #abd1c6;
|
||||
--color-button: #f9bc60;
|
||||
--color-button-text: #001e1d;
|
||||
/* Font Size */
|
||||
--font-size-sm: 0.75rem; /* 12px */
|
||||
--font-size-base: 1rem; /* 16px, base */
|
||||
--font-size-md: 1.25rem; /* 20px */
|
||||
--font-size-lg: 1.5rem; /* 24px */
|
||||
--font-size-xl: 1.75rem; /* 28px */
|
||||
--font-size-xxl: 2rem; /* 32px */
|
||||
--font-size-xxxl: 2.25rem; /* 36px */
|
||||
|
||||
/* colours - illustrations */
|
||||
--color-stroke: #001e1d;
|
||||
--color-main: #e8e4e6;
|
||||
--color-highlight: #f9bc60;
|
||||
--color-secondary: #abd1c6;
|
||||
--color-tertiary: #e16162;
|
||||
/* Colours */
|
||||
--color-primary: oklch(36.8% 0.1 125.505);
|
||||
--color-secondary: oklch(96.3% 0.1 125.505);
|
||||
--color-link: oklch(48.09% 0.146 241.41);
|
||||
--color-link-visited: oklch(70.44% 0.21 304.41);
|
||||
--color-primary-shadow: oklch(19.56% 0.054 125.505 / 40%);
|
||||
}
|
||||
|
|
|
|||
29
resources/es6-orig/colours.js
vendored
29
resources/es6-orig/colours.js
vendored
|
|
@ -1,29 +0,0 @@
|
|||
//colours.js
|
||||
|
||||
let link = document.querySelector('#colourScheme');
|
||||
|
||||
let css = link.getAttribute('href').split('/').pop();
|
||||
|
||||
// update selected item in colour scheme list
|
||||
document.querySelector('#colourSchemeSelect [value="' + css + '"]').selected = true;
|
||||
|
||||
// fix form
|
||||
let form = document.getElementById('colourSchemeForm');
|
||||
let btn = form.querySelector('button');
|
||||
btn.addEventListener('click', function (event) {
|
||||
event.preventDefault();
|
||||
let newCss = document.getElementById('colourSchemeSelect').value;
|
||||
let css = link.getAttribute('href');
|
||||
let parts = css.split('/');
|
||||
parts.pop();
|
||||
parts.push(newCss);
|
||||
link.setAttribute('href', parts.join('/'));
|
||||
let formData = new FormData(form);
|
||||
fetch('/update-colour-scheme', {
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
body: formData
|
||||
}).catch(function (error) {
|
||||
console.warn(error);
|
||||
});
|
||||
});
|
||||
7
resources/es6-orig/edit-place-icon.js
vendored
7
resources/es6-orig/edit-place-icon.js
vendored
|
|
@ -1,7 +0,0 @@
|
|||
//edit-place-icon.js
|
||||
|
||||
export default function getIcon() {
|
||||
let iconOption = document.querySelector('#icon');
|
||||
|
||||
return iconOption.value;
|
||||
}
|
||||
31
resources/es6-orig/links.js
vendored
31
resources/es6-orig/links.js
vendored
|
|
@ -1,31 +0,0 @@
|
|||
//links.js
|
||||
|
||||
let youtubeRegex = /watch\?v=([A-Za-z0-9\-_]+)\b/;
|
||||
let spotifyRegex = /https:\/\/play\.spotify\.com\/(.*)\b/;
|
||||
|
||||
let notes = document.querySelectorAll('.e-content');
|
||||
|
||||
for (let note of notes) {
|
||||
let ytid = note.textContent.match(youtubeRegex);
|
||||
if (ytid) {
|
||||
let ytcontainer = document.createElement('div');
|
||||
ytcontainer.classList.add('container');
|
||||
let ytiframe = document.createElement('iframe');
|
||||
ytiframe.classList.add('youtube');
|
||||
ytiframe.setAttribute('src', 'https://www.youtube.com/embed/' + ytid[1]);
|
||||
ytiframe.setAttribute('frameborder', 0);
|
||||
ytiframe.setAttribute('allowfullscreen', 'true');
|
||||
ytcontainer.appendChild(ytiframe);
|
||||
note.appendChild(ytcontainer);
|
||||
}
|
||||
let spotifyid = note.textContent.match(spotifyRegex);
|
||||
if (spotifyid) {
|
||||
let sid = spotifyid[1].replace('/', ':');
|
||||
let siframe = document.createElement('iframe');
|
||||
siframe.classList.add('spotify');
|
||||
siframe.setAttribute('src', 'https://embed.spotify.com/?uri=spotify:' + sid);
|
||||
siframe.setAttribute('frameborder', 0);
|
||||
siframe.setAttribute('allowtransparency', 'true');
|
||||
note.appendChild(siframe);
|
||||
}
|
||||
}
|
||||
192
resources/es6-orig/mapbox-utils.js
vendored
192
resources/es6-orig/mapbox-utils.js
vendored
|
|
@ -1,192 +0,0 @@
|
|||
//mapbox-utils.js
|
||||
import parseLocation from './parse-location';
|
||||
import selectPlaceInForm from './select-place';
|
||||
|
||||
/*
|
||||
* For specific lines on this file I have disabled the `no-undef`
|
||||
* rule in ESLint. This is for the mapboxgl object which is defined
|
||||
* in the mapbox-gl.js file that we pull in from their CDN before
|
||||
* this script gets run.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
mapboxgl.accessToken = 'pk.eyJ1Ijoiam9ubnliYXJuZXMiLCJhIjoiY2l2cDhjYW04MDAwcjJ0cG1uZnhqcm82ayJ9.qA2zeVA-nsoMh9IFrd5KQw';
|
||||
|
||||
// Define some functions to be used in the default function.
|
||||
const titlecase = (string) => {
|
||||
return string.split('-').map(([first,...rest]) => first.toUpperCase() + rest.join('').toLowerCase()).join(' ');
|
||||
};
|
||||
|
||||
// Get the ID for the map, i.e. get the u-url of the containing note.
|
||||
const getId = (map) => {
|
||||
let href = map._container.parentNode.querySelector('.u-url').getAttribute('href');
|
||||
return href.substr(href.lastIndexOf('/') + 1);
|
||||
};
|
||||
|
||||
const addMapTypeOption = (map, menu, option, checked = false) => {
|
||||
let div = document.createElement('div');
|
||||
let input = document.createElement('input');
|
||||
let id = option + getId(map);
|
||||
input.setAttribute('id', id);
|
||||
input.setAttribute('type', 'radio');
|
||||
input.setAttribute('name', 'map' + getId(map));
|
||||
input.setAttribute('value', option);
|
||||
if (checked == true) {
|
||||
input.setAttribute('checked', 'checked');
|
||||
}
|
||||
input.addEventListener('click', function () {
|
||||
let source = map.getSource('points');
|
||||
map.setStyle('mapbox://styles/mapbox/' + option + '-v9');
|
||||
map.on('style.load', function () {
|
||||
map.addLayer({
|
||||
'id': 'points',
|
||||
'type': 'symbol',
|
||||
'source': {
|
||||
'type': 'geojson',
|
||||
'data': source._data
|
||||
},
|
||||
'layout': {
|
||||
'icon-image': '{icon}-15',
|
||||
'text-field': '{title}',
|
||||
'text-offset': [0, 1]
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
let label = document.createElement('label');
|
||||
label.setAttribute('for', option + getId(map));
|
||||
label.appendChild(document.createTextNode(titlecase(option)));
|
||||
div.appendChild(input);
|
||||
div.appendChild(label);
|
||||
menu.appendChild(div);
|
||||
};
|
||||
|
||||
const makeMapMenu = (map) => {
|
||||
let mapMenu = document.createElement('fieldset');
|
||||
let legend = document.createElement('legend');
|
||||
let title = document.createTextNode('Map Style');
|
||||
legend.appendChild(title);
|
||||
mapMenu.appendChild(legend);
|
||||
mapMenu.classList.add('map-menu');
|
||||
addMapTypeOption(map, mapMenu, 'streets', true);
|
||||
addMapTypeOption(map, mapMenu, 'satellite-streets');
|
||||
return mapMenu;
|
||||
};
|
||||
|
||||
// The main function.
|
||||
export default function addMap(div, position = null, places = null) {
|
||||
let data;
|
||||
let dataLatitude = div.dataset.latitude;
|
||||
let dataLongitude = div.dataset.longitude;
|
||||
let dataName = div.dataset.name;
|
||||
let dataMarker = div.dataset.marker;
|
||||
if (dataMarker == '') {
|
||||
dataMarker = 'circle';
|
||||
}
|
||||
if (dataName == null) {
|
||||
data = {
|
||||
'type': 'FeatureCollection',
|
||||
'features': [{
|
||||
'type': 'Feature',
|
||||
'geometry': {
|
||||
'type': 'Point',
|
||||
'coordinates': [dataLongitude, dataLatitude]
|
||||
},
|
||||
'properties': {
|
||||
'title': 'Current Location',
|
||||
'icon': 'circle-stroked',
|
||||
'uri': 'current-location'
|
||||
}
|
||||
}]
|
||||
};
|
||||
} else {
|
||||
data = {
|
||||
'type': 'FeatureCollection',
|
||||
'features': [{
|
||||
'type': 'Feature',
|
||||
'geometry': {
|
||||
'type': 'Point',
|
||||
'coordinates': [dataLongitude, dataLatitude]
|
||||
},
|
||||
'properties': {
|
||||
'title': dataName,
|
||||
'icon': dataMarker,
|
||||
}
|
||||
}]
|
||||
};
|
||||
}
|
||||
if (places != null) {
|
||||
for (let place of places) {
|
||||
let placeLongitude = parseLocation(place.location).longitude;
|
||||
let placeLatitude = parseLocation(place.location).latitude;
|
||||
data.features.push({
|
||||
'type': 'Feature',
|
||||
'geometry': {
|
||||
'type': 'Point',
|
||||
'coordinates': [placeLongitude, placeLatitude]
|
||||
},
|
||||
'properties': {
|
||||
'title': place.name,
|
||||
'icon': 'circle',
|
||||
'uri': place.slug
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if (position != null) {
|
||||
dataLongitude = position.coords.longitude;
|
||||
dataLatitude = position.coords.latitude;
|
||||
}
|
||||
// eslint-disable-next-line no-undef
|
||||
let map = new mapboxgl.Map({
|
||||
container: div,
|
||||
style: 'mapbox://styles/mapbox/streets-v9',
|
||||
center: [dataLongitude, dataLatitude],
|
||||
zoom: 15
|
||||
});
|
||||
if (position == null) {
|
||||
map.scrollZoom.disable();
|
||||
}
|
||||
// eslint-disable-next-line no-undef
|
||||
map.addControl(new mapboxgl.NavigationControl());
|
||||
div.appendChild(makeMapMenu(map));
|
||||
map.on('load', function () {
|
||||
map.addLayer({
|
||||
'id': 'points',
|
||||
'type': 'symbol',
|
||||
'source': {
|
||||
'type': 'geojson',
|
||||
'data': data
|
||||
},
|
||||
'layout': {
|
||||
'icon-image': '{icon}-15',
|
||||
'text-field': '{title}',
|
||||
'text-offset': [0, 1]
|
||||
}
|
||||
});
|
||||
});
|
||||
if (position != null) {
|
||||
map.on('click', function (e) {
|
||||
let features = map.queryRenderedFeatures(e.point, {
|
||||
layer: ['points']
|
||||
});
|
||||
// if there are features within the given radius of the click event,
|
||||
// fly to the location of the click event
|
||||
if (features.length) {
|
||||
// Get coordinates from the symbol and center the map on those coordinates
|
||||
map.flyTo({center: features[0].geometry.coordinates});
|
||||
selectPlaceInForm(features[0].properties.uri);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (data.features && data.features.length > 1) {
|
||||
// eslint-disable-next-line no-undef
|
||||
let bounds = new mapboxgl.LngLatBounds();
|
||||
for (let feature of data.features) {
|
||||
bounds.extend(feature.geometry.coordinates);
|
||||
}
|
||||
map.fitBounds(bounds, { padding: 65});
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue