<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
If you want to add it before the map loads, there is no session.<br>
This happens because the MapGuide AJAX viewer creates the session and
the runtime map.<br>
<br>
You have to create the LayerDefinition and the MapDefinition in the
Library repository.<br>
My best solution for this is to create a folder like "Libray://Temp".<br>
Then create a GUID for each resource, and dump it here.<br>
After the AJAX viewer loads, you may delete the created items, as it
then uses the RuntimeMap in the session repository.<br>
<br>
<pre class="moz-signature" cols="72">Regards, Kenneth, GEOGRAF A/S
</pre>
<br>
<br>
uXuf skrev:
<blockquote cite="mid:14843786.post@talk.nabble.com" type="cite">
  <pre wrap="">Its just a copy of the parcelmarker.xml from the samples. It works otherwise
with tasks, but I couldn't seem to get it work before the map is loaded.

uXuf


Jackie Ng wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">What does the feature source xml look like? It seems that feature source
xml is an invalid document.

- Jackie




uXuf wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">Hi all,
I am trying to add a dynamic layer to a map but before loading the map in
the map frame. It is supposed to work on some query string parameters and
should add a dynamic layer based on that information. I can add the Map
to the session. I want to query the map from the Session Repository and
work on a copy, however I keep getting the
Session:xxxx//PointPlotter.FeatureSource Exception occurred in method
MgResourceDefinitionManager.GetDocument at line 476 in file
c:\build_bond_area\mapguide_open_source_v1.2\build_18.1\mgdev\server\src\services\resource\ResourceDefinitionManager.cpp 
error.

Here is how I constructed the logic:
1- Make a new MgSite object
2- Use MgSite-&gt;Open with a new MgUserInformation object
3- store the session ID in a variable
4- Check GET parameters
5- if records exists depending on the GET parameters, make a new
MgSiteConnection object
6- Open this MgSiteConnection object with the session ID
7- Create a ResourceService by using MgSiteConnection-&gt;CreateService
8- Open the map by using $map-&gt;Open($resourceService, 'MapName') (EDIT: I
used the $map-&gt;Create() function)
9- Verify and add layers (building upon the Sheboygan Find Parcel example
from MG 1.1 samples)

Do I need to explicity add a feature source to the session repository?
But I think that's what exactly the CreatePointPlotterFeatureSource
function does from the findparcelsfunctions.php does in the samples.

And this error occurs when I call the CreatePointPlotterFeatureSource
function. When I add a new FeatureSource in the form of
MgResourceIdentifier it works fine (i.e. no errors generated), but on the
first call to the above-mentioned function it crashes. Apparently it
doesn't execute even the first line which I changed into an "echo" for
debugging purposes.

Anybody got any tips?

Regards,
uXuf


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