forked from MapComplete/MapComplete
		
	Add link to wikipedia-image in the attribution box, fix #1049
This commit is contained in:
		
							parent
							
								
									efd1f5467b
								
							
						
					
					
						commit
						c09b437d9a
					
				
					 3 changed files with 16 additions and 3 deletions
				
			
		|  | @ -8,4 +8,5 @@ export class LicenseInfo { | |||
|     copyrighted: boolean = false; | ||||
|     credit: string = ""; | ||||
|     description: string = ""; | ||||
|     informationLocation: URL = undefined | ||||
| } | ||||
|  | @ -129,7 +129,7 @@ export class WikimediaImageProvider extends ImageProvider { | |||
|         if (pageInfo === undefined) { | ||||
|             return undefined; | ||||
|         } | ||||
| 
 | ||||
|          | ||||
|         const license = (pageInfo.imageinfo ?? [])[0]?.extmetadata; | ||||
|         if (license === undefined) { | ||||
|             console.warn("The file", filename, "has no usable metedata or license attached... Please fix the license info file yourself!") | ||||
|  | @ -153,6 +153,7 @@ export class WikimediaImageProvider extends ImageProvider { | |||
|         licenseInfo.licenseShortName = license.LicenseShortName?.value; | ||||
|         licenseInfo.credit = license.Credit?.value; | ||||
|         licenseInfo.description = license.ImageDescription?.value; | ||||
|         licenseInfo.informationLocation = new URL("https://en.wikipedia.org/wiki/"+pageInfo.title) | ||||
|         return licenseInfo; | ||||
| 
 | ||||
|     } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue