diff --git a/src/public/app/widgets/type_widgets/geo_map.ts b/src/public/app/widgets/type_widgets/geo_map.ts index ee0f95b76..fdca64cbc 100644 --- a/src/public/app/widgets/type_widgets/geo_map.ts +++ b/src/public/app/widgets/type_widgets/geo_map.ts @@ -204,9 +204,7 @@ export default class GeoMapTypeWidget extends TypeWidget { const xmlResponse = await server.get(`notes/${note.noteId}/open`); const stringResponse = new XMLSerializer().serializeToString(xmlResponse); - const track = new this.L.GPX(stringResponse, { - - }); + const track = new this.L.GPX(stringResponse, {}); track.addTo(this.geoMapWidget.map); this.currentTrackData[note.noteId] = track; } @@ -219,15 +217,7 @@ export default class GeoMapTypeWidget extends TypeWidget { const [ lat, lng ] = latLng.split(",", 2).map((el) => parseFloat(el)); const L = this.L; - const icon = L.divIcon({ - html: `\ - - - - ${note.title}`, - iconSize: [ 25, 41 ], - iconAnchor: [ 12, 41 ] - }) + const icon = this.#buildIcon(note.getIcon(), note.title); const marker = L.marker(L.latLng(lat, lng), { icon, @@ -254,6 +244,18 @@ export default class GeoMapTypeWidget extends TypeWidget { this.currentMarkerData[note.noteId] = marker; } + #buildIcon(bxIconClass: string, title: string) { + return this.L.divIcon({ + html: `\ + + + + ${title}`, + iconSize: [ 25, 41 ], + iconAnchor: [ 12, 41 ] + }) + } + #changeState(newState: State) { this._state = newState; this.geoMapWidget.$container.toggleClass("placing-note", newState === State.NewNote);