<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>The original use case was to facilitate minor edits to existing object properties but not sub-objects. For example, you can't replace all the classes in a layer through a string update to the layer itself. We certainly could make all that work cleaner if
 there were demand.<br>
<br>
</p>
<p>At least you get a proper error message... ;-)</p>
<p><br>
</p>
<p>Steve</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> mapserver-dev <mapserver-dev-bounces@lists.osgeo.org> on behalf of Tamas Szekeres <szekerest@gmail.com><br>
<b>Sent:</b> Sunday, October 8, 2017 12:49:55 PM<br>
<b>To:</b> mapserver-dev@lists.osgeo.org<br>
<b>Subject:</b> [mapserver-dev] Using updateFromString on existing items</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hi Devs,
<div><br>
</div>
<div>Is that a supported use case to apply updateFromString on an existing item or it should only be used only on a newly created item?</div>
<div><br>
</div>
<div>For example when I use layerObj.updateFromString on an existing layer I get the following error</div>
<div><br>
</div>
<div><span style="color:rgb(0,0,0);font-family:Consolas,Courier,monospace,serif,EmojiFont;font-size:13.3333px">loadProjection(): General error message. Projection is already initialized. Multiple projection definitions are not allowed in this object. (line
 10)</span><br>
</div>
<div><span style="color:rgb(0,0,0);font-family:Consolas,Courier,monospace,serif,EmojiFont;font-size:13.3333px"><br>
</span></div>
<div>This is because we don't have a proper cleanup code on the existing layer before calling loadLayer on it. The same applies to the other object types.</div>
<div><br>
</div>
Thanks,<br>
<br>
Tamas</div>
</div>
</body>
</html>