@dative-gpi/foundation-shared-components 0.0.213 → 0.0.214

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/utils/index.ts CHANGED
@@ -3,6 +3,7 @@ export * from "./css";
3
3
  export * from "./error";
4
4
  export * from "./gradient";
5
5
  export * from "./icons";
6
+ export * from "./leafletMarkers"
6
7
  export * from "./levenshtein";
7
8
  export * from "./lexical";
8
9
  export * from "./sort";
@@ -0,0 +1,42 @@
1
+ import L from 'leaflet';
2
+
3
+ export const locationMarker = (icon: string, color: string, size = 36) => {
4
+ const iconHtml = `
5
+ <div style="--fs-map-mylocation-pin-color-alpha:${color}50;--fs-map-location-pin-color: ${color}">
6
+ <div class="fs-map-location-pin">
7
+ <i class="${icon} mdi v-icon notranslate v-theme--DefaultTheme fs-icon" aria-hidden="true" style="--fs-icon-font-size: 22px;" />
8
+ </div>
9
+ </div>`;
10
+
11
+ return L.divIcon({
12
+ html: iconHtml,
13
+ iconSize: [size, size],
14
+ className: 'fs-map-location',
15
+ iconAnchor: [size / 2, size / 2],
16
+ });
17
+ }
18
+
19
+ export const clusterMarker = (label: string, size = 36) => {
20
+ const iconHtml = `
21
+ <div class="fs-map-cluster">
22
+ <span>${label}</span>
23
+ </div>`;
24
+
25
+ return L.divIcon({
26
+ html: iconHtml,
27
+ className: 'fs-map-location fs-map-location-full',
28
+ iconSize: [size, size],
29
+ iconAnchor: [size / 2, size / 2],
30
+ })
31
+ }
32
+
33
+ export const myLocationMarker = (size = 16) => {
34
+ const iconHtml = `<div class="fs-map-mylocation-pin" />`;
35
+
36
+ return L.divIcon({
37
+ html: iconHtml,
38
+ className: 'fs-map-mylocation',
39
+ iconSize: [size, size],
40
+ iconAnchor: [size / 2, size / 2],
41
+ });
42
+ }
Binary file