[mapguide-trac] #1175: Failed to set map name using MgMap.Open

MapGuide Open Source trac_mapguide at osgeo.org
Thu Dec 3 20:53:54 EST 2009


#1175: Failed to set map name using MgMap.Open
-----------------------+----------------------------------------------------
   Reporter:  liuar    |       Owner:       
       Type:  defect   |      Status:  new  
   Priority:  low      |   Milestone:       
  Component:  General  |     Version:  2.0.2
   Severity:  trivial  |    Keywords:       
External_id:           |  
-----------------------+----------------------------------------------------
 a.Assume we have a MapDefinition called
 “Library://Test/Default.MapDefinition”;[[BR]]
 b.We create the map using the following code:[[BR]]

 {{{
     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:[[BR]]

 {{{
     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.[[BR]]

 If you open the code of
 “\\trunk\MgDev\Common\MapGuideCommon\MapLayer\Map.cpp”, you’ll find the
 line 504 and 505 is like this:[[BR]]

 {{{
     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.[[BR]]
 So we should put “m_name = mapName;” behind “MgResource::Open”.

-- 
Ticket URL: <https://trac.osgeo.org/mapguide/ticket/1175>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list