[uMap] afficher une image avec « Popup content template »

Antoine Riche antoine.riche at zaclys.net
Fri Apr 9 12:44:08 UTC 2021


Bonjour.

Les accolades sont cumulées : il faut 2 accolades si on fournit une URL 
directement, ex. {{http://xxx/pic.jpg}}, auxquelles on ajoute une 
accolade pour le placeholders pour récupérer l'URL, ex. {{{image_url}}}.

Antoine.

Le 09/04/2021 à 12:34, Philippe Gauron via Umap a écrit :
> Bonjour,
> [english version below]
>
> en essayant de créer un calque à partir d'un CSV dont un champ était 
> une image, j'ai rencontré une comportement qui m'a étonné.
>
> Contexte : le calque contient des champs Lieu, latitude, longitude, 
> Photo, Projet et Description. Le champ « Photo » contient une URL 
> d'image.
>
>
> Comportement constaté :
>
> En éditant les propriétés du calque, puis dans « Interaction options » 
> et « Popup content template », et en indiquant :
> -----
> # {Lieu}
> {Description}
> {{Photo}}
> {Projet}
> -----
>
> en cohérence avec l'aide de la propriété qui indique
>
> -----
> Dynamic properties
>
> Use placeholders with feature properties between brackets, eg. {name}, 
> they will be dynamically replaced by the corresponding values.
> Text formatting
>
>     *simple star for italic*
>     **double star for bold**
>     # one hash for main heading
>     ## two hashes for second heading
>     ### three hashes for third heading
>     Simple link: [[http://example.com]]
>     Link with text: [[http://example.com|text of the link]]
>     Image: {{http://image.url.com}}
>     Image with custom width (in px): {{http://image.url.com|width}}
>     Iframe: {{{http://iframe.url.com}}}
>     Iframe with custom height (in px): {{{http://iframe.url.com|height}}}
>     Iframe with custom height and width (in px): 
> {{{http://iframe.url.com|height*width}}}
>     --- for an horizontal rule
> -----
>
> On devrait voir apparaitre l'image au milieu du texte dans les popups.
>
>
>
> Correction à effectuer :
>
> la photo ne s'affiche qu'en utilisant {{{Photo}}} (avec 3 accolades au 
> lieu de 2 comme indiqué dans l'aide).
>
> J'ai l'impression soit qu'il faudrait clarifier l'aide, soit que le 
> comportement ne correspond pas à ce qui est attendu, non ?
>
>
>
> En tout cas, merci pour cette fonctionnalité particulièrement pratique :)
>
>
>
>
>
>
>
> english version :
>
> while trying to create a layer from a CSV import with a field 
> containing an image, I encountered a strange behaviour.
>
> Context : the layer contains following fields Lieu, latitude, 
> longitude, Photo, Projet et Description. The field "Photo" contains a 
> picture URL.
>
>
> Noticed behaviour :
>
> While editing the layer properties and then "Interaction options" and 
> "Popup content template", when I enter :
> -----
> # {Lieu}
> {Description}
> {{Photo}}
> {Projet}
> -----
>
> consistently with property help which indicates
>
> -----
> Dynamic properties
>
> Use placeholders with feature properties between brackets, eg. {name}, 
> they will be dynamically replaced by the corresponding values.
> Text formatting
>
>     *simple star for italic*
>     **double star for bold**
>     # one hash for main heading
>     ## two hashes for second heading
>     ### three hashes for third heading
>     Simple link: [[http://example.com]]
>     Link with text: [[http://example.com|text of the link]]
>     Image: {{http://image.url.com}}
>     Image with custom width (in px): {{http://image.url.com|width}}
>     Iframe: {{{http://iframe.url.com}}}
>     Iframe with custom height (in px): {{{http://iframe.url.com|height}}}
>     Iframe with custom height and width (in px): 
> {{{http://iframe.url.com|height*width}}}
>     --- for an horizontal rule
> -----
>
> we should see appearing the picture in the middle of the text fields 
> in the popups.
>
>
> Correction to make :
>
> the picture is displayed only when using {{{Photo}}} (with 3 embrace 
> instead of 2 as written in help).
>
> It seems to me help should be clarified, or the perhaps the behaviour 
> is not the expected one.
>
>
>
> Whatever, thank you for this functionnality which is especially useful :)
>
>
>
>
> - Fil.
>
> _______________________________________________
> Umap mailing list
> Umap at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/umap
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/umap/attachments/20210409/dd19abc3/attachment.htm>


More information about the Umap mailing list