Thanks for the quickly reply.<br><br>About the options:<br>1) Unfortunately, I can't.<br><br>2) I tried to modify tile.php and kaMap.js to accept variable substituion. The problem is:<br>- when an user select a vessel in my app and refreshes the map, the code of these vessel is passed to
tile.php. These code is used to construct the SQL query. The problem is when the user select another vessel and unselect the previous one. The tile is cached and the previous vessel will still be there. I think I can't use any type of cache in this scenario, because every time a vessel is selected and the user refreshes the map, a new SQL query will be used (in the data section of my layer,
e.g. data %sql%). So, the cache will be useless.<br><br>3) I am using variable substituion because I can't have a layer for each vessel (there will be more than 2000 vessels in the system). So, one layer for each is impracticable. Also, these data is dynamic.
<br><br>4) Maybe this is my only option, but I don't know where to start.<br><br>Sorry about any misunderstanding, english is not my native language.<br><br><div><span class="gmail_quote">On 2/5/07, <b class="gmail_sendername">
Paul Spencer</b> <<a href="mailto:pspencer@dmsolutions.ca">pspencer@dmsolutions.ca</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
right, sorry I missed that detail. The only options you have are:<br><br>1) live with it (not good)<br>2) modify redraw so that it will accept variable substitution - the<br>code is already in the no-cache case so redraw shouldn't be hard to add
<br>3) change your app so you don't need to use variable substitution -<br>may not be possible<br>4) fix the no-cache implementation so it doesn't cause a full<br>metatile draw for every tile<br><br>Cheers<br><br>
Paul<br><br>On 5-Feb-07, at 8:42 AM, Pje wrote:<br><br>> Hmm. But if I set tile_source to redraw I will can't use variable<br>> substitution, right? Because variable substitution is only<br>> implemented in tile_nocache.php
<br>><br>> On 2/5/07, Paul Spencer <<a href="mailto:pspencer@dmsolutions.ca">pspencer@dmsolutions.ca</a>> wrote: Pje,<br>><br>> using no-cache is a "BAD THING" (tm). It causes the whole metatile
<br>> to redraw for every tile request. This is absolutely the worst case<br>> performance.<br>><br>> What you really want to do is use is something like:<br>><br>> "tile_source" "redraw"
<br>> "redraw_interval" "150"<br>> "refresh_interval" "300"<br>><br>> This will cause the client to automatically re-request tiles every<br>> 300 seconds (5 minutes) and the tiles will be considered stale and be
<br>> recreated every 150 seconds (2.5 minutes).<br>><br>> This allows the tiles to be cached for 2.5 minutes so when a client<br>> loads a tile, it only causes one map draw per metatile rather than a<br>> map draw per tile. The tiles are time-stamped and when a request
<br>> comes in for a tile that is past the time allowed, it redraws the<br>> cached tiles. The timestamp is done per-layer so that all the tiles<br>> are synchronized.<br>><br>> The refresh interval ensures that the layer is dynamically updated
<br>> even if the user does nothing.<br>><br>> You can play with the times to get the desired effect and balance<br>> your load, but you should find that this produces substantially<br>> better results for you.
<br>><br>> Cheers<br>><br>> Paul<br>><br>> On 5-Feb-07, at 7:53 AM, Pje wrote:<br>><br>> > Hi,<br>> ><br>> > I am having some problems with two layers that use tile_source<br>> > "nocache".
<br>> ><br>> > I am using it because these layers are respectively points sent by<br>> > fishing vessels and areas. These points are sent at 5min intervals<br>> > and the areas are inserted by the user. So, *i think* i can't use
<br>> > cache in this case.<br>> ><br>> > The problem is that the map is taking too much time to load. The<br>> > points table in the database have 18.000 registers... and there<br>> > will be a lot more. And there is about 18 areas.
<br>> ><br>> > Also, I am using variable substitution in mapfile. My points layer<br>> > is something like that:<br>> ><br>> > layer<br>> > name "track"<br>> > group "Track"
<br>> > connectiontype POSTGIS<br>> > connection "dbname=xxx user=xxx password=xxx host=xxx port=5432"<br>> > data "%data%"<br>> > type line<br>> > status on
<br>> > metadata<br>> > tile_source "nocache"<br>> > end<br>> > class<br>> > name "track"<br>> > color 0 0 0<br>> > end
<br>> > end<br>> ><br>> ><br>> > When the user select some vessel, I do that using javascript:<br>> ><br>> > var map = myKaMap.getCurrentMap();<br>> > var track = mapa.getLayer('track');
<br>> > track.replacementVariables = {vessel: id_vessel};<br>> > track.redraw();<br>> ><br>> > The areas layer is using the same logic.<br>> ><br>> > So, there is a way to achieve that but with better perfomance? The
<br>> > performance was ok before I add these two layers. Any tips?<br>> > _______________________________________________<br>> > ka-Map-users mailing list<br>> > <a href="mailto:ka-Map-users@lists.maptools.org">
ka-Map-users@lists.maptools.org</a><br>> > <a href="http://lists.maptools.org/mailman/listinfo/ka-map-users">http://lists.maptools.org/mailman/listinfo/ka-map-users</a><br>><br>> +-----------------------------------------------------------------+
<br>> |Paul Spencer <a href="mailto:pspencer@dmsolutions.ca">pspencer@dmsolutions.ca</a> |<br>> +-----------------------------------------------------------------+<br>> |Chief Technology Officer |
<br>> |DM Solutions Group Inc <a href="http://www.dmsolutions.ca/">http://www.dmsolutions.ca/</a> |<br>> +-----------------------------------------------------------------+<br>><br>><br>><br>
><br>><br>> _______________________________________________<br>> ka-Map-users mailing list<br>> <a href="mailto:ka-Map-users@lists.maptools.org">ka-Map-users@lists.maptools.org</a><br>> <a href="http://lists.maptools.org/mailman/listinfo/ka-map-users">
http://lists.maptools.org/mailman/listinfo/ka-map-users</a><br><br>+-----------------------------------------------------------------+<br>|Paul Spencer <a href="mailto:pspencer@dmsolutions.ca">pspencer@dmsolutions.ca
</a> |<br>+-----------------------------------------------------------------+<br>|Chief Technology Officer |<br>|DM Solutions Group Inc <a href="http://www.dmsolutions.ca/">
http://www.dmsolutions.ca/</a> |<br>+-----------------------------------------------------------------+<br><br><br><br><br></blockquote></div><br>