<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
This is a PHP version of the same:<br>
<a class="moz-txt-link-freetext" href="http://trac.osgeo.org/mapguide/wiki/CodeSamples/PHP/AddLayerToInitialMap">http://trac.osgeo.org/mapguide/wiki/CodeSamples/PHP/AddLayerToInitialMap</a><br>
<br>
If you are using .Net, be aware of the UTF-8 BOM problem, as it
validates, but fails to create the map.<br>
If you are using .Net, you can try the MaestroAPI:<br>
<a class="moz-txt-link-freetext" href="http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/AddInitialLayer">http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/AddInitialLayer</a><br>
<pre class="moz-signature" cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
</pre>
<br>
<br>
Galois skrev:
<blockquote cite="mid:19974012.post@talk.nabble.com" type="cite">
  <pre wrap="">Hello,

if u find a way to solve your problem, can u plZ show me some sample code.

I'm trying also to add a layer via .NET and I'm going really crazy with that
thing...

Thx in advance!



Carl Grice wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi,

I am trying to programmatically filter and add a layer to a map that
exists in the repository before the map is initially loaded in the clients
viewer. The steps i am performing are as follows;

1)Initialize the web teir and open site
2)Create a new session and open a site connection
3)Use map.create() to create a map from an existing map definition in the
repository
4)Create a session resource identifier and use map.Save() to save the
existing map into the session repository
5)Use map.Open() to open the map resource just created in the session
repository
6)Use map.Getlayers() and insert() to add a new layer into the map
7)use map.save() to save the map with the added layer into the session
repository

When i debug my code i get no errors and the map displays in the viewer
but the added layer does not (even after performing a map refresh).

Please can you point me in the direction of a sample that performs a
similar task or provide a code example? (I have found similar problems
disscussed but cannot find a solution)

Thanks in advance.

    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
</blockquote>
</body>
</html>