diff --git a/angular.json b/angular.json index fee2ce7..9477cd0 100644 --- a/angular.json +++ b/angular.json @@ -18,13 +18,22 @@ "browser": "src/main.ts", "polyfills": ["zone.js"], "tsConfig": "tsconfig.app.json", + "allowedCommonJsDependencies": ["leaflet"], "assets": [ { "glob": "**/*", "input": "public" + }, + { + "glob": "**/*", + "input": "node_modules/leaflet/dist/images/", + "output": "assets/images/" } ], - "styles": ["src/styles.css"], + "styles": [ + "src/styles.css", + "node_modules/leaflet/dist/leaflet.css" + ], "scripts": [ "node_modules/flowbite/dist/flowbite.min.js", "node_modules/leaflet/dist/leaflet.js" @@ -35,13 +44,13 @@ "budgets": [ { "type": "initial", - "maximumWarning": "500kB", - "maximumError": "1MB" + "maximumWarning": "500kb", + "maximumError": "1mb" }, { "type": "anyComponentStyle", - "maximumWarning": "4kB", - "maximumError": "8kB" + "maximumWarning": "2kb", + "maximumError": "4kb" } ], "outputHashing": "all", @@ -85,6 +94,11 @@ { "glob": "**/*", "input": "public" + }, + { + "glob": "**/*", + "input": "./node_modules/leaflet/dist/images", + "output": "./assets" } ], "styles": ["src/styles.css"], diff --git a/public/icons/icon-128x128.png b/public/icons/icon-128x128.png index 95a4187..badfb19 100644 Binary files a/public/icons/icon-128x128.png and b/public/icons/icon-128x128.png differ diff --git a/public/icons/icon-144x144.png b/public/icons/icon-144x144.png index 00c4cd4..95070b0 100644 Binary files a/public/icons/icon-144x144.png and b/public/icons/icon-144x144.png differ diff --git a/public/icons/icon-152x152.png b/public/icons/icon-152x152.png index b9bf3b5..3a50e4a 100644 Binary files a/public/icons/icon-152x152.png and b/public/icons/icon-152x152.png differ diff --git a/public/icons/icon-192x192.png b/public/icons/icon-192x192.png index 1df51b1..1c582e9 100644 Binary files a/public/icons/icon-192x192.png and b/public/icons/icon-192x192.png differ diff --git a/public/icons/icon-384x384.png b/public/icons/icon-384x384.png index 87c9f6a..59608b9 100644 Binary files a/public/icons/icon-384x384.png and b/public/icons/icon-384x384.png differ diff --git a/public/icons/icon-512x512.png b/public/icons/icon-512x512.png index 1f7e491..1f5b1eb 100644 Binary files a/public/icons/icon-512x512.png and b/public/icons/icon-512x512.png differ diff --git a/public/icons/icon-72x72.png b/public/icons/icon-72x72.png index 2c646b8..33e0667 100644 Binary files a/public/icons/icon-72x72.png and b/public/icons/icon-72x72.png differ diff --git a/public/icons/icon-96x96.png b/public/icons/icon-96x96.png index 465bad8..af7d00c 100644 Binary files a/public/icons/icon-96x96.png and b/public/icons/icon-96x96.png differ diff --git a/public/manifest.webmanifest b/public/manifest.webmanifest index 1b26054..7a34aa7 100644 --- a/public/manifest.webmanifest +++ b/public/manifest.webmanifest @@ -1,8 +1,8 @@ { "name": "Memory Map", "short_name": "Memory Map", - "theme_color": "#1976d2", - "background_color": "#fafafa", + "theme_color": "#111827", + "background_color": "#FFFFFF", "display": "standalone", "scope": "./", "start_url": "./", @@ -11,49 +11,57 @@ "src": "icons/icon-72x72.png", "sizes": "72x72", "type": "image/png", - "purpose": "maskable any" + "purpose": "maskable any", + "background_color": "#FFFFFF" }, { "src": "icons/icon-96x96.png", "sizes": "96x96", "type": "image/png", - "purpose": "maskable any" + "purpose": "maskable any", + "background_color": "#FFFFFF" }, { "src": "icons/icon-128x128.png", "sizes": "128x128", "type": "image/png", - "purpose": "maskable any" + "purpose": "maskable any", + "background_color": "#FFFFFF" }, { "src": "icons/icon-144x144.png", "sizes": "144x144", "type": "image/png", - "purpose": "maskable any" + "purpose": "maskable any", + "background_color": "#FFFFFF" }, { "src": "icons/icon-152x152.png", "sizes": "152x152", "type": "image/png", - "purpose": "maskable any" + "purpose": "maskable any", + "background_color": "#FFFFFF" }, { "src": "icons/icon-192x192.png", "sizes": "192x192", "type": "image/png", - "purpose": "maskable any" + "purpose": "maskable any", + "background_color": "#FFFFFF" }, { "src": "icons/icon-384x384.png", "sizes": "384x384", "type": "image/png", - "purpose": "maskable any" + "purpose": "maskable any", + "background_color": "#FFFFFF" }, { "src": "icons/icon-512x512.png", "sizes": "512x512", "type": "image/png", - "purpose": "maskable any" + "purpose": "maskable any", + "background_color": "#FFFFFF" } ] } diff --git a/src/app/components/confirm-modal/confirm-modal.component.html b/src/app/components/confirm-modal/confirm-modal.component.html index bf51305..c5f590d 100644 --- a/src/app/components/confirm-modal/confirm-modal.component.html +++ b/src/app/components/confirm-modal/confirm-modal.component.html @@ -11,7 +11,7 @@
-
+
{ - // console.log('getExifData(file)'); - // return new Promise((resolve, reject) => { - // console.log('getExifData(file) -> Promise'); - // const reader = new FileReader(); - // console.log('getExifData(file) -> Promise -> reader'); - // reader.onload = (event: any) => { - // console.log('getExifData(file) -> Promise -> reader -> onload'); - // EXIF.getData(event.target.result, function() { - // console.log('getExifData(file) -> Promise -> reader -> onload -> EXIF.getData'); - // const allExifData = EXIF.getAllTags(this); - // console.log('getExifData(file) -> Promise -> reader -> onload -> EXIF.getData -> getAllTags'); - // resolve(allExifData); - // }); - // }; - // reader.onerror = (error) => reject(error); - // reader.readAsArrayBuffer(file); - // }); return exifr.parse(file); } @@ -32,7 +14,7 @@ export class ExifService { return await this.getExifData(file); } catch (error) { console.error('Error reading EXIF data:', error); - return + return; } } @@ -56,12 +38,21 @@ export class ExifService { } } - async getLocation(file: File): Promise<{ latitude?: number; longitude?: number }> { + async getLocation( + file: File + ): Promise<{ latitude?: number; longitude?: number }> { try { const exifData = await this.getExifData(file); return { - latitude: exifData.GPSLatitude ? this.convertToDecimal(exifData.GPSLatitude, exifData.GPSLatitudeRef) : undefined, - longitude: exifData.GPSLongitude ? this.convertToDecimal(exifData.GPSLongitude, exifData.GPSLongitudeRef) : undefined + latitude: exifData.GPSLatitude + ? this.convertToDecimal(exifData.GPSLatitude, exifData.GPSLatitudeRef) + : undefined, + longitude: exifData.GPSLongitude + ? this.convertToDecimal( + exifData.GPSLongitude, + exifData.GPSLongitudeRef + ) + : undefined, }; } catch (error) { console.error('Error reading EXIF data:', error); @@ -82,6 +73,6 @@ export class ExifService { private convertToDecimal(coordinate: number[], direction: string): number { if (!coordinate || coordinate.length !== 3) return NaN; const decimal = coordinate[0] + coordinate[1] / 60 + coordinate[2] / 3600; - return (direction === 'S' || direction === 'W') ? -decimal : decimal; + return direction === 'S' || direction === 'W' ? -decimal : decimal; } } diff --git a/src/index.html b/src/index.html index eb386f5..022c205 100644 --- a/src/index.html +++ b/src/index.html @@ -7,9 +7,9 @@ - + - + diff --git a/src/styles.css b/src/styles.css index 2135bf0..e5453bc 100644 --- a/src/styles.css +++ b/src/styles.css @@ -10,3 +10,15 @@ .leaflet-control-zoom a { @apply dark:!bg-gray-900 dark:!text-white !rounded-md m-1 dark:hover:!bg-gray-700 bg-white hover:bg-gray-200 !border-none !shadow-none; } + +/* Fix Leaflet image paths */ +.leaflet-control-layers-toggle { + background-image: url(/assets/images/layers.png); +} + +@media only screen and (-webkit-min-device-pixel-ratio: 2), + only screen and (min-resolution: 192dpi) { + .leaflet-control-layers-toggle { + background-image: url(/assets/images/layers-2x.png); + } +}