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 &quot;the_geom from (select * from my table where mysessionid=%SESSIONID%) as foo using unique oid using srid 4326&quot;
<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> &lt;<a href="mailto:Adrian.Moser@bs.ch">Adrian.Moser@bs.ch</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NAME path<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CONNECTIONTYPE POSTGIS<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CONNECTION &quot;user=xxx password=xxx dbname=xxx host=localhost port=5432&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATA &quot;the_geom from routingrouten&quot;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PROJECTION<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;init=epsg:4326&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;END<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STATUS ON<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TYPE LINE<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CLASS<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NAME 'path'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STYLE
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;COLOR 0 255 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WIDTH 3<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;END<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;END<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;METADATA<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;wms_title&quot; &quot;path&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;END<br>END<br><br>JavaScript function:<br><br>function showRoute(sessId) {
<br>&nbsp;&nbsp;//Berechente Route anzeigen<br>&nbsp;&nbsp;wms_path = new OpenLayers.Layer.WMS(&quot;path&quot;,<br>&nbsp;&nbsp;&nbsp;&nbsp;'<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>&nbsp;&nbsp;&nbsp;&nbsp;{LAYERS: 'path', format: 'png', transparent: 'true'},{'buffer':1});<br>&nbsp;&nbsp;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