Web API Reference | MapGuide Open Source

- Overview
- Modules
- Classes

AddComputedProperty
AddFeatureProperty
MgFeatureQueryOptions
RemoveComputedProperty
RemoveFeatureProperty
SetBinaryOperator
SetFilter
SetOrderingFilter
SetSpatialFilter
INT32 MgFeatureQueryOptions::AddFeatureProperty | ( | CREFSTRING | propertyName | ) |
Call this method for each class property whose value you want retrieved by the MgFeatureService::SelectFeatures() call. Not calling this method results in the retrieval of all property values for each feature selected. .NET Syntax
`int AddFeatureProperty(string propertyName);`
Java Syntax
`int AddFeatureProperty(String propertyName);`
PHP Syntax
`int AddFeatureProperty(string propertyName);`
  Parameters:
  | propertyName | (String/string) The name of the class property to be added.
Returns: Returns the total number of properties added. Example (PHP)
     <?php
     $queryOptions->AddFeatureProperty("aDouble");
     $queryOptions->AddFeatureProperty("aSingle");
     $featureService->SelectFeatures($featureSrcResourceId, $featClassName, $queryOptions);
     ?>
     sqlplus> select aDouble,aSingle from featclass;
  Exceptions:
  | MgInvalidArgumentException | if property name is empty
Example (C#)
     using OSGeo.MapGuide;
     private MgFeatureQueryOptions queryOptions;
     private MgFeatureService featureService;
     private String className = "SdfFeatureClass";
     // the SDF file identified by this MgResourceIdentifier exists in the repository
     private MgResourceIdentifier resourceId;
     private MgFeatureReader featureReader;

     resourceId = new MgResourceIdentifier("Library://PlatformApiDocTests/SdfFeatureClass.FeatureSource");
     queryOptions = new MgFeatureQueryOptions();
     queryOptions.AddFeatureProperty("FeatId");
     queryOptions.AddFeatureProperty("anInt16");
     featureReader = featureService.SelectFeatures(resourceId, className, queryOptions);

Comments or suggestions? Send us feedback.