Share via


FindFilter.SortProperties Property

FindFilter.SortProperties Property

Array of entity property names (as an array of objects) used for sorting the find results returned from the point-of-interest and polygon find methods .


Public SortProperties As SortProperty()


[C#]

public SortProperty[] SortProperties;

Remarks

  • When you use multiple properties to sort the find results, the priority is given in the same order as they are specified.

  • If a sort is not specified, the following defaults are used for the find methods:

    1. FindNearby method—Sorted by increasing distance from the input Latitude/Longitude, and then by ascending Entity.ID where two locations have the same Latitude/Longitude or are exactly the same distance from the input Latitude/Longitude.

    2. FindByProperty method—Sorted by ascending Entity.ID value.

    3. FindByID method—Sorted in the same order the IDs were input via the FindByIDSpecification.EnityIDs array.

    4. FindNearRoute method—Sorted by increasing distance along the route, and then by increasing distance to the nearest point on the route and finally by ascending Entity.ID.

    5. FindPolygon method—Sorted by ascending Entity.ID value.

  • You can use up to three properties to sort find results. If more than three properties are specified, an exception is thrown.

Example

[Visual Basic]

 Dim findServiceSoap As FindServiceSoap = New FindServiceSoap
    findServiceSoap.Credentials = _
        New NetworkCredential(myMapPointUserId, mySecurePassword)

    Dim findByPropertySpecification _
        As FindByPropertySpecification = New FindByPropertySpecification
    findByPropertySpecification.DataSourceName = "MapPoint.FourthCoffeeSample"
    findByPropertySpecification.Filter = New FindFilter
            findByPropertySpecification.Filter.EntityTypeName = "FourthCoffeeShops"

    findByPropertySpecification.Filter.Expression = New FilterExpression
    findByPropertySpecification.Filter.Expression.Text = "PrimaryCity = {0} AND IsWiFiHotSpot"
    findByPropertySpecification.Filter.Expression.Parameters = New Object() {"Berlin"}

    Dim findResults As FindResults = _
        findServiceSoap.FindByProperty(findByPropertySpecification)



[C#]

   FindServiceSoap findService = new FindServiceSoap();
   findService.Credentials = 
    new System.Net.NetworkCredential(myMapPointUserId, mySecurePassword);

   FindByPropertySpecification findbypropspec = new FindByPropertySpecification();

   findbypropspec.DataSourceName = "MapPoint.FourthCoffeeSample";
   findbypropspec.Filter = new FindFilter();
   findbypropspec.Filter.EntityTypeName = "FourthCoffeeShops";


   findbypropspec.Filter.Expression = new FilterExpression();
   findbypropspec.Filter.Expression.Text = "PrimaryCity = {0} AND IsWiFiHotSpot";
   findbypropspec.Filter.Expression.Parameters = new object[] {"Berlin"};

   FindResults foundResults;
   foundResults = findService.FindByProperty(findbypropspec);


See Also

  FindFilter Class   |   SortProperty Class   |   EntityType.Name Property   |   FindServiceSoap Class   |   MapPoint Web Service Property Value Types