[Chameleon] legendtemplate problem: numlayers

Paul Spencer pagameba at magma.ca
Thu Aug 12 10:24:43 EDT 2004


Um, this was broken when we used it last fall for building Studio and 
working with both classes and styles through mapscript.  We now make it 
standard practice to refetch objects when anything has changed because 
synchronization just doesn't happen.

In fact, Zak was having problems with this for the aggregator until he 
rewrote the code to basically save and open the map file again because 
layer objects get very messed up (esp metadata I think) when you use 
them over again.

I just assumed that this was "the way it worked" with PHP and was a 
limitation of the way PHP works with extensions and C 
structures/objects, not necessarily a problem with MapScript.  If you 
think it should work, however, then perhaps there is some other problem?

I'm not sure if this is a chameleon problem, I would have to dig into 
it.  I know in the case of Studio the problem was easily reproducible 
outside of Chameleon.  I guess we would need to do the same thing here.

Bart, if possible, can you produce a short php/mapscript test case 
outside of chameleon that replicates the problem?  If you cannot 
replicate it then it is likely a chameleon issue.

Cheers,

Paul

Daniel Morissette wrote:
> Paul Spencer wrote:
> 
>> Bart,
>>
>> I think there is some problem with PHP and extensions, for instance if 
>> you add a class then layer->numclasses is not updated unless you 
>> refetch the layer ($oLayer = $oMap->getLayer( 0 ) for instance) ... 
>> this synchronization (or lack thereof) seems to cause all kinds of 
>> problems.
>>
> 
> Are you sure that it's not Chameleon or the widget that's caching the 
> numlayers value?  (Bart's problem seems to be with numlayers, not 
> numclasses BTW)
> 
> I seem to remember a problem related to that in PHP MapScript but it 
> would have been fixed a long time ago (back in 2002 according to CVS 
> logs). I just checked in the 4.2 source and the $layer->numclasses is 
> synchronized after creating a new class. Same with the $map->numlayers 
> when adding a new layer.
> 
> Daniel

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



More information about the Chameleon mailing list