4
0
mirror of https://git.coop/cotech/website.git synced 2025-06-26 08:30:47 +00:00

Remove maps from the site

I've also removed as much related code as I can find.
This commit is contained in:
Chris Lowis
2025-06-20 12:30:09 +01:00
parent 9a9f5be563
commit b8127bffd3
9 changed files with 35 additions and 206 deletions

View File

@ -47,4 +47,3 @@ defaults:
values:
layout: technology
forum: https://community.coops.tech/
mapbox_access_token: pk.eyJ1IjoiY290ZWNoIiwiYSI6ImNpemgxbzhwODAwMHMzM28zdXF3cGxyYmwifQ.9nPExuEUqwblCCl-6gyFXA

View File

@ -69,7 +69,4 @@
</style>
<link rel="stylesheet" href="/assets/foundation-icons/foundation-icons.css">
<link rel="icon" type="image/x-icon" href="/assets/img/CoTech-logo.png">
<script type="text/javascript">
window.mapboxAccessToken = '{{ site.mapbox_access_token }}';
</script>
</head>

View File

@ -27,59 +27,18 @@
<div class="row">
<div class="small-12 columns">
<div class="view float-center">
<ul class="tabs" data-tabs id="coops-view-tabs">
<li class="tabs-title is-active"><a href="#grid" aria-selected="true">Grid</a></li>
<li class="separator">|</li>
<li class="tabs-title"><a href="#map">Map</a></li>
</ul>
</div>
<div class="tabs-content" data-tabs-content="coops-view-tabs">
<!-- START Grid View Content -->
<div class="tabs-panel is-active" id="grid">
<div class="row small-up-2 medium-up-4 large-up-6 small-collapse">
{% for coop in site.coops %}
{% if coop.services contains page.slug %}
<div class="column">
<a href="{{ coop.url | relative_url }}" class="coop-thumb" id="#{{ coop.slug }}">
<img src="/images/coops/{{ coop.slug }}" alt="{{ coop.name }}">
</a>
</div>
{% endif %}
{% endfor %}
<div id="grid">
<div class="row small-up-2 medium-up-4 large-up-6 small-collapse">
{% for coop in site.coops %}
{% if coop.services contains page.slug %}
<div class="column">
<a href="{{ coop.url | relative_url }}" class="coop-thumb" id="#{{ coop.slug }}">
<img src="/images/coops/{{ coop.slug }}" alt="{{ coop.name }}">
</a>
</div>
{% endif %}
{% endfor %}
</div>
<!-- END Grid View Content -->
<!-- START Map View Content -->
<div class="tabs-panel" id="map">
<div class="row small-up-2 medium-up-4 large-up-6 small-collapse">
<div id="map-services"></div>
<script type="text/javascript">
var mapEntries = [
{% for coop in site.coops %}
{% if coop.services contains page.slug %}
{
lat: {{ coop.latitude }},
lng: {{ coop.longitude }},
markerText: '<b><a href=\"{{ coop.url | relative_url }}\">{{ coop.name }}</a></b><br><br>{{ coop.address | split: "," | join: "<br>" }}'
},
{% endif %}
{% endfor %}
];
$(document).ready(function() {
var map = window.app.createMapMultiMarker('map-services', 54.7, -4.2, 6, mapEntries);
$('#coops-view-tabs').on('change.zf.tabs', function() {
map.invalidateSize();
});
});
</script>
</div>
</div>
<!-- END Map View Content -->
</div>
</div>
</div>

View File

@ -26,60 +26,18 @@
<div class="row">
<div class="small-12 columns">
<div class="view float-center">
<ul class="tabs" data-tabs id="coops-view-tabs">
<li class="tabs-title is-active"><a href="#grid" aria-selected="true">Grid</a></li>
<li class="separator">|</li>
<li class="tabs-title"><a href="#map">Map</a></li>
</ul>
</div>
<div class="tabs-content" data-tabs-content="coops-view-tabs">
<!-- START Grid View Content -->
<div class="tabs-panel is-active" id="grid">
<div class="row small-up-2 medium-up-4 large-up-6 small-collapse">
{% for coop in site.coops %}
{% if coop.technologies contains page.slug %}
<div class="column">
<a href="{{ coop.url | relative_url }}" class="coop-thumb" id="#{{ coop.slug }}">
<img src="/images/coops/{{ coop.slug }}" alt="{{ coop.name }}">
</a>
</div>
{% endif %}
{% endfor %}
<div id="grid">
<div class="row small-up-2 medium-up-4 large-up-6 small-collapse">
{% for coop in site.coops %}
{% if coop.technologies contains page.slug %}
<div class="column">
<a href="{{ coop.url | relative_url }}" class="coop-thumb" id="#{{ coop.slug }}">
<img src="/images/coops/{{ coop.slug }}" alt="{{ coop.name }}">
</a>
</div>
{% endif %}
{% endfor %}
</div>
<!-- END Grid View Content -->
<!-- START Map View Content -->
<div class="tabs-panel" id="map">
<div class="row small-up-2 medium-up-4 large-up-6 small-collapse">
<div id="map-technologies"></div>
<script type="text/javascript">
var mapEntries = [
{% for coop in site.coops %}
{% if coop.technologies contains page.slug %}
{
lat: {{ coop.latitude }},
lng: {{ coop.longitude }},
markerText: '<b><a href=\"{{ coop.url | relative_url }}\">{{ coop.name }}</a></b><br><br>{{ coop.address | split: "," | join: "<br>" }}'
},
{% endif %}
{% endfor %}
];
$(document).ready(function() {
var map = window.app.createMapMultiMarker('map-technologies', 54.7, -4.2, 6, mapEntries);
$('#coops-view-tabs').on('change.zf.tabs', function() {
map.invalidateSize();
});
});
</script>
</div>
</div>
<!-- END Map View Content -->
</div>
</div>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 618 B

View File

@ -1,56 +1,6 @@
$(document).foundation();
$('#coops-view-tabs').on('change.zf.tabs', function() {
window.app.createMapMultiMarker('map-coops', 54.7, -4.2, 6, window.app.mapEntries);
});
var elem = new Foundation.Sticky($('.top-bar'));
var app = window.app || {};
var mapboxAccessToken = window.mapboxAccessToken || '';
app.apiUrl = 'https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=' + mapboxAccessToken;
app.tileLayerOptions = {
maxZoom: 18,
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + 'Imagery © <a href="http://mapbox.com">Mapbox</a>',
id: 'mapbox/streets-v12',
token: window.mapboxAccessToken
};
app.map = null;
app.createMap = function(mapId, lat, lng, zoom) {
window.app.map = L.map(mapId).setView([lat, lng], zoom);
}
app.createMapSingleMarker = function(mapId, lat, lng, zoom, markerText) {
if (!window.app.map) {
window.app.createMap(mapId, lat, lng, zoom);
var myMap = window.app.map;
L.tileLayer(window.app.apiUrl, window.app.tileLayerOptions).addTo(myMap);
var marker = L.marker([lat - 0.0005, lng]).addTo(myMap);
marker.bindPopup(markerText).openPopup();
}
return window.app.map;
}
app.createMapMultiMarker = function(mapId, lat, lng, zoom, markersArray) {
if (!window.app.map) {
window.app.createMap(mapId, lat, lng, zoom);
var myMap = window.app.map;
L.tileLayer(window.app.apiUrl, window.app.tileLayerOptions).addTo(myMap);
markersArray.forEach(function (markerVar) {
var marker = L.marker([markerVar.lat, markerVar.lng]).addTo(myMap);
marker.bindPopup(markerVar.markerText);
});
}
return window.app.map;
};
//# sourceMappingURL=app.js.map
$('#client-list .column').shuffle();

View File

@ -50,55 +50,21 @@ layout: home
<h2>Members</h2>
<p>Take a look at who is part of the CoTech network</p>
<div class="view float-center">
<ul class="tabs" data-tabs id="coops-view-tabs">
<li class="tabs-title is-active"><a href="#grid" aria-selected="true">Grid</a></li>
<li class="separator">|</li>
<li class="tabs-title"><a href="#map">Map</a></li>
</ul>
</div>
<div class="tabs-content" data-tabs-content="coops-view-tabs">
<!-- START Grid View Content -->
<div class="tabs-panel is-active" id="grid">
<div class="row small-up-2 medium-up-4 large-up-6 small-collapse">
{% for coop in site.coops %}
<div class="column">
<a class="coop-thumb" href="{{ coop.url | relative_url }}">
<div class="coop-thumb-img has-tip tip-bottom radius" style="background-image: url(/images/coops/{{ coop.slug }})" data-tooltip aria-haspopup="true" title="{{ coop.name }}"></div>
</a>
</div>
{% endfor %}
<div class="column">
<a href="join" class="coop-thumb">
<h5 id="join-us">Join CoTech</h5>
</a>
</div>
<div id="grid">
<div class="row small-up-2 medium-up-4 large-up-6 small-collapse">
{% for coop in site.coops %}
<div class="column">
<a class="coop-thumb" href="{{ coop.url | relative_url }}">
<div class="coop-thumb-img has-tip tip-bottom radius" style="background-image: url(/images/coops/{{ coop.slug }})" data-tooltip aria-haspopup="true" title="{{ coop.name }}"></div>
</a>
</div>
{% endfor %}
<div class="column">
<a href="join" class="coop-thumb">
<h5 id="join-us">Join CoTech</h5>
</a>
</div>
</div>
<!-- END Grid View Content -->
<!-- START Map View Content -->
<div class="tabs-panel" id="map">
<div class="row small-up-2 medium-up-4 large-up-6 small-collapse">
<div id="map-coops"></div>
<script type="text/javascript">
var app = window.app || {};
app.mapEntries = [
{% for coop in site.coops %}
{
lat: {{ coop.latitude }},
lng: {{ coop.longitude }},
markerText: '<b><a href=\"{{ coop.url | relative_url }}\">{{ coop.name }}</a></b><br><br>{{ coop.address | split: "," | join: "<br>" }}'
},
{% endfor %}
];
</script>
</div>
</div>
<!-- END Map View Content -->
</div>
</div>
</div>