Opened 9 years ago

Closed 5 years ago

#655 closed enhancement (fixed)

API needs MgLayerGroup SetExpandInLegend Method

Reported by: amorsell Owned by:
Priority: low Milestone:
Component: Web API Version:
Severity: minor Keywords:
Cc: chrisclaydon, trevorwekel, brucedechant External ID:

Description

The API has an MgLayerGroup? GetExpandInLegend? method, but there is no SetExpandInLegend? method. When programmaticly creating a new layer group, having it expanded when the legend refreshes is often desirable and there is currently no way to do this. A good example can be seen in the Modifying Maps and Layers section of the developers samples. When adding any new layer to the map, the resultant Analysis group is collapsed each time and then has to be manually expanded by the end-user.

Attachments (3)

MgLayerGroup_SetExpandInLegend.patch (1.7 KB) - added by jng 7 years ago.
MgLayerGroup_SetExpandInLegend.2.patch (1.7 KB) - added by jng 7 years ago.
LayerGroupTest.zip (5.2 KB) - added by jng 7 years ago.
Simple PHP invoke URL test command

Download all attachments as: .zip

Change History (12)

comment:1 Changed 9 years ago by tomfukushima

Cc: chrisclaydon trevorwekel added

comment:2 Changed 9 years ago by tomfukushima

Cc: brucedechant added

comment:3 Changed 8 years ago by jbirch

Version: 2.0.1

Removing version from enhancement request. If this enhancement request has been addressed or is no longer required, please close ticket.

Changed 7 years ago by jng

Changed 7 years ago by jng

comment:4 Changed 7 years ago by jng

I've attached a patch which simply moves the SetExpandInLegend?() method from the INTERNAL_API section to the PUBLISHED_API section, thus exposing it to SWIG.

The 2nd patch is just a "cleaner" version of the first one.

comment:5 Changed 7 years ago by tomfukushima

Hi Jackie, to help whoever looks at this...what kind of testing did you do so far to check whether this works or not?

Changed 7 years ago by jng

Attachment: LayerGroupTest.zip added

Simple PHP invoke URL test command

comment:6 Changed 7 years ago by jng

Hi Tom,

I wrote a simple PHP invoke URL command that uses the (made public) SetExpandInLegend?() API. It is attached here (along with a mgp containing the weblayout with this command)

When you run the command it will add a new layer group to the legend which is initally expanded. If you comment out the SetExpandInLegend?() call and run the command again (on a fresh map), the new layer group is added to the legend but is not initially expanded (the old behaviour)

comment:7 Changed 7 years ago by jng

The effect of this API change on other PlatformBase? implementations like AutoCAD Map is unknown for obvious reasons (I am not an Autodesk developer) :D

comment:8 Changed 7 years ago by trevorwekel

MgLayerGroup has not changed since 2006. The SetExpandInLegend() may have been excluded from PUBLISHED_API for a compatibility reason with the DWF viewer. From what I recall (really ancient history and Walt might remember more) only certain state changes could be propagated through eMap DWF. This may have been one of them.

As far as I know, we do not support eMap DWF anymore so this change is probably safe assuming it does not do something bad to AutoCAD Map.

comment:9 Changed 5 years ago by jng

Resolution: fixed
Status: newclosed

Fixed r7137

Note: See TracTickets for help on using tickets.