Add Mapillary image load support, close #136

This commit is contained in:
Pieter Vander Vennet 2020-10-17 00:37:45 +02:00
parent 5e869479c1
commit 6a2b3d82de
6 changed files with 166 additions and 63 deletions

26
Logic/Web/Mapillary.ts Normal file
View file

@ -0,0 +1,26 @@
import $ from "jquery"
import {LicenseInfo} from "./Wikimedia";
export class Mapillary {
static getDescriptionOfImage(key: string,
handleDescription: ((license: LicenseInfo) => void)) {
const url = `https://a.mapillary.com/v3/images/${key}?client_id=TXhLaWthQ1d4RUg0czVxaTVoRjFJZzowNDczNjUzNmIyNTQyYzI2`
const settings = {
async: true,
type: 'GET',
url: url
};
$.getJSON(url, function(data) {
const license = new LicenseInfo();
license.artist = data.properties?.username;
license.licenseShortName = "CC BY-SA 4.0";
license.license = "Creative Commons Attribution-ShareAlike 4.0 International License";
license.attributionRequired = true;
handleDescription(license);
})
}
}