dbox legend question

Richard Greenwood richard.greenwood at GMAIL.COM
Wed Nov 15 22:52:43 EST 2006


On 11/15/06, Sam Young <samnyoung at hotmail.com> wrote:
> The checkboxes for my legend in my dbox applications are not turned on for
> active layers,

That's okay, you have to set the checkboxes with:
   legend.changeNodeStatus("roads", "on");

nor do they change anything if I check/uncheck them and
> redraw the map.

That's not okay.

 The image that dislpays the color and shape of the layers
> is also not being displayed.  I get the following two errors in the
> Javascript console:
>
> Error: xEvent is not defined
> Source File: http://localhost/src/javascript/mapserver/dbox.js
> Line: 486
>
> Error: xml declaration not at start of external entity
> Source File:
> http://localhost/cgi-bin/make_dlegend_xml_cgi.py?map=/ms4w/Apache/htdocs/sunvalley.map&server=localhost
> Line: 2, Column: 1
> Source Code:
> <?xml version="1.0" ?>^
>
> I have an "alert" in my code here:
>
> // legend setup
>     var legend_xml = get_content(config.dlegend_xml_executable + "?map=" +
> config.mapfile + "&server=" + config.dlegend_server);
>     alert(legend_xml);
>     legend.initialize("legend_container", legend_xml);
>     legend.setHandler(DLEGEND_CLICK, ms.setLayer);
>
>     ms.draw();

I assume that's in your window.onload function. And I am guessing that
when you say the alert doesn't give any errors, the alert isn't
opening at all. So I don't think your window.onload is getting called,
or it is generating an error before legend_xml gets initialized.

Try moving your alert up earlier in the code to see where it's
crapping out. Like to the first line in window.onload() so you can see
if window.onload is even getting called.

-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com



More information about the mapserver-users mailing list