From 4f396db577655ad2014fed854577232c9d1f509c Mon Sep 17 00:00:00 2001
From: xaralis <filip.varecha@fragaria.cz>
Date: Mon, 30 May 2022 10:03:10 +0100
Subject: [PATCH] feat(maps_utils): preload map collection images

---
 .../static/maps_utils/geo-feature-collection.js   | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/maps_utils/static/maps_utils/geo-feature-collection.js b/maps_utils/static/maps_utils/geo-feature-collection.js
index c157372b..d8efccb9 100644
--- a/maps_utils/static/maps_utils/geo-feature-collection.js
+++ b/maps_utils/static/maps_utils/geo-feature-collection.js
@@ -236,6 +236,14 @@ const GeoFeatureCollection = Vue.component("GeoFeatureCollection", {
                 });
             }
 
+            // Preload images
+            annotatedFeatures.forEach((feature) => {
+                if (feature.properties.image) {
+                    const i = new Image();
+                    i.src = feature.properties.image;
+                }
+            });
+
             // Draw the map.
             this.initMap({
                 type: "FeatureCollection",
@@ -651,7 +659,12 @@ const GeoFeatureCollection = Vue.component("GeoFeatureCollection", {
                                         {{ currentItem.description }}
                                     </div>
 
-                                    <a v-if="currentItem.link" :href="currentItem.link" class="mt-4 text-sm btn btn--grey-125 btn--hoveractive"><div class="btn__body">Zjistit více</div></a>
+                                    <a v-if="currentItem.link" :href="currentItem.link" class="mt-4 text-sm btn btn--black btn--icon">
+                                        <div class="btn__body-wrap">
+                                            <div class="btn__body">Zjistit více</div>
+                                            <div class="btn__icon"><i class="ico--chevron-right"></i></div>
+                                        </div>
+                                    </a>
                                 </div>
                             </div>
                         </div>
-- 
GitLab