<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Change filter or theme conditions through API</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2722" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=204295511-08112006><FONT face=Arial
color=#0000ff size=2>Bob,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=204295511-08112006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=204295511-08112006><FONT face=Arial
color=#0000ff size=2>This is a great help - thanks for
replying.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=204295511-08112006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=204295511-08112006><FONT face=Arial
color=#0000ff size=2>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.<FONT
size=2>SetLayerDefinition</FONT> to point to the amended version rather than
remove the layer, and add a new one back in.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=204295511-08112006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=204295511-08112006><FONT face=Arial
color=#0000ff size=2>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?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=204295511-08112006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=204295511-08112006><FONT face=Arial
color=#0000ff size=2>Keith</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Robert Bray [mailto:rbray@robertbray.net]
<BR><B>Sent:</B> 03 November 2006 17:32<BR><B>To:</B>
users@mapguide.osgeo.org<BR><B>Subject:</B> Re: [mapguide-users] Change filter
or theme conditions through API<BR></FONT><BR></DIV>
<DIV></DIV>Keith,<BR><BR>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:<BR><BR>1. Get the LayerDefintion ResourceIdentifier from
MgLayer.GetLayerDefinition.<BR>2. Read the XML by calling
MgResourceService::GetResourceContent.<BR>3. Load the XML document into
the W3C DOM objects (language specific).<BR>4. Manipulate the XML object
model.<BR>5. Save the XML to your session using
MgResourceService::SetResource.<BR>6. Replace the MgLayer in the Map with a new
one that points to your new Layer Definition. <BR><BR>Hope this
helps,<BR>Bob<BR><BR>Campbell, Keith A wrote:
<BLOCKQUOTE
cite=mid2D5D8AC034A54041A6B2AE1C9148CC310449304C@SGBBMA2102.wsatkins.com
type="cite">
<META content="MS Exchange Server version 6.5.7638.1" name=Generator><!-- Converted from text/rtf format -->
<P><FONT face=Arial size=2>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.</FONT></P><BR><BR>
<P align=center><FONT color="#ff0000"
defanghtml_style="background-color: rgb(255, 255, 255);"><STRONG><FONT
color=#000000>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</FONT>.</STRONG></FONT></P></BLOCKQUOTE><BR><BR><BR><FONT
style="BACKGROUND-COLOR: #ffffff">
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">This message has been
scanned for viruses by </FONT><A
href="http://bluepages.wsatkins.co.uk/?4318150"><FONT
style="BACKGROUND-COLOR: #ffffff"
color=#000000>MailControl</FONT></A></P></FONT>---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@mapguide.osgeo.org For additional
commands, e-mail: users-help@mapguide.osgeo.org </BODY></HTML>