FindNearRouteSpecification Class

Contains the search specification used in the FindServiceSoap.FindNearRoute method. Specifies the route, the search options to use, and the data source from which to get results.

Public Class FindNearRouteSpecification Inherits System.Object
    Member of [Namespace]
[C#]
public class FindNearRouteSpecification : System.Object
    Member of [Namespace]

Public Properties

public property DataSourceName A string representing the name of the data source (DataSource.Name property) in which to search for entities.  System.String
public property Distance The distance from the Route property in which to search, in distance units (DistanceUnit enumeration) as specified in the UserInfoFindHeader.DefaultDistanceUnit property. System.Double
public property Filter 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.  [Namespace].FindFilter
public property Options The search options (FindOptions object), which may include the range of results and a flag to identify which objects are desired in the returned results.  [Namespace].FindOptions
public property Route The route from which the points of interest are searched.  [Namespace].Route

Example

 
[Visual Basic]
    'This example assumes that the MapPoint Web Service 
    'namespace has been imported 
    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

  FindNearRoute Method