Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#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 brucedechant)

  • 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)

Fix1175.patch (519 bytes ) - added by sparkliu 15 years ago.
The fix for the Ticket 1175

Download all attachments as: .zip

Change History (5)

comment:1 by christinebao, 15 years ago

External ID: 1289006

Hi Spark,

You already have fixing for this ticket. Would you please attach it for review/submission?

Thanks & regards,
Christine

by sparkliu, 15 years ago

Attachment: Fix1175.patch added

The fix for the Ticket 1175

comment:2 by sparkliu, 15 years ago

Resolution: fixed
Status: newclosed

comment:3 by christinebao, 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 brucedechant, 15 years ago

Description: modified (diff)
Milestone: 2.2

Fixed in trunk. Submission r4461

Note: See TracTickets for help on using tickets.