From b1ea98651592a1cb88416f99a43b6ebddc2fa445 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Mon, 22 Aug 2022 22:58:14 +0200 Subject: [PATCH] More work --- UI/BigComponents/PlantNetSpeciesSearch.ts | 9 +++++---- langs/en.json | 9 ++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/UI/BigComponents/PlantNetSpeciesSearch.ts b/UI/BigComponents/PlantNetSpeciesSearch.ts index f1b2ba434..f5bae3b11 100644 --- a/UI/BigComponents/PlantNetSpeciesSearch.ts +++ b/UI/BigComponents/PlantNetSpeciesSearch.ts @@ -25,15 +25,16 @@ export default class PlantNetSpeciesSearch extends VariableUiElement { if (images.length === 0) { return null } - return new UIEventSource({success: PlantNet.exampleResultPrunus}) /*/ UIEventSource.FromPromiseWithErr(PlantNet.query(images.slice(0,5))); //*/ + return UIEventSource.FromPromiseWithErr(PlantNet.query(images.slice(0,5))); }) .map(result => { + if (result === null) { + return t.takeImages + } if (result === undefined) { return new Loading(t.querying.Subs(images.data)) } - if (result === null) { - return t.takeImages - } + if (result["error"] !== undefined) { return t.error.Subs(result).SetClass("alert") } diff --git a/langs/en.json b/langs/en.json index 88b694808..cac8bdc2c 100644 --- a/langs/en.json +++ b/langs/en.json @@ -694,7 +694,14 @@ "overviewVerify": "Please verify that correct species and link it to the tree", "querying": "Querying plantnet.org with {length} images", "seeInfo": "See more information about the species", - "takeImages": "Take images of the tree to automatically detect the tree type" + "takeImages": "Take images of the tree to automatically detect the tree type", + "howTo":{ + "intro": "For optimal results,", + "li0": "take a picture which show the tree in the center without much background", + "li1": "take a picture which shows a single leaf", + "li2": "take a picture which shows the bark", + "li3": "take a picture of the flowers" + } }, "privacy": { "editing": "When you make a change to the map, this change is recorded on OpenStreetMap and is publicly available to anyone. A changeset made with MapComplete includes the following data: Please refer to the privacy policy on OpenStreetMap.org for detailed information. We'd like to remind you that you can use a fictional name when signing up.",