Bug 1014 - map crash when using keymap widget and no reference object in MAP file
: map crash when using keymap widget and no reference object in MAP file
Status: NEW
: Chameleon
Core
: 2.0
: PC Windows 2000
: P2 normal
: ---
Assigned To:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2005-04-27 16:07 by
Modified: 2005-05-05 05:15 (History)


Attachments


Note

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


Description From 2005-04-27 16:07:49
Today I struggled with the following.

I tried to use a copy my MAP file in the Chameleon samples by renaming it to
world_wms.map.

But then I got:
Error rendering map image. A fatal error has occurred .... please restart the
application.

When digging into this, I found this was caused by my MAP file missing a
REFERENCE object, and my template having a KeyMapDHTML widget. But it took a lot
of digging :).

The cause is apparently in the generated session MAP file which gets a default
extent of -1 -1 -1 which causes this:

  REFERENCE
    COLOR 255 0 0
    EXTENT -1 -1 -1 -1
    IMAGE "C:\ms4w\apps\chameleon\samples\htdocs/images/world_key.png"
    OUTLINECOLOR 0 0 0
    SIZE 0 0
    STATUS OFF
      MARKER 0
      MARKERSIZE 0
      MINBOXSIZE 3
      MAXBOXSIZE 0
  END

Can anything be done about this?
------- Comment #1 From 2005-05-04 09:37:39 -------
This is odd.  Did you provide valid extents in your widget attributes?

MapServer will automatically create a default reference object if the mapfile
doesn't contain one.  I suspect that you didn't provide extents in your widget
and that caused the problem.

The fix would be to test the extents of the reference object if extents are not
provided as part of the widget definition.  Unfortunately there is no way to do
conditionally optional attributes (i.e. minx only required if extents not set in
reference object) so it will have to be manually tested in the widget
intialization and an appropriate error message emitted if the extents are -1 -1
-1 -1.

Bart, are you willing to investigate a fix for this?
------- Comment #2 From 2005-05-05 05:15:33 -------
The extents were probably not valid since I just used the Chameleon sample
applications and then my own MAP file for Netherlands RD system.

I will try to investigate this.