<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
You are a bit unprecise:<br>
"I’ve got the layerdefinitionfactory.php file included in my aspx page"
<br>
AFAIK, that is not possible.<br>
<br>
The file LayerDefinition.php is a helper file that is used to create
the various components of <br>
a LayerDefinition.xml file, defined by LayerDefinition-1.2.0.xsd, for
use in a preview of a featuresource.<br>
<pre class="moz-signature" cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
</pre>
<br>
<br>
Marius_360 skrev:
<blockquote cite="mid:18529564.post@talk.nabble.com" type="cite">
<pre wrap="">Great, I got it to work with:
var featureService: MgFeatureService =
MgFeatureService(siteConnection.CreateService(MgServiceType.FeatureService));
Thanks
Now for my next problem…
What does the LayerDefinitionFactory do? I’ve got the
layerdefinitionfactory.php file included in my aspx page, but on the
var factory = new LayerDefinitionFactory();
var lineRule = factory.CreateLineRule(ruleLegendLabel, filter, color); I
get:
Variable 'LayerDefinitionFactory' has not been declared
Kenneth Skovhede, GEOGRAF A/S wrote:
</pre>
<blockquote type="cite">
<pre wrap="">
There is a class map together with the documentation:
<a class="moz-txt-link-freetext" href="http://mapguide.osgeo.org/2.0/documentation.html">http://mapguide.osgeo.org/2.0/documentation.html</a>
This can be found in the Web API documentation:
<a class="moz-txt-link-freetext" href="http://mapguide.osgeo.org/files/mapguide/docs/webapi/index.htm">http://mapguide.osgeo.org/files/mapguide/docs/webapi/index.htm</a>
The specific class is here:
<a class="moz-txt-link-freetext" href="http://mapguide.osgeo.org/files/mapguide/docs/webapi/d5/d10/class_mg_feature_service.htm">http://mapguide.osgeo.org/files/mapguide/docs/webapi/d5/d10/class_mg_feature_service.htm</a>
And the "CreateService" is here:
<a class="moz-txt-link-freetext" href="http://mapguide.osgeo.org/files/mapguide/docs/webapi/df/d57/class_mg_site_connection.htm">http://mapguide.osgeo.org/files/mapguide/docs/webapi/df/d57/class_mg_site_connection.htm</a>
As for dll, that depends... the class you are seeing is in
MapGuideDotNetApi.dll, but it is actually a wrapper
for the other dll files in that folder.
Regards, Kenneth Skovhede, GEOGRAF A/S
Marius_360 skrev:
</pre>
<blockquote type="cite">
<pre wrap="">Where does the OSGeo.MapGuide.MgService come from, in other words, in
which
dll in the bin folder?
Kenneth Skovhede, GEOGRAF A/S wrote:
</pre>
<blockquote type="cite">
<pre wrap="">So you are using JScript .Net?
In that case you might have to typecast it:
var featureService =
(MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService);
Not completely familiar with JScript.Net, but the error seems to
indicate that the object (featureService) is of type MgService.
MgService is a base class, and also the signature return type for
CreateService.
The actual type of the object returned is MgFeatureService.
Regards, Kenneth Skovhede, GEOGRAF A/S
Marius_360 skrev:
</pre>
<blockquote type="cite">
<pre wrap="">This is exactly how I had it from the beginning, but it gives me
“Objects
of
type 'OSGeo.MapGuide.MgService' do not have such a
member” error
Carl Jokl wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I will assume this must be JScript .Net because what you are doing
could
not work at all otherwise but I see the problem in the code:
var featureService = new MgFeatureService(); //You explicity create a
new
feature service. This is wrong
//This method call retrieves the feature service from the site
connection
but you are not storing the //returned value
siteConnection.CreateService(MgServiceType.FeatureService);
//This will not work because you explicity created this feature
service
instead of getting it from the feature ///service
featureService.CreateFeatureSource(resourceIdentifier, sdfParams)
I am not completely familiar with JScript .Net but I would think that
this
should be
//Get the feature service from the site connection, don't create it
explicity.
var featureService =
siteConnection.CreateService(MgServiceType.FeatureService);
//Assuming you correctly created the resource identifier and the sdf
params elsewhere this should work
if (featureService) //Checking the returned feature service was not
null
just in case.
{
featureService.CreateFeatureSource(resourceIdentifier,
sdfParams);
}
</pre>
</blockquote>
<pre wrap="">
</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="">
</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=""><!---->
</pre>
</blockquote>
</body>
</html>