简体   繁体   中英

Geoserver FreeMarkerTemplate GetFeatureInfo Image not showing

I'm trying to use Freemarker template to show the corresponding picture of a building when clicking on it. The getfeatureinfo functionality works as intended but the picture is not showing when implementing freemarker template.

My freemarker template:

<ul>
<#list features as feature>
  <li><b>Building, "${feature.BID.value}"</b>: <br/>
  <img src="http://localhost:8115/geoserver/data/www/hus/fotoinv/${feature.FOTO.value}"/>
  </li>
</#list>
</ul>

All the pictures are located in the fotoinv folder.

An image src icon shows up but no picture is showing, when inspecting icon the correct number from the FOTO has been added to the src, eg /fotoinv/60140 but the image still is not showing.

Appreciate any help on this since it's my first time working with Geoserver and FTL's.

An image that is stored in the www directory is served at http://localhost:8080/geoserver/www/ so on my local machine I have a file called logo.png in the data/www folder to display it in my browser I need to use http://localhost:8080/geoserver/www/logo.png .

Note : that location will only work for users on you physical machine. If you want remote users to see the pictures then you will need to use http://machine.domain.com/geoserver/www

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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