MapTools.org

[Chameleon] legend_single_template works delayed

Paul Spencer spencer@dmsolutions.ca
Tue, 25 Nov 2003 08:35:55 -0500
Huub,

Great Stuff!  My first guess is that the legend template is somehow 
processing a different map object than the LayerOrderUp/Down widgets. 
There are a couple of ways this can happen ... mostly due to how PHP 
handles references to objects (i.e. it doesn't, it makes copies by 
default).  This doesn't seem to be the case here, since some other 
operation will cause the legend to update.

It may be a bug in the move functions also.  One way to test if this is 
a bug would be to write a small script that loads the map, moves a layer 
then processes the legend template.  I would start there to rule out 
that possibility.

The next thing to check would be the order of execution of the widgets. 
  In general, all widgets are executed in order of appearance in the 
template, but widgets can be given a priority that causes them to 
execute before or after other widgets.  Again, I'm not sure this is the 
problem because the LegendTemplate widget does not actually process the 
legend template until DrawPublish.  In the widget cycle, all widgets 
have ParseURL called, then a second loop calls DrawPublish, so there 
should be no interaction at this point.

Other than that, I would need to run your code through a debugger to 
figure out exactly what is going on.

Cheers,

Paul

Huub Fleuren wrote:

> Hi list,
> 
> I created two new  widgets called LayerOrderDown and LayerOrderUp (based 
> on the MapUpdateWidget)
> 
> What the ParseURL function does is, loop through the $oMaps Layers list 
> and if the name is the selected_layer $oMap->moveLayerUp($i)  in the 
> LayerDown widget and $oMap->moveLayerDown($i)  in the LayerUp widget
> 
> I'm proud to say that this works.
> 
> That is: the map is recreated in the new order, but, there is a delay in 
> the legend
> Only a second /pan/update/zoomin event shows the selected layer in the 
> new position in the legendlist
> 
> Its like the legend_template uses a session number of the previous cicle
> 
> What is going wrong?
> 
> 
> 
> Greetings,
> Huub
> 
> 

-- 
  -----------------------------------------------------------------
|Paul Spencer                           spencer@dmsolutions.ca    |
|-----------------------------------------------------------------|
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
  -----------------------------------------------------------------




This archive was generated by Pipermail.