#1175 closed defect (fixed)
Failed to set map name using MgMap.Open
Reported by: | liuar | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 2.2 |
Component: | General | Version: | 2.0.2 |
Severity: | trivial | Keywords: | |
Cc: | spark.liu@…; jenny.he@… | External ID: | 1289006 |
Description (last modified by )
- Assume we have a MapDefinition called “Library://Test/Default.MapDefinition”
- We create the map using the following code:
MgMap map = new MgMap(); map.Create(resourceService, new MgResourceIdentifier(“Library://Test/Default.MapDefinition”), “Default1234”); map.Save();
- In other code, we want to use this map, so we use this code:
MgMap map = new MgMap(); map.Open(resourceService, “Default1234”);
- Now the Name property for map in step c) is supposed to be “Default1234”. However, you’ll find it’s still “Default”, the name of map definition, not the name of map.
If you open the code of “
trunk\MgDev\Common\MapGuideCommon\MapLayer\Map.cpp”, you’ll find the line 504 and 505 is like this:
m_name = mapName; MgResource::Open(m_resourceService, resId);
However, MgResource::Open() will use the name of map definition, not the name of map to replace the value of m_name. So we should put “m_name = mapName;” behind “MgResource::Open()”.
Attachments (1)
Change History (5)
comment:1 by , 15 years ago
External ID: | → 1289006 |
---|
comment:2 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 15 years ago
The patch looks good.
In MgResource::Open(m_resourceService, resId); m_name is deserialized from stream, thus m_name = mapName; is override. To keep m_name is mapName as expected, the code should be moved down.
The code is submitted on behalf of Spark Liu to fix this ticket.
comment:4 by , 15 years ago
Description: | modified (diff) |
---|---|
Milestone: | → 2.2 |
Fixed in trunk. Submission r4461
Hi Spark,
Thanks & regards,
Christine