Closed govvin closed 4 months ago
I think of the popups as a "user-friendly" display of the information about the map feature. Would you like any specific tags which should be shown in the popup?
You can see all attributes of the feature when you click 'show details'.
Yes, I understand that you can see more more information when you click on "show details" but what I meant to ask is that how to display the tags/attributes by default, without clicking anything.
I know I've seen it work with some other category, but couldn't remember which one, and hope to learn how to replicate that behavior.
It seems to be related to how populating the body of the pop-up. Could you point me to an example of how to list all the attributes of the selected object in the popup body?
Ah, I see.
The easiest would be the following snippet, which formats the tags as YAML output:
query: nwr[whatever=you_want]
feature:
body: "<pre>{{ tags|yaml }}</pre>"
Alternatively, you could also use:
query: nwr[whatever=you_want]
feature:
body: |
{% for k, v in tags %}
{{ k }}: {{ v }}<br>
{% endfor %}
I hope this is helpful for you.
Learn more about how to create custom categories:
Right now whenever I see a marker on the map and click on it, it shows just the following:
I don't remember which OSB category (or custom category) feature I saw, where instead of the above, the window actually display the attributes for the feature.
What do I need to add to a custom category to make that happen?