SpatialFilterOptions Object

Represents the spatial filter options for querying a data source that is hosted in the Bing Spatial Data Services.

Properties

Name Type Description
spatialFilterType string Required. One of the following values:

  • nearby – Searches in a radius around a location.
  • nearRoute – Searches for results that are within 1 mile of a route.
  • intersects – Searches for results that intersect with the specified geometry.

Note: Note that the NavteqNA and NavteqEU data sources only support nearby queries.
location string or Location Location at which the filter should be applied (only for nearby filter).
radius number Radius to use when performing a nearby search. The distance in kilometers and must be between 0.16 and 1000 kilometers. (only for nearby filter).
start string or Location Start location of the route (only for nearRoute filter)
end string or Location End location of the route (only for nearRoute filter).
intersects string or LocationRect or IPrimitive Intersection object. Can be a well known text string or a LocationRect object. (only for intersects filter).

If performing a nearRoute query the following additional properties may optionally also be specified in in the SpatialFilterOptions object.

Name Type Description
avoid string[] A list of values that limit the use of highways and toll roads in the route. Supported values:

  • highways - Avoids the use of highways in the route.
  • tolls - Avoids the use of toll roads in the route.
  • minimizeHighways - Minimizes (tries to avoid) the use of highways in the route.
  • minimizeTolls - Minimizes (tries to avoid) the use of toll roads in the route.
distanceBeforeFirstTurn number An integer distance specified in meters. Use this parameter to make sure that the moving vehicle has enough distance to make the first turn.
heading number An integer value between 0 and 359 that represents degrees from north where north is 0 degrees and the heading is specified clockwise from north. For example, setting the heading of 270 degrees creates a route that initially heads west.
optimize string The optimization setting for the route calculation. One of the following values:

  • distance - The route is calculated to minimize the distance. Traffic information is not used.
  • time - The route is calculated to minimize the time. Traffic information is not used.
  • timeWithTraffic - The route is calculated to minimize the time and uses current traffic information.

Default: time.
travelMode string The type of directions to calculate. One of the following values:

  • Driving
  • Walking

Default: Driving.

Tip

The Bing Maps Spatial Data Services does all distance calculations in kilometers. You can use the Distance conversion functionality in the Spatial Math module if you prefer to work a different distance unit such as miles, meters, yards or feet.