<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Nachricht</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV>
<DIV><SPAN class=990141314-02112006><FONT face=Arial color=#0000ff
size=2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=990141314-02112006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=990141314-02112006><FONT face=Arial color=#0000ff size=2>That
seems to be exactly what I'm searching for. I t<SPAN
class=520541514-02112006>r</SPAN>ied to transform my WMS layer to a Mapserver
Layer but it doesnt' work.</FONT></SPAN></DIV>
<DIV><SPAN class=990141314-02112006><FONT face=Arial color=#0000ff size=2>What
do I need to change in the following layer definition that it
works?</FONT></SPAN></DIV>
<DIV><SPAN class=990141314-02112006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=990141314-02112006><FONT face=Arial color=#0000ff
size=2>wms_path = new OpenLayers.Layer.WMS("path",<BR>
'http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/Apache/htdocs/nafmomNeu/map/nafmom.map',<BR>
{LAYERS: 'path', format: 'png', transparent:
'true'},{'buffer':1});<BR>map.addLayer(wms_path);</FONT></SPAN></DIV>
<DIV><SPAN class=990141314-02112006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=990141314-02112006><SPAN class=520541514-02112006><FONT
face=Arial color=#0000ff size=2>Best regards,</FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=990141314-02112006><SPAN class=520541514-02112006><FONT
face=Arial color=#0000ff size=2>Adrian Moser</FONT></SPAN></SPAN></DIV></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=de dir=ltr align=left><FONT face=Tahoma
size=2>-----Ursprüngliche Nachricht-----<BR><B>Von:</B> david.bitner@gmail.com
[mailto:david.bitner@gmail.com] <B>Im Auftrag von </B>David William
Bitner<BR><B>Gesendet:</B> Donnerstag, 2. November 2006 14:36<BR><B>An:</B>
Moser Adrian<BR><B>Cc:</B> users@openlayers.org<BR><B>Betreff:</B> Re:
[OpenLayers-Users] PostgreSQL dynamic layer<BR><BR></FONT></DIV>You might want
to try using the MapServer direct layer:<BR><A
href="http://openlayers.org/dev/examples/mapserver.html">http://openlayers.org/dev/examples/mapserver.html</A><BR><BR>Then
set up your data string in your mapfile to use variable substitution to
contain your session id <BR>(read the mapserver manual for variable sub and
for the postgis data statement syntax as this is coming from my head)<BR>so
your data string would be something like<BR>DATA "the_geom from (select * from
my table where mysessionid=%SESSIONID%) as foo using unique oid using srid
4326" <BR><BR>Then in openlayers you would add a parameter to your layer
string:<BR>{layers:'mylayer',sessionid:'234255464564'}<BR><BR>You could then
use MergeNewParams (see <A
href="http://openlayers.org/dev/examples/wmst.html">http://openlayers.org/dev/examples/wmst.html</A>
for example) to change your sessionid as you add new routes to the
table.<BR><BR>As I said, take this as a general road map and check the docs, I
can guarantee I butchered some syntax, <BR><BR>bitner<BR>
<DIV><SPAN class=gmail_quote>On 11/2/06, <B class=gmail_sendername>Moser
Adrian</B> <<A href="mailto:Adrian.Moser@bs.ch">Adrian.Moser@bs.ch</A>>
wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Hi
list,<BR><BR>I already posted this question once but couldn't solve the
problem.<BR>I'm implementing a routing application based on
PostgreSQL/PostGIS. The routes are stored temporarily in a Postgres table
together with the current session-ID. I then included this table in a
Mapserver Layer which I want to show with OpenLayers. The problem is that
could be different routes in the table and I just want to display the one
belonging to the current session. <BR>There is a parameter expression that
can be set in the .map file but I need to do this
dynamically.<BR><BR>Mapserver
Layer:<BR><BR>LAYER<BR> NAME
path<BR> CONNECTIONTYPE
POSTGIS<BR> CONNECTION "user=xxx
password=xxx dbname=xxx host=localhost port=5432"
<BR> DATA "the_geom from
routingrouten"<BR><BR> PROJECTION<BR> "init=epsg:4326"<BR> END<BR> STATUS
ON<BR> TYPE
LINE<BR><BR> CLASS<BR> NAME
'path'<BR> STYLE
<BR> COLOR 0 255
0<BR> WIDTH
3<BR> END<BR> END<BR> METADATA<BR> "wms_title"
"path"<BR> END<BR>END<BR><BR>JavaScript
function:<BR><BR>function showRoute(sessId) { <BR> //Berechente
Route anzeigen<BR> wms_path = new
OpenLayers.Layer.WMS("path",<BR> '<A
href="http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/Apache/htdocs/nafmomNeu/map/nafmom.map">http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/Apache/htdocs/nafmomNeu/map/nafmom.map
</A>',<BR> {LAYERS: 'path', format: 'png',
transparent:
'true'},{'buffer':1});<BR> map.addLayer(wms_path);<BR>}<BR><BR>Is
there a possibility to do this?<BR><BR>I noticed that if I display a route
(currently all routes are displayed) and the recalculate the route with
slightly other start and end point an display it OpenLayers still shows the
old route. It display to show a cached tile. How can I solve this problem?
<BR><BR><BR>_______________________________________________<BR>Users mailing
list<BR><A href="mailto:Users@openlayers.org">Users@openlayers.org</A><BR><A
href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users
</A><BR></BLOCKQUOTE></DIV><BR><BR clear=all><BR>--
<BR>************************************<BR>David William Bitner
</BLOCKQUOTE></BODY></HTML>