/** * Provides methods for features, such as: * - style setting / getting * - measurement * - export * * @class * @param {angular.IFilterService} $filter Angular filter. * @param {import('ngeo/options').ngeoMeasurePrecision} ngeoMeasurePrecision The precision. * @param {import('ngeo/options').ngeoMeasureDecimals} ngeoMeasureDecimals The decimals. * @param {import('ngeo/options').ngeoMeasureSpherical} ngeoMeasureSpherical Spherical measure. * @param {import('ngeo/options').ngeoPointfilter} ngeoPointfilter the point filter. * @ngdoc service * @ngname ngeoFeatureHelper * @hidden */ export function FeatureHelper($filter: angular.IFilterService, ngeoMeasurePrecision: import("ngeo/options").ngeoMeasurePrecision, ngeoMeasureDecimals: import("ngeo/options").ngeoMeasureDecimals, ngeoMeasureSpherical: import("ngeo/options").ngeoMeasureSpherical, ngeoPointfilter: import("ngeo/options").ngeoPointfilter): void; export class FeatureHelper { /** * Provides methods for features, such as: * - style setting / getting * - measurement * - export * * @class * @param {angular.IFilterService} $filter Angular filter. * @param {import('ngeo/options').ngeoMeasurePrecision} ngeoMeasurePrecision The precision. * @param {import('ngeo/options').ngeoMeasureDecimals} ngeoMeasureDecimals The decimals. * @param {import('ngeo/options').ngeoMeasureSpherical} ngeoMeasureSpherical Spherical measure. * @param {import('ngeo/options').ngeoPointfilter} ngeoPointfilter the point filter. * @ngdoc service * @ngname ngeoFeatureHelper * @hidden */ constructor($filter: angular.IFilterService, ngeoMeasurePrecision: import("ngeo/options").ngeoMeasurePrecision, ngeoMeasureDecimals: import("ngeo/options").ngeoMeasureDecimals, ngeoMeasureSpherical: import("ngeo/options").ngeoMeasureSpherical, ngeoPointfilter: import("ngeo/options").ngeoPointfilter); /** * @type {angular.IFilterService} */ $filter_: angular.IFilterService; /** * @type {import('ngeo/options').ngeoMeasureDecimals} */ decimals_: import("ngeo/options").ngeoMeasureDecimals; /** * @type {import('ngeo/options').ngeoMeasurePrecision} */ precision_: import("ngeo/options").ngeoMeasurePrecision; /** * @type {import('ngeo/options').ngeoMeasureSpherical} */ spherical: import("ngeo/options").ngeoMeasureSpherical; /** * @type {import('ngeo/misc/filters').formatNumber} */ numberFormat_: import("ngeo/misc/filters").formatNumber; /** * @type {import('ngeo/misc/filters').unitPrefix} */ unitPrefixFormat_: import("ngeo/misc/filters").unitPrefix; /** * @type {import('ngeo/misc/filters').numberCoordinates} */ ngeoNumberCoordinates_: import("ngeo/misc/filters").numberCoordinates; /** * Filter function to display point coordinates or null to don't use any filter. * * @type {?angular.IFilterFilter} */ pointFilterFn_: angular.IFilterFilter | null; /** * Arguments to apply to the point filter function. * * @type {*[]} */ pointFilterArgs_: any[]; /** * @type {?import('ol/proj/Projection').default} */ projection_: import("ol/proj/Projection").default | null; /** * @param {import('ol/proj/Projection').default} projection Projection. */ setProjection(projection: import("ol/proj/Projection").default): void; /** * Set the style of a feature using its inner properties and depending on * its geometry type. * * @param {olFeature} feature Feature. * @param {boolean} [opt_select] Whether the feature should be rendered as * selected, which includes additional vertex and halo styles. */ setStyle(feature: olFeature, opt_select?: boolean): void; /** * Create and return a style object from a given feature using its inner * properties and depending on its geometry type. * * @param {olFeature} feature Feature. * @returns {import('ol/style/Style').default[]} The style object. */ getStyle(feature: olFeature): import("ol/style/Style").default[]; /** * @param {olFeature} feature Feature with linestring geometry. * @returns {import('ol/style/Style').default[]} Style. */ getLineStringStyle_(feature: olFeature): import("ol/style/Style").default[]; /** * @param {olFeature} feature Feature with linestring geometry. * @param {string} arrowDirection An ArrowDirections value. * @param {string} arrowPosition An ArrowPositions value. * @param {import('ol/color').Color} color an hex Color. * @returns {import('ol/style/Style').default[]} Style Arrows style for the line. */ getArrowLineStyles_(feature: olFeature, arrowDirection: string, arrowPosition: string, color: import("ol/color").Color): import("ol/style/Style").default[]; /** * @param {olFeature} feature Feature with point geometry. * @returns {import('ol/style/Style').default[]} Style. */ getPointStyle_(feature: olFeature): import("ol/style/Style").default[]; /** * Get an optional number feature attribute. * * @param {olFeature} feature Feature. * @param {string} attrib The attribute name. * @returns {number|undefined}, The attribute value */ optNumber(feature: olFeature, attrib: string): number | undefined; /** * Get a number feature attribute. * * @param {olFeature} feature Feature. * @param {string} attrib The attribute name. * @returns {number}, The attribute value */ getNumber(feature: olFeature, attrib: string): number; /** * @param {olFeature} feature Feature with polygon geometry. * @returns {import('ol/style/Style').default[]} Style. */ getPolygonStyle_(feature: olFeature): import("ol/style/Style").default[]; /** * @param {olFeature} feature Feature with point geometry, rendered as text. * @returns {import('ol/style/Style').default} Style. */ getTextStyle_(feature: olFeature): import("ol/style/Style").default; /** * @param {olFeature} feature Feature to create the editing styles with. * @returns {import('ol/style/Style').default[]} List of style. */ createEditingStyles(feature: olFeature): import("ol/style/Style").default[]; createNoEditingSelectionStyles(feature: any): olStyleStyle[]; /** * For a given feature, if its geometry supports vertice that can be * removed on click, then check if there is a vertex a the given * coordinate. The map current map view resolution is used to * calculate a buffer of the size of the vertex (using its style). * * If a vertex hits, then return its information, i.e. its indexes * among the coordinates of the geometry of the feature, as an * array. For example, if the geometry is a LineString, then the * coordinates are an array of ol.Coordinate, so a single index is * required. For a polygon, coordinates are an array of array of * coordinates, so 2 indexes are required. * * If removing a vertex would make the geometry invalid, then the * vertex info is not returned. * * @param {olFeature} feature Feature. * @param {import('ol/coordinate').Coordinate} coordinate Coordinate. * @param {number} resolution Current map view resolution. * @returns {?number[]} The indexes of the vertex (coordinate) that hits. */ getVertexInfoAtCoordinate(feature: olFeature, coordinate: import("ol/coordinate").Coordinate, resolution: number): number[] | null; /** * Loop in the given coordinates and look one that hits an other given * coordinate using a buffer. If one does, return its index. * * @param {import('ol/coordinate').Coordinate[]} coordinates Coordinates in which to * loop to find the one that hits the other given coordinate. * @param {import('ol/coordinate').Coordinate} coordinate Coordinate that has to hit. * @param {number} min Minimum number of coordinates required to look * for the one that hits. * @param {number} buffer Buffer, in map view units, to extend the * extent with. * @returns {number} Index of the coordinate that hits. If none did, -1 * is returned. */ getCoordinateIndexThatHitsAt_(coordinates: import("ol/coordinate").Coordinate[], coordinate: import("ol/coordinate").Coordinate, min: number, buffer: number): number; /** * Create and return a style object to be used for vertex. * * @param {boolean} [opt_incGeomFunc] Whether to include the geometry function * or not. One wants to use the geometry function when you want to draw * the vertex of features that don't have point geometries. One doesn't * want to include the geometry function if you just want to have the * style object itself to be used to draw features that have point * geometries. Defaults to `true`. * @returns {import('ol/style/Style').default} Style. */ getVertexStyle(opt_incGeomFunc?: boolean): import("ol/style/Style").default; /** * Remove a vertex from a feature using the given information (indexes). * * @param {olFeature} feature Feature. * @param {number[]} vertexInfo The indexes of the vertex * (coordinate) to remove. */ removeVertex(feature: olFeature, vertexInfo: number[]): void; /** * @param {olFeature} feature Feature. * @returns {boolean} Whether the feature supports vertex or not. */ supportsVertex_(feature: olFeature): boolean; /** * @param {olFeature} feature Feature. * @returns {boolean} Whether the feature supports having its vertex * removed or not. Does not validate the number of coordinates. */ supportsVertexRemoval_(feature: olFeature): boolean; /** * @param {olFeature} feature Feature. * @returns {import('ol/style/Style').default} Style. */ getHaloStyle_(feature: olFeature): import("ol/style/Style").default; /** * @param {olFeature} feature Feature. * @returns {number} Angle. */ getAngleProperty(feature: olFeature): number; /** * @param {olFeature} feature Feature. * @returns {?string} Color. */ getColorProperty(feature: olFeature): string | null; /** * @param {olFeature} feature Feature. * @returns {?import('ol/color').Color} Color. */ getRGBAColorProperty(feature: olFeature): import("ol/color").Color | null; /** * @param {olFeature} feature Feature. * @returns {string} Name. */ getNameProperty(feature: olFeature): string; /** * @param {olFeature} feature Feature. * @returns {number} Opacity. */ getOpacityProperty(feature: olFeature): number; /** * @param {olFeature} feature Feature. * @returns {boolean} Show measure. */ getShowMeasureProperty(feature: olFeature): boolean; /** * @param {olFeature} feature Feature. * @returns {boolean} Show feature label. */ getShowLabelProperty(feature: olFeature): boolean; /** * @param {olFeature} feature Feature. * @returns {boolean} Show at least one arrow. */ getShowArrowsProperty(feature: olFeature): boolean; /** * @param {olFeature} feature Feature. * @returns {number} Size. */ getSizeProperty(feature: olFeature): number; /** * @param {olFeature} feature Feature. * @returns {number} Stroke. */ getStrokeProperty(feature: olFeature): number; /** * @param {olFeature} feature Feature. * @returns {string} The ArrowDirections value of the feature. ArrowDirections.NONE by default. */ getArrowDirectionProperty(feature: olFeature): string; /** * @param {olFeature} feature Feature. * @returns {string} The ArrowPositions value of the feature. ArrowPositions.FIRST by default. */ getArrowPositionProperty(feature: olFeature): string; /** * Export features in the given format. The projection of the exported features * is: `EPSG:4326`. * * @param {olFeature[]} features Array of vector features. * @param {string} formatType Format type to export the features. */ export(features: olFeature[], formatType: string): void; /** * Export features in GPX and download the result to the browser. The * projection of the exported features is: `EPSG:4326`. * * @param {olFeature[]} features Array of vector features. */ exportGPX(features: olFeature[]): void; /** * Export features in KML and download the result to the browser. The * projection of the exported features is: `EPSG:4326`. * * @param {olFeature[]} features Array of vector features. */ exportKML(features: olFeature[]): void; /** * Export features using a given format to a specific filename and download * the result to the browser. The projection of the exported features is: * `EPSG:4326`. * * @param {olFeature[]} features Array of vector features. * @param {import('ol/format/Feature').default} format Format * @param {string} fileName Name of the file. * @param {string} [opt_mimeType] Mime type. Defaults to 'text/plain'. */ export_(features: olFeature[], format: import("ol/format/Feature").default, fileName: string, opt_mimeType?: string): void; /** * @param {import('ngeo/rule/Text').TextOptions} options Options. * @returns {import('ol/style/Text').default} Style. */ createTextStyle_(options: import("ngeo/rule/Text").TextOptions): import("ol/style/Text").default; /** * Get the measure of the given feature as a string. For points, you can format * the result by setting a filter to apply on the coordinate with the function * {@link import('ngeo/misc/FeatureHelper').setPointFilterFn}. * * @param {olFeature} feature Feature. * @returns {string} Measure. */ getMeasure(feature: olFeature): string; /** * Return the type of geometry of a feature using its geometry property and * some inner properties. * * @param {olFeature} feature Feature. * @returns {string} The type of geometry. */ getType(feature: olFeature): string; /** * This methods will try to fit a feature into a map view. * * If the feature is already visible, then the map will be zoomed out * if the feature is too big for the current view. * * If the feature is not visible but would fit in the map view, the * map is panned to the center of the feature. * * If the feature is not visible and would not fit in the map view, * the map is fix to the feature's extent. * * @param {olFeature} feature Feature. * @param {import('ol/Map').default} map Map. * @param {number} [opt_duration] Aimation duration. Defaults to `250`. */ fitMapToFeature(feature: olFeature, map: import("ol/Map").default, opt_duration?: number): void; /** * This method generates a line string geometry that represents the radius for * a given azimut. It expects the input geometry to be a circle. * * @param {olFeature} feature Feature. * @param {number} azimut Azimut in degrees. * @returns {import('ol/geom/LineString').default} The line geometry. */ getRadiusLine(feature: olFeature, azimut: number): import("ol/geom/LineString").default; /** * Return the properties of a feature, with the exception of the geometry. * * @param {olFeature} feature Feature. * @returns {Object} Object. */ getNonSpatialProperties(feature: olFeature): { [x: string]: any; }; /** * Clear all properties of a feature, with the exception of the geometry. * * @param {olFeature} feature Feature. */ clearNonSpatialProperties(feature: olFeature): void; /** * @param {olFeature[]} features Features. * @param {string} fid Feature id * @returns {number} Index of found feature */ findFeatureIndexByFid(features: olFeature[], fid: string): number; } export namespace FeatureHelper { let $inject: string[]; } /** * Delete the unwanted ol3 properties from the current feature then return the properties. * Also delete the 'ngeo_feature_type_' from the ngeo query system. * * @param {olFeature} feature Feature. * @returns {Object} Filtered properties of the current feature. * @hidden */ export function getFilteredFeatureValues(feature: olFeature): { [x: string]: string | number | boolean; }; /** * * */ export type FeatureFormatType = string; export namespace FeatureFormatType { let GPX: string; let KML: string; } /** * Arrow possible direction on segments of lines. */ export type ArrowDirections = string; export namespace ArrowDirections { let NONE: string; let FORWARD: string; let BACKWARD: string; let BOTH: string; } /** * Arrow possible position on lines */ export type ArrowPositions = string; export namespace ArrowPositions { let FIRST: string; let LAST: string; let EVERY: string; } export default myModule; import angular from 'angular'; import olFeature from 'ol/Feature'; import olGeomLineString from 'ol/geom/LineString'; import olStyleStyle from 'ol/style/Style'; /** * @type {angular.IModule} * @hidden */ declare const myModule: angular.IModule;