<!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">
Sorry, I don't have any code for it, <br>
but you might be able to bend some of the PHP <br>
samples in the developers guide.<br>
<br>
Beware that the streams behave rather odd in .Net.<br>
<br>
Also, I have reported quite a few bugs regarding the parsing of saved
Xml.<br>
Generally these rules must be followed:<br>
1. Xml must be UTF-8 encoded.<br>
2. Xml document must not contain UTF-8 byte-order mark.<br>
3. Studio requires whitespace in the documents.<br>
<br>
<pre class="moz-signature" cols="72">Regards, Kenneth, GEOGRAF A/S
</pre>
<br>
<br>
Carl skrev:
<blockquote cite="mid:000301c7ddb9$2389f340$3101a8c0@carlspc49"
type="cite">
<pre wrap="">That does make perfect sense! The runtime map is being overwritten as I am
still passing the web layout to the viewer as the original web layout from
the library and not the session repository.
Thank you for detailing the required steps, I am currently trying to code
this in .Net, however as I am relatively new to the MapGuide API this may
take me a little while!
I don't suppose you have any code examples that I could follow or modify?
Thanks again for your feedback.
Carl Grice
Keynetix Ltd
Tel. +44 (0) 1527 68888
Fax. +44 (0) 1527 62880
Web Site: <a class="moz-txt-link-freetext" href="http://www.keynetix.com">http://www.keynetix.com</a>
IMPORTANT: Please address all support & sales correspondence
<a class="moz-txt-link-abbreviated" href="mailto:keynetix@key-systems.com">keynetix@key-systems.com</a>.
Addressing support questions to individuals may delay the response.
-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a>
[<a class="moz-txt-link-freetext" href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</a>] On Behalf Of Kenneth,
GEOGRAF A/S
Sent: 13 August 2007 15:16
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] programmatically add layer to initial map
When the viewer loads, it creates a map from the weblayout/mapdefinition
passed.
Your runtime map gets overwritten when the viewer starts.
Instead you can do this:
Initialize web tier
Create a session, and open connection
Use GetResource to retrieve the Xml for the WebLayout AND MapDefinition
Modify the MapDefinition Xml to your liking (add layers etc.)
Save the MapDefinition to the session repository, using SetResource.
Update the WebLayout's map resourceid to point towards your modified
WebLayout.
Save the WebLayout to the session repositiory, using SetResource
Start the viewer, pointing at the newly created WebLayout.
You may of course use the "Library://" repository, if you want the
changes to persist.
Regards, Kenneth, GEOGRAF A/S
Scott, Brian skrev:
</pre>
<blockquote type="cite">
<pre wrap="">Hi Carl -
What db are you using? I found, for example, that I could not filter at
</pre>
</blockquote>
<pre wrap=""><!---->run time against Postgres/PostGIS. I was able to create a whole new layer
based on points available in PG, but I had to extact the attributes, create
points, then apply them to a new layer. Very cumbersome, but for whatever
reason, filtering just wouldn't work w/PostGIS.
</pre>
<blockquote type="cite">
<pre wrap="">Good luck!
brian
-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a>
[<a class="moz-txt-link-freetext" href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</a>]On Behalf Of Carl Grice
Sent: Monday, August 13, 2007 10:01 AM
To: <a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
Subject: [mapguide-users] programmatically add layer to initial map
Hi,
I am trying to programmatically filter and add a layer to a map that
</pre>
</blockquote>
<pre wrap=""><!---->exists
</pre>
<blockquote type="cite">
<pre wrap="">in the repository before the map is initially loaded in the clients
</pre>
</blockquote>
<pre wrap=""><!---->viewer.
</pre>
<blockquote type="cite">
<pre wrap="">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
</pre>
</blockquote>
<pre wrap=""><!---->but
</pre>
<blockquote type="cite">
<pre wrap="">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
</pre>
</blockquote>
<pre wrap=""><!---->similar
</pre>
<blockquote type="cite">
<pre wrap="">task or provide a code example? (I have found similar problems disscussed
but cannot find a solution)
Thanks in advance.
</pre>
</blockquote>
<pre wrap=""><!---->_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
</pre>
</blockquote>
</body>
</html>