[mapguide-users] modifying map before the WebLayout loads

David Hequet david.hequet at free.fr
Fri Jul 20 10:08:43 EDT 2007


hum ok, my code miss this:

Load WebLayout
Modify WebLayout to point to session map
Save WebLayout in session repo
Open viewer pointing to WebLayout in Session repo 

Since there is no API to access WebLayout, i dont know how to acces/modify
the Layout.
Thank you!


Kenneth, GEOGRAF A/S wrote:
> 
> I realise that the supplied code is just a snip of the actual code, but 
> the overal procedure should be:
> Create session
> Load MapDefinition
> Modify MapDefinition as needed
> Save MapDefinition in session repo
> Load WebLayout
> Modify WebLayout to point to session map
> Save WebLayout in session repo
> Open viewer pointing to WebLayout in Session repo
> 
> If you modify any layers, you must also save those to the session repo, 
> and update the MapDefintion to point to those.
> 
> Below I think you are saving a runtime map, rather than the MapDefinition.
> I belive the viewer will overwrite any existing runtime maps.
> 
> Regards, Kenneth, GEOGRAF A/S
> 
> 
> 
> 
> David Hequet skrev:
>> Hi,
>>
>> I'm using Mapguide Enterprise 2008 / MGOS1.2 and i can't solve this:
>>
>> I have a frame containing mapguide viewer.
>> This frame performs VB.net scripts that initialize the Session and
>> eventually modify the mapdefinition (setting filter's on layer..)
>>
>> I can Access the map before the WebLayout Load process like this:
>> (assuming
>> that sessionId and resourceService are well intialized)
>>
>> Dim aMap As New MgMap()
>> dim aMapname as String = "MyMapName"
>>
>> resId = New MgResourceIdentifier(aMapLibraryPath & aMapname & "." &
>> MgResourceType.MapDefinition)
>> aMap.Create(resourceService, resId, aMapname)
>> Dim mapStateId As MgResourceIdentifier = New
>> MgResourceIdentifier("Session:"
>> + sessionId + "//" + aMapname + "." + MgResourceType.Map)
>> aMap.Save(resourceService, mapStateId)
>>
>> It actually work, i access the MgMap Object, can perform modification.
>> But
>> when the the layout loads after these modification (via
>> "http://localhost/mapguide/mapviewerajax/?Session=" + sessionId +
>> "&WebLayout=Library://myLayout.WebLayout&LOCALE=fr" on my frame) it seems
>> to
>> re-initialize the MapDefinition :
>> If i access it and ask about my modified Filters, there back to original
>> value..
>> I'm almost sure this code was good working using Mapguide 2007 / MGOS
>> 1.0.
>>
>> Does the WebLayout Load process changed?
>> I you have an idea that can help me..
>>   
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> 
> 

-- 
View this message in context: http://www.nabble.com/modifying-map-before-the-WebLayout-loads-tf4116094s16610.html#a11708876
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list