SpatialFilterOptions Object

Bing
 

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

NameTypeDescription
spatialFilterTypestringRequired. 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.
locationstring or LocationLocation at which the filter should be applied (only for nearby filter).
radiusnumberRadius to use when performing a nearby search. The distance in kilometers and must be between 0.16 and 1000 kilometers. (only for nearby filter).
startstring or LocationStart location of the route (only for nearRoute filter)
endstring or LocationEnd location of the route (only for nearRoute filter).
intersectsstring or LocationRect or IPrimitiveIntersection 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.

NameTypeDescription
avoidstring[]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.
distanceBeforeFirstTurnnumberAn integer distance specified in meters. Use this parameter to make sure that the moving vehicle has enough distance to make the first turn.
headingnumberAn 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.
optimizestringThe 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.
travelModestringThe 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.

Show: