Redlining error

View: New views
16 Messages — Rating Filter:   Alert me  

Redlining error

by Marius_360 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

I need to develop a redlining application for a client using VB.Net and JavaScript.
I converted the demo code available, but get stuck with the “featureService.CreateFeatureSource” command, it gives me a “Objects of type 'OSGeo.MapGuide.MgService' do not have such a member” error

Marius

Re: Redlining error

by Kenneth Skovhede, GEOGRAF A/S :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How do you construct the featureService variable?

You should do something like:

Dim featureService as MgFeatureService  =
connection.CreateService(MgServiceType.FeatureService)
featureService.CreateFeatureSource(...., ....)


Regards, Kenneth Skovhede, GEOGRAF A/S



Marius_360 skrev:

> Hi
>
> I need to develop a redlining application for a client using VB.Net and
> JavaScript.
> I converted the demo code available, but get stuck with the
> “featureService.CreateFeatureSource” command, it gives me a “Objects of type
> 'OSGeo.MapGuide.MgService' do not have such a member” error
>
> Marius
>  
_______________________________________________
mapguide-users mailing list
mapguide-users@...
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Re: Redlining error

by Marius_360 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am using JavaScript :
var featureService = siteConnection.CreateService(MgServiceType.FeatureService);

featureService.CreateFeatureSource(resourceIdentifier, sdfParams);


Kenneth Skovhede, GEOGRAF A/S wrote:
How do you construct the featureService variable?

You should do something like:

Dim featureService as MgFeatureService  =
connection.CreateService(MgServiceType.FeatureService)
featureService.CreateFeatureSource(...., ....)


Regards, Kenneth Skovhede, GEOGRAF A/S



Marius_360 skrev:
> Hi
>
> I need to develop a redlining application for a client using VB.Net and
> JavaScript.
> I converted the demo code available, but get stuck with the
> “featureService.CreateFeatureSource” command, it gives me a “Objects of type
> 'OSGeo.MapGuide.MgService' do not have such a member” error
>
> Marius
>  
_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Re: Redlining error

by Kenneth Skovhede, GEOGRAF A/S :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What do you mean?

There is no MgServiceType declared in JavaScript?
You wrote that you used VB.Net in the original post.

You cannot use any of the Mg* classes from JavaScript because they are server side components.
Regards, Kenneth Skovhede, GEOGRAF A/S


Marius_360 skrev:
I am using JavaScript :
var featureService =
siteConnection.CreateService(MgServiceType.FeatureService);

featureService.CreateFeatureSource(resourceIdentifier, sdfParams);



Kenneth Skovhede, GEOGRAF A/S wrote:
  
How do you construct the featureService variable?

You should do something like:

Dim featureService as MgFeatureService  = 
connection.CreateService(MgServiceType.FeatureService)
featureService.CreateFeatureSource(...., ....)


Regards, Kenneth Skovhede, GEOGRAF A/S



Marius_360 skrev:
    
Hi

I need to develop a redlining application for a client using VB.Net and
JavaScript.
I converted the demo code available, but get stuck with the
“featureService.CreateFeatureSource” command, it gives me a “Objects of
type
'OSGeo.MapGuide.MgService' do not have such a member” error

Marius
  
      
_______________________________________________
mapguide-users mailing list
mapguide-users@...
http://lists.osgeo.org/mailman/listinfo/mapguide-users


    

  

_______________________________________________
mapguide-users mailing list
mapguide-users@...
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Re: Redlining error

by Marius_360 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, I’m using ASP.Net with JavaScript


Kenneth Skovhede, GEOGRAF A/S wrote:
What do you mean?

There is no MgServiceType declared in JavaScript?
You wrote that you used VB.Net in the original post.

You cannot use any of the Mg* classes from JavaScript because they are
server side components.

Regards, Kenneth Skovhede, GEOGRAF A/S



Marius_360 skrev:
> I am using JavaScript :
> var featureService =
> siteConnection.CreateService(MgServiceType.FeatureService);
>
> featureService.CreateFeatureSource(resourceIdentifier, sdfParams);
>
>
>
> Kenneth Skovhede, GEOGRAF A/S wrote:
>  
>> How do you construct the featureService variable?
>>
>> You should do something like:
>>
>> Dim featureService as MgFeatureService  =
>> connection.CreateService(MgServiceType.FeatureService)
>> featureService.CreateFeatureSource(...., ....)
>>
>>
>> Regards, Kenneth Skovhede, GEOGRAF A/S
>>
>>
>>
>> Marius_360 skrev:
>>    
>>> Hi
>>>
>>> I need to develop a redlining application for a client using VB.Net and
>>> JavaScript.
>>> I converted the demo code available, but get stuck with the
>>> “featureService.CreateFeatureSource” command, it gives me a “Objects of
>>> type
>>> 'OSGeo.MapGuide.MgService' do not have such a member” error
>>>
>>> Marius
>>>  
>>>      
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users@lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>
>>
>>    
>
>  

_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Re: Redlining error

by Kenneth Skovhede, GEOGRAF A/S :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, then you still have to do:
Dim featureService as MgFeatureService = siteConnection.CreateService(MgServiceType.FeatureService)
featureService.CreateFeatureSource(resourceIdentifier, sdfParams)

In VB.Net, because you cannot call the Mg* classes from JavaScript.

Regards, Kenneth Skovhede, GEOGRAF A/S


Marius_360 skrev:
Sorry, I’m using ASP.Net with JavaScript



Kenneth Skovhede, GEOGRAF A/S wrote:
  
What do you mean?

There is no MgServiceType declared in JavaScript?
You wrote that you used VB.Net in the original post.

You cannot use any of the Mg* classes from JavaScript because they are 
server side components.

Regards, Kenneth Skovhede, GEOGRAF A/S



Marius_360 skrev:
    
I am using JavaScript :
var featureService =
siteConnection.CreateService(MgServiceType.FeatureService);

featureService.CreateFeatureSource(resourceIdentifier, sdfParams);



Kenneth Skovhede, GEOGRAF A/S wrote:
  
      
How do you construct the featureService variable?

You should do something like:

Dim featureService as MgFeatureService  = 
connection.CreateService(MgServiceType.FeatureService)
featureService.CreateFeatureSource(...., ....)


Regards, Kenneth Skovhede, GEOGRAF A/S



Marius_360 skrev:
    
        
Hi

I need to develop a redlining application for a client using VB.Net and
JavaScript.
I converted the demo code available, but get stuck with the
“featureService.CreateFeatureSource” command, it gives me a “Objects of
type
'OSGeo.MapGuide.MgService' do not have such a member” error

Marius
  
      
          
_______________________________________________
mapguide-users mailing list
mapguide-users@...
http://lists.osgeo.org/mailman/listinfo/mapguide-users


    
        
  
      
_______________________________________________
mapguide-users mailing list
mapguide-users@...
http://lists.osgeo.org/mailman/listinfo/mapguide-users


    

  

_______________________________________________
mapguide-users mailing list
mapguide-users@...
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Re: Redlining error

by Marius_360 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, I changed it to:
var featureService = new MgFeatureService();
siteConnection.CreateService(MgServiceType.FeatureService);

featureService.CreateFeatureSource(resourceIdentifier, sdfParams)

But now I get:
OSGeo.MapGuide.MgUnclassifiedException: An unclassified exception occurred.



Kenneth Skovhede, GEOGRAF A/S wrote:
Ok, then you still have to do:

Dim featureService as MgFeatureService = siteConnection.CreateService(MgServiceType.FeatureService)
featureService.CreateFeatureSource(resourceIdentifier, sdfParams)


In VB.Net, because you cannot call the Mg* classes from JavaScript.

Regards, Kenneth Skovhede, GEOGRAF A/S



Marius_360 skrev:
> Sorry, I’m using ASP.Net with JavaScript
>
>
>
> Kenneth Skovhede, GEOGRAF A/S wrote:
>  
>> What do you mean?
>>
>> There is no MgServiceType declared in JavaScript?
>> You wrote that you used VB.Net in the original post.
>>
>> You cannot use any of the Mg* classes from JavaScript because they are
>> server side components.
>>
>> Regards, Kenneth Skovhede, GEOGRAF A/S
>>
>>
>>
>> Marius_360 skrev:
>>    
>>> I am using JavaScript :
>>> var featureService =
>>> siteConnection.CreateService(MgServiceType.FeatureService);
>>>
>>> featureService.CreateFeatureSource(resourceIdentifier, sdfParams);
>>>
>>>
>>>
>>> Kenneth Skovhede, GEOGRAF A/S wrote:
>>>  
>>>      
>>>> How do you construct the featureService variable?
>>>>
>>>> You should do something like:
>>>>
>>>> Dim featureService as MgFeatureService  =
>>>> connection.CreateService(MgServiceType.FeatureService)
>>>> featureService.CreateFeatureSource(...., ....)
>>>>
>>>>
>>>> Regards, Kenneth Skovhede, GEOGRAF A/S
>>>>
>>>>
>>>>
>>>> Marius_360 skrev:
>>>>    
>>>>        
>>>>> Hi
>>>>>
>>>>> I need to develop a redlining application for a client using VB.Net and
>>>>> JavaScript.
>>>>> I converted the demo code available, but get stuck with the
>>>>> “featureService.CreateFeatureSource” command, it gives me a “Objects of
>>>>> type
>>>>> 'OSGeo.MapGuide.MgService' do not have such a member” error
>>>>>
>>>>> Marius
>>>>>  
>>>>>      
>>>>>          
>>>> _______________________________________________
>>>> mapguide-users mailing list
>>>> mapguide-users@lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>>>
>>>>
>>>>    
>>>>        
>>>  
>>>      
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users@lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>
>>
>>    
>
>  

_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Re: Redlining error

by Carl Jokl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

When you say ASP.Net with JavaScript, where are you trying to create the feature source, on the client or the server?

MapGuide API has the web server API which can be invoked only from the server side which would handle such things as creating a new feature source and such.

There is also a viewer API written in JavaScript for manipulating the viewer.

The two API's are separate and cover different types of functionality. Creating new feature sources must be done on the server side. This could be done in theory with whatever .Net compliant language you are using. I use C#. I am not sure if you are using VB.Net or even JScript .Net on the server side.

Re: Redlining error

by Carl Jokl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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);
}

Re: Redlining error

by Marius_360 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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:
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);
}

Re: Redlining error

by Kenneth Skovhede, GEOGRAF A/S :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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:
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:
  
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);
}

    

  

_______________________________________________
mapguide-users mailing list
mapguide-users@...
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Re: Redlining error

by Marius_360 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Where does the OSGeo.MapGuide.MgService come from, in other words, in which dll in the bin folder?


Kenneth Skovhede, GEOGRAF A/S wrote:
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:
> 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:
>  
>> 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);
>> }
>>
>>    
>
>  

_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Re: Redlining error

by Carl Jokl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From what I can quickly read about JScript .Net it seems a bit more JavaScript 2.0 like and so the following may be possible:

var featureService: MgFeatureService = MgFeatureService(siteConnection.CreateService(MgServiceType.FeatureService));

featureService.CreateFeatureSource(resourceIdentifier, sdfParams);

JScript .Net from what I can see has the JavaScript 2.0 style typed variables i.e.

var <variable name> : <variable type>

And if I am reading the information on casting in JScript .Net correctly it looks like casting is a little wierd but of the form: <Variable or Specific type> = <Specific type class>( <variable of general type> );

and not what I would have been used to of <variable of specific type> = (<specific type class>) <variable of general type> which is the C# / Java style way of casting.

Re: Redlining error

by Kenneth Skovhede, GEOGRAF A/S :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


There is a class map together with the documentation:
http://mapguide.osgeo.org/2.0/documentation.html

This can be found in the Web API documentation:
http://mapguide.osgeo.org/files/mapguide/docs/webapi/index.htm

The specific class is here:
http://mapguide.osgeo.org/files/mapguide/docs/webapi/d5/d10/class_mg_feature_service.htm

And the "CreateService" is here:
http://mapguide.osgeo.org/files/mapguide/docs/webapi/df/d57/class_mg_site_connection.htm


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:
Where does the OSGeo.MapGuide.MgService come from, in other words, in which
dll in the bin folder?



Kenneth Skovhede, GEOGRAF A/S wrote:
  
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:
    
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:
  
      
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);
}

    
        
  
      
_______________________________________________
mapguide-users mailing list
mapguide-users@...
http://lists.osgeo.org/mailman/listinfo/mapguide-users


    

  

_______________________________________________
mapguide-users mailing list
mapguide-users@...
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Re: Redlining error

by Marius_360 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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:
There is a class map together with the documentation:
http://mapguide.osgeo.org/2.0/documentation.html

This can be found in the Web API documentation:
http://mapguide.osgeo.org/files/mapguide/docs/webapi/index.htm

The specific class is here:
http://mapguide.osgeo.org/files/mapguide/docs/webapi/d5/d10/class_mg_feature_service.htm

And the "CreateService" is here:
http://mapguide.osgeo.org/files/mapguide/docs/webapi/df/d57/class_mg_site_connection.htm


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:
> Where does the OSGeo.MapGuide.MgService come from, in other words, in which
> dll in the bin folder?
>
>
>
> Kenneth Skovhede, GEOGRAF A/S wrote:
>  
>> 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:
>>    
>>> 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:
>>>  
>>>      
>>>> 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);
>>>> }
>>>>
>>>>    
>>>>        
>>>  
>>>      
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users@lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>
>>
>>    
>
>  

_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Re: Redlining error

by Kenneth Skovhede, GEOGRAF A/S :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You are a bit unprecise:
"I’ve got the layerdefinitionfactory.php file included in my aspx page"
AFAIK, that is not possible.

The file LayerDefinition.php is a helper file that is used to create the various components of
a LayerDefinition.xml file, defined by LayerDefinition-1.2.0.xsd, for use in a preview of a featuresource.
Regards, Kenneth Skovhede, GEOGRAF A/S


Marius_360 skrev:
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:
  
There is a class map together with the documentation:
http://mapguide.osgeo.org/2.0/documentation.html

This can be found in the Web API documentation:
http://mapguide.osgeo.org/files/mapguide/docs/webapi/index.htm

The specific class is here:
http://mapguide.osgeo.org/files/mapguide/docs/webapi/d5/d10/class_mg_feature_service.htm

And the "CreateService" is here:
http://mapguide.osgeo.org/files/mapguide/docs/webapi/df/d57/class_mg_site_connection.htm


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:
    
Where does the OSGeo.MapGuide.MgService come from, in other words, in
which
dll in the bin folder?



Kenneth Skovhede, GEOGRAF A/S wrote:
  
      
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:
    
        
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:
  
      
          
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);
}

    
        
            
  
      
          
_______________________________________________
mapguide-users mailing list
mapguide-users@...
http://lists.osgeo.org/mailman/listinfo/mapguide-users


    
        
  
      
_______________________________________________
mapguide-users mailing list
mapguide-users@...</