FindNearRouteSpecification.Filter Property

The filter (FindFilter object) to apply to the results; that is, the specific entity type, properties, and values that the returned results must match. Required.

Public Property Filter As [Namespace].FindFilter
[C#]
public property [Namespace].FindFilter Filter

Remarks

  • The Filter property is used with the specification parameter of the FindServiceSoap.FindNearRoute method.
  • The Filter property is required; otherwise, a SOAP fault is returned.

Example

 
[Visual Basic]
    'This example assumes that the MapPoint Web Service 
    'namespace has been 
    Dim findServiceSoap As FindServiceSoap = New FindServiceSoap
    findServiceSoap.Credentials = _
        New NetworkCredential(myMapPointUserId, mySecurePassword)
    Dim routeServiceSoap As RouteServiceSoap = New RouteServiceSoap
    routeServiceSoap.Credentials = _
        New NetworkCredential(myMapPointUserId, mySecurePassword)

    Dim latLongs As LatLong() = New LatLong() {New LatLong, New LatLong}
    latLongs(0).Latitude = 52.5
    latLongs(0).Longitude = 13.1
    latLongs(1).Latitude = 52.51
    latLongs(1).Longitude = 13.11
    Dim route As Route = _
        routeServiceSoap.CalculateSimpleRoute(latLongs, _
                                                "MapPoint.EU", _
                                            SegmentPreference.Quickest)
    Dim findNearRouteSpecification As FindNearRouteSpecification = _
                                        New FindNearRouteSpecification
    findNearRouteSpecification.DataSourceName = "MapPoint.FourthCoffeeSample"
    findNearRouteSpecification.Filter = New FindFilter
    findNearRouteSpecification.Filter.EntityTypeName = "FourthCoffeeShops"
    findNearRouteSpecification.Distance = 20.0
    findNearRouteSpecification.Route = route
    Dim findResults As FindResults = _
                findServiceSoap.FindNearRoute(findNearRouteSpecification)
    
 
[C#]
   //This example assumes that the MapPoint Web Service 
   //namespace has been imported 

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

   RouteServiceSoap routeService = new RouteServiceSoap();
   routeService.Credentials = 
    new System.Net.NetworkCredential(myMapPointUserId, mySecurePassword);
 
   //Route between two locations
   LatLong[] latLongs = new LatLong[2];
   latLongs[0] = new LatLong();
   latLongs[1] = new LatLong();
   latLongs[0].Latitude = 52.5;
   latLongs[0].Longitude = 13.1;
   latLongs[1].Latitude = 52.51;
   latLongs[1].Longitude = 13.11;

   Route myRoute = 
    routeService.CalculateSimpleRoute(latLongs, 
              "MapPoint.EU", SegmentPreference.Quickest);

   FindNearRouteSpecification findnearroutespec = 
            new FindNearRouteSpecification();

   findnearroutespec.DataSourceName = "MapPoint.FourthCoffeeSample";
   findnearroutespec.Filter = new FindFilter();
   findnearroutespec.Filter.EntityTypeName = "FourthCoffeeShops";
   findnearroutespec.Distance = 20;
   findnearroutespec.Route = myRoute;

   FindResults foundResults;
   foundResults = findService.FindNearRoute(findnearroutespec);
   
 

See Also

  FindNearRouteSpecification Class  |   FindNearRoute Method  |   FindFilter Class