Skip to content

Commit

Permalink
fix "X" display
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafnuss committed Apr 21, 2024
1 parent c58a9b8 commit 8e12da0
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import logo from "./assets/logo.svg";
<l-map :bounds="bounds" :options="{ zoomControl: false, preferCanvas: true }" ref="map">
<l-control-layers position="topright"></l-control-layers>
<l-control position="topleft">
<b-button v-b-toggle.sidebar-1><b-icon-layout-sidebar-inset></b-icon-layout-sidebar-inset></b-button>
<b-button v-b-toggle.sidebar-1
><b-icon-layout-sidebar-inset></b-icon-layout-sidebar-inset
></b-button>
</l-control>
<l-tile-layer
v-for="tileProvider in tileProviders"
Expand Down Expand Up @@ -70,11 +72,17 @@ import logo from "./assets/logo.svg";
</b-card-group>
</div>
<template #footer>
<div class="d-flex bg-dark text-light align-items-center px-3 py-2 w-100 justify-content-between">
<div
class="d-flex bg-dark text-light align-items-center px-3 py-2 w-100 justify-content-between"
>
<a href="https://github.com/Zoziologie/view-geojson/" target="_blank" title="github">
<b-icon-github style="color: white" />
</a>
<a href="https://zoziologie.raphaelnussbaumer.com/" target="_blank" title="zoziologie.com">
<a
href="https://zoziologie.raphaelnussbaumer.com/"
target="_blank"
title="zoziologie.com"
>
<b-img :src="logo" class="zozio" style="height: 1rem" />
</a>
</div>
Expand Down Expand Up @@ -149,7 +157,8 @@ export default {
{
name: "OpenStreetMap",
visible: false,
attribution: '&copy; <a target="_blank" href="http://osm.org/copyright">OpenStreetMap</a> contributors',
attribution:
'&copy; <a target="_blank" href="http://osm.org/copyright">OpenStreetMap</a> contributors',
url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
},
],
Expand Down Expand Up @@ -195,7 +204,11 @@ export default {
}, 500);
},
iconCreateFunction: function (cluster) {
var childCount = cluster.getAllChildMarkers().reduce((acc, x) => acc + x.options.count, 0);
var childCount = cluster
.getAllChildMarkers()
.map((x) => x.options.count)
.reduce((acc, x) => acc + (isNaN(x) ? 0 : x));
childCount = isNaN(childCount) ? "X" : childCount;
var c = " marker-cluster-";
if (childCount < 10) {
c += "small";
Expand All @@ -222,7 +235,7 @@ export default {
true ? "#5286bf" : "#ED7A25"
};}.cls-2{font-family:ArialMT, Arial;font-size:14.2px; fill:#fff;}</style></defs><g><path id="cls-${"1"}" d="M12.35,32.81c-.32,0-.8-.11-1.27-.66-2.97-3.44-5.33-6.7-7.21-9.96-1.43-2.49-2.36-4.61-2.91-6.66C.01,12.01,.54,8.71,2.52,5.74,4.22,3.21,6.6,1.55,9.6,.83c.42-.1,.86-.17,1.29-.23,.19-.03,.38-.06,.57-.09h1.67c.27,.03,.46,.06,.65,.09,.43,.06,.87,.13,1.29,.23,3.35,.83,5.92,2.79,7.64,5.83,.84,1.5,1.33,3.18,1.43,5.01,.15,2.57-.65,4.85-1.36,6.55-1.22,2.91-2.94,5.85-5.26,8.98-1.01,1.36-2.09,2.69-3.14,3.98l-.78,.97c-.45,.56-.93,.68-1.25,.68Z"/><path class="cls-1" d="M13.13,1c.61,.1,1.23,.17,1.83,.32,3.25,.8,5.69,2.69,7.32,5.59,.83,1.48,1.27,3.09,1.37,4.79,.13,2.23-.48,4.31-1.32,6.33-1.33,3.19-3.15,6.11-5.2,8.87-1.25,1.68-2.59,3.3-3.91,4.93-.27,.33-.57,.49-.87,.49s-.61-.16-.89-.49c-2.67-3.09-5.11-6.34-7.15-9.88-1.19-2.07-2.24-4.22-2.86-6.54-.9-3.35-.43-6.5,1.5-9.38,1.63-2.44,3.91-4.01,6.78-4.7,.6-.14,1.22-.21,1.83-.32h1.59m.08-1h-1.84c-.19,.05-.37,.07-.56,.1-.43,.07-.88,.13-1.33,.24C6.35,1.1,3.87,2.82,2.11,5.46,.04,8.56-.51,11.99,.48,15.66c.56,2.09,1.5,4.25,2.96,6.78,1.89,3.29,4.27,6.57,7.26,10.03,.6,.69,1.23,.84,1.65,.84,.61,0,1.19-.31,1.64-.86l.79-.97c1.05-1.29,2.13-2.62,3.15-3.99,2.35-3.16,4.09-6.13,5.32-9.08,.73-1.75,1.55-4.1,1.4-6.77-.11-1.9-.61-3.66-1.5-5.22-1.78-3.16-4.46-5.21-7.95-6.07-.45-.11-.9-.18-1.34-.24-.19-.03-.37-.06-.56-.09h-.08Z"/></g><text class="cls-2" transform="translate(${
s.count > 9 ? "4.44" : "8.39"
} 18.5)"><tspan x="0" y="0">${s.count}</tspan></text></svg>`,
} 18.5)"><tspan x="0" y="0">${isNaN(s.count) ? "X" : s.count}</tspan></text></svg>`,
});
},
},
Expand Down

0 comments on commit 8e12da0

Please sign in to comment.