/** * @hidden */ export class DrawFeatureOptionsController { /** * @param {angular.IScope} $scope Scope. * @ngdoc controller * @ngname GmfDrawFeatureOptionsController */ constructor($scope: angular.IScope); /** * @type {!import('ol/Map').default} */ map: import("ol/Map").default; /** * @type {?import('ngeo/interaction/MeasureLength').default} */ measureLength: import("ngeo/interaction/MeasureLength").default | null; /** * @type {?import('ngeo/interaction/MeasureArea').default} */ measureArea: import("ngeo/interaction/MeasureArea").default | null; /** * @type {?import('ngeo/interaction/MeasureAzimut').default} */ measureAzimut: import("ngeo/interaction/MeasureAzimut").default | null; /** * @type {?OLInteractionDraw} */ drawRectangle: OLInteractionDraw | null; /** * @type {angular.IScope} * @private */ private scope_; /** * The length is used to determine: * - the length of a line segment to draw (for length and area measurements) * - the width of a rectangle to draw * - the radius of a circle to draw (for azimut measurements) * * @type {number} */ length: number; /** * Measure unit for the length. Possible values are: 'm', 'km'. * * @type {string} */ lengthUnits: string; /** * The height is used to determine: * - the height of the rectangle to draw * * @type {number} */ height: number; /** * Measure unit for the height. Possible values are: 'm', 'km'. * * @type {string} */ heightUnits: string; /** * The draw interaction that was given. * * @type {?OLInteractionDraw} * @private */ private drawInteraction_; /** * The feature being drawn. Set when the 'drawstart' event is * fired by the draw interaction. * * @type {?OLFeature} * @private */ private feature_; /** * @type {import('ol/events').EventsKey[]} * @private */ private listenerKeys_; /** * Used to keep track of the current number of vertices while * drawing a LineString or a Polygon. Why? Because the only way to * keep track of the changes that occur within their geometry is * with the 'change' event, which occurs while the mouse is * moving. * * If at any moment, while drawing, this number becomes different * than the actual number of vertices in the geometry, then we * need to update the snap feature. * * @type {number} */ verticesCounter_: number; /** * @type {!OLFeature} * @private */ private snapFeature_; /** * @type {!OLSourceVector} * @private */ private snapSource_; /** * @type {!OLInteractionSnap} * @private */ private snapInteraction_; /** * Flag used to manually stop drawing after a double * click. See explanations where used. * * @type {boolean} * @private */ private shouldStopDrawing_; /** * Called on initialization of the controller. */ $onInit(): void; /** * Called on destruction of the controller. */ $onDestroy(): void; /** * When the draw interaction starts drawing, the feature being drawn * is stored. * * @param {Event|import('ol/events/Event').default} evt Event. * @private */ private handleDrawInteractionDrawStart_; /** * Called every time the geometry of the feature being drawn changes. * * @private */ private handleFeatureGeometryChange_; /** * Reset the snap feature's geometry. * * @private */ private resetSnapFeature_; /** * Adjust the snap feature's geometry depending on the given arguments. * * @param {number} length Length * @param {string} lengthUnits Length units * @param {number} [opt_height] Height * @param {string} [opt_heightUnits] Height units * @private */ private adjustSnapFeature_; /** * Override handler method of the map browser event for the snap * interaction. If the event is 'pointerup', if the following map * browser event is 'dblclick', then we should stop drawing. * * @param {import('ol/MapBrowserEvent').default} evt Map browser event. * @returns {boolean} `false` to stop event propagation. * @private */ private snapInteractionHandleEvent_; /** * If a 'singleclick' event occur on the map after a snap, then we * can continue drawing. * * @param {Event|import('ol/events/Event').default} evt Event. * @private */ private handleMapSingleClick_; /** * If a 'dblclick' event occur on the map after a snap, then we * should stop drawing. * * Note: double clicking to end drawing only occurs while measuring * length or area, i.e. while drawing a LineString or Polygon. When * that happens while snapping, then we need to manually force the * drawing to finish and also remove the last point that has been * added as a consequence of the snap still being active and causing * an unwanted point to be added. * * @param {Event|import('ol/events/Event').default} evt Event. * @private */ private handleMapDoubleClick_; } export namespace DrawFeatureOptionsController { let $inject: string[]; } export default myModule; import OLInteractionDraw from 'ol/interaction/Draw'; import angular from 'angular'; /** * @type {angular.IModule} * @hidden */ declare const myModule: angular.IModule;