mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-30 18:05:55 +01:00 
			
		
		
		
	refactor(geomap): use webpack for importing marker icon (closes #1628)
This commit is contained in:
		
							
								
								
									
										4
									
								
								src/public/app/types-assets.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								src/public/app/types-assets.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | |||||||
|  | declare module "*.png" { | ||||||
|  |     var path: string; | ||||||
|  |     export default path; | ||||||
|  | } | ||||||
| @@ -8,12 +8,14 @@ import dialogService from "../../services/dialog.js"; | |||||||
| import type { EventData } from "../../components/app_context.js"; | import type { EventData } from "../../components/app_context.js"; | ||||||
| import { t } from "../../services/i18n.js"; | import { t } from "../../services/i18n.js"; | ||||||
| import attributes from "../../services/attributes.js"; | import attributes from "../../services/attributes.js"; | ||||||
| import asset_path from "../../../../services/asset_path.js"; |  | ||||||
| import openContextMenu from "./geo_map_context_menu.js"; | import openContextMenu from "./geo_map_context_menu.js"; | ||||||
| import link from "../../services/link.js"; | import link from "../../services/link.js"; | ||||||
| import note_tooltip from "../../services/note_tooltip.js"; | import note_tooltip from "../../services/note_tooltip.js"; | ||||||
| import appContext from "../../components/app_context.js"; | import appContext from "../../components/app_context.js"; | ||||||
|  |  | ||||||
|  | import markerIcon from "leaflet/dist/images/marker-icon.png"; | ||||||
|  | import markerIconShadow from "leaflet/dist/images/marker-shadow.png"; | ||||||
|  |  | ||||||
| const TPL = /*html*/`\ | const TPL = /*html*/`\ | ||||||
| <div class="note-detail-geo-map note-detail-printable"> | <div class="note-detail-geo-map note-detail-printable"> | ||||||
|     <style> |     <style> | ||||||
| @@ -259,9 +261,9 @@ export default class GeoMapTypeWidget extends TypeWidget { | |||||||
|  |  | ||||||
|     #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*/`\ | ||||||
|                 <img class="icon" src="${asset_path}/app-dist/leaflet/images/marker-icon.png" /> |                 <img class="icon" src="${markerIcon}" /> | ||||||
|                 <img class="icon-shadow" src="${asset_path}/app-dist/leaflet/images/marker-shadow.png" /> |                 <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], | ||||||
|   | |||||||
| @@ -34,11 +34,6 @@ const config: Configuration = { | |||||||
|                     context: "node_modules/@excalidraw/excalidraw/dist/prod/fonts/", |                     context: "node_modules/@excalidraw/excalidraw/dist/prod/fonts/", | ||||||
|                     from: "**/*", |                     from: "**/*", | ||||||
|                     to: "excalidraw/fonts/" |                     to: "excalidraw/fonts/" | ||||||
|                 }, |  | ||||||
|                 { |  | ||||||
|                     context: "node_modules/leaflet/dist/images/", |  | ||||||
|                     from: "**/*", |  | ||||||
|                     to: "leaflet/images/" |  | ||||||
|                 } |                 } | ||||||
|             ] |             ] | ||||||
|         }) |         }) | ||||||
| @@ -108,6 +103,10 @@ const config: Configuration = { | |||||||
|                         loader: "sass-loader" |                         loader: "sass-loader" | ||||||
|                     } |                     } | ||||||
|                 ] |                 ] | ||||||
|  |             }, | ||||||
|  |             { | ||||||
|  |                 test: /\.(png)$/i, | ||||||
|  |                 type: 'asset/resource' | ||||||
|             } |             } | ||||||
|         ] |         ] | ||||||
|     }, |     }, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user