<!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">
Then it is difficult.<br>
There are two ways.<br>
1) Get the resourceID for the MapDefinition (I can't remember if it is
avalible in the viewer directly, but it should be)<br>
Then get the MapDefinition like below, and search through the layers in
the map Xml.<br>
This assumes that the current map has not been modified.<br>
<br>
2) Download and parse the binary runtime layers resource tag. (Very
difficult, but is the most correct way).<br>
If you have access to .Net on either the client or server, you can use
my .Net API to do this:<br>
<a class="moz-txt-link-freetext" href="http://code.google.com/p/mapstudioos/wiki/HowToUseMapGuideAPI">http://code.google.com/p/mapstudioos/wiki/HowToUseMapGuideAPI</a><br>
<pre class="moz-signature" cols="72">Regards, Kenneth, GEOGRAF A/S
</pre>
<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:alucas@srtec.com">alucas@srtec.com</a> skrev:
<blockquote
 cite="mid:14563051.83851210018335202.JavaMail.nabble@isper.nabble.com"
 type="cite">
  <pre wrap="">I have only the layer name via mapFrame.GetLayers() and I need to get the path to the layerdefinition resource id.


Kenneth, GEOGRAF A/S wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">So you have the resourceId, but need the layerdefinition xml?
Look at <a class="moz-txt-link-freetext" href="http://localhost/mapguide/mapagent/index.html">http://localhost/mapguide/mapagent/index.html</a>
Click "Resource", then "GetResourceContent".
Fill in the field "Resource ID" and click submit.
You can read the URL of the resulting page:
<a class="moz-txt-link-freetext" href="http://localhost/mapguide/mapagent/mapagent.fcgi?OPERATION=GETRESOURCECONTENT&VERSION=1.0.0&LOCALE=en&RESOURCEID=Library%3A%2F%2FTest%2FSources%2FWorld.FeatureSource&FORMAT=text%2Fxml">http://localhost/mapguide/mapagent/mapagent.fcgi?OPERATION=GETRESOURCECONTENT&amp;VERSION=1.0.0&amp;LOCALE=en&amp;RESOURCEID=Library%3A%2F%2FTest%2FSources%2FWorld.FeatureSource&amp;FORMAT=text%2Fxml</a>

If you have a sessionID, you can append it as a parameter like:
&amp;SESSION=...sessionid...
That will prevent it from asking about a username/password.
Alternatively add "&amp;USERNAME=Anonymous&amp;PASSWORD="

Regards, Kenneth, GEOGRAF A/S



<a class="moz-txt-link-abbreviated" href="mailto:alucas@srtec.com">alucas@srtec.com</a> skrev:
    </pre>
    <blockquote type="cite">
      <pre wrap="">Hi kenneth,

I need the layer definition for a layer.

Kenneth, GEOGRAF A/S wrote:
  
      </pre>
      <blockquote type="cite">
        <pre wrap="">What do you have to query with?
The map definition?
The runtime map?
The layer guid?
The layer name?
The layer xml?

Regards, Kenneth, GEOGRAF A/S



alucas skrev:
    
        </pre>
        <blockquote type="cite">
          <pre wrap="">Hello,

I know this is a strange question, but it's possible to get the
resource
id
from a layer through mapagent? I need to get this information without
using
the server API if it is possible.

For example: For the parcel's layer, I need to get
Library://Samples/Sheboygan/Layers/Parcels.LayerDefinition

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>


    
        </pre>
      </blockquote>
      <pre wrap="">Quoted from: 
<a class="moz-txt-link-freetext" href="http://www.nabble.com/getting-layerdefinition-tp17067340p17069516.html">http://www.nabble.com/getting-layerdefinition-tp17067340p17069516.html</a>

  
      </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>


    </pre>
  </blockquote>
  <pre wrap=""><!---->Quoted from: 
<a class="moz-txt-link-freetext" href="http://www.nabble.com/getting-layerdefinition-tp17067340p17069757.html">http://www.nabble.com/getting-layerdefinition-tp17067340p17069757.html</a>

  </pre>
</blockquote>
</body>
</html>