[mapguide-users] Change filter or theme conditions through API

Campbell, Keith A keith.campbell at atkinsglobal.com
Wed Nov 8 07:01:45 EST 2006


Bob,
 
This is a great help - thanks for replying.
 
I've been working through this, and referring to some of the samples and
the Dev guide. I think that in point 6 I can use
MgLayer.SetLayerDefinition to point to the amended version rather than
remove the layer, and add a new one back in.
 
I have another question, as this code all seems to run through as
expected  but the map is not updated. I'm assuming that this is because
I'll need to alter the map definition to point to the amended layer def,
and then the web layout definition to point to the amended map def?
 
Keith

________________________________

From: Robert Bray [mailto:rbray at robertbray.net] 
Sent: 03 November 2006 17:32
To: users at mapguide.osgeo.org
Subject: Re: [mapguide-users] Change filter or theme conditions through
API


Keith,

Yes this is possible. You need to modify the Layer Definition XML it
cannot be done by manipulating the MgLayer object. The general approach
is:

1. Get the LayerDefintion ResourceIdentifier from
MgLayer.GetLayerDefinition.
2. Read the XML by calling MgResourceService::GetResourceContent.
3. Load the XML document into the  W3C DOM objects (language specific).
4. Manipulate the XML object model.
5. Save the XML to your session using MgResourceService::SetResource.
6. Replace the MgLayer in the Map with a new one that points to your new
Layer Definition. 

Hope this helps,
Bob

Campbell, Keith A wrote: 

	Presumably it is possible to change conditions for themes or
filters for layers through the API? I can get the layer, but I can't see
any methods that give access to the theme or filter set-up - just things
like the legend label, visibility, etc.



	This email and any attached files are confidential and copyright
protected. If you are not the addressee, any dissemination of this
communication is strictly prohibited. Unless otherwise expressly agreed
in writing, nothing stated in this communication shall be legally
binding.




This message has been scanned for viruses by MailControl
<http://bluepages.wsatkins.co.uk/?4318150> 

--------------------------------------------------------------------- To
unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org For additional
commands, e-mail: users-help at mapguide.osgeo.org 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20061108/8d4d1880/attachment.html


More information about the Mapguide-users mailing list