<!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">
The map->Create() should return the runtime map.<br>
However, when you start the viewer, it also calls map->Create() and
destroys your adjusted runtime map.<br>
So, you must do:<br>
<br>
1. Load MapDefinition from Library<br>
2. Insert the polygon layer into the Xml<br>
3. Save the MapDefinition to Session<br>
4. Load WebLayout from Library<br>
5. Modify WebLayout to use Session-based MapDefinition (from step 3)<br>
6. Save WebLayout to Session<br>
7. Redirect to Session-based WebLayout (from step 6)<br>
<br>
You can combine step 5 with your overriden zoom function.<br>
You might want to examine the MapDefinition xml to see how the layer
information looks (step 1).<br>
<br>
The runtime map is a binary chunk, not an xml document.<br>
(Actually it is a ResourceData file appended to an empty xml document)<br>
<pre class="moz-signature" cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
</pre>
<br>
<br>
gingerbbm skrev:
<blockquote cite="mid:19308752.post@talk.nabble.com" type="cite">
<pre wrap="">
Kenneth Skovhede, GEOGRAF A/S wrote:
</pre>
<blockquote type="cite">
<pre wrap="">You must add your layer to the MapDefinition in step 1.
</pre>
</blockquote>
<pre wrap=""><!---->
OK. I changed my code to do a $map->Create() based upon the Library Map
Definition, whereupon I create the polygon and layer and add it successfully
to $map.
I save that to an MgResourceIdentifier derived from
"Session:$sessionId//$mapName.Map".
Then what I try and do is GetResourceContent() on that MgResourceIdentifier
to load as XML. Then I create a new MgResourceIdentifier derived from
"Session:$sessionId//$sessionMdName.MapDefinition", and when I call
SetResource() against that the script breaks.
I suspect that something is going wrong before that though, because the
script also breaks if I try and echo the variable populated by the saveXML()
method.
</pre>
</blockquote>
</body>
</html>