Opened 15 years ago
Last modified 15 years ago
#1175 closed defect
Failed to set map name using MgMap.Open — at Initial Version
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: |
Description
a.Assume we have a MapDefinition called “Library://Test/Default.MapDefinition”;[[BR]]
b.We create the map using the following code:
MgMap map = new MgMap(); map.Create(resourceService, new MgResourceIdentifier(“Library://Test/Default.MapDefinition”), “Default1234”); map.Save();
c.In other code, we want to use this map, so we use this code:
MgMap map = new MgMap(); map.Open(resourceService, “Default1234”);
d.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”.