[OpenLayers-Users] How can I show a picture a popup (URL for the pic should be read automatically from the attributes)

Till Adams adams at terrestris.de
Tue Feb 3 07:24:26 EST 2009


Max,

in general you need to define your output format which comes back from
Geoserver as text or Xml or whatever - then you may parse the backcoming
stuff and put the URL in an html image tag - basically you can see what to
do regarding the OL featureinfo example:: 
you must do alter it at the place when you receive the result from your WMS
back and before you put it this in the result-div in your client - you'll
have to parse it and rewrite it to html, alternatively you may define a
template for your WMS which gives the results back in Html, so you can do
sth like:

<html>
...
<img src='[URL]'>
...

Where [URL] will be filled by your WMS server - this is mainly the
proceeding I know from UMN mapserver.

Just some ideas - regards, Till


"Max Stephan" <x.zam at gmx.net> schrieb:
> Hey everybody!
> 
> I got a shapefile here which I added to my geoserver. I have integrated it
> as a layer in an openlayers map container. In the attributes of the
> layer/shapefile is a field which contains an URL to a pic of each feature
> (in this case the features are points). Now I want this picture to be
> displayed in a popup (like it can be done in a marker layer). But I want
to
> have the URL automatically read from the attributes of the feature I´m
> clicking on. It would be great to see some of the other attributes read
from
> the feature as well. The problem is I don´t know that much about the
> OpenLayers-API. I only know how to write a GetFeatureRequest but this
would
> show me only the attribute table. If it´s too difficult to show a picture
> which´s URL is in the attributes it would be even enough if the URL in the
> attribute table (the one I get from the GetFeatureRequest) would be
> clickable.
> 
> Greets and thanks for your help in advance Max Stephan
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 





More information about the Users mailing list