mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 04:16:17 +01:00 
			
		
		
		
	fix(geomap): missing start/end icons + add customization
This commit is contained in:
		@@ -232,7 +232,12 @@ export default class GeoMapTypeWidget extends TypeWidget {
 | 
				
			|||||||
            stringResponse = xmlResponse;
 | 
					            stringResponse = xmlResponse;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const track = new this.L.GPX(stringResponse, {});
 | 
					        const track = new this.L.GPX(stringResponse, {
 | 
				
			||||||
 | 
					            markers: {
 | 
				
			||||||
 | 
					                startIcon: this.#buildIcon(note.getIcon(), note.getColorClass(), note.title),
 | 
				
			||||||
 | 
					                endIcon: this.#buildIcon("bxs-flag-checkered")
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
        track.addTo(this.geoMapWidget.map);
 | 
					        track.addTo(this.geoMapWidget.map);
 | 
				
			||||||
        this.currentTrackData[note.noteId] = track;
 | 
					        this.currentTrackData[note.noteId] = track;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -280,13 +285,13 @@ export default class GeoMapTypeWidget extends TypeWidget {
 | 
				
			|||||||
        this.currentMarkerData[note.noteId] = marker;
 | 
					        this.currentMarkerData[note.noteId] = marker;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    #buildIcon(bxIconClass: string, colorClass: string, title: string) {
 | 
					    #buildIcon(bxIconClass: string, colorClass?: string, title?: string) {
 | 
				
			||||||
        return this.L.divIcon({
 | 
					        return this.L.divIcon({
 | 
				
			||||||
            html: /*html*/`\
 | 
					            html: /*html*/`\
 | 
				
			||||||
                <img class="icon" src="${markerIcon}" />
 | 
					                <img class="icon" src="${markerIcon}" />
 | 
				
			||||||
                <img class="icon-shadow" src="${markerIconShadow}" />
 | 
					                <img class="icon-shadow" src="${markerIconShadow}" />
 | 
				
			||||||
                <span class="bx ${bxIconClass} ${colorClass}"></span>
 | 
					                <span class="bx ${bxIconClass} ${colorClass ?? ""}"></span>
 | 
				
			||||||
                <span class="title-label">${title}</span>`,
 | 
					                <span class="title-label">${title ?? ""}</span>`,
 | 
				
			||||||
            iconSize: [25, 41],
 | 
					            iconSize: [25, 41],
 | 
				
			||||||
            iconAnchor: [12, 41]
 | 
					            iconAnchor: [12, 41]
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user