Skip to content

Commit

Permalink
style: improve display of signage on map
Browse files Browse the repository at this point in the history
  • Loading branch information
bastyen committed Jan 6, 2025
1 parent e6ce310 commit f7fd7e3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
14 changes: 14 additions & 0 deletions src/components/grw-map/grw-map.scss
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,20 @@
}
}

.signage-marker {
overflow: hidden;
border-radius: 0%;
img {
width: 30% !important;
}
.signage-name {
margin-left: 8px;
color: white;
white-space: nowrap;
max-width: 50%;
}
}

.parking-marker {
width: 100%;
height: 100%;
Expand Down
6 changes: 3 additions & 3 deletions src/components/grw-map/grw-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2450,12 +2450,12 @@ export class GrwMap {
}

this.currentSignagesLayer = L.geoJSON(currentSignagesFeatureCollection, {
pointToLayer: (_geoJsonPoint, latlng) =>
pointToLayer: (geoJsonPoint, latlng) =>
L.marker(latlng, {
icon: L.divIcon({
html: `<div part="signage-marker" class="signage-marker"><img src=${signageImageSrc} /></div>`,
html: `<div part="signage-marker" class="signage-marker"><img src=${signageImageSrc} /><div part="signage-name" class="signage-name">${geoJsonPoint.properties.name}</div></div>`,
className: '',
iconSize: this.commonMarkerSize,
iconSize: [this.commonMarkerSize * 1.2, this.commonMarkerSize * 0.8],
} as any),
autoPanOnFocus: false,
} as any),
Expand Down
2 changes: 1 addition & 1 deletion src/services/treks.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ export function getSources(api, language, init) {
}

export function getSignages(api, language, trekId, init) {
return fetch(`${api}signage/?language=${language}&near_trek=${trekId}&fields=id,geometry,name`, init);
return fetch(`${api}signage/?language=${language}&near_trek=${trekId}&fields=id,geometry,name&published=true&page_size=999`, init);
}

0 comments on commit f7fd7e3

Please sign in to comment.