[mapguide-trac] #1964: Group property empty on RuntimeMap layers
from basemap group/layer
MapGuide Open Source
trac_mapguide at osgeo.org
Tue Mar 6 09:31:48 EST 2012
#1964: Group property empty on RuntimeMap layers from basemap group/layer
-----------------------+----------------------------------------------------
Reporter: hm | Owner: jng
Type: defect | Status: new
Priority: medium | Milestone:
Component: Maestro | Version:
Severity: minor | Keywords: MaestroAPI, base layer group
External_id: |
-----------------------+----------------------------------------------------
Steps to reproduce:
1. Create a map with a group and a layer. Convert the group to a base
layer group.
When you create a runtimemap using IMappingService.CreateMap() and run the
following code, the Group property string of the layer is empty:
foreach (RuntimeMapLayer l in map.Layers)
{
Console.Writeline(l.Group);
}
Fix:
in the MaestroAPI. RuntimeMap.cs constructor:
internal RuntimeMap(IMapDefinition mdf, double metersPerUnit)
: this(mdf.CurrentConnection)
update the code inside:
if(mdf.BaseMap != null)
{
.
.
.
foreach (var layer in group.BaseMapLayer)
{
var rtl = _mapSvc.CreateMapLayer(this, layer);
rtl.Visible = true;
rtl.Type = RuntimeMapLayer.kBaseMap;
NEW LINE --> rtl.Group = group.Name;
this.Layers.Add(rtl);
}
.
.
.
}
Best regards
Hans Milling...
--
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/1964>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals
More information about the mapguide-trac
mailing list