Class: Query service:ngeoQuery


new Query($http, $q, ngeoQueryResult, ngeoQueryOptions, ngeoLayerHelper)

The Query service provides a way to send WMS GetFeatureInfo and WFS GetFeature requests from visible layer objects within a map. Those do not necessarily need to have a WMS source. The Query service requires source configuration in order for layers to actually be considered queryable.

To know more about the specification of a source configuration, see ngeox.QuerySource

Name Type Description
$http angular.$http

Angular $http service.

$q angular.$q

The Angular $q service.

ngeoQueryResult ngeox.QueryResult

The ngeo query result service.

ngeoQueryOptions ngeox.QueryOptions|undefined

The options to configure the ngeo query service with.

ngeoLayerHelper ngeo.LayerHelper

Ngeo Layer Helper.


dimensions: Object:.<string:, string:>



Adds a new source to the query service.

A source must at least have an id configured. That id is then used to associate the corresponding layer object within a map.

A source will require a ol.source.ImageWMS or ol.source.TileWMS object. You can either set it directly in the config, or use the one from a given layer or let the query service create one for you using other source config such as url and params.

A source can be set with either a format and/or infoFormat, which will determine how the returned features of a query will be read.

This method will also create a result entry in the ngeoQueryResult value service.

Name Type Description
source ngeox.QuerySource

The source to add to the query service.


Add multiple sources at once in the order they are given.

Name Type Description
sources !Array.

The sources to add to the query service.


Clear the results.



The maximum number of features that are requested.

issue(map, object)

Issue a new request using a given map and a given object, which can be a coordinate or extent.

When given a coordinate, WMS GetFeatureInfo or WFS GetFeature requests will be made. If a layer supports WFS, a GetFeature request with a bbox around the coordinate are issued.

For an extent, WFS GetFeature is used.

Name Type Description
map ol.Map

The ol3 map object to fetch the layers from.

object ol.Coordinate|ol.Extent

The coordinate or extent to issue the request with.


Remove all sources.