Bug 916 - symbol picker does not work if MAP file only has WMS layers
: symbol picker does not work if MAP file only has WMS layers
Status: RESOLVED FIXED
: Chameleon
Core
: 1.99
: PC Windows XP
: P2 normal
: ---
Assigned To:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2005-01-07 07:39 by
Modified: 2005-01-11 13:19 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2005-01-07 07:39:56
The symbol picker (which is used eg in MapNotes widget) does not work on
Chameleon MAP files which only have WMS layers. This is because it looks for a
dummy class and a dummy style in the map file, and these result in non objects.

[07-Jan-2005 12:12:19] PHP Fatal error:  Call to a member function on a
non-object in C:\ms4w\apps\chameleon\htdocs\common\picker\symbol_picker.php on
line 152
------- Comment #1 From 2005-01-11 10:29:57 -------
this requires some thinking.  It may be sufficient to create a dummy layer,
class and style instead of trying to find an existing one.  Can you try
replacing the code after line 136:

//get first layer with class

up to line 155:

if ($nSelectedSymbol == "")

with something like:

$this->m_oDummyLayer = ms_newLayerObj( $this->m_oDummyMap );
$this->m_oDummyClass = ms_newClassObj( $this->m_oDummyLayer );
$this->m_oDummyStyle = ms_newStyleObj( $this->m_oDummyClass );

and give it a try (since I'm not in a position to test this right now)
------- Comment #2 From 2005-01-11 10:38:43 -------
Paul,

that fixed things. I did a similar hack to the code. But I thought this is 
something that needs to go into CVS in a well-thought way.

Bart
------- Comment #3 From 2005-01-11 10:48:51 -------
if you have a working version that you are happy with, please commit it to cvs
to make sure it is included in the 2.0 release (going out today!)  If you don't
have commit access to php_utils, send me the file and I'll commit it ... and
sort out your privileges too.
------- Comment #4 From 2005-01-11 11:12:54 -------
Hi Paul,

do you want to use this approach instead of the old one, or do you want the code 
to check if there is a class in one of the layers? I think this approach will be 
sufficient for all cases, was there a specific reason why the current code 
looked for a class in one of the layers instead of creating dummy objects? I 
can't think of a reason. My working version is currently the same as the fix you 
proposed in this bug report, so if you put that into CVS that will be fine. I 
don't have commit access to common btw.

Bart
------- Comment #5 From 2005-01-11 13:19:41 -------
done in cvs.