/** * @typedef {import('ngeo/query/MapQuerent').QueryResult} QueryResult */ /** * Results for a query source. * * @typedef {Object} QueryResultSource * @property {Feature[]} features The matching features for this source. * @property {number|string} id Identifier (can be not unique). * @property {string} label Label. * @property {number} [featuresCount] The total number of features that corresponds to the query. * @property {boolean} pending Is the request for this source still ongoing? * @property {boolean} [tooManyResults] If the last query for this source would return more features than the * configured limit. * @property {number} [totalFeatureCount] If `tooManyResults` is `true`, this contains the total number of * features. * @property {string} [identifierAttributeField] The field to use to identify the feature. * @property {string[]} [mergeComposants] The original datasources merged in merged result. * @property {string[]} [requestPartners] The datasources of the request (which are summed in totalFeatureCount). */ /** * @typedef {Object} WfsPermalinkData * @property {string} wfsType * @property {WfsPermalinkFilterGroup[]} filterGroups * @property {boolean} showFeatures */ /** * @typedef {Object} WfsPermalinkFilter * @property {string} property * @property {string[]|string} condition */ /** * @typedef {Object} WfsPermalinkFilterGroup * @property {WfsPermalinkFilter[]} filters */ /** * WFS permalink service that can be used to load features with a WFS * GetFeature request given query parameters. * * Resulting features are then highlighted and the map is zoomed to the nearest map extent. * * Configuration: * * ngeoWfsPermalinkOptions: * wfsTypes: * - featureType: * label: * featureNS: (optional, defaults to defaultFeatureNS) * featurePrefix: (optional, defaults to defaultFeaturePrefix) * urlName: (optional, defaults to 'ngeoPermalinkOgcserverUrl') * ogcServer: (optional, used to apply attribute aliases from the OGC server) * - ... * defaultFeatureNS: * defaultFeaturePrefix: * maxFeatures: (optional, defaults to 50) * pointRecenterZoom: (optional) * * For ``featureNS`` and ``featurePrefix`` have a look on the OpenLayers documentation: * https://openlayers.org/en/latest/apidoc/module-ol_format_WFS-WFS.html#writeGetFeature * * Example of configuration with alternate OGC Server: * * vars: * interfaces_config: * : * constants: * ngeoWfsPermalinkOptions: * wfsTypes: * - featureType: type_from_another_server * urlName: myCustomOgcServerUrl * ogcServer: My OGC Server # Used to find aliases for attributes * routes: * myCustomOgcServerUrl: * name: mapserverproxy * params: * ogcserver: My OGC Server * * Parameters: * * - ``wfs_layer`` tells what layer will be queried * - ``wfs_showFeatures`` (boolean) tells if the features should be * highlighted and listed (when true) or if the map should only be * recentered on the features (when false). Default is true. * - other parameters will be considered as WFS attribute/values filters and * must be of the form: * ``wfs_=`` * * Example: * http://example.com?wfs_layer=parcels&wfs_city=Oslo&wfs_number=12,34,56 * will load parcels #12, 34 and 56 of the city of Oslo. * * It is possible to define several groups of filtering parameters by: * * - adding a ``wfs_ngroups`` parameter telling how many groups are defined * - prefixing all filtering parameters by the number of each group, * starting at 0. For instance ``wfs_0_`` * * Example: * http://example.com?wfs_layer=parcels&wfs_ngroups=2&wfs_0_city=Oslo&wfs_0_number=12,34,56&wfs_1_city=Paris&wfs_1_number=78,90 * will load parcels #12, 34 and 56 of the city of Oslo as well as * parcels #78 and 90 of the city of Paris. * * @class * @param {angular.IHttpService} $http Angular $http service. * @param {QueryResult} ngeoQueryResult The ngeo query result service. * @param {import('ngeo/options').ngeoWfsPermalinkOptions} ngeoWfsPermalinkOptions The options to * configure the ngeo wfs permalink service with. * @param {import('ngeo/options').gmfFitOptions} gmfFitOptions The fit options. * @param {angular.auto.IInjectorService} $injector Injector. * @param {import("gmf/theme/Themes.js").ThemesService} gmfThemes The gmf Themes service. * @ngdoc service * @ngname ngeoWfsPermalink */ export function WfsPermalinkService($http: angular.IHttpService, ngeoQueryResult: QueryResult, ngeoWfsPermalinkOptions: import("ngeo/options").ngeoWfsPermalinkOptions, gmfFitOptions: import("ngeo/options").gmfFitOptions, $injector: angular.auto.IInjectorService, gmfThemes: import("gmf/theme/Themes.js").ThemesService): void; export class WfsPermalinkService { /** * @typedef {import('ngeo/query/MapQuerent').QueryResult} QueryResult */ /** * Results for a query source. * * @typedef {Object} QueryResultSource * @property {Feature[]} features The matching features for this source. * @property {number|string} id Identifier (can be not unique). * @property {string} label Label. * @property {number} [featuresCount] The total number of features that corresponds to the query. * @property {boolean} pending Is the request for this source still ongoing? * @property {boolean} [tooManyResults] If the last query for this source would return more features than the * configured limit. * @property {number} [totalFeatureCount] If `tooManyResults` is `true`, this contains the total number of * features. * @property {string} [identifierAttributeField] The field to use to identify the feature. * @property {string[]} [mergeComposants] The original datasources merged in merged result. * @property {string[]} [requestPartners] The datasources of the request (which are summed in totalFeatureCount). */ /** * @typedef {Object} WfsPermalinkData * @property {string} wfsType * @property {WfsPermalinkFilterGroup[]} filterGroups * @property {boolean} showFeatures */ /** * @typedef {Object} WfsPermalinkFilter * @property {string} property * @property {string[]|string} condition */ /** * @typedef {Object} WfsPermalinkFilterGroup * @property {WfsPermalinkFilter[]} filters */ /** * WFS permalink service that can be used to load features with a WFS * GetFeature request given query parameters. * * Resulting features are then highlighted and the map is zoomed to the nearest map extent. * * Configuration: * * ngeoWfsPermalinkOptions: * wfsTypes: * - featureType: * label: * featureNS: (optional, defaults to defaultFeatureNS) * featurePrefix: (optional, defaults to defaultFeaturePrefix) * urlName: (optional, defaults to 'ngeoPermalinkOgcserverUrl') * ogcServer: (optional, used to apply attribute aliases from the OGC server) * - ... * defaultFeatureNS: * defaultFeaturePrefix: * maxFeatures: (optional, defaults to 50) * pointRecenterZoom: (optional) * * For ``featureNS`` and ``featurePrefix`` have a look on the OpenLayers documentation: * https://openlayers.org/en/latest/apidoc/module-ol_format_WFS-WFS.html#writeGetFeature * * Example of configuration with alternate OGC Server: * * vars: * interfaces_config: * : * constants: * ngeoWfsPermalinkOptions: * wfsTypes: * - featureType: type_from_another_server * urlName: myCustomOgcServerUrl * ogcServer: My OGC Server # Used to find aliases for attributes * routes: * myCustomOgcServerUrl: * name: mapserverproxy * params: * ogcserver: My OGC Server * * Parameters: * * - ``wfs_layer`` tells what layer will be queried * - ``wfs_showFeatures`` (boolean) tells if the features should be * highlighted and listed (when true) or if the map should only be * recentered on the features (when false). Default is true. * - other parameters will be considered as WFS attribute/values filters and * must be of the form: * ``wfs_=`` * * Example: * http://example.com?wfs_layer=parcels&wfs_city=Oslo&wfs_number=12,34,56 * will load parcels #12, 34 and 56 of the city of Oslo. * * It is possible to define several groups of filtering parameters by: * * - adding a ``wfs_ngroups`` parameter telling how many groups are defined * - prefixing all filtering parameters by the number of each group, * starting at 0. For instance ``wfs_0_`` * * Example: * http://example.com?wfs_layer=parcels&wfs_ngroups=2&wfs_0_city=Oslo&wfs_0_number=12,34,56&wfs_1_city=Paris&wfs_1_number=78,90 * will load parcels #12, 34 and 56 of the city of Oslo as well as * parcels #78 and 90 of the city of Paris. * * @class * @param {angular.IHttpService} $http Angular $http service. * @param {QueryResult} ngeoQueryResult The ngeo query result service. * @param {import('ngeo/options').ngeoWfsPermalinkOptions} ngeoWfsPermalinkOptions The options to * configure the ngeo wfs permalink service with. * @param {import('ngeo/options').gmfFitOptions} gmfFitOptions The fit options. * @param {angular.auto.IInjectorService} $injector Injector. * @param {import("gmf/theme/Themes.js").ThemesService} gmfThemes The gmf Themes service. * @ngdoc service * @ngname ngeoWfsPermalink */ constructor($http: angular.IHttpService, ngeoQueryResult: QueryResult, ngeoWfsPermalinkOptions: import("ngeo/options").ngeoWfsPermalinkOptions, gmfFitOptions: import("ngeo/options").gmfFitOptions, $injector: angular.auto.IInjectorService, gmfThemes: import("gmf/theme/Themes.js").ThemesService); /** * @type {number} */ maxFeatures_: number; /** * @type {angular.auto.IInjectorService} */ $injector_: angular.auto.IInjectorService; /** * @type {import('ngeo/options').gmfFitOptions} */ _gmfFitOptions: import("ngeo/options").gmfFitOptions; /** * @type {Object} */ wfsTypes_: { [x: string]: import("ngeo/options").WfsType; }; /** * @type {string} */ defaultFeatureNS_: string; /** * @type {string} */ defaultFeaturePrefix_: string; /** * @type {number|undefined} */ pointRecenterZoom_: number | undefined; /** * @type {angular.IHttpService} */ $http_: angular.IHttpService; /** * @type {QueryResult} */ result_: QueryResult; /** * @type {import("gmf/theme/Themes.js").ThemesService} */ _gmfThemes: import("gmf/theme/Themes.js").ThemesService; /** * Clear the results. */ clear(): void; /** * Build a WFS GetFeature request for the given query parameter data, send the * request and add the received features to {@link QueryResult}. * * @param {WfsPermalinkData} queryData Query data for the WFS request. * @param {import('ol/Map').default} map The ol3 map object to get the current projection from. * @param {number} [zoomLevel] The level to zoom on when recentering on features. */ issue(queryData: WfsPermalinkData, map: import("ol/Map").default, zoomLevel?: number): void; /** * @param {import('ngeo/options').WfsType} wfsType Type. * @param {import('ol/format/filter/Filter').default} filter Filter. * @param {import('ol/Map').default} map The ol3 map object to get the current projection from. * @param {boolean} showFeatures Show features or only zoom to feature extent? * @param {number} [zoomLevel] The level to zoom on when recentering on features. */ issueRequest_(wfsType: import("ngeo/options").WfsType, filter: import("ol/format/filter/Filter").default, map: import("ol/Map").default, showFeatures: boolean, zoomLevel?: number): void; /** * @param {import('ol/Feature').FeatureLike[]} features Features. * @returns {import('ol/extent').Extent} The extent of all features. */ getExtent_(features: import("ol/Feature").FeatureLike[]): import("ol/extent").Extent; /** * Create OGC filters for the filter groups extracted from the query params. * * @param {WfsPermalinkFilterGroup[]} filterGroups Filter groups. * @returns {?import('ol/format/filter/Filter').default} OGC filters. */ createFilters_(filterGroups: WfsPermalinkFilterGroup[]): import("ol/format/filter/Filter").default | null; /** * Clear every features for all result sources and reset the total counter * as well. */ clearResult_(): void; } export namespace WfsPermalinkService { let $inject: string[]; /** * Join a list of filters with `and(...)`. * * @param {import('ol/format/filter/Filter').default[]} filters The filters to join. * @returns {import('ol/format/filter/Filter').default} The joined filters. */ function and_(filters: import("ol/format/filter/Filter").default[]): import("ol/format/filter/Filter").default; /** * Join a list of filters with `or(...)`. * * @param {import('ol/format/filter/Filter').default[]} filters The filters to join. * @returns {import('ol/format/filter/Filter').default} The joined filters. */ function or_(filters: import("ol/format/filter/Filter").default[]): import("ol/format/filter/Filter").default; /** * Join a list of filters with a given join function. * * @param {import('ol/format/filter/Filter').default[]} filters The filters to join. * @param {function(import('ol/format/filter/Filter').default, import('ol/format/filter/Filter').default): import('ol/format/filter/Filter').default} joinFn * The function to join two filters. * @returns {import('ol/format/filter/Filter').default} The joined filters. */ function joinFilters_(filters: import("ol/format/filter/Filter").default[], joinFn: (arg0: import("ol/format/filter/Filter").default, arg1: import("ol/format/filter/Filter").default) => import("ol/format/filter/Filter").default): import("ol/format/filter/Filter").default; } export default myModule; export type QueryResult = import("ngeo/query/MapQuerent").QueryResult; /** * Results for a query source. */ export type QueryResultSource = { /** * The matching features for this source. */ features: Feature[]; /** * Identifier (can be not unique). */ id: number | string; /** * Label. */ label: string; /** * The total number of features that corresponds to the query. */ featuresCount?: number; /** * Is the request for this source still ongoing? */ pending: boolean; /** * If the last query for this source would return more features than the * configured limit. */ tooManyResults?: boolean; /** * If `tooManyResults` is `true`, this contains the total number of * features. */ totalFeatureCount?: number; /** * The field to use to identify the feature. */ identifierAttributeField?: string; /** * The original datasources merged in merged result. */ mergeComposants?: string[]; /** * The datasources of the request (which are summed in totalFeatureCount). */ requestPartners?: string[]; }; export type WfsPermalinkData = { wfsType: string; filterGroups: WfsPermalinkFilterGroup[]; showFeatures: boolean; }; export type WfsPermalinkFilter = { property: string; condition: string[] | string; }; export type WfsPermalinkFilterGroup = { filters: WfsPermalinkFilter[]; }; import angular from 'angular'; /** * @type {angular.IModule} * @hidden */ declare const myModule: angular.IModule; import Feature from 'ol/Feature';