\n
${toTitle(\n model\n )}\n
\n
${model.address.street} ${\n model.address.houseNumber\n } ${toLevel(parseFloat(model.address.level), t)}
\n
${model.address.postcode}\n
${model.address.locality}\n
\n
\n ${\n !attributesGenerator.empty(tags, value, {} as M, t)\n ? `\n
\n ${attributesGenerator.render(t, tags, value, {} as M)}`\n : ``\n }\n
\n ${\n model.opening\n ? `
${toOpenOrClose(model.opening, t)}
`\n : ``\n }\n ${\n model.seasonal\n ? `
${toSeasonal(model.seasonal, t)}
`\n : ``\n }\n ${model.conditionalFee ? `
${t(\"conditionalFee\")}
` : ``}\n
\n ${\n model.img || model.wikipedia.image\n ? `\n
\n
`\n : ``\n }\n
\n
\n ${generateHtmlDescription(model)}\n
\n
\n ${\n !linksGenerator.empty(tags, value, {}, t)\n ? `\n
\n ${linksGenerator.render(t, tags, value, {})}`\n : ``\n }\n
\n
\n
\n ${t(\"documentation\")}
\n ${e.type} ${e.id}\n \n ${renderTags(tags, t(\"code\"))}\n
\n \n
`\n );\n\n const info = getQueryParams()[\"info\"];\n const share = contentElement.querySelector(\".share\") as HTMLLinkElement;\n share.addEventListener(\"click\", function (e) {\n e.preventDefault();\n shareLink(\n `${window.location.origin}${window.location.pathname}?${\n !single ? `offers=${group}/${value}&` : \"\"\n }location=${model.address.latitude},${model.address.longitude}${\n info ? `&info=${info}` : ``\n }`,\n share,\n t(\"linkCopied\"),\n toTitle(model),\n model.description ||\n model.wikipedia.summary ||\n model.wikimediaDescription\n );\n });\n const popup = L.popup({\n minWidth: 200,\n autoPanPaddingTopLeft: [10, 85],\n autoPanPaddingBottomRight: [10, 10],\n }).setContent(() => {\n if (!isLoaded) {\n isLoaded = true;\n const img = contentElement.querySelector(\n \".img\"\n ) as HTMLImageElement;\n if (img) img.src = img.getAttribute(\"dynamic-src\") || img.src;\n {\n // Enrich Address\n getJson(\"https://nominatim.openstreetmap.org/reverse\", {\n format: \"json\",\n addressdetails: \"1\",\n namedetails: \"1\",\n lat: pos.lat,\n lon: pos.lng,\n }).then((result) => {\n model.address.name = extractName(result.namedetails, t(\"code\"));\n model.address.postcode =\n model.address.postcode || result.address.postcode || \"\";\n model.address.locality =\n model.address.locality ||\n extractLocality(result.address) ||\n \"\";\n if (!model.address.street) {\n model.address.street = extractStreet(result, t(\"code\")) || \"\";\n model.address.houseNumber =\n model.address.houseNumber ||\n result.address.house_number ||\n \"\";\n }\n const name = getHtmlElement(\".name\", contentElement);\n name.innerHTML = toTitle(model);\n name.title = toTitle(model);\n getHtmlElement(\n \".street-address\",\n contentElement\n ).innerHTML = `${model.address.street} ${\n model.address.houseNumber\n } ${toLevel(parseFloat(model.address.level), t)}`;\n getHtmlElement(\".postal-code\", contentElement).innerHTML =\n model.address.postcode;\n getHtmlElement(\".region\", contentElement).innerHTML =\n model.address.locality;\n popup.update();\n });\n }\n {\n // Enrich Data\n const qid = tags.wikidata || tags[\"species:wikidata\"];\n\n if (qid)\n getJson(\"https://www.wikidata.org/w/api.php\", {\n format: \"json\",\n action: \"wbgetentities\",\n formatversion: \"2\",\n ids: qid,\n props: \"labels|descriptions|claims|sitelinks\",\n sitefilter: t(\"code\") + \"wiki\",\n languages: t(\"code\"),\n languagefallback: \"0\",\n origin: \"*\",\n }).then(async (r) => {\n if (r && r.error) return;\n if (!r.entities[qid]) return;\n const entity = r.entities[qid];\n let i;\n let description;\n if (\n entity.descriptions &&\n Object.keys(entity.descriptions).length > 0\n ) {\n description =\n entity.descriptions[Object.keys(entity.descriptions)[0]]\n .value;\n }\n let label;\n if (entity.labels && Object.keys(entity.labels).length > 0) {\n label = entity.labels[Object.keys(entity.labels)[0]].value;\n }\n const result: {\n title: string;\n description: string;\n imageURL?: string;\n wiki?: {\n title: string;\n url: string;\n };\n } = {\n title: label,\n description: description,\n };\n // add image\n if (entity.claims) {\n const imageroot =\n \"https://commons.wikimedia.org/w/index.php\";\n const props = [\"P154\", \"P18\"]; // logo image, image\n let prop;\n let image;\n for (i = 0; i < props.length; i++) {\n prop = entity.claims[props[i]];\n if (prop && Object.keys(prop).length > 0) {\n image =\n prop[Object.keys(prop)[0]].mainsnak.datavalue.value;\n if (image) {\n result.imageURL = `${imageroot}?${utilQsString({\n title: \"Special:Redirect/file/\" + image,\n width: 300,\n })}`;\n }\n break;\n }\n }\n }\n if (entity.sitelinks) {\n // check each, in order of preference\n const w = t(\"code\") + \"wiki\";\n if (entity.sitelinks[w]) {\n const title = entity.sitelinks[w].title || \"\";\n const url = `https://${t(\n \"code\"\n )}.wikipedia.org/wiki/${title.replace(/ /g, \"_\")}`;\n result.wiki = {\n title: title,\n url: url,\n };\n loadWikipediaSummary(title, t(\"code\")).then(\n (wikipedia) => {\n model.wikipedia = wikipedia;\n\n getHtmlElement(\n \".description\",\n contentElement\n ).innerHTML = generateHtmlDescription(model);\n popup.update();\n }\n );\n }\n }\n model.name =\n model.name ||\n result.title ||\n (result.wiki && result.wiki.title);\n model.wikimediaDescription = result.description;\n model.img =\n model.img || model.wikipedia.image || result.imageURL || \"\";\n getHtmlElement(\".name\", contentElement).innerHTML =\n toTitle(model);\n getHtmlElement(\".name\", contentElement).title =\n toTitle(model);\n getHtmlElement(\".description\", contentElement).innerHTML =\n generateHtmlDescription(model);\n getHtmlElement(\".img-container\", contentElement).innerHTML =\n model.img || model.wikipedia.image\n ? `