@dative-gpi/foundation-shared-components 0.0.216 → 0.0.218

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.
@@ -137,7 +137,7 @@ import "leaflet.markercluster";
137
137
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
138
138
  import { type Address, type FSArea } from '@dative-gpi/foundation-shared-domain/models';
139
139
 
140
- import { clusterMarker, locationMarker, myLocationMarker } from "../../utils";
140
+ import { clusterMarkerHtml, locationMarkerHtml, myLocationMarkerHtml } from "../../utils";
141
141
  import { ColorEnum, type FSLocation, type MapLayer } from "../../models";
142
142
  import { useColors, useAddress, useBreakpoints } from "../../composables";
143
143
 
@@ -323,7 +323,13 @@ export default defineComponent({
323
323
  const displayLocations = () => {
324
324
  markerLayerGroup.clearLayers();
325
325
  innerModelValue.value.forEach((location) => {
326
- const icon = locationMarker(location.icon, getColors(location.color).base, L);
326
+ const size = 36;
327
+ const icon = L.divIcon({
328
+ html: locationMarkerHtml(location.icon, getColors(location.color).base),
329
+ iconSize: [size, size],
330
+ className: 'fs-map-location',
331
+ iconAnchor: [size / 2, size / 2],
332
+ });
327
333
  const marker = LL.marker([location.address.latitude, location.address.longitude], { icon }).addTo(markerLayerGroup);
328
334
  markers[location.id] = marker;
329
335
  marker.on('click', () => emit('update:selectedLocationId', location.id));
@@ -369,7 +375,13 @@ export default defineComponent({
369
375
  showCoverageOnHover: false,
370
376
  disableClusteringAtZoom: 17,
371
377
  iconCreateFunction: function (cluster: any) {
372
- return clusterMarker(cluster.getChildCount(), L);
378
+ const size = 36;
379
+ return L.divIcon({
380
+ html: clusterMarkerHtml(cluster.getChildCount()),
381
+ className: 'fs-map-location fs-map-location-full',
382
+ iconSize: [size, size],
383
+ iconAnchor: [size / 2, size / 2],
384
+ });
373
385
  }
374
386
  });
375
387
  }
@@ -448,7 +460,13 @@ export default defineComponent({
448
460
  map.locate();
449
461
  map.on('locationfound', (e: L.LocationEvent) => {
450
462
  map.panTo(calculateTargetPosition(e.latlng));
451
- const icon = myLocationMarker(L);
463
+ const size= 16;
464
+ const icon = L.divIcon({
465
+ html: myLocationMarkerHtml(L),
466
+ className: 'fs-map-mylocation',
467
+ iconSize: [size, size],
468
+ iconAnchor: [size / 2, size / 2],
469
+ });
452
470
  myLocationLayerGroup.clearLayers();
453
471
  LL.marker(e.latlng, { icon }).addTo(myLocationLayerGroup);
454
472
  });
@@ -505,7 +523,7 @@ export default defineComponent({
505
523
  if (entry.target.id === `left-overlay-${mapId}`) {
506
524
  leftOverlayWidth.value = entry.contentRect.width;
507
525
  }
508
- if(entry.target.id === `left-overlay-mobile-${mapId}`) {
526
+ if (entry.target.id === `left-overlay-mobile-${mapId}`) {
509
527
  leftOverlayHeight.value = entry.contentRect.height;
510
528
  }
511
529
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-shared-components",
3
3
  "sideEffects": false,
4
- "version": "0.0.216",
4
+ "version": "0.0.218",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,8 +10,8 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-shared-domain": "0.0.216",
14
- "@dative-gpi/foundation-shared-services": "0.0.216"
13
+ "@dative-gpi/foundation-shared-domain": "0.0.218",
14
+ "@dative-gpi/foundation-shared-services": "0.0.218"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "@dative-gpi/bones-ui": "^0.0.75",
@@ -35,5 +35,5 @@
35
35
  "sass": "1.71.1",
36
36
  "sass-loader": "13.3.2"
37
37
  },
38
- "gitHead": "f4cd126d13779ae55d565f2b11efd30f338757f3"
38
+ "gitHead": "acf47fef8b7fea244ba21efefb07251c976eef22"
39
39
  }
@@ -1,38 +1,23 @@
1
- export const locationMarker = (icon: string, color: string, L: any, size = 36) => {
1
+ export const locationMarkerHtml = (icon: string, color: string) => {
2
2
  const iconHtml = `
3
3
  <div style="--fs-map-mylocation-pin-color-alpha:${color}50;--fs-map-location-pin-color: ${color}">
4
4
  <i class="${icon} mdi notranslate v-theme--DefaultTheme fs-icon" aria-hidden="true" style="--fs-icon-font-size: 22px;" />
5
5
  </div>`;
6
6
 
7
- return L.divIcon({
8
- html: iconHtml,
9
- iconSize: [size, size],
10
- className: 'fs-map-location',
11
- iconAnchor: [size / 2, size / 2],
12
- });
7
+ return iconHtml;
13
8
  }
14
9
 
15
- export const clusterMarker = (label: string, L: any, size = 36) => {
10
+ export const clusterMarkerHtml = (label: string) => {
16
11
  const iconHtml = `
17
12
  <div class="fs-map-cluster">
18
13
  <span>${label}</span>
19
14
  </div>`;
20
15
 
21
- return L.divIcon({
22
- html: iconHtml,
23
- className: 'fs-map-location fs-map-location-full',
24
- iconSize: [size, size],
25
- iconAnchor: [size / 2, size / 2],
26
- })
16
+ return iconHtml;
27
17
  }
28
18
 
29
- export const myLocationMarker = (L: any, size = 16) => {
19
+ export const myLocationMarkerHtml = () => {
30
20
  const iconHtml = `<div class="fs-map-mylocation-pin" />`;
31
21
 
32
- return L.divIcon({
33
- html: iconHtml,
34
- className: 'fs-map-mylocation',
35
- iconSize: [size, size],
36
- iconAnchor: [size / 2, size / 2],
37
- });
22
+ return iconHtml;
38
23
  }