Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shows Favorites on NC25 Fixes #866 #909

Merged
merged 1 commit into from
Dec 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions src/components/map/FavoritesLayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,11 @@ export default {
const icons = {}
Object.keys(this.categories).forEach((catid) => {
const color = this.categories[catid].color
const iconUrl = OCA.Accessibility?.theme === 'dark'
? generateUrl('/svg/maps/star-circle-black') + '?color=' + color
: generateUrl('/svg/maps/star-circle-white') + '?color=' + color
icons[catid] = L.divIcon({
iconAnchor: [18, 18],
className: 'leaflet-marker-favorite',
// html: '<div class="favoriteMarker ' + darkClass + '" style="background-color: #' + color + '"></div>',
html: '<div class="favoriteMarker" style="background-image: url(' + iconUrl + ');"></div>',
html: '<div class="favoriteMarker icon-star-white" style="background-color: #' + color + ';"></div>',
})
})
return icons
Expand All @@ -127,14 +124,11 @@ export default {
const icons = {}
Object.keys(this.categories).forEach((catid) => {
const color = this.categories[catid].color
const iconUrl = OCA.Accessibility?.theme === 'dark'
? generateUrl('/svg/maps/star-circle-black') + '?color=' + color
: generateUrl('/svg/maps/star-circle-white') + '?color=' + color
icons[catid] = L.divIcon({
iconAnchor: [18, 18],
className: 'leaflet-marker-favorite',
// html: '<div class="favoriteMarker ' + darkClass + '" style="background-color: #' + color + '"></div>',
html: '<div class="favoriteMarker selected" style="background-image: url(' + iconUrl + ');"></div>',
html: '<div class="favoriteMarker selected icon-star-white" style="background-color: #' + color + ';"></div>',
})
})
return icons
Expand Down Expand Up @@ -182,13 +176,10 @@ export default {
const catid = favorite.category
const color = this.categories[catid].color
const label = cluster.getChildCount()
const iconUrl = OCA.Accessibility?.theme === 'dark'
? generateUrl('/svg/maps/star-circle-black') + '?color=' + color
: generateUrl('/svg/maps/star-circle-white') + '?color=' + color
return new L.DivIcon(L.extend({
className: 'leaflet-marker-favorite-cluster cluster-marker',
// html: '<div class="favoriteClusterMarker ' + darkClass + '" style="background-color: #' + color + '"></div>'
html: '<div class="favoriteClusterMarker" style="background-image: url(' + iconUrl + ');"></div>'
html: '<div class="favoriteClusterMarker icon-star-white" style="background-color: #' + color + ';"></div>'
+ '​<span class="label">' + label + '</span>',
}, cluster, {
iconSize: [CLUSTER_MARKER_VIEW_SIZE, CLUSTER_MARKER_VIEW_SIZE],
Expand All @@ -215,5 +206,5 @@ export default {
</script>

<style lang="scss" scoped>
// nothing

</style>
1 change: 1 addition & 0 deletions src/views/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1772,4 +1772,5 @@ export default {
background: url('../../img/star-black.svg') no-repeat 50% 50%;
border-radius: 50%;
}

</style>