Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#306 closed defect (fixed)

Legend panel is empty with Raster/WMS data source

Reported by: jennyhe Owned by: madair
Priority: P2 Milestone: 2.0
Component: Widgets Version: 1.1.1
Severity: Major Keywords:
Cc: madair@… Browser: All
External ID: 1263361 Operating System: All
state: Committed

Description

From Autodesk QA

Stepts:

  1. Create one connection to WMS.

http://wms1.agr.gc.ca/cgi-bin/mapplant2000_f

  1. New layer with any data source -> New Map->New Flexible Web layout
  2. Open the web layout in IE

Results: Legend panel is empty and one error message from IE.

Expected results: Legend panel should display the layer item.

Workaround: N Regression:Y G21.6 works correctly.

Attachments (5)

legend_panel.PNG (69.4 KB ) - added by jennyhe 13 years ago.
Patch306.patch (2.1 KB ) - added by liuar 13 years ago.
RasterLayerIconInLegend.patch (1.7 KB ) - added by liuar 12 years ago.
RasterLayerIconInLegend.2.patch (1.6 KB ) - added by liuar 12 years ago.
RasterLayerIconInLegend.3.patch (1.6 KB ) - added by madair 12 years ago.

Download all attachments as: .zip

Change History (19)

by jennyhe, 13 years ago

Attachment: legend_panel.PNG added

comment:1 by liuar, 13 years ago

Resolution: fixed
Status: newclosed

comment:2 by liuar, 13 years ago

Resolution: fixed
Status: closedreopened

comment:3 by liuar, 13 years ago

The displayed raster layer icon is incorrect. I reverted the changes in http://trac.osgeo.org/fusion/changeset/1934, and it works. It seems the defect was caused by no styles in raster layer. The code logic should be updated.

Thanks, Arthur

by liuar, 13 years ago

Attachment: Patch306.patch added

comment:4 by liuar, 13 years ago

Cc: pspencer@… added

Hi Paul,

Would you please review this patch for me? There's no reply from other experts, but I am not sure if my update might affect other functions.

Thanks,
Arthur

comment:5 by pagameba, 13 years ago

Cc: madair@… pdeschamps@… added

I'll need to get this tested against mapserver, cc'ing Mike and Paul.

comment:6 by liuar, 12 years ago

Hello all,

I would like to know if I could submit the code or not. Will this patch break the mapserver legend icon?

Thanks,
Arthur

by liuar, 12 years ago

by liuar, 12 years ago

by madair, 12 years ago

comment:7 by madair, 12 years ago

Arthur: this 3 version of the patch works slightly better for MapServer since raster layers have a valid 'style' object but no icon in it. The new patch ovrerrides the image value for raster layers. If this still works in MapGuide, I would say go ahead and commit.

comment:8 by liuar, 12 years ago

The third patch works on MapGuide. Thanks Mike.

Arthur

comment:9 by liuar, 12 years ago

Resolution: fixed
Status: reopenedclosed

comment:10 by liuar, 12 years ago

Resolution: fixed
Status: closedreopened

Hi Mike,

Jenny and I find that the DWF icon is not the displayed incorrectly which is a disabled icon

In Legend.js, to create raster and DWF icon,

        // MapGuide Raster and DWF layer 
        if (layer.layerTypes[0] == 4 ) {
            if (style && style.staticIcon == Fusion.Constant.LAYER_DWF_TYPE) {
                opt.image = this.imgLayerDWFIcon;
            } else {
                opt.image = this.imgLayerRasterIcon;
            }
            opt.enabled = true;
        }


the DWF layer type 5 is never considered. Should be update to:

        // MapGuide Raster and DWF layer 
        if(layer.layerTypes[0] == 4){
            opt.image = this.imgLayerRasterIcon;
            opt.enabled = true;
        } else if(layer.layerTypes[0] == 5){
            opt.image = this.imgLayerDWFIcon;
            opt.enabled = true;
        }


to create the check box for layers,

              if (checkbox) {
                 layer.legend.treeItem.checkBox.checked = layer.visible?true:false;
              if (layer.layerTypes[0] == 4 || range.styles.length > 0) {
                layer.legend.treeItem.checkBox.disabled = false;
              } else {
                layer.legend.treeItem.checkBox.disabled = true;
              }
            }



which should be:

              if (checkbox) {
                 layer.legend.treeItem.checkBox.checked = layer.visible?true:false;
              if (layer.layerTypes[0] == 4 || layer.layerTypes[0] == 5 || range.styles.length > 0) {
                layer.legend.treeItem.checkBox.disabled = false;
              } else {
                layer.legend.treeItem.checkBox.disabled = true;
              }
            }


I am not sure if it's a defect or by design, so would you please give me your opinion?

Thanks,
Arthur

comment:11 by liuar, 12 years ago

Cc: pspencer@… pdeschamps@… removed

comment:12 by madair, 12 years ago

The changes proposed make sense and I can verify that the Legend still works with MapServer, but it is difficult to test all the possibilities. If this fixes the issue for you and the Sheboygan legend still appears correctly I would say go ahead and make the change.

comment:13 by liuar, 12 years ago

Resolution: fixed
state: NewCommitted
Status: reopenedclosed

Changeset [2108]

comment:14 by madair, 12 years ago

Milestone: Future2.0
Note: See TracTickets for help on using tickets.