简体   繁体   English

在 ol-ext (OpenLayers) 的弹出功能中添加图像

[英]Add images in popup feature of ol-ext (OpenLayers)

I am trying to add images within the popup feature of ol-ext (OpenLayers) available at https://github.com/Viglino/ol-ext/blob/master/examples/popup/map.popup.feature.html我正在尝试在https://github.com/Viglino/ol-ext/blob/master/examples/popup/map.popup.feature.html提供的 ol-ext(OpenLayers)的弹出功能中添加图像

Any workarounds on how to either add images below the popup or within it?关于如何在弹出窗口下方或其中添加图像的任何解决方法? I have already asked for it to be added as a feature at the official repository.我已经要求将其作为功能添加到官方存储库中。

You are displaying data in an HTML table so to display an image you would need the necessary HTML to construct an image - in the case of the example you could show the department flag by using its id in the url for the image src.您正在 HTML 表中显示数据,因此要显示图像,您需要必要的 HTML 来构造图像 - 在示例的情况下,您可以通过在图像 src 的 url 中使用其 id 来显示部门标志。 The source I am using has flags for most, but not all, French departments我使用的来源有大多数(但不是全部)法国部门的标志

      'id': {
        title: 'Flag',  // attribute's title
        before: '<img src="https://www.crwflags.com/fotw/images/f/fr-',
        after: '.gif">'
       }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM