Opened 15 years ago
Closed 15 years ago
#324 closed defect (fixed)
Theme widget doesn't work because layer definition schema definition
Reported by: | christinebao | Owned by: | Christine Bao |
---|---|---|---|
Priority: | P2 | Milestone: | Future |
Component: | Widgets | Version: | 1.1.1 |
Severity: | Major | Keywords: | Theme |
Cc: | Chris Claydon | Browser: | All |
External ID: | 1276805 | Operating System: | All |
state: | New |
Description
Steps to reproduce:
Scenario 1:
- Load the attached bayarea_cities.sdf, let's name the layer as layer1.LayerDefinition.
- Create a map based on layer1.LayerDefinition using default setting, and create a flexible web layout based on the map using default setting. Let's name the web as web1.ApplicationDefinition.
- Open web1 in browser, choose Theme widget, using the default setting, and Apply.
Result: Nothing happens. The map is not themed.
Scenario 2:
- Load the attached bayarea_cities.sdf, let's name the layer as layer2.LayerDefinition. Make some change in layer2.LayerDefinition, for example, choose "OBJECTID" as Tooltips displayed for feature.
- Create a map based on layer2.LayerDefinition using default setting, and create a flexible web layout based on the map using default setting. Let's name the web as web2.ApplicationDefinition.
- Open web2 in browser, choose Theme widget, using the default setting, and Apply.
Result: The map is themed.
Attachments (3)
Change History (7)
by , 15 years ago
Attachment: | bayarea_cities.sdf added |
---|
comment:1 by , 15 years ago
by , 15 years ago
Attachment: | Ticket#324.patch added |
---|
comment:2 by , 15 years ago
Attach patch http://trac.osgeo.org/fusion/attachment/ticket/324/Ticket%23324.patch for fixing this defect.
by , 15 years ago
Attachment: | RefineTicket#324.patch added |
---|
comment:3 by , 15 years ago
Refine the patch by http://trac.osgeo.org/fusion/attachment/ticket/324/RefineTicket%23324.patch.
The new area rule should be inserted by order, otherwise the legend will be disordered.
comment:4 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Commit the patch to fix defect.
Note:
See TracTickets
for help on using tickets.
Tech diagnosis:
The key point is the original layer definition. Please use MapAgent / GetResourceContent to check the layer definitioins. Please pay special attention to the element <AreaTypeStyle>.
In layer1.LayerDefinition, it's:
And in layer2.LayerDefinition it's:
The difference is layer1.LayerDefinition contains additional element <ShowInLegend> besides <AreaRule>, while layer2.LayerDefinition doesn't.
How this defect happens?
The theme widget works in this way:
LayerDefinition-1.3.0.xsd defines <AreaTypeStyle> in this way:
It requires <AreaRule> must be ahead of <ShowInLegend>.
In scenario 1, because new <AreaRule> is appended to <AreaTypeStyle>, and it goes after <ShowInLegend>, an exception throws out when saving to DB XML.
In scenario 2, the above problem doesn't exist, so it works.
How to fix?
theme.php function ApplyTheme(): should decide whether <AreaTypeStyle> has additional element besides <AreaRule>. If yes, the new <AreaRule> should insert into first node. If no the new <AreaRule> should be appended.