Export (0) Print
Expand All

FindNearRouteSpecification Class

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

public class FindNearRouteSpecification : System.Object

Public Properties

public propertyDataSourceName

A string representing the name of the data source (DataSource.Name property) in which to search for entities.

public propertyDistance

The distance from the Route property in which to search, in distance units (DistanceUnit enumeration) as specified in the UserInfoFindHeader.DefaultDistanceUnit property.

public propertyFilter

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 propertyOptions

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.

public propertyRoute

The route from which the points of interest are searched.


[Visual Basic]

    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", _
    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 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 = 
              "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  

© 2015 Microsoft