Ticket #306 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

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@… External ID: 1263361
state: Committed Browser: All
Operating System: All

Description

From Autodesk QA

Stepts: 1. Create one connection to WMS.  http://wms1.agr.gc.ca/cgi-bin/mapplant2000_f 2. New layer with any data source -> New Map->New Flexible Web layout 3. 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

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

Change History

Changed 4 years ago by jennyhe

Changed 4 years ago by liuar

  • status changed from new to closed
  • resolution set to fixed

Changed 4 years ago by liuar

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 4 years ago by liuar

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

Changed 3 years ago by liuar

Changed 3 years ago by liuar

  • 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

Changed 3 years ago by pagameba

  • cc madair@…, pdeschamps@… added

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

Changed 3 years ago by liuar

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

Changed 3 years ago by liuar

Changed 3 years ago by liuar

Changed 3 years ago by madair

Changed 3 years ago by madair

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.

Changed 3 years ago by liuar

The third patch works on MapGuide. Thanks Mike.

Arthur

Changed 3 years ago by liuar

  • status changed from reopened to closed
  • resolution set to fixed

Changed 3 years ago by liuar

  • status changed from closed to reopened
  • resolution fixed deleted

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

Changed 3 years ago by liuar

  • cc pspencer@…, pdeschamps@… removed

Changed 3 years ago by madair

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.

Changed 3 years ago by liuar

  • status changed from reopened to closed
  • state changed from New to Committed
  • resolution set to fixed

Changeset [2108]

Changed 3 years ago by madair

  • milestone changed from Future to 2.0
Note: See TracTickets for help on using tickets.