FindNearRouteSpecification.Options Property
FindNearRouteSpecification.Options Property
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 Options As FindOptions
[C#]
public FindOptions Options;
Example
[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", _
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
findNearRouteSpecification.Options = New FindOptions()
findNearRouteSpecification.Options.Range = New FindRange()
findNearRouteSpecification.Options.Range.StartIndex = 0
findNearRouteSpecification.Options.Range.Count = 30
Dim findResults As FindResults = _
findServiceSoap.FindNearRoute(findNearRouteSpecification)
[C#]
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;
findnearroutespec.Options = new FindOptions();
findnearroutespec.Options.Range = new FindRange();
findnearroutespec.Options.Range.StartIndex = 0;
findnearroutespec.Options.Range.Count = 30;
FindResults foundResults;
foundResults = findService.FindNearRoute(findnearroutespec);
See Also
FindNearRouteSpecification Class | FindNearRoute Method | FindOptions Class