forked from MapComplete/MapComplete
UX: add 'show nearby picture' in new point popup
This commit is contained in:
parent
d56cf56511
commit
dad9bb1349
8 changed files with 37 additions and 24 deletions
|
@ -188,7 +188,7 @@
|
||||||
"tagRenderings": [
|
"tagRenderings": [
|
||||||
{
|
{
|
||||||
"id": "add_new",
|
"id": "add_new",
|
||||||
"classes": "h-full flex special-add-new-point",
|
"classes": "max-h-leave-room special-add-new-point flex-1",
|
||||||
"condition": "has_presets=yes",
|
"condition": "has_presets=yes",
|
||||||
"render": {
|
"render": {
|
||||||
"*": "{add_new_point()}"
|
"*": "{add_new_point()}"
|
||||||
|
@ -196,11 +196,19 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "add_note",
|
"id": "add_note",
|
||||||
|
"classes": "flex-1",
|
||||||
"condition": "has_note_layer=yes",
|
"condition": "has_note_layer=yes",
|
||||||
"render": {
|
"render": {
|
||||||
"*": "{open_note()}"
|
"*": "{open_note()}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "nearby_images",
|
||||||
|
"classes": "w-fit self-end",
|
||||||
|
"render": {
|
||||||
|
"*": "{nearby_images(,true)}"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "debug",
|
"id": "debug",
|
||||||
"metacondition": "__featureSwitchIsDebugging=true",
|
"metacondition": "__featureSwitchIsDebugging=true",
|
||||||
|
|
|
@ -1390,11 +1390,6 @@ input[type="range"].range-lg::-moz-range-thumb {
|
||||||
margin-right: 0.25rem;
|
margin-right: 0.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx-12 {
|
|
||||||
margin-left: 3rem;
|
|
||||||
margin-right: 3rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mx-16 {
|
.mx-16 {
|
||||||
margin-left: 4rem;
|
margin-left: 4rem;
|
||||||
margin-right: 4rem;
|
margin-right: 4rem;
|
||||||
|
@ -5779,6 +5774,11 @@ svg.apply-fill path {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.max-h-leave-room {
|
||||||
|
/* Leaves room for a single button, with padding */
|
||||||
|
max-height: calc(100% - 3.25rem);
|
||||||
|
}
|
||||||
|
|
||||||
.max-w-screen {
|
.max-w-screen {
|
||||||
max-width: 100vw;
|
max-width: 100vw;
|
||||||
}
|
}
|
||||||
|
@ -8844,10 +8844,6 @@ svg.apply-fill path {
|
||||||
margin-right: 0px;
|
margin-right: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lg\:w-1\/3 {
|
|
||||||
width: 33.333333%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lg\:w-5\/12 {
|
.lg\:w-5\/12 {
|
||||||
width: 41.666667%;
|
width: 41.666667%;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,17 +15,18 @@ export default abstract class Script {
|
||||||
args.splice(0, 2)
|
args.splice(0, 2)
|
||||||
const start = new Date()
|
const start = new Date()
|
||||||
this.main(args)
|
this.main(args)
|
||||||
.then((_) => {
|
.catch((e) => {
|
||||||
|
console.log(`ERROR in script ${process.argv[1]}:`, e)
|
||||||
|
process.exit(1)
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
const end = new Date()
|
const end = new Date()
|
||||||
const millisNeeded = end.getTime() - start.getTime()
|
const millisNeeded = end.getTime() - start.getTime()
|
||||||
|
|
||||||
const green = (s) => "\x1b[92m" + s + "\x1b[0m"
|
const green = (s) => "\x1b[92m" + s + "\x1b[0m"
|
||||||
console.log(green("All done! (" + millisNeeded + " ms)"))
|
console.log(green("All done! (" + millisNeeded + " ms)"))
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
|
||||||
console.log(`ERROR in script ${process.argv[1]}:`, e)
|
|
||||||
process.exit(1)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public printHelp() {
|
public printHelp() {
|
||||||
|
|
|
@ -187,7 +187,7 @@ export default class LayerConfig extends WithContextLoader {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (pr.snapToLayer !== undefined) {
|
if (pr.snapToLayer !== undefined) {
|
||||||
let snapToLayers = pr.snapToLayer
|
const snapToLayers = pr.snapToLayer
|
||||||
preciseInput = {
|
preciseInput = {
|
||||||
snapToLayers,
|
snapToLayers,
|
||||||
maxSnapDistance: pr.maxSnapDistance ?? 10,
|
maxSnapDistance: pr.maxSnapDistance ?? 10,
|
||||||
|
@ -277,8 +277,9 @@ export default class LayerConfig extends WithContextLoader {
|
||||||
tr["rewrite"] === undefined
|
tr["rewrite"] === undefined
|
||||||
) ?? []
|
) ?? []
|
||||||
if (missingIds?.length > 0 && official) {
|
if (missingIds?.length > 0 && official) {
|
||||||
console.error("Some tagRenderings of", this.id, "are missing an id:", missingIds)
|
const msg = `Context: ${context}; Some tagRenderings of ${this.id} are missing an id: ${missingIds.map(x => JSON.stringify(x)).join(", ")} `
|
||||||
throw "Missing ids in tagrenderings"
|
console.error(msg)
|
||||||
|
throw msg
|
||||||
}
|
}
|
||||||
|
|
||||||
this.tagRenderings = (Utils.NoNull(json.tagRenderings) ?? []).map(
|
this.tagRenderings = (Utils.NoNull(json.tagRenderings) ?? []).map(
|
||||||
|
|
|
@ -144,9 +144,6 @@ export default class TagRenderingConfig {
|
||||||
this.classes = json.classes ?? []
|
this.classes = json.classes ?? []
|
||||||
}
|
}
|
||||||
this.classes = [].concat(...this.classes.map((cl) => cl.split(" ")))
|
this.classes = [].concat(...this.classes.map((cl) => cl.split(" ")))
|
||||||
if (this.classes.length === 0) {
|
|
||||||
this.classes = undefined
|
|
||||||
}
|
|
||||||
|
|
||||||
this.render = Translations.T(<any>json.render, translationKey + ".render")
|
this.render = Translations.T(<any>json.render, translationKey + ".render")
|
||||||
this.question = Translations.T(json.question, translationKey + ".question")
|
this.question = Translations.T(json.question, translationKey + ".question")
|
||||||
|
|
|
@ -64,7 +64,12 @@ export class WithSpecialLayers extends WithChangesState {
|
||||||
this.initActorsSpecialLayers()
|
this.initActorsSpecialLayers()
|
||||||
this.drawSelectedElement()
|
this.drawSelectedElement()
|
||||||
this.drawSpecialLayers()
|
this.drawSpecialLayers()
|
||||||
this.drawLastClick()
|
try {
|
||||||
|
this.drawLastClick()
|
||||||
|
} catch (e) {
|
||||||
|
console.error("FATAL: invalid last click layer", e)
|
||||||
|
throw e
|
||||||
|
}
|
||||||
// Note: the lock-range is handled by UserMapFeatureSwitchState
|
// Note: the lock-range is handled by UserMapFeatureSwitchState
|
||||||
{
|
{
|
||||||
// Activate metatagging for the 'current_view' layer
|
// Activate metatagging for the 'current_view' layer
|
||||||
|
|
|
@ -86,9 +86,9 @@
|
||||||
{selectedElement}
|
{selectedElement}
|
||||||
{layer}
|
{layer}
|
||||||
{highlightedRendering}
|
{highlightedRendering}
|
||||||
clss={$knownTagRenderings.length === 1
|
clss={($knownTagRenderings.length === 1
|
||||||
? "h-full"
|
? "h-full"
|
||||||
: "tr-length-" + $knownTagRenderings.length}
|
: "tr-length-" + $knownTagRenderings.length)+" "+config.classes.join(" ")}
|
||||||
/>
|
/>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -674,6 +674,11 @@ svg.apply-fill path {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.max-h-leave-room {
|
||||||
|
/* Leaves room for a single button, with padding */
|
||||||
|
max-height: calc(100% - 3.25rem);
|
||||||
|
}
|
||||||
|
|
||||||
.max-w-screen {
|
.max-w-screen {
|
||||||
max-width: 100vw;
|
max-width: 100vw;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue